Browse Source

fix(bug): bug

bug
master
wpxp123456 6 years ago
parent
commit
fb3b5122a5
  1. 47
      src/controllers/handler.js
  2. 2
      src/controllers/ifFormulaGenerator.js
  3. 3
      src/controllers/locationCell.js
  4. 7
      src/controllers/menuButton.js
  5. 5
      src/controllers/selection.js
  6. 8
      src/controllers/splitColumn.js
  7. 3
      src/index.html
  8. 2
      src/locale/zh.js

47
src/controllers/handler.js

@ -20,6 +20,7 @@ import { selectHightlightShow, selectIsOverlap, selectionCopyShow, luckysheet_co
import selection from './selection'; import selection from './selection';
import controlHistory from './controlHistory'; import controlHistory from './controlHistory';
import splitColumn from './splitColumn'; import splitColumn from './splitColumn';
import { luckysheetdefaultstyle } from './constant';
import { import {
replaceHtml, replaceHtml,
@ -3260,7 +3261,7 @@ export default function luckysheetHandler() {
return; return;
} }
//复制范围内包含部分合并单元格,提示 //截图范围内包含部分合并单元格,提示
if (Store.config["merge"] != null) { if (Store.config["merge"] != null) {
let has_PartMC = false; let has_PartMC = false;
@ -3293,14 +3294,6 @@ export default function luckysheetHandler() {
let st_c = Store.luckysheet_select_save[0].column[0], let st_c = Store.luckysheet_select_save[0].column[0],
ed_c = Store.luckysheet_select_save[0].column[1]; 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; let scrollHeight, rh_height;
if (st_r - 1 < 0) { if (st_r - 1 < 0) {
scrollHeight = 0; scrollHeight = 0;
@ -3326,13 +3319,37 @@ export default function luckysheetHandler() {
height: Math.ceil(rh_height * devicePixelRatio) height: Math.ceil(rh_height * devicePixelRatio)
}).css({ width: ch_width, height: rh_height }); }).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); luckysheetDrawMain(scrollWidth, scrollHeight, ch_width, rh_height, 1, 1, null, null, newCanvas);
let ctx_newCanvas = newCanvas.get(0).getContext("2d");
Store.flowdata = d;
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据 //补上 左边框和上边框
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 image = new Image();
let url = newCanvas.get(0).toDataURL("image/png"); let url = newCanvas.get(0).toDataURL("image/png");

2
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(); $("#luckysheet-ifFormulaGenerator-multiRange-dialog").css({ "left": (winw + scrollLeft - myw) / 2, "top": (winh + scrollTop - myh) / 3 }).show();
}, },
getIfList: function(compareValue, smallRange, largeRange, method, methodVal){ getIfList: function(compareValue, smallRange, largeRange, method, methodVal){
const locale_formula = locale().formula;
$("#luckysheet-ifFormulaGenerator-dialog .ifList").empty(); $("#luckysheet-ifFormulaGenerator-dialog .ifList").empty();
smallRange = parseInt(smallRange); smallRange = parseInt(smallRange);

3
src/controllers/locationCell.js

@ -108,6 +108,8 @@ const luckysheetLocationCell = {
init: function(){ init: function(){
let _this = this; let _this = this;
const locale_location = locale().findAndReplace;
$(document).on("click", "#luckysheet-locationCell-dialog .listItem input:radio", function(e){ $(document).on("click", "#luckysheet-locationCell-dialog .listItem input:radio", function(e){
$("#luckysheet-locationCell-dialog .listItem input:checkbox").prop("disabled", true); $("#luckysheet-locationCell-dialog .listItem input:checkbox").prop("disabled", true);
$("#luckysheet-locationCell-dialog .listItem .subbox label").css("color", "#666"); $("#luckysheet-locationCell-dialog .listItem .subbox label").css("color", "#666");
@ -213,6 +215,7 @@ const luckysheetLocationCell = {
}); });
}, },
apply: function(range, type, value){ apply: function(range, type, value){
const locale_location = locale().findAndReplace;
let rangeArr = []; let rangeArr = [];
if(type == "locationFormula" || type == "locationConstant" || type == "locationNull"){ //公式 常量 空值 if(type == "locationFormula" || type == "locationConstant" || type == "locationNull"){ //公式 常量 空值

7
src/controllers/menuButton.js

@ -2736,8 +2736,10 @@ const menuButton = {
}, },
getQKBorder: function(width, type, color){ getQKBorder: function(width, type, color){
let bordertype = ""; let bordertype = "";
if(width.indexOf("pt") > -1){ if(width.indexOf("pt") > -1){
let width = parseFloat(width); width = parseFloat(width);
if(width < 1){ if(width < 1){
} }
@ -2749,7 +2751,8 @@ const menuButton = {
} }
} }
else{ else{
let width = parseFloat(width); width = parseFloat(width);
if(width < 2){ if(width < 2){
} }

5
src/controllers/selection.js

@ -429,7 +429,7 @@ const selection = {
} }
if(c_value == null){ if(c_value == null){
c_value = ""; c_value = " ";
} }
column += 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 += '</td>'; column += '</td>';

8
src/controllers/splitColumn.js

@ -249,6 +249,10 @@ const luckysheetSplitColumn = {
value = getcellvalue(r, c, Store.flowdata); value = getcellvalue(r, c, Store.flowdata);
} }
if(value == null){
value = "";
}
rowArr = value.toString().split(reg); rowArr = value.toString().split(reg);
dataArr.push(rowArr); dataArr.push(rowArr);
@ -287,6 +291,10 @@ const luckysheetSplitColumn = {
value = getcellvalue(r, c, Store.flowdata); value = getcellvalue(r, c, Store.flowdata);
} }
if(value == null){
value = "";
}
rowArr.push(value); rowArr.push(value);
arr.push(rowArr); arr.push(rowArr);

3
src/index.html

@ -33,7 +33,8 @@
luckysheet.create({ luckysheet.create({
container: 'luckysheet', container: 'luckysheet',
lang: 'en', // lang: 'en',
lang: 'zh',
allowEdit:true, allowEdit:true,
plugins: ['chart'], plugins: ['chart'],
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart] data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart]

2
src/locale/zh.js

@ -584,7 +584,7 @@ export default {
successTip:"已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')", successTip:"已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')",
}, },
splitText:{ splitText:{
splitSymbol:"分割符号", splitDelimiters:"分割符号",
splitOther:"其它", splitOther:"其它",
splitContinueSymbol:"连续分隔符号视为单个处理", splitContinueSymbol:"连续分隔符号视为单个处理",
splitDataPreview:"数据预览", splitDataPreview:"数据预览",

Loading…
Cancel
Save