diff --git a/docs/guide/data.md b/docs/guide/data.md index fdd65c085..343667fcb 100644 --- a/docs/guide/data.md +++ b/docs/guide/data.md @@ -192,12 +192,12 @@ } ``` - ### config.columlen + ### config.columnlen - Type:Object - Default:{} - Usage:The column width of each cell, example: ```js - "columlen": { + "columnlen": { "0": 97, "1": 115, "2": 128 diff --git a/docs/guide/operate.md b/docs/guide/operate.md index 1775f42da..6b63fbc98 100644 --- a/docs/guide/operate.md +++ b/docs/guide/operate.md @@ -75,8 +75,8 @@ - Update: `luckysheetfile[3].config.["rowlen"]["3"] = 10` 2. Examples of modifying column width: - - Enter: `{"t":"cg","i":1,"v":{"20":74, "15":170, "6":40},"k":" columlen"}` - - Update: `luckysheetfile[1].config.["columlen"]["20"] = 74` + - Enter: `{"t":"cg","i":1,"v":{"20":74, "15":170, "6":40},"k":" columnlen"}` + - Update: `luckysheetfile[1].config.["columnlen"]["20"] = 74` 3. Examples of merged cells: - Enter: `{"t":"cg","i":1,"v":{"5_10":{row:[1,3], column:[3,5]},"k":" merge "}` diff --git a/docs/zh/guide/data.md b/docs/zh/guide/data.md index bdebe7589..9ffbb4ace 100644 --- a/docs/zh/guide/data.md +++ b/docs/zh/guide/data.md @@ -192,12 +192,12 @@ } ``` - ### config.columlen + ### config.columnlen - 类型:Object - 默认值:{} - 作用:每个单元格的列宽,示例: ```js - "columlen": { + "columnlen": { "0": 97, "1": 115, "2": 128 diff --git a/docs/zh/guide/operate.md b/docs/zh/guide/operate.md index 45469caf5..c1d3c700d 100644 --- a/docs/zh/guide/operate.md +++ b/docs/zh/guide/operate.md @@ -75,8 +75,8 @@ - 更新:`luckysheetfile[3].config.["rowlen"]["3"] = 10` 2. 修改列宽度举例: - - 输入:`{"t":"cg","i":1,"v":{"20":74, "15":170, "6":40},"k":" columlen"}` - - 更新:`luckysheetfile[1].config.["columlen"]["20"] = 74` + - 输入:`{"t":"cg","i":1,"v":{"20":74, "15":170, "6":40},"k":" columnlen"}` + - 更新:`luckysheetfile[1].config.["columnlen"]["20"] = 74` 3. 合并单元格举例: - 输入:`{"t":"cg","i":1,"v":{"5_10":{row:[1,3], column:[3,5]},"k":" merge "}` diff --git a/src/controllers/controlHistory.js b/src/controllers/controlHistory.js index 7e96c57b0..adde630f2 100644 --- a/src/controllers/controlHistory.js +++ b/src/controllers/controlHistory.js @@ -108,7 +108,7 @@ const controlHistory = { server.saveParam("cg", ctr.sheetIndex, ctr.config["rowlen"], { "k": "rowlen" }); } else if(ctr.ctrlType == "resizeC"){ - server.saveParam("cg", ctr.sheetIndex, ctr.config["columlen"], { "k": "columlen" }); + server.saveParam("cg", ctr.sheetIndex, ctr.config["columnlen"], { "k": "columnlen" }); } jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length); @@ -359,7 +359,7 @@ const controlHistory = { server.saveParam("cg", ctr.sheetIndex, ctr.curconfig["rowlen"], { "k": "rowlen" }); } else if(ctr.ctrlType == "resizeC"){ - server.saveParam("cg", ctr.sheetIndex, ctr.curconfig["columlen"], { "k": "columlen" }); + server.saveParam("cg", ctr.sheetIndex, ctr.curconfig["columnlen"], { "k": "columnlen" }); } jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length); diff --git a/src/controllers/handler.js b/src/controllers/handler.js index fd21ea2d7..75d7f5d34 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -919,11 +919,11 @@ export default function luckysheetHandler() { //列宽默认值 let cfg = $.extend(true, {}, Store.config); - if (cfg["columlen"] == null) { - cfg["columlen"] = {}; + if (cfg["columnlen"] == null) { + cfg["columnlen"] = {}; } - let first_collen = cfg["columlen"][Store.luckysheet_select_save[0].column[0]] == null ? Store.defaultcollen : cfg["columlen"][Store.luckysheet_select_save[0].column[0]]; + let first_collen = cfg["columnlen"][Store.luckysheet_select_save[0].column[0]] == null ? Store.defaultcollen : cfg["columnlen"][Store.luckysheet_select_save[0].column[0]]; let isSame = true; for (let i = 0; i < Store.luckysheet_select_save.length; i++) { @@ -931,7 +931,7 @@ export default function luckysheetHandler() { let c1 = s.column[0], c2 = s.column[1]; for (let c = c1; c <= c2; c++) { - let collen = cfg["columlen"][c] == null ? Store.defaultcollen : cfg["columlen"][c]; + let collen = cfg["columnlen"][c] == null ? Store.defaultcollen : cfg["columnlen"][c]; if (collen != first_collen) { isSame = false; @@ -2364,12 +2364,12 @@ export default function luckysheetHandler() { let size = (x + 3) - Store.luckysheet_cols_change_size_start[0]; - let firstcolumlen = Store.defaultcollen; - if (Store.config["columlen"] != null && Store.config["columlen"][Store.luckysheet_cols_change_size_start[1]] != null) { - firstcolumlen = Store.config["columlen"][Store.luckysheet_cols_change_size_start[1]]; + let firstcolumnlen = Store.defaultcollen; + if (Store.config["columnlen"] != null && Store.config["columnlen"][Store.luckysheet_cols_change_size_start[1]] != null) { + firstcolumnlen = Store.config["columnlen"][Store.luckysheet_cols_change_size_start[1]]; } - if (Math.abs(size - firstcolumlen) < 3) { + if (Math.abs(size - firstcolumnlen) < 3) { return; } if ((x + 3) - Store.luckysheet_cols_change_size_start[0] < 30) { @@ -2381,11 +2381,11 @@ export default function luckysheetHandler() { } let cfg = $.extend(true, {}, Store.config); - if (cfg["columlen"] == null) { - cfg["columlen"] = {}; + if (cfg["columnlen"] == null) { + cfg["columnlen"] = {}; } - cfg["columlen"][Store.luckysheet_cols_change_size_start[1]] = Math.ceil(size); + cfg["columnlen"][Store.luckysheet_cols_change_size_start[1]] = Math.ceil(size); if (Store.clearjfundo) { Store.jfundo = []; @@ -2403,7 +2403,7 @@ export default function luckysheetHandler() { Store.config = cfg; Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config; - server.saveParam("cg", Store.currentSheetIndex, cfg["columlen"], { "k": "columlen" }); + server.saveParam("cg", Store.currentSheetIndex, cfg["columnlen"], { "k": "columnlen" }); jfrefreshgrid_rhcw(null, Store.flowdata[0].length); diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index d70e57cd2..1ff659f4e 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -3816,8 +3816,8 @@ const menuButton = { else{ let config = getluckysheetfile()[getSheetIndex(Store.currentSheetIndex)]["config"]; - if (config["columlen"] != null && config["columlen"][cell_c] != null) { - width = config["columlen"][cell_c]; + if (config["columnlen"] != null && config["columnlen"][cell_c] != null) { + width = config["columnlen"][cell_c]; } if (config["rowlen"] != null && config["rowlen"][cell_r] != null) { diff --git a/src/controllers/rowColumnOperation.js b/src/controllers/rowColumnOperation.js index 4e62491a6..4056dd660 100644 --- a/src/controllers/rowColumnOperation.js +++ b/src/controllers/rowColumnOperation.js @@ -776,11 +776,11 @@ export function rowColumnOperationInitial(){ //列宽默认值 let cfg = $.extend(true, {}, Store.config); - if(cfg["columlen"] == null){ - cfg["columlen"] = {}; + if(cfg["columnlen"] == null){ + cfg["columnlen"] = {}; } - let first_collen = cfg["columlen"][Store.luckysheet_select_save[0].column[0]] == null ? Store.defaultcollen : cfg["columlen"][Store.luckysheet_select_save[0].column[0]]; + let first_collen = cfg["columnlen"][Store.luckysheet_select_save[0].column[0]] == null ? Store.defaultcollen : cfg["columnlen"][Store.luckysheet_select_save[0].column[0]]; let isSame = true; for(let i = 0; i < Store.luckysheet_select_save.length; i++){ @@ -788,7 +788,7 @@ export function rowColumnOperationInitial(){ let c1 = s.column[0], c2 = s.column[1]; for(let c = c1; c <= c2; c++){ - let collen = cfg["columlen"][c] == null ? Store.defaultcollen : cfg["columlen"][c]; + let collen = cfg["columnlen"][c] == null ? Store.defaultcollen : cfg["columnlen"][c]; if(collen != first_collen){ isSame = false; @@ -1443,8 +1443,8 @@ export function rowColumnOperationInitial(){ else if(Store.luckysheetRightHeadClickIs == "column"){ type = "resizeC"; - if(cfg["columlen"] == null){ - cfg["columlen"] = {}; + if(cfg["columnlen"] == null){ + cfg["columnlen"] = {}; } for(let s = 0; s < Store.luckysheet_select_save.length; s++){ @@ -1452,7 +1452,7 @@ export function rowColumnOperationInitial(){ let c2 = Store.luckysheet_select_save[s].column[1]; for(let c = c1; c <= c2; c++){ - cfg["columlen"][c] = size; + cfg["columnlen"][c] = size; } } } @@ -1477,7 +1477,7 @@ export function rowColumnOperationInitial(){ jfrefreshgrid_rhcw(Store.flowdata.length, null); } else if(Store.luckysheetRightHeadClickIs == "column"){ - server.saveParam("cg", Store.currentSheetIndex, cfg["columlen"], { "k": "columlen" }); + server.saveParam("cg", Store.currentSheetIndex, cfg["columnlen"], { "k": "columnlen" }); jfrefreshgrid_rhcw(null, Store.flowdata[0].length); } }); @@ -1557,11 +1557,11 @@ function luckysheetcolsdbclick() { size = winW - 100 + scrollLeft; } - if (cfg["columlen"] == null) { - cfg["columlen"] = {}; + if (cfg["columnlen"] == null) { + cfg["columnlen"] = {}; } - cfg["columlen"][Store.luckysheet_cols_change_size_start[1]] = Math.ceil(size); + cfg["columnlen"][Store.luckysheet_cols_change_size_start[1]] = Math.ceil(size); matchColumn[col_index] = 1; } @@ -1607,17 +1607,17 @@ function luckysheetcolsdbclick() { size = winW - 100 + scrollLeft; } - if (cfg["columlen"] == null) { - cfg["columlen"] = {}; + if (cfg["columnlen"] == null) { + cfg["columnlen"] = {}; } - cfg["columlen"][c] = Math.ceil(size); + cfg["columnlen"][c] = Math.ceil(size); matchColumn[c] = 1; } } } - jfrefreshgridall(Store.flowdata[0].length, Store.flowdata.length, Store.flowdata, cfg, Store.luckysheet_select_save, "resizeC", "columlen"); + jfrefreshgridall(Store.flowdata[0].length, Store.flowdata.length, Store.flowdata, cfg, Store.luckysheet_select_save, "resizeC", "columnlen"); } /** diff --git a/src/controllers/selection.js b/src/controllers/selection.js index cd56e7dbf..a4a0cc69a 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -183,11 +183,11 @@ const selection = { let style = "", span = ""; if(r == minR){ - if(Store.config == null || Store.config["columlen"] == null || Store.config["columlen"][c.toString()] == null){ + if(Store.config == null || Store.config["columnlen"] == null || Store.config["columnlen"][c.toString()] == null){ colgroup += ''; } else { - colgroup += ''; + colgroup += ''; } } @@ -471,11 +471,11 @@ const selection = { column += ""; if(r == minR){ - if(Store.config == null || Store.config["columlen"] == null || Store.config["columlen"][c.toString()] == null){ + if(Store.config == null || Store.config["columnlen"] == null || Store.config["columnlen"][c.toString()] == null){ colgroup += ''; } else { - colgroup += ''; + colgroup += ''; } } diff --git a/src/controllers/server.js b/src/controllers/server.js index ef36ff027..8833b6d90 100644 --- a/src/controllers/server.js +++ b/src/controllers/server.js @@ -280,7 +280,7 @@ const server = { }, 1); } } - else if(type == "cg"){ //config更新(rowhidden,rowlen,columlen,merge,borderInfo) + else if(type == "cg"){ //config更新(rowhidden,rowlen,columnlen,merge,borderInfo) let k = item.k; if(k == "borderInfo"){ @@ -299,7 +299,7 @@ const server = { if(index == Store.currentSheetIndex){//更新数据为当前表格数据 Store.config = file["config"]; - if(k == "rowlen" || k == "columlen" || k == "rowhidden"){ + if(k == "rowlen" || k == "columnlen" || k == "rowhidden"){ jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length); } diff --git a/src/demoData/sheetCell.js b/src/demoData/sheetCell.js index e3f058b84..546e5a55c 100644 --- a/src/demoData/sheetCell.js +++ b/src/demoData/sheetCell.js @@ -1146,7 +1146,7 @@ const sheetCell = { "27": 20, "28": 80 }, - "columlen": { + "columnlen": { "0": 97, "2": 115, "3": 128, diff --git a/src/demoData/sheetComment.js b/src/demoData/sheetComment.js index 944fc7508..62bc2412a 100644 --- a/src/demoData/sheetComment.js +++ b/src/demoData/sheetComment.js @@ -2,7 +2,7 @@ const sheetComment = { "name": "Comment", "color": "", "config": { - "columlen": { + "columnlen": { "2": 102 } }, diff --git a/src/demoData/sheetConditionFormat.js b/src/demoData/sheetConditionFormat.js index a07b96fa5..471fae8d8 100644 --- a/src/demoData/sheetConditionFormat.js +++ b/src/demoData/sheetConditionFormat.js @@ -138,7 +138,7 @@ const sheetConditionFormat = { "28": 20, "29": 20 }, - "columlen": { + "columnlen": { "0": 30, "1": 30, "2": 86, diff --git a/src/demoData/sheetFormula.js b/src/demoData/sheetFormula.js index 93d1e5ab9..c2d4bc6e5 100644 --- a/src/demoData/sheetFormula.js +++ b/src/demoData/sheetFormula.js @@ -71,7 +71,7 @@ const sheetFormula = { } }, "rowlen": {}, - "columlen": { + "columnlen": { "0": 111, "2": 105, "3": 82, diff --git a/src/demoData/sheetSparkline.js b/src/demoData/sheetSparkline.js index 2cdf5b406..2ae21e2b1 100644 --- a/src/demoData/sheetSparkline.js +++ b/src/demoData/sheetSparkline.js @@ -355,7 +355,7 @@ const sheetSparkline = { "56": 20, "57": 20 }, - "columlen": { + "columnlen": { "0": 101, "2": 131, "3": 30, diff --git a/src/function/functionImplementation.js b/src/function/functionImplementation.js index 1450b9c4f..17981f81c 100644 --- a/src/function/functionImplementation.js +++ b/src/function/functionImplementation.js @@ -23379,8 +23379,8 @@ const functionImplementation = { case "width": var cfg = file.config; - if(cfg["columlen"] != null && col_index in cfg["columlen"]){ - return cfg["columlen"][col_index]; + if(cfg["columnlen"] != null && col_index in cfg["columnlen"]){ + return cfg["columnlen"][col_index]; } return Store.defaultcollen; @@ -25482,7 +25482,7 @@ const functionImplementation = { return temp1; // { // height:rowlen, - // width:firstcolumlen, + // width:firstcolumnlen, // normalRangeMin:6, // normalRangeMax:6, // normalRangeColor:"#000" @@ -25627,7 +25627,7 @@ const functionImplementation = { return temp1; // { // height:rowlen, - // width:firstcolumlen, + // width:firstcolumnlen, // normalRangeMin:6, // normalRangeMax:6, // normalRangeColor:"#000" diff --git a/src/global/draw.js b/src/global/draw.js index e99552bf8..9eb5c21c5 100644 --- a/src/global/draw.js +++ b/src/global/draw.js @@ -405,9 +405,9 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of } else { - let firstcolumlen = Store.defaultcollen; - if (Store.config["columlen"] != null && Store.config["columlen"][c] != null) { - firstcolumlen = Store.config["columlen"][c]; + let firstcolumnlen = Store.defaultcollen; + if (Store.config["columnlen"] != null && Store.config["columnlen"][c] != null) { + firstcolumnlen = Store.config["columnlen"][c]; } if (Store.flowdata[r] != null && Store.flowdata[r][c] != null) { @@ -438,7 +438,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of "start_r": start_r, "end_r": end_r, "end_c": end_c, - "firstcolumlen": firstcolumlen, + "firstcolumnlen": firstcolumnlen, }); } else{ @@ -448,7 +448,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of if(margeMain.r == r){ margeMain.end_c += (end_c - start_c); - margeMain.firstcolumlen += firstcolumlen; + margeMain.firstcolumnlen += firstcolumnlen; } } @@ -464,7 +464,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of "start_c": start_c, "end_r": end_r, "end_c": end_c, - "firstcolumlen": firstcolumlen, + "firstcolumnlen": firstcolumnlen, }); borderOffset[r + "_" + c] = { "start_r": start_r, @@ -498,7 +498,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of start_c = item.start_c, end_r = item.end_r, end_c = item.end_c; - let firstcolumlen = item.firstcolumlen; + let firstcolumnlen = item.firstcolumnlen; if(Store.flowdata[r] == null){ continue; @@ -582,7 +582,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of start_c = item.start_c, end_r = item.end_r, end_c = item.end_c; - let firstcolumlen = item.firstcolumlen; + let firstcolumnlen = item.firstcolumnlen; let cell = Store.flowdata[r][c]; let value = null, er = r, ec = c, end_ec = end_c; diff --git a/src/global/extend.js b/src/global/extend.js index 34fcd5653..f58a971e4 100644 --- a/src/global/extend.js +++ b/src/global/extend.js @@ -590,29 +590,29 @@ function luckysheetextendtable(type, index, value, direction) { type1 = "c"; //行高配置变动 - if(cfg["columlen"] != null){ - let columlen_new = {}; + if(cfg["columnlen"] != null){ + let columnlen_new = {}; - for(let c in cfg["columlen"]){ + for(let c in cfg["columnlen"]){ c = parseFloat(c); if(c < index){ - columlen_new[c] = cfg["columlen"][c]; + columnlen_new[c] = cfg["columnlen"][c]; } else if(c == index){ if(direction == "lefttop"){ - columlen_new[(c + value)] = cfg["columlen"][c]; + columnlen_new[(c + value)] = cfg["columnlen"][c]; } else if(direction == "rightbottom"){ - columlen_new[c] = cfg["columlen"][c]; + columnlen_new[c] = cfg["columnlen"][c]; } } else{ - columlen_new[(c + value)] = cfg["columlen"][c]; + columnlen_new[(c + value)] = cfg["columnlen"][c]; } } - cfg["columlen"] = columlen_new; + cfg["columnlen"] = columnlen_new; } //空列模板 @@ -1377,21 +1377,21 @@ function luckysheetdeletetable(type, st, ed) { type1 = "c"; //列宽配置变动 - if(cfg["columlen"] == null){ - cfg["columlen"] = {}; + if(cfg["columnlen"] == null){ + cfg["columnlen"] = {}; } - let columlen_new = {}; - for(let c in cfg["columlen"]){ + let columnlen_new = {}; + for(let c in cfg["columnlen"]){ if(c < st){ - columlen_new[c] = cfg["columlen"][c]; + columnlen_new[c] = cfg["columnlen"][c]; } else if(c > ed){ - columlen_new[c - slen] = cfg["columlen"][c]; + columnlen_new[c - slen] = cfg["columnlen"][c]; } } - cfg["columlen"] = columlen_new; + cfg["columnlen"] = columnlen_new; //边框配置变动 if(cfg["borderInfo"] && cfg["borderInfo"].length > 0){ diff --git a/src/global/refresh.js b/src/global/refresh.js index eab983e56..345552e29 100644 --- a/src/global/refresh.js +++ b/src/global/refresh.js @@ -652,14 +652,14 @@ function jfrefreshgrid_rhcw(rowheight, colwidth, isRefreshCanvas=true){ Store.config["rowlen"] = {}; } - if(Store.config["columlen"] == null){ - Store.config["columlen"] = {}; + if(Store.config["columnlen"] == null){ + Store.config["columnlen"] = {}; } for(let i = 0; i < calcChain.length; i++){ let r = calcChain[i].r, c = calcChain[i].c, index = calcChain[i].index; - if(index == Store.currentSheetIndex && Store.flowdata[r][c] != null && Store.flowdata[r][c].spl != null && ((r in Store.config["rowlen"]) || (c in Store.config["columlen"]))){ + if(index == Store.currentSheetIndex && Store.flowdata[r][c] != null && Store.flowdata[r][c].spl != null && ((r in Store.config["rowlen"]) || (c in Store.config["columnlen"]))){ window.luckysheetCurrentRow = r; window.luckysheetCurrentColumn = c; window.luckysheetCurrentFunction = Store.flowdata[r][c].f; diff --git a/src/global/rhchInit.js b/src/global/rhchInit.js index d90562848..77ba1f6da 100644 --- a/src/global/rhchInit.js +++ b/src/global/rhchInit.js @@ -33,43 +33,43 @@ export default function rhchInit(rowheight, colwidth) { Store.visibledatacolumn = []; Store.ch_width = 0; - let maxColumlen = 120; + let maxColumnlen = 120; for (let i = 0; i < colwidth; i++) { - let firstcolumlen = Store.defaultcollen; + let firstcolumnlen = Store.defaultcollen; - if (Store.config["columlen"] != null && Store.config["columlen"][i] != null) { - firstcolumlen = Store.config["columlen"][i]; + if (Store.config["columnlen"] != null && Store.config["columnlen"][i] != null) { + firstcolumnlen = Store.config["columnlen"][i]; } else { if (Store.flowdata[0] != null && Store.flowdata[0][i] != null) { - if (firstcolumlen > 300) { - firstcolumlen = 300; + if (firstcolumnlen > 300) { + firstcolumnlen = 300; } - else if (firstcolumlen < Store.defaultcollen) { - firstcolumlen = Store.defaultcollen; + else if (firstcolumnlen < Store.defaultcollen) { + firstcolumnlen = Store.defaultcollen; } - if (firstcolumlen != Store.defaultcollen) { - if (Store.config["columlen"] == null) { - Store.config["columlen"] = {}; + if (firstcolumnlen != Store.defaultcollen) { + if (Store.config["columnlen"] == null) { + Store.config["columnlen"] = {}; } - Store.config["columlen"][i] = firstcolumlen; + Store.config["columnlen"][i] = firstcolumnlen; } } } - Store.ch_width += firstcolumlen + 1; + Store.ch_width += firstcolumnlen + 1; Store.visibledatacolumn.push(Store.ch_width);//列的临时长度分布 - if(maxColumlen < firstcolumlen + 1){ - maxColumlen = firstcolumlen + 1; + if(maxColumnlen < firstcolumnlen + 1){ + maxColumnlen = firstcolumnlen + 1; } } // Store.ch_width += 120; - Store.ch_width += maxColumlen; + Store.ch_width += maxColumnlen; } } \ No newline at end of file