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

Commit

Permalink
fix(bug): bug
Browse files Browse the repository at this point in the history
bug
  • Loading branch information
wpxp123456 committed Aug 4, 2020
1 parent 04e2b8e commit fb3b512
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 21 deletions.
47 changes: 32 additions & 15 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -3260,7 +3261,7 @@ export default function luckysheetHandler() {
return;
}

//复制范围内包含部分合并单元格,提示
//截图范围内包含部分合并单元格,提示
if (Store.config["merge"] != null) {
let has_PartMC = false;

Expand Down Expand Up @@ -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;
Expand All @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions src/controllers/ifFormulaGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/locationCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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"){ //公式 常量 空值
Expand Down
7 changes: 5 additions & 2 deletions src/controllers/menuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){

}
Expand All @@ -2749,7 +2751,8 @@ const menuButton = {
}
}
else{
let width = parseFloat(width);
width = parseFloat(width);

if(width < 2){

}
Expand Down
5 changes: 3 additions & 2 deletions src/controllers/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ const selection = {
}

if(c_value == null){
c_value = "";
c_value = " ";
}

column += c_value;
Expand Down Expand Up @@ -488,7 +488,8 @@ const selection = {
}
}

column = replaceHtml(column, {"style":style, "span":""});
column = replaceHtml(column, {"style": style, "span": ""});
column += " ";
}

column += '</td>';
Expand Down
8 changes: 8 additions & 0 deletions src/controllers/splitColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ const luckysheetSplitColumn = {
value = getcellvalue(r, c, Store.flowdata);
}

if(value == null){
value = "";
}

rowArr = value.toString().split(reg);

dataArr.push(rowArr);
Expand Down Expand Up @@ -287,6 +291,10 @@ const luckysheetSplitColumn = {
value = getcellvalue(r, c, Store.flowdata);
}

if(value == null){
value = "";
}

rowArr.push(value);

arr.push(rowArr);
Expand Down
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/locale/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ export default {
successTip:"已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')",
},
splitText:{
splitSymbol:"分割符号",
splitDelimiters:"分割符号",
splitOther:"其它",
splitContinueSymbol:"连续分隔符号视为单个处理",
splitDataPreview:"数据预览",
Expand Down

0 comments on commit fb3b512

Please sign in to comment.