Browse Source

fix(setcellvalue delete function fix): fix it

master
liuyang 5 years ago
parent
commit
00b351fa0d
  1. 22
      src/controllers/cellFormat.js
  2. 4
      src/global/formula.js
  3. 6
      src/global/setdata.js
  4. 4
      src/index.html

22
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++;
}

4
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,

6
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;

4
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":{

Loading…
Cancel
Save