diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index 1afc7d2..d618271 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -694,6 +694,7 @@ const sheetmanage = { } let execF = function(){ + _this.mergeCalculation(file["index"]); _this.storeSheetParam(); _this.restoreselect(); _this.CacheNotLoadControll = []; @@ -903,6 +904,48 @@ const sheetmanage = { Store.luckysheetfile[index]["data"] = Store.flowdata; Store.luckysheetfile[index]["config"] = $.extend(true, {}, Store.config); }, + mergeCalculationSheet:{}, + mergeCalculation:function(index){ + let file = Store.luckysheetfile[this.getSheetIndex(index)]; + let config = file.config, data = file.data, mergeConfig = config.merge; + if(mergeConfig==null || index in this.mergeCalculationSheet || file["autoCalculationMerge"]===false){ + return; + } + + this.mergeCalculationSheet[index] = 1; + + for(let x in mergeConfig){ + let r = parseInt(x.substr(0, x.indexOf('_'))); + let c = parseInt(x.substr(x.indexOf('_') + 1)); + let mcInfo = mergeConfig[x]; + if(data[r][c]==null){ + data[r][c] = {}; + } + + data[r][c]["mc"] = { + r:r, + c:c, + rs:mcInfo.rs, + cs:mcInfo.cs, + } + + for(let ir=r;ir