diff --git a/src/controllers/cellFormat.js b/src/controllers/cellFormat.js index 87c69c9..415b794 100644 --- a/src/controllers/cellFormat.js +++ b/src/controllers/cellFormat.js @@ -6,6 +6,7 @@ import menuButton from './menuButton'; import {checkProtectionNotEnable} from './protection'; import { jfrefreshgrid } from '../global/refresh'; import locale from '../locale/locale'; +import { setcellvalue } from '../global/setdata'; let isInitialCellFormatModel = false; @@ -22,9 +23,17 @@ function initialCellFormatModelEvent(){ hidden = hidden==true?1:0; let d = recycleSeletion( - function(cell){ - cell.lo = locked; - cell.hi = hidden; + function(cell, r, c, data){ + if(cell==null){ + setcellvalue(r, c, data, { + lo:locked, + hi:hidden + }); + } + else{ + cell.lo = locked; + cell.hi = hidden; + } }, function(){ alert(local_cellFormat.sheetDataIsNullAlert); @@ -79,7 +88,8 @@ function recycleSeletion(cycleFunction, dataIsNullFunction){ // } // count++; - cycleFunction(cell); + + cycleFunction(cell, r, c, data); } } } @@ -152,12 +162,12 @@ export function openCellFormatModel(){ recycleSeletion( function(cell){ // let cell = data[r][c]; - if(cell.lo==null || cell.lo==1){ + if(cell==null || cell.lo==null || cell.lo==1){ locked = true; lockedCount++; } - if(cell.hi==1){ + if(cell!=null && cell.hi==1){ hidden = true; hiddenCount++; } diff --git a/src/global/formula.js b/src/global/formula.js index 0e97a90..706d31a 100644 --- a/src/global/formula.js +++ b/src/global/formula.js @@ -1238,7 +1238,7 @@ const luckysheetformula = { } if(!checkProtectionLocked(r, c, Store.currentSheetIndex)){ - return + return; } //数据验证 输入数据无效时禁止输入 @@ -5188,6 +5188,7 @@ const luckysheetformula = { "r": u.r, "c": u.c, "v": v[1], + "f": v[2], "spe":v[3], "index": u.index }); @@ -5226,6 +5227,7 @@ const luckysheetformula = { } } updateValue.v = item.v; + updateValue.f = item.f; setcellvalue(item.r, item.c, data, updateValue); server.saveParam("v", item.index, item.v, { "r": item.r, diff --git a/src/global/setdata.js b/src/global/setdata.js index 460a2b3..2f968a1 100644 --- a/src/global/setdata.js +++ b/src/global/setdata.js @@ -22,9 +22,9 @@ function setcellvalue(r, c, d, v) { if(v.f != null){ cell.f = v.f; } - else{ - delete cell.f; - } + // else{ + // delete cell.f; + // } if(v.spl != null){ cell.spl = v.spl; diff --git a/src/index.html b/src/index.html index 4ea429d..7c5aa2c 100644 --- a/src/index.html +++ b/src/index.html @@ -53,8 +53,8 @@ "url":"./assets/iconfont/Pacifico-Regular.ttf" } ], - data: - [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification] + // data: + // [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification] /*[{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81,"17":100}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[ {"r":0,"c":0, "v":{