fix: index function ref error

This commit is contained in:
gazedreamily 2023-02-15 15:29:52 +08:00 committed by Qaplagzy
parent 4ccfc45528
commit 1781467662
3 changed files with 5 additions and 7 deletions

View File

@ -320,7 +320,6 @@ export function setCellValue(
const mask = genarate(cell.v as string);
if (mask) {
cell.m = mask[0].toString();
[, , cell.v] = mask;
}
}
} else {

View File

@ -317,7 +317,7 @@ export function escapeHTML(preValue: string) {
let resultValue = preValue;
if (
(!resultValue && typeof resultValue !== "string") ||
preValue.startsWith("=")
(typeof preValue === "string" && preValue.startsWith("="))
)
return preValue;
try {

View File

@ -433,11 +433,11 @@ function checkSpecialFunctionRange(
}
try {
ctx.calculateSheetId = id;
let str = new Function(`return ${function_str}`)();
const str = function_str
.split(",")
[function_str.split(",").length - 1].split("'")[1]
.split("'")[0];
if (str instanceof Object && !_.isNil(str.startCell)) {
str = str.startCell;
}
const str_nb = _.trim(str);
// console.log(function_str, tempFunc,str, this.iscelldata(str_nb),this.isFunctionRangeSave,r,c);
if (iscelldata(str_nb)) {
@ -785,7 +785,6 @@ function isFunctionRange(
i += 1;
}
// console.log(function_str);
checkSpecialFunctionRange(
ctx,
function_str,