|
@ -19,13 +19,15 @@ import { createFilterOptions } from '../controllers/filter'; |
|
|
import { getSheetIndex } from '../methods/get'; |
|
|
import { getSheetIndex } from '../methods/get'; |
|
|
import Store from '../store'; |
|
|
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){ |
|
|
if(data == null){ |
|
|
data = Store.flowdata; |
|
|
data = Store.flowdata; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(range == null){ |
|
|
if(range == null){ |
|
|
range = Store.luckysheet_select_save; |
|
|
range = Store.luckysheet_select_save; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//单元格数据更新联动
|
|
|
//单元格数据更新联动
|
|
|
if (isRunExecFunction) { |
|
|
if (isRunExecFunction) { |
|
|
formula.execFunctionExist = []; |
|
|
formula.execFunctionExist = []; |
|
@ -41,6 +43,19 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, |
|
|
formula.execFunctionGroupData = null; |
|
|
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) { |
|
|
if (Store.clearjfundo) { |
|
|
Store.jfundo = []; |
|
|
Store.jfundo = []; |
|
|
|
|
|
|
|
@ -54,7 +69,7 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, |
|
|
|
|
|
|
|
|
let curCdformat; |
|
|
let curCdformat; |
|
|
if(cdformat == null){ |
|
|
if(cdformat == null){ |
|
|
curCdformat = $.extend(true, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["luckysheet_conditionformat_save"]); |
|
|
curCdformat = $.extend(true, [], file["luckysheet_conditionformat_save"]); |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
curCdformat = cdformat; |
|
|
curCdformat = cdformat; |
|
@ -62,11 +77,19 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, |
|
|
|
|
|
|
|
|
let curDataVerification; |
|
|
let curDataVerification; |
|
|
if(dataVerification == null){ |
|
|
if(dataVerification == null){ |
|
|
curDataVerification = $.extend(true, {}, Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["dataVerification"]) |
|
|
curDataVerification = $.extend(true, {}, file["dataVerification"]) |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
curDataVerification = dataVerification; |
|
|
curDataVerification = dataVerification; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let curDynamicArray; |
|
|
|
|
|
if(dynamicArray == null){ |
|
|
|
|
|
curDynamicArray = $.extend(true, [], file["dynamicArray"]); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
curDynamicArray = dynamicArray; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Store.jfredo.push({ |
|
|
Store.jfredo.push({ |
|
|
"type": "datachange", |
|
|
"type": "datachange", |
|
@ -76,23 +99,25 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, |
|
|
"range": range, |
|
|
"range": range, |
|
|
"config": $.extend(true, {}, Store.config), |
|
|
"config": $.extend(true, {}, Store.config), |
|
|
"curConfig": curConfig, |
|
|
"curConfig": curConfig, |
|
|
"cdformat": $.extend(true, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["luckysheet_conditionformat_save"]), |
|
|
"cdformat": $.extend(true, [], file["luckysheet_conditionformat_save"]), |
|
|
"curCdformat": curCdformat, |
|
|
"curCdformat": curCdformat, |
|
|
"RowlChange": RowlChange, |
|
|
"RowlChange": RowlChange, |
|
|
"dataVerification": $.extend(true, [], Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["dataVerification"]), |
|
|
"dataVerification": $.extend(true, [], file["dataVerification"]), |
|
|
"curDataVerification": curDataVerification |
|
|
"curDataVerification": curDataVerification, |
|
|
|
|
|
"dynamicArray": $.extend(true, [], file["dynamicArray"]), |
|
|
|
|
|
"curDynamicArray": curDynamicArray |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//Store.flowdata
|
|
|
//Store.flowdata
|
|
|
Store.flowdata = data; |
|
|
Store.flowdata = data; |
|
|
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
|
|
|
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
|
|
|
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].data = Store.flowdata; |
|
|
file.data = Store.flowdata; |
|
|
|
|
|
|
|
|
//config
|
|
|
//config
|
|
|
if(cfg != null){ |
|
|
if(cfg != null){ |
|
|
Store.config = cfg; |
|
|
Store.config = cfg; |
|
|
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config; |
|
|
file.config = Store.config; |
|
|
|
|
|
|
|
|
server.saveParam("all", Store.currentSheetIndex, cfg, { "k": "config" }); |
|
|
server.saveParam("all", Store.currentSheetIndex, cfg, { "k": "config" }); |
|
|
|
|
|
|
|
@ -103,7 +128,7 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, dataVerification, |
|
|
|
|
|
|
|
|
//条件格式
|
|
|
//条件格式
|
|
|
if(cdformat != null){ |
|
|
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" }); |
|
|
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){ |
|
|
if(dataVerification != null){ |
|
|
dataVerificationCtrl.dataVerification = dataVerification; |
|
|
dataVerificationCtrl.dataVerification = dataVerification; |
|
|
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)]["dataVerification"] = dataVerification; |
|
|
file["dataVerification"] = dataVerification; |
|
|
server.saveParam("all", Store.currentSheetIndex, dataVerification, { "k": "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++){ |
|
|
for(let s = 0; s < range.length; s++){ |
|
|
let r1 = range[s].row[0]; |
|
|
let r1 = range[s].row[0]; |
|
|