diff --git a/src/controllers/controlHistory.js b/src/controllers/controlHistory.js index c27d68e..71bc6af 100644 --- a/src/controllers/controlHistory.js +++ b/src/controllers/controlHistory.js @@ -85,7 +85,11 @@ const controlHistory = { "dataVerification": ctr.dataVerification, "dynamicArray": ctr.dynamicArray } - jfrefreshgrid(ctr.data, ctr.range, allParam); + // jfrefreshgrid(ctr.data, ctr.range, allParam); + + /* ⚠️ 这个🌶️ dataRange表示的才是数据更新的位置 */ + jfrefreshgrid(ctr.data, ctr.dataRange, allParam); + // formula.execFunctionGroup(null, null, null, null, ctr.data);//取之前的数据 } else if (ctr.type == "pasteCut") { diff --git a/src/controllers/server.js b/src/controllers/server.js index 813fc50..f7cd526 100644 --- a/src/controllers/server.js +++ b/src/controllers/server.js @@ -427,9 +427,21 @@ const server = { file["config"][k] = {}; } - for(let key in value){ - file["config"][k][key] = value[key]; - } + // for(let key in value){ + // file["config"][k][key] = value[key]; + // } + + // ⚠️ 上面的处理方式会导致部分配置项被遗漏,以致协同编辑的时候多视图出现不一致的情况,调整处理的策略为直接替换配置项: + // 可能的配置项为: + // columnlen: {0: 65, 1: 186, 2: 52} + // customHeight: {0: 1, 5: 1, 6: 1} + // customWidth: {0: 1, 1: 1, 2: 1} + // merge: {2_1: {…}, 4_2: {…}, 6_2: {…}} + // rowlen: {0: 19, 5: 93, 6: 117} + if(value && (typeof value == "object")){ + file["config"][k] = value; + } + } if(index == Store.currentSheetIndex){//更新数据为当前表格数据 @@ -694,7 +706,14 @@ const server = { file["column"] += len; for(let i = 0; i < data.length; i++){ - data[i].splice(st_i, 0, addData[i]); + // data[i].splice(st_i, 0, addData[i]); + + // 备注:区分插入的位置(可能是左侧插入或者右侧插入) + if(direction == "lefttop"){ + data[i].splice(st_i, 0, addData[i]); + }else{ + data[i].splice(st_i + 1, 0, addData[i]); + } } } diff --git a/src/global/format.js b/src/global/format.js index a50781f..8549bc3 100644 --- a/src/global/format.js +++ b/src/global/format.js @@ -1353,8 +1353,16 @@ var make_ssf = function make_ssf(SSF) { } // var retval = ""; var retval = tempV === 0 ? "0" : ""; - for (i = 0; i !== out.length; ++i) - if (out[i] != null) retval += out[i].v; + // for (i = 0; i !== out.length; ++i) + // if (out[i] != null) retval += out[i].v; + for (i = 0; i !== out.length; ++i){ + if (out[i] != null && out[i].v.startsWith(".")){ + retval += out[i].v; + }else{ + retval = out[i].v || retval; + } + } + return retval; } SSF._eval = eval_fmt;