设置快捷键

This script is only for Chinese mainland users. The script function is to help Beijing Construction Research Company set up excel forms with one click

Fra og med 09.08.2021. Se den nyeste version.

Dette script bør ikke installeres direkte. Det er et bibliotek, som andre scripts kan inkludere med metadirektivet // @require https://update.greatest.deepsurf.us/scripts/430373/958503/%E8%AE%BE%E7%BD%AE%E5%BF%AB%E6%8D%B7%E9%94%AE.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         设置快捷键
// @namespace    coderWyh
// @version      1.0.1
// @description  This script is only for Chinese mainland users. The script function is to help Beijing Construction Research Company set up excel forms with one click
// @author       coderWyh
// @match        http://www.gczl360.com:8084/Admin/ZLKGL/Template*
// @run-at       document-end
// @require      https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js
// ==/UserScript==
// 本代码所有权归作者所有 作者QQ:2471630907 手机号:18990193572  微信同手机号
// 本代码具有知识产权 未经作者授权严禁任何人进行使用、传播、二次开发等一系列损害作者知识产权的操作
// 作者对未经授权的操作保留起诉但不仅限于起诉的维护个人知识产权利益的法律途径
(function() {
    'use strict';
    const BASEURL = 'http://121.196.101.210:8423/'
    let valueList = []
    let attrValue ;
    axios.post(BASEURL+'jky/value/getCodeValue/'+ShortcutButtonCode)
        .then(response =>{
        if (response.data.success) {
            valueList = response.data.data.valueList
            let Index = 2;
            attrValue = response.data.data.functionName
            valueList.forEach((item,index,arr) => {
                if(index%2==0){
                    $(".record_box>.slimScrollDiv").append("<div value='"+item.value+"' style='top:"+Index*7+"%;left: 2%' class='"+item.className+"'>"+item.name+"</div>")
                    Index++
                }else {
                    $(".record_box>.slimScrollDiv").append("<div value='"+item.value+"' style='top:"+((Index-1)*7)+"%;left: 40%' class='"+item.className+"'>"+item.name+"</div>")
                }
            })
            $(".easycellset").on('click',function() {
                var value=$(this).attr(attrValue+'');var sheetIndex=spread.getActiveSheetIndex();var sheet=spread.getActiveSheet();var selections=sheet.getSelections();for(var i=0;i<selections.length;i++){var row=selections[i].row;var col=selections[i].col;var rowCount=selections[i].rowCount;var colCount=selections[i].colCount;for(var x=0;x<rowCount;x++){for(var y=0;y<colCount;y++){var rowIndex=row+x;var colIndex=col+y;var span=sheet.getSpan(rowIndex,colIndex);if(span!=null){y+=(span.colCount-1);}for(var b=0;b<attrArray.length;b++){var item=attrArray[b];if(item.sheetIndex==sheetIndex&&item.row==rowIndex&&item.col==colIndex){item.value=value;item.type="";return;}}attrArray.push({sheetIndex:sheetIndex,row:rowIndex,col:colIndex,value:value,type:""});}var row_span=sheet.getSpan(row,col);if(row_span!=null){x+=(row_span.rowCount-1);}}}layer.msg("添加成功",{time:100});
            });
            $(".easycellset_sign").click(function () {
                var value=$(this).attr(attrValue+'');var sheetIndex=spread.getActiveSheetIndex();var sheet=spread.getActiveSheet();var selections=sheet.getSelections();for(var i=0;i<selections.length;i++){var row=selections[i].row;var col=selections[i].col;var rowCount=selections[i].rowCount;var colCount=selections[i].colCount;for(var x=0;x<rowCount;x++){for(var y=0;y<colCount;y++) {var rowIndex=row+x;var colIndex=col+y;var span=sheet.getSpan(rowIndex,colIndex);if(span!=null){y+=(span.colCount-1);}for(var a=0;a<attrArray.length;a++){var item=attrArray[a];if(item.sheetIndex==sheetIndex&&item.row==rowIndex&&item.col==colIndex){item.value=value;item.type="sign";return;}}var sign_attr={sheetIndex:sheetIndex,row:row,col:col,value:value,type:"sign"};attrArray.push(sign_attr);}var row_span=sheet.getSpan(row,col);if(row_span!=null){x+=(row_span.rowCount-1);}}}layer.msg("添加成功",{time: 400});
            });
            $(".autoSet").mydrag();
 
        } else {
            $(".record_box>.slimScrollDiv").append("<div style='position:absolute;top:40%;left:2%;background-color:red;border:1px;text-transform: uppercase;font-size: 14px;padding: 5px 10px;font-weight: 300;color:white' class='tips'>"+response.data.message+ShortcutButtonCode+"</div>")

        }
    })
        .catch(error =>{
        console.log(error);
    })
 
})();