diff --git a/src/controllers/dataVerificationCtrl.js b/src/controllers/dataVerificationCtrl.js index 686cfc7..de64c18 100644 --- a/src/controllers/dataVerificationCtrl.js +++ b/src/controllers/dataVerificationCtrl.js @@ -573,6 +573,28 @@ const dataVerificationCtrl = { return; } + let str = range[range.length - 1].row[0], + edr = range[range.length - 1].row[1], + stc = range[range.length - 1].column[0], + edc = range[range.length - 1].column[1]; + let d = editor.deepCopyFlowData(Store.flowdata); + + if(str < 0){ + str = 0; + } + + if(edr > d.length - 1){ + edr = d.length - 1; + } + + if(stc < 0){ + stc = 0; + } + + if(edc > d[0].length - 1){ + edc = d[0].length - 1; + } + let type = $("#luckysheet-dataVerification-dialog #data-verification-type-select").val(); let type2 = null, value1 = "", value2 = ""; @@ -699,13 +721,6 @@ const dataVerificationCtrl = { let historyDataVerification = $.extend(true, {}, _this.dataVerification); let currentDataVerification = $.extend(true, {}, _this.dataVerification); - let str = range[range.length - 1].row[0], - edr = range[range.length - 1].row[1], - stc = range[range.length - 1].column[0], - edc = range[range.length - 1].column[1]; - - let d = editor.deepCopyFlowData(Store.flowdata); - for(let r = str; r <= edr; r++){ for(let c = stc; c <= edc; c++){ currentDataVerification[r + '_' + c] = item; diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index bf008a6..deaaf2f 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -314,6 +314,24 @@ const sheetmanage = { }); server.saveParam("shr", null, orders); + + Store.luckysheetfile.sort((x, y) => { + let order_x = x.order; + let order_y = y.order; + + if(order_x != null && order_y != null){ + return order_x - order_y; + } + else if(order_x != null){ + return -1; + } + else if(order_y != null){ + return 1; + } + else{ + return 1; + } + }) }, createSheet: function() { //修复拖动sheet更新后台后,重新打开显示错误 let _this = this; diff --git a/src/global/api.js b/src/global/api.js index 453bee4..8366f27 100644 --- a/src/global/api.js +++ b/src/global/api.js @@ -4709,6 +4709,9 @@ export function setSheetActive(order, options = {}) { success } = {...options} + $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active"); + $("#luckysheet-sheets-item" + file.index).addClass("luckysheet-sheets-item-active"); + sheetmanage.changeSheet(file.index); setTimeout(() => { diff --git a/src/global/extend.js b/src/global/extend.js index 23b2eca..305e8a3 100644 --- a/src/global/extend.js +++ b/src/global/extend.js @@ -482,9 +482,17 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) { else if(index == r){ if(direction == "lefttop"){ newDataVerification[(r + value) + "_" + c] = item; + + for(let i = 0; i < value; i++){ + newDataVerification[(r + i) + "_" + c] = item; + } } else{ newDataVerification[r + "_" + c] = item; + + for(let i = 0; i < value; i++){ + newDataVerification[(r + i + 1) + "_" + c] = item; + } } } else{ @@ -498,9 +506,17 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) { else if(index == c){ if(direction == "lefttop"){ newDataVerification[r + "_" + (c + value)] = item; + + for(let i = 0; i < value; i++){ + newDataVerification[r + "_" + (c + i)] = item; + } } else{ newDataVerification[r + "_" + c] = item; + + for(let i = 0; i < value; i++){ + newDataVerification[r + "_" + (c + i + 1)] = item; + } } } else{ @@ -2112,20 +2128,20 @@ function luckysheetDeleteCell(type, str, edr, stc, edc, sheetIndex) { let row_index = cfg["borderInfo"][i].value.row_index; let col_index = cfg["borderInfo"][i].value.col_index; - if(row_index < str || col_index < stc){ - borderInfo.push(cfg["borderInfo"][i]); - } - else if(row_index > edr || col_index > edc){ - if(row_index > edr){ - row_index -= rlen; - cfg["borderInfo"][i].value.row_index = row_index; + if(row_index < str || row_index > edr || col_index < stc || col_index > edc){ + if(type == 'moveLeft'){ + if(col_index > edc && row_index >= str && row_index <= edr){ + col_index -= clen; + cfg["borderInfo"][i].value.col_index = col_index; + } } - - if(col_index > edc){ - col_index -= clen; - cfg["borderInfo"][i].value.col_index = col_index; + else if(type == 'moveUp'){ + if(row_index > edr && col_index >= stc && col_index <= edc){ + row_index -= rlen; + cfg["borderInfo"][i].value.row_index = row_index; + } } - + borderInfo.push(cfg["borderInfo"][i]); } }