Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
feat(inline string render finished): begin to develop edit feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tubiaoge committed Sep 17, 2020
1 parent 2d6a03f commit 2ffd9ae
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 40 deletions.
12 changes: 12 additions & 0 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions src/global/getRowlen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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计算

Expand All @@ -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++){
Expand Down
80 changes: 40 additions & 40 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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":[]}]
})

})
Expand Down

0 comments on commit 2ffd9ae

Please sign in to comment.