diff --git a/src/controllers/handler.js b/src/controllers/handler.js index 65347b2..fd21ea2 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -20,6 +20,7 @@ import { selectHightlightShow, selectIsOverlap, selectionCopyShow, luckysheet_co import selection from './selection'; import controlHistory from './controlHistory'; import splitColumn from './splitColumn'; +import { luckysheetdefaultstyle } from './constant'; import { replaceHtml, @@ -3260,7 +3261,7 @@ export default function luckysheetHandler() { return; } - //复制范围内包含部分合并单元格,提示 + //截图范围内包含部分合并单元格,提示 if (Store.config["merge"] != null) { let has_PartMC = false; @@ -3293,14 +3294,6 @@ export default function luckysheetHandler() { let st_c = Store.luckysheet_select_save[0].column[0], ed_c = Store.luckysheet_select_save[0].column[1]; - let shotData = datagridgrowth([], ed_r + 1, ed_c + 1); - - for (let r = st_r; r <= ed_r; r++) { - for (let c = st_c; c <= ed_c; c++) { - shotData[r][c] = Store.flowdata[r][c]; - } - } - let scrollHeight, rh_height; if (st_r - 1 < 0) { scrollHeight = 0; @@ -3326,13 +3319,37 @@ export default function luckysheetHandler() { height: Math.ceil(rh_height * devicePixelRatio) }).css({ width: ch_width, height: rh_height }); - let d = Store.flowdata; - Store.flowdata = shotData; - luckysheetDrawMain(scrollWidth, scrollHeight, ch_width, rh_height, 1, 1, null, null, newCanvas); - - Store.flowdata = d; - editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据 + let ctx_newCanvas = newCanvas.get(0).getContext("2d"); + + //补上 左边框和上边框 + ctx_newCanvas.beginPath(); + ctx_newCanvas.moveTo( + 0, + 0 + ); + ctx_newCanvas.lineTo( + 0, + Store.devicePixelRatio * rh_height + ); + ctx_newCanvas.lineWidth = Store.devicePixelRatio * 2; + ctx_newCanvas.strokeStyle = luckysheetdefaultstyle.strokeStyle; + ctx_newCanvas.stroke(); + ctx_newCanvas.closePath(); + + ctx_newCanvas.beginPath(); + ctx_newCanvas.moveTo( + 0, + 0 + ); + ctx_newCanvas.lineTo( + Store.devicePixelRatio * ch_width, + 0 + ); + ctx_newCanvas.lineWidth = Store.devicePixelRatio * 2; + ctx_newCanvas.strokeStyle = luckysheetdefaultstyle.strokeStyle; + ctx_newCanvas.stroke(); + ctx_newCanvas.closePath(); let image = new Image(); let url = newCanvas.get(0).toDataURL("image/png"); diff --git a/src/controllers/ifFormulaGenerator.js b/src/controllers/ifFormulaGenerator.js index 35a17a9..9340ff5 100644 --- a/src/controllers/ifFormulaGenerator.js +++ b/src/controllers/ifFormulaGenerator.js @@ -472,6 +472,8 @@ const ifFormulaGenerator = { $("#luckysheet-ifFormulaGenerator-multiRange-dialog").css({ "left": (winw + scrollLeft - myw) / 2, "top": (winh + scrollTop - myh) / 3 }).show(); }, getIfList: function(compareValue, smallRange, largeRange, method, methodVal){ + const locale_formula = locale().formula; + $("#luckysheet-ifFormulaGenerator-dialog .ifList").empty(); smallRange = parseInt(smallRange); diff --git a/src/controllers/locationCell.js b/src/controllers/locationCell.js index 9a5c8d3..8e64beb 100644 --- a/src/controllers/locationCell.js +++ b/src/controllers/locationCell.js @@ -108,6 +108,8 @@ const luckysheetLocationCell = { init: function(){ let _this = this; + const locale_location = locale().findAndReplace; + $(document).on("click", "#luckysheet-locationCell-dialog .listItem input:radio", function(e){ $("#luckysheet-locationCell-dialog .listItem input:checkbox").prop("disabled", true); $("#luckysheet-locationCell-dialog .listItem .subbox label").css("color", "#666"); @@ -213,6 +215,7 @@ const luckysheetLocationCell = { }); }, apply: function(range, type, value){ + const locale_location = locale().findAndReplace; let rangeArr = []; if(type == "locationFormula" || type == "locationConstant" || type == "locationNull"){ //公式 常量 空值 diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index 84d37ec..d70e57c 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -2736,8 +2736,10 @@ const menuButton = { }, getQKBorder: function(width, type, color){ let bordertype = ""; + if(width.indexOf("pt") > -1){ - let width = parseFloat(width); + width = parseFloat(width); + if(width < 1){ } @@ -2749,7 +2751,8 @@ const menuButton = { } } else{ - let width = parseFloat(width); + width = parseFloat(width); + if(width < 2){ } diff --git a/src/controllers/selection.js b/src/controllers/selection.js index d825d42..cd56e7d 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -429,7 +429,7 @@ const selection = { } if(c_value == null){ - c_value = ""; + c_value = " "; } column += c_value; @@ -488,7 +488,8 @@ const selection = { } } - column = replaceHtml(column, {"style":style, "span":""}); + column = replaceHtml(column, {"style": style, "span": ""}); + column += " "; } column += ''; diff --git a/src/controllers/splitColumn.js b/src/controllers/splitColumn.js index 7eb53b4..8675c97 100644 --- a/src/controllers/splitColumn.js +++ b/src/controllers/splitColumn.js @@ -249,6 +249,10 @@ const luckysheetSplitColumn = { value = getcellvalue(r, c, Store.flowdata); } + if(value == null){ + value = ""; + } + rowArr = value.toString().split(reg); dataArr.push(rowArr); @@ -287,6 +291,10 @@ const luckysheetSplitColumn = { value = getcellvalue(r, c, Store.flowdata); } + if(value == null){ + value = ""; + } + rowArr.push(value); arr.push(rowArr); diff --git a/src/index.html b/src/index.html index 4c467e0..ec8d314 100644 --- a/src/index.html +++ b/src/index.html @@ -33,7 +33,8 @@ luckysheet.create({ container: 'luckysheet', - lang: 'en', + // lang: 'en', + lang: 'zh', allowEdit:true, plugins: ['chart'], data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart] diff --git a/src/locale/zh.js b/src/locale/zh.js index a8c7b2a..6cf101d 100644 --- a/src/locale/zh.js +++ b/src/locale/zh.js @@ -584,7 +584,7 @@ export default { successTip:"已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')", }, splitText:{ - splitSymbol:"分割符号", + splitDelimiters:"分割符号", splitOther:"其它", splitContinueSymbol:"连续分隔符号视为单个处理", splitDataPreview:"数据预览",