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

fix #243, fix #226
  • Loading branch information
wpxp123456 committed Dec 3, 2020
1 parent 88aa6c5 commit 385bc03
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
8 changes: 4 additions & 4 deletions src/global/formula.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ const luckysheetformula = {
let value = "";
// && d[r][c].v != null
if (d[r] != null && d[r][c] != null) {
let cell = d[r][c];
let cell = $.extend(true, {}, d[r][c]);

if(isInlineStringCell(cell)){
value = getInlineStringNoStyle(r, c);
Expand Down Expand Up @@ -1339,7 +1339,7 @@ const luckysheetformula = {
if(getObjType(value) == "string" && value.slice(0, 1) == "=" && value.length > 1){
let v = _this.execfunction(value, r, c, undefined, true);
isRunExecFunction = false;
curv = d[r][c];
curv = $.extend(true, {}, d[r][c]);
curv.v = v[1];
curv.f = v[2];

Expand Down Expand Up @@ -1370,7 +1370,7 @@ const luckysheetformula = {
isRunExecFunction = false;
// get v/m/ct

curv = d[r][c];
curv = $.extend(true, {}, d[r][c]);
curv.v = v[1];
curv.f = v[2];

Expand Down Expand Up @@ -1438,7 +1438,7 @@ const luckysheetformula = {
_this.execFunctionGroup(r, c, value);
isRunExecFunction = false;

curv = d[r][c];
curv = $.extend(true, {}, d[r][c]);
// let gd = _this.execFunctionGlobalData[r+"_"+c+"_"+Store.currentSheetIndex];
// if(gd!=null){
// curv.v = gd.v;
Expand Down
57 changes: 28 additions & 29 deletions src/global/func_methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,40 @@ const func_methods = {

if(rangeObj.data == null){
if(!isNeglectNullCell){
if(nullCellType == "number"){
if(nullCellType === "number"){
dataArr.push(0);
}
else if(nullCellType == "text"){
else if(nullCellType === "text"){
dataArr.push("");
}
}
}
else{
if(getObjType(rangeObj.data) == "array"){
if(getObjType(rangeObj.data) === "array"){
for(let i = 0; i < rangeObj.data.length; i++){
for(let j = 0; j < rangeObj.data[i].length; j++){
if(rangeObj.data[i][j] != null){
let datav = rangeObj.data[i][j];
if(datav instanceof Object){
dataArr.push(datav.v);
}
else{
dataArr.push(datav);
}
let cell = rangeObj.data[i][j];
let value = cell

if(getObjType(cell) === 'object'){
value = cell.v
}
else{

if(value == null ){
if(!isNeglectNullCell){
if(nullCellType == "number"){
dataArr.push(0);
if(nullCellType === "number"){
value = 0;
}
else if(nullCellType == "text"){
dataArr.push("");
else if(nullCellType === "text"){
value = '';
}

dataArr.push(value);
}
}
else{
dataArr.push(value);
}
}
}
}
Expand Down Expand Up @@ -97,23 +100,19 @@ const func_methods = {
let rowArr = [];

for(let j = 0; j < rangeObj.data[i].length; j++){
let value;
let cell = rangeObj.data[i][j];
let value = cell;

if(rangeObj.data[i][j] != null){
let datav = rangeObj.data[i][j];
if(datav instanceof Object){
value = datav.v;
}
else{
value = datav;
}
if(getObjType(cell) === 'object'){
value = cell.v
}
else{
if(nullCellType == "number"){

if(value == null){
if(nullCellType === "number"){
value = 0;
}
else if(nullCellType == "text"){
value = "";
else if(nullCellType === "text"){
value = '';
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/global/setdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function setcellvalue(r, c, d, v) {
if(d == null){
d = Store.flowdata;
}
let cell = d[r][c];
let cell = $.extend(true, {}, d[r][c]);

let vupdate;

Expand Down

0 comments on commit 385bc03

Please sign in to comment.