@fileverse-dev/fortune-core 1.1.80-patch-test-6 → 1.1.80-patch-test-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/api/sheet.js +11 -2
- package/lib/api/sheet.js +10 -1
- package/package.json +1 -1
package/es/api/sheet.js
CHANGED
|
@@ -2,7 +2,7 @@ import _ from "lodash";
|
|
|
2
2
|
import { v4 as uuidv4 } from "uuid";
|
|
3
3
|
import { dataToCelldata, getSheet } from "./common";
|
|
4
4
|
import { getSheetIndex } from "../utils";
|
|
5
|
-
import { api, execfunction, insertUpdateFunctionGroup, locale } from "..";
|
|
5
|
+
import { api, execfunction, getFlowdata, insertUpdateFunctionGroup, locale, spillSortResult } from "..";
|
|
6
6
|
export function getAllSheets(ctx) {
|
|
7
7
|
return ctx.luckysheetfile;
|
|
8
8
|
}
|
|
@@ -122,7 +122,16 @@ export function calculateSheetFromula(ctx, id) {
|
|
|
122
122
|
}
|
|
123
123
|
var result = execfunction(ctx, (_c = ctx.luckysheetfile[index].data[r][c]) === null || _c === void 0 ? void 0 : _c.f, r, c, id);
|
|
124
124
|
console.log("Formula result", result);
|
|
125
|
-
|
|
125
|
+
var isValueArray = Array.isArray(result[1]);
|
|
126
|
+
if (isValueArray) {
|
|
127
|
+
var value = {
|
|
128
|
+
f: result[2],
|
|
129
|
+
v: result[1]
|
|
130
|
+
};
|
|
131
|
+
spillSortResult(ctx, r, c, value, getFlowdata(ctx));
|
|
132
|
+
} else {
|
|
133
|
+
api.setCellValue(ctx, r, c, result[1], null);
|
|
134
|
+
}
|
|
126
135
|
insertUpdateFunctionGroup(ctx, r, c, id);
|
|
127
136
|
}
|
|
128
137
|
}
|
package/lib/api/sheet.js
CHANGED
|
@@ -139,7 +139,16 @@ function calculateSheetFromula(ctx, id) {
|
|
|
139
139
|
}
|
|
140
140
|
var result = (0, _2.execfunction)(ctx, (_c = ctx.luckysheetfile[index].data[r][c]) === null || _c === void 0 ? void 0 : _c.f, r, c, id);
|
|
141
141
|
console.log("Formula result", result);
|
|
142
|
-
|
|
142
|
+
var isValueArray = Array.isArray(result[1]);
|
|
143
|
+
if (isValueArray) {
|
|
144
|
+
var value = {
|
|
145
|
+
f: result[2],
|
|
146
|
+
v: result[1]
|
|
147
|
+
};
|
|
148
|
+
(0, _2.spillSortResult)(ctx, r, c, value, (0, _2.getFlowdata)(ctx));
|
|
149
|
+
} else {
|
|
150
|
+
_2.api.setCellValue(ctx, r, c, result[1], null);
|
|
151
|
+
}
|
|
143
152
|
(0, _2.insertUpdateFunctionGroup)(ctx, r, c, id);
|
|
144
153
|
}
|
|
145
154
|
}
|