Browse Source

feat(inline string render finished): begin to develop edit feature

master
liuyang 5 years ago
parent
commit
2ffd9aedd8
  1. 12
      src/controllers/handler.js
  2. 8
      src/global/getRowlen.js
  3. 80
      src/index.html

12
src/controllers/handler.js

@ -3146,6 +3146,12 @@ export default function luckysheetHandler() {
cfg["rowlen"] = {};
}
if (cfg["customHeight"] == null) {
cfg["customHeight"] = {};
}
cfg["customHeight"][Store.luckysheet_rows_change_size_start[1]] = 1;
cfg["rowlen"][Store.luckysheet_rows_change_size_start[1]] = Math.ceil(size/Store.zoomRatio);
let images = imageCtrl.moveChangeSize("row", Store.luckysheet_rows_change_size_start[1], size);
@ -3222,6 +3228,12 @@ export default function luckysheetHandler() {
cfg["columnlen"] = {};
}
if (cfg["customWidth"] == null) {
cfg["customWidth"] = {};
}
cfg["customWidth"][Store.luckysheet_cols_change_size_start[1]] = 1;
cfg["columnlen"][Store.luckysheet_cols_change_size_start[1]] = Math.ceil(size/Store.zoomRatio);
let images = imageCtrl.moveChangeSize("column", Store.luckysheet_cols_change_size_start[1], size);

8
src/global/getRowlen.js

@ -12,6 +12,10 @@ function rowlenByRange(d, r1, r2, cfg) {
cfg_clone["rowlen"] = {};
}
if(cfg_clone["customHeight"] == null){
cfg_clone["customHeight"] = {};
}
let canvas = $("#luckysheetTableContent").get(0).getContext("2d");
canvas.textBaseline = 'top'; //textBaseline以top计算
@ -25,6 +29,10 @@ function rowlenByRange(d, r1, r2, cfg) {
// currentRowLen = cfg_clone["rowlen"][r];
// }
if(cfg_clone["customHeight"][r]==1){
continue;
}
delete cfg_clone["rowlen"][r];
for(let c = 0; c < d[r].length; c++){

80
src/index.html

@ -78,46 +78,46 @@
forceCalculation:false,
plugins: ['chart'],
data:
[sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart]
// [{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"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":{
// "ct":{
// "fa":"General",
// "t":"inlineStr",
// "s":[
// {
// "ff":"等线", //font family
// "fc":"#fff000",//font color
// "fs":12,//font size
// "cl":0,//strike
// "un":0,//underline
// "bl":0,//blod
// "it":1,//italic
// v:"我在马路\r\n边捡到\r\n\r\n一分钱"
// },
// {
// "ff":"等线", //font family
// "fc":"#ff0000",//font color
// "fs":14,//font size
// "cl":"1",//strike
// "un":"1",//underline
// "bl":"1",//blod
// "it":"0",//italic
// v:"交给警\r\n察叔叔\r\n"
// },
// ]
// },
// "fs":11,
// "ff":"等线",
// "vt":0,
// "tb":2,
// "v":"",
// "qp":1,
// }
// },
// {"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
// ],"calcChain":[]}]
// [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart]
[{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"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":{
"ct":{
"fa":"General",
"t":"inlineStr",
"s":[
{
"ff":"等线", //font family
"fc":"#fff000",//font color
"fs":12,//font size
"cl":0,//strike
"un":0,//underline
"bl":0,//blod
"it":1,//italic
v:"我在马路\r\n边捡到\r\n\r\n一分钱"
},
{
"ff":"等线", //font family
"fc":"#ff0000",//font color
"fs":14,//font size
"cl":"1",//strike
"un":"1",//underline
"bl":"1",//blod
"it":"0",//italic
v:"交给警\r\n察叔叔\r\n"
},
]
},
"fs":11,
"ff":"等线",
"vt":0,
"tb":2,
"v":"",
"qp":1,
}
},
{"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
],"calcChain":[]}]
})
})

Loading…
Cancel
Save