From 27d1be0037c2bd5ba290e7b0f9db229de04582d9 Mon Sep 17 00:00:00 2001 From: wpxp123456 <2677556700@qq.com> Date: Mon, 21 Sep 2020 16:34:23 +0800 Subject: [PATCH] fix(bug): bug bug --- src/controllers/controlHistory.js | 32 ++++++++++++++++--- src/controllers/dropCell.js | 7 ++++- src/controllers/filter.js | 11 ++++--- src/controllers/handler.js | 8 ++++- src/controllers/menuButton.js | 13 +++++--- src/controllers/orderBy.js | 11 ++++--- src/controllers/pivotTable.js | 2 +- src/controllers/selection.js | 51 +++++++++++++++++++++++++----- src/controllers/sheetmanage.js | 18 +++++------ src/global/api.js | 35 ++++++++++++--------- src/global/editor.js | 2 +- src/global/formula.js | 51 +++++++++++++++++++++++------- src/global/refresh.js | 52 +++++++++++++++++++++++++------ src/global/sort.js | 22 ++++++++----- 14 files changed, 234 insertions(+), 81 deletions(-) diff --git a/src/controllers/controlHistory.js b/src/controllers/controlHistory.js index 9d26669..881d25a 100644 --- a/src/controllers/controlHistory.js +++ b/src/controllers/controlHistory.js @@ -59,7 +59,15 @@ const controlHistory = { } formula.execFunctionGroup(null, null, null, null, ctr.data);//取之前的数据 - jfrefreshgrid(ctr.data, ctr.range, ctr.config, ctr.cdformat, ctr.RowlChange, ctr.dataVerification); + let allParam = { + "cfg": ctr.config, + "RowlChange": ctr.RowlChange, + "cdformat": ctr.cdformat, + "dataVerification": ctr.dataVerification, + "dynamicArray": ctr.dynamicArray + } + + jfrefreshgrid(ctr.data, ctr.range, allParam); } else if (ctr.type == "pasteCut") { let s = { @@ -320,7 +328,11 @@ const controlHistory = { server.saveParam("all", ctr.sheetIndex, ctr.oldcolor, { "k": "color" }); } else if (ctr.type == "mergeChange") { - jfrefreshgrid(ctr.data, ctr.range, ctr.config); + let allParam = { + "cfg": ctr.config, + } + + jfrefreshgrid(ctr.data, ctr.range, allParam); } else if (ctr.type == "updateDataVerification"){ dataVerificationCtrl.ref(ctr.currentDataVerification, ctr.historyDataVerification, ctr.sheetIndex); @@ -416,7 +428,15 @@ const controlHistory = { if (ctr.type == "datachange") { formula.execFunctionGroup(); - jfrefreshgrid(ctr.curdata, ctr.range, ctr.curConfig, ctr.curCdformat, ctr.RowlChange, ctr.curDataVerification); + let allParam = { + "cfg": ctr.curConfig, + "RowlChange": ctr.RowlChange, + "cdformat": ctr.curCdformat, + "dataVerification": ctr.curDataVerification, + "dynamicArray": ctr.curDynamicArray + } + + jfrefreshgrid(ctr.curdata, ctr.range, allParam); } else if (ctr.type == "pasteCut") { jfrefreshgrid_pastcut(ctr.source, ctr.target, ctr.RowlChange); @@ -611,7 +631,11 @@ const controlHistory = { server.saveParam("all", ctr.sheetIndex, ctr.color, { "k": "color" }); } else if (ctr.type == "mergeChange") { - jfrefreshgrid(ctr.curData, ctr.range, ctr.curConfig); + let allParam = { + "cfg": ctr.curConfig, + } + + jfrefreshgrid(ctr.curData, ctr.range, allParam); } else if (ctr.type == "updateDataVerification"){ dataVerificationCtrl.ref(ctr.historyDataVerification, ctr.currentDataVerification, ctr.sheetIndex); diff --git a/src/controllers/dropCell.js b/src/controllers/dropCell.js index 550be2c..2d37a67 100644 --- a/src/controllers/dropCell.js +++ b/src/controllers/dropCell.js @@ -873,7 +873,12 @@ const luckysheetDropCell = { } //刷新一次表格 - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, cdformat, null, dataVerification); + let allParam = { + "cfg": cfg, + "cdformat": cdformat, + "dataVerification": dataVerification + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); selectHightlightShow(); }, diff --git a/src/controllers/filter.js b/src/controllers/filter.js index 980b72c..24bc433 100644 --- a/src/controllers/filter.js +++ b/src/controllers/filter.js @@ -120,15 +120,18 @@ function orderbydatafiler(str, stc, edr, edc, index, asc) { } } + let allParam = {}; if(Store.config["rowlen"] != null){ let cfg = $.extend(true, {}, Store.config); cfg = rowlenByRange(d, str, edr, cfg); - jfrefreshgrid(d, [{ "row": [str, edr], "column": [stc, edc] }], cfg, null, true); - } - else{ - jfrefreshgrid(d, [{ "row": [str, edr], "column": [stc, edc] }]); + allParam = { + "cfg": cfg, + "RowlChange": true + } } + + jfrefreshgrid(d, [{ "row": [str, edr], "column": [stc, edc] }], allParam); } //创建筛选按钮 diff --git a/src/controllers/handler.js b/src/controllers/handler.js index f50564a..69cd877 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -3511,7 +3511,13 @@ export default function luckysheetHandler() { last["row_focus"] = rf; last["column_focus"] = cf; - jfrefreshgrid(d, range, cfg, cdformat, RowlChange); + let allParam = { + "cfg": cfg, + "RowlChange": RowlChange, + "cdformat": cdformat + } + + jfrefreshgrid(d, range, allParam); selectHightlightShow(); diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index 4546896..7cbab7a 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -2985,12 +2985,15 @@ const menuButton = { cfg = rowlenByRange(d, row_st, row_ed, cfg); } + let allParam = {}; if(attr == "tb" || attr == "tr" || attr == "fs"){ - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, null, true, null, false); - } - else{ - jfrefreshgrid(d, Store.luckysheet_select_save, undefined, undefined,undefined,undefined,false); + allParam = { + "cfg": cfg, + "RowlChange": true + } } + + jfrefreshgrid(d, Store.luckysheet_select_save, allParam, false); }, updateFormat_mc: function(d, foucsStatus){ let cfg = $.extend(true, {}, Store.config); @@ -3191,7 +3194,7 @@ const menuButton = { } Store.clearjfundo = false; - jfrefreshgrid(d, Store.luckysheet_select_save, cfg); + jfrefreshgrid(d, Store.luckysheet_select_save, {"cfg": cfg}); Store.clearjfundo = true; }, borderfix: function(d, r, c){ diff --git a/src/controllers/orderBy.js b/src/controllers/orderBy.js index f855040..c658753 100644 --- a/src/controllers/orderBy.js +++ b/src/controllers/orderBy.js @@ -212,16 +212,19 @@ export function orderByInitial(){ } } + let allParam = {}; if(Store.config["rowlen"] != null){ let cfg = $.extend(true, {}, Store.config); cfg = rowlenByRange(d, str, r2, cfg); - jfrefreshgrid(d, [{ "row": [str, r2], "column": [c1, c2] }], cfg, null, true); - } - else{ - jfrefreshgrid(d, [{ "row": [str, r2], "column": [c1, c2] }]); + allParam = { + "cfg": cfg, + "RowlChange": true + } } + jfrefreshgrid(d, [{ "row": [str, r2], "column": [c1, c2] }], allParam); + $("#luckysheet-sort-dialog").hide(); $("#luckysheet-modal-dialog-mask").hide(); }); diff --git a/src/controllers/pivotTable.js b/src/controllers/pivotTable.js index 87c0f1c..dea760b 100644 --- a/src/controllers/pivotTable.js +++ b/src/controllers/pivotTable.js @@ -733,7 +733,7 @@ const pivotTable = { jfrefreshgridall(data[0].length, data.length, data, null, Store.luckysheet_select_save, "datachangeAll", undefined, undefined,isRefreshCanvas); } else { - jfrefreshgrid(data, Store.luckysheet_select_save, undefined, undefined, undefined, undefined, undefined,isRefreshCanvas); + jfrefreshgrid(data, Store.luckysheet_select_save, {}, null, isRefreshCanvas); selectHightlightShow(); } diff --git a/src/controllers/selection.js b/src/controllers/selection.js index f9d37f9..494f5e3 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -721,11 +721,19 @@ const selection = { Store.luckysheet_select_save = [{ "row": [minh, maxh], "column": [minc, maxc] }]; + if(addr > 0 || addc > 0 || RowlChange){ - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, null, true); + let allParam = { + "cfg": cfg, + "RowlChange": true + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); } else{ - jfrefreshgrid(d, Store.luckysheet_select_save, cfg); + let allParam = { + "cfg": cfg + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); selectHightlightShow(); } } @@ -790,7 +798,10 @@ const selection = { last["column"] = [curC, curC + clen - 1]; if (addr > 0 || addc > 0) { - jfrefreshgrid(d, Store.luckysheet_select_save, null, null, true); + let allParam = { + "RowlChange": true + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); } else { jfrefreshgrid(d, Store.luckysheet_select_save); @@ -1521,10 +1532,23 @@ const selection = { if(copyRowlChange || addr > 0 || addc > 0){ cfg = rowlenByRange(d, minh, maxh, cfg); - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, cdformat, true, dataVerification); + + let allParam = { + "cfg": cfg, + "RowlChange": true, + "cdformat": cdformat, + "dataVerification": dataVerification + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); } else{ - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, cdformat, null, dataVerification); + let allParam = { + "cfg": cfg, + "cdformat": cdformat, + "dataVerification": dataVerification + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); + selectHightlightShow(); } }, @@ -1752,10 +1776,23 @@ const selection = { if(copyRowlChange){ cfg = rowlenByRange(d, minh, maxh, cfg); - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, cdformat, true, dataVerification); + + let allParam = { + "cfg": cfg, + "RowlChange": true, + "cdformat": cdformat, + "dataVerification": dataVerification + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); } else{ - jfrefreshgrid(d, Store.luckysheet_select_save, cfg, cdformat, null, dataVerification); + let allParam = { + "cfg": cfg, + "cdformat": cdformat, + "dataVerification": dataVerification + } + jfrefreshgrid(d, Store.luckysheet_select_save, allParam); + selectHightlightShow(); } }, diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index 3eb5a4d..299b008 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -1428,18 +1428,18 @@ const sheetmanage = { let index = this.getSheetIndex(sheetIndex); let file = Store.luckysheetfile[index]; - if($('#luckysheet-filter-selected-sheet' + sheetIndex).length > 0 || file.filter_select == null || JSON.stringify(file.filter_select) == "{}"){ - if(file.config != null && file.config.rowhidden != null){ - file.config.rowhidden = {}; - Store.config = file.config; + // if($('#luckysheet-filter-selected-sheet' + sheetIndex).length > 0 || file.filter_select == null || JSON.stringify(file.filter_select) == "{}"){ + // if(file.config != null && file.config.rowhidden != null){ + // file.config.rowhidden = {}; + // Store.config = file.config; - jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length,false); - } + // jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length,false); + // } - return; - } + // return; + // } - if(getObjType(file.filter_select) != "object"){ + if(getObjType(file.filter_select) == "string"){ file.filter_select = JSON.parse(file.filter_select); } diff --git a/src/global/api.js b/src/global/api.js index dda0a41..8fdc7f6 100644 --- a/src/global/api.js +++ b/src/global/api.js @@ -1829,7 +1829,7 @@ export function cancelRangeMerge(options = {}) { // 当前sheet页合并时刷新 if (order === curSheetOrder) { - jfrefreshgrid(data, range, cfg) + jfrefreshgrid(data, range, {"cfg": cfg}) } } @@ -1903,19 +1903,22 @@ export function setRangeSort(type, options = {}) { fileData[r][c] = data[r - r1][c - c1]; } } + + let allParam = {}; if(cfg["rowlen"] != null){ let config = $.extend(true, {}, cfg); config = rowlenByRange(fileData, r1, r2, config); - - if (order == Store.currentSheetIndex) { - jfrefreshgrid(fileData, [{ "row": [r1, r2], "column": [c1, c2] }], config, null, true); - } - } else{ - if (order == Store.currentSheetIndex) { - jfrefreshgrid(fileData, [{ "row": [r1, r2], "column": [c1, c2] }]); + + allParam = { + "cfg": config, + "RowlChange": true } } + if (file.index == Store.currentSheetIndex) { + jfrefreshgrid(fileData, [{ "row": [r1, r2], "column": [c1, c2] }], allParam); + } + if (success && typeof success === 'function') { success(); } @@ -2001,19 +2004,23 @@ export function setRangeSortMulti(hasTitle, sort, options = {}) { fileData[r][c] = data[r - str][c - c1]; } } + + + let allParam = {}; if(cfg["rowlen"] != null){ let config = $.extend(true, {}, cfg); config = rowlenByRange(fileData, str, r2, config); - if (order === Store.currentSheetIndex) { - jfrefreshgrid(fileData, [{ "row": [str, r2], "column": [c1, c2] }], config, null, true); - } - } else{ - if (order === Store.currentSheetIndex) { - jfrefreshgrid(fileData, [{ "row": [str, r2], "column": [c1, c2] }]); + allParam = { + "cfg": config, + "RowlChange": true } } + if (file.index === Store.currentSheetIndex) { + jfrefreshgrid(fileData, [{ "row": [str, r2], "column": [c1, c2] }], allParam); + } + if (success && typeof success === 'function') { success(); } diff --git a/src/global/editor.js b/src/global/editor.js index 99ea8a2..f42fa1d 100644 --- a/src/global/editor.js +++ b/src/global/editor.js @@ -120,7 +120,7 @@ const editor = { clen = ed_c - st_c + 1; if (rlen > 5000) { - jfrefreshgrid(d, st_r, ed_r, st_c, ed_c); + jfrefreshgrid(d, [{ "row": [st_r, ed_r], "column": [st_c, ed_c] }]); } else { jfrefreshrange(d, { "row": [st_r, ed_r], "column": [st_c, ed_c] }); diff --git a/src/global/formula.js b/src/global/formula.js index 9fe88d6..7787f92 100644 --- a/src/global/formula.js +++ b/src/global/formula.js @@ -1240,6 +1240,7 @@ const luckysheetformula = { let isRunExecFunction = true; let d = editor.deepCopyFlowData(Store.flowdata); + let dynamicArrayItem = null; //动态数组 if (getObjType(curv) == "object") { if(getObjType(value) == "string" && value.slice(0, 1) == "=" && value.length > 1){ @@ -1262,6 +1263,9 @@ const luckysheetformula = { curv.spl = v[3].data; } } + else if(v.length == 4 && v[3].type == "dynamicArrayItem"){ + dynamicArrayItem = v[3].data; + } } // from API setCellValue,luckysheet.setCellValue(0, 0, {f: "=sum(D1)", bg:"#0188fb"}),value is an object, so get attribute f as value else if(getObjType(value) == "object"){ @@ -1296,6 +1300,9 @@ const luckysheetformula = { curv.spl = v[3].data; } } + else if(v.length == 4 && v[3].type == "dynamicArrayItem"){ + dynamicArrayItem = v[3].data; + } } } @@ -1339,6 +1346,9 @@ const luckysheetformula = { value.spl = v[3].data; } } + else if(v.length == 4 && v[3].type == "dynamicArrayItem"){ + dynamicArrayItem = v[3].data; + } } // from API setCellValue,luckysheet.setCellValue(0, 0, {f: "=sum(D1)", bg:"#0188fb"}),value is an object, so get attribute f as value else if(getObjType(value) == "object"){ @@ -1367,6 +1377,9 @@ const luckysheetformula = { value.spl = v[3].data; } } + else if(v.length == 4 && v[3].type == "dynamicArrayItem"){ + dynamicArrayItem = v[3].data; + } } } @@ -1424,14 +1437,29 @@ const luckysheetformula = { RowlChange = true; } } + + //动态数组 + let dynamicArray = null; + if(!!dynamicArrayItem){ + let file = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]; + dynamicArray = $.extend(true, [], file["dynamicArray"]); + dynamicArray.push(dynamicArrayItem); + } + + let allParam = { + "dynamicArray": dynamicArray + } if(RowlChange){ - jfrefreshgrid(d, [{ "row": [r, r], "column": [c, c] }], cfg, null, RowlChange, null, isRunExecFunction); - } - else { - jfrefreshgrid(d, [{ "row": [r, r], "column": [c, c] }], undefined, undefined, undefined, undefined, isRunExecFunction); + allParam = { + "cfg": cfg, + "dynamicArray": dynamicArray, + "RowlChange": RowlChange + } } + jfrefreshgrid(d, [{ "row": [r, r], "column": [c, c] }], allParam, isRunExecFunction); + // Store.luckysheetCellUpdate.length = 0; //clear array _this.execFunctionGroupData = null; //销毁 }, @@ -4968,6 +4996,8 @@ const luckysheetformula = { } //公式结果是数组,分错误值 和 动态数组 两种情况 + let dynamicArrayItem = null; + if(getObjType(result) == "array"){ let isErr = false; @@ -4980,14 +5010,7 @@ const luckysheetformula = { result = result[0][0]; } else{ - let luckysheetfile = getluckysheetfile(); - let file = luckysheetfile[getSheetIndex(Store.currentSheetIndex)]; - let dynamicArray = file["dynamicArray"] == null ? [] : file["dynamicArray"]; - dynamicArray.push({"r": r, "c": c, "f": txt, "data": result}); - - file["dynamicArray"] = dynamicArray; - setluckysheetfile(luckysheetfile); - + dynamicArrayItem = {"r": r, "c": c, "f": txt, "data": result}; result = ""; } } @@ -5014,6 +5037,10 @@ const luckysheetformula = { return [true, result, txt, {type: "sparklines", data: sparklines}]; } + if(!!dynamicArrayItem){ + return [true, result, txt, {type: "dynamicArrayItem", data: dynamicArrayItem}]; + } + return [true, result, txt]; }, testFunction: function(txt, fp) { diff --git a/src/global/refresh.js b/src/global/refresh.js index 48c9720..39bd04f 100644 --- a/src/global/refresh.js +++ b/src/global/refresh.js @@ -19,13 +19,15 @@ import { createFilterOptions } from '../controllers/filter'; import { getSheetIndex } from '../methods/get'; import Store from '../store'; -function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, isRunExecFunction=true, isRefreshCanvas=true) { +function jfrefreshgrid(data, range, allParam, isRunExecFunction = true, isRefreshCanvas = true) { if(data == null){ data = Store.flowdata; } + if(range == null){ range = Store.luckysheet_select_save; } + //单元格数据更新联动 if (isRunExecFunction) { formula.execFunctionExist = []; @@ -41,6 +43,19 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, formula.execFunctionGroupData = null; } + //关联参数 + if(allParam == null){ + allParam = {}; + } + + let cfg = allParam["cfg"]; //config + let RowlChange = allParam["RowlChange"]; //行高改变 + let cdformat = allParam["cdformat"]; //条件格式 + let dataVerification = allParam["dataVerification"]; //数据验证 + let dynamicArray = allParam["dynamicArray"]; //动态数组 + + let file = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]; + if (Store.clearjfundo) { Store.jfundo = []; @@ -54,7 +69,7 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, let curCdformat; if(cdformat == null){ - curCdformat = $.extend(true, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["luckysheet_conditionformat_save"]); + curCdformat = $.extend(true, [], file["luckysheet_conditionformat_save"]); } else{ curCdformat = cdformat; @@ -62,11 +77,19 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, let curDataVerification; if(dataVerification == null){ - curDataVerification = $.extend(true, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["dataVerification"]) + curDataVerification = $.extend(true, {}, file["dataVerification"]) } else{ curDataVerification = dataVerification; } + + let curDynamicArray; + if(dynamicArray == null){ + curDynamicArray = $.extend(true, [], file["dynamicArray"]); + } + else{ + curDynamicArray = dynamicArray; + } Store.jfredo.push({ "type": "datachange", @@ -76,23 +99,25 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, "range": range, "config": $.extend(true, {}, Store.config), "curConfig": curConfig, - "cdformat": $.extend(true, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["luckysheet_conditionformat_save"]), + "cdformat": $.extend(true, [], file["luckysheet_conditionformat_save"]), "curCdformat": curCdformat, "RowlChange": RowlChange, - "dataVerification": $.extend(true, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["dataVerification"]), - "curDataVerification": curDataVerification + "dataVerification": $.extend(true, [], file["dataVerification"]), + "curDataVerification": curDataVerification, + "dynamicArray": $.extend(true, [], file["dynamicArray"]), + "curDynamicArray": curDynamicArray }); } //Store.flowdata Store.flowdata = data; editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据 - Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata; + file.data = Store.flowdata; //config if(cfg != null){ Store.config = cfg; - Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config; + file.config = Store.config; server.saveParam("all", Store.currentSheetIndex, cfg, { "k": "config" }); @@ -103,7 +128,7 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, //条件格式 if(cdformat != null){ - Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["luckysheet_conditionformat_save"] = cdformat; + file["luckysheet_conditionformat_save"] = cdformat; server.saveParam("all", Store.currentSheetIndex, cdformat, { "k": "luckysheet_conditionformat_save" }); } @@ -111,10 +136,17 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, //数据验证 if(dataVerification != null){ dataVerificationCtrl.dataVerification = dataVerification; - Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["dataVerification"] = dataVerification; + file["dataVerification"] = dataVerification; server.saveParam("all", Store.currentSheetIndex, dataVerification, { "k": "dataVerification" }); } + //动态数组 + if(dynamicArray != null){ + file["dynamicArray"] = dynamicArray; + + server.saveParam("all", Store.currentSheetIndex, dynamicArray, { "k": "dynamicArray" }); + } + //更新数据的范围 for(let s = 0; s < range.length; s++){ let r1 = range[s].row[0]; diff --git a/src/global/sort.js b/src/global/sort.js index 0383468..c80735e 100644 --- a/src/global/sort.js +++ b/src/global/sort.js @@ -267,15 +267,18 @@ function sortSelection(isAsc) { } } + let allParam = {}; if(Store.config["rowlen"] != null){ let cfg = $.extend(true, {}, Store.config); cfg = rowlenByRange(d, str, edr, cfg); - jfrefreshgrid(d, [{ "row": [str, edr], "column": [c1, c2] }], cfg, null, true); - } - else{ - jfrefreshgrid(d, [{ "row": [str, edr], "column": [c1, c2] }]); + allParam = { + "cfg": cfg, + "RowlChange": true + } } + + jfrefreshgrid(d, [{ "row": [str, edr], "column": [c1, c2] }], allParam); } //排序一列数据 @@ -352,15 +355,18 @@ function sortColumnSeletion(colIndex, isAsc) { } } + let allParam = {}; if(Store.config["rowlen"] != null){ let cfg = $.extend(true, {}, Store.config); cfg = rowlenByRange(d, str, edr, cfg); - jfrefreshgrid(d, [{ "row": [str, edr], "column": [c1, c2] }], cfg, null, true); - } - else{ - jfrefreshgrid(d, [{ "row": [str, edr], "column": [c1, c2] }]); + allParam = { + "cfg": cfg, + "RowlChange": true + } } + + jfrefreshgrid(d, [{ "row": [str, edr], "column": [c1, c2] }], allParam); } export {