|
@@ -543,6 +543,8 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
|
searchResult.push(data);
|
|
|
}
|
|
|
}
|
|
|
+ calculateCompletePercent(searchResult);
|
|
|
+ calculateSum();
|
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
|
};
|
|
|
const getCheckFun = function (key) {
|
|
@@ -576,8 +578,15 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
|
}
|
|
|
}
|
|
|
calculateCompletePercent(searchResult);
|
|
|
+ calculateSum();
|
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
|
};
|
|
|
+ const calculateSum = function () {
|
|
|
+ if (!searchResult || searchResult.length === 0 || !setting.calcSum) return;
|
|
|
+
|
|
|
+ const sum = setting.calcSum(searchResult);
|
|
|
+ if (sum) searchResult.unshift(sum);
|
|
|
+ };
|
|
|
const calculateCompletePercent = function (searchResult) {
|
|
|
if (!searchResult) return;
|
|
|
for (const sr of searchResult) {
|
|
@@ -596,7 +605,7 @@ const showSelectTab = function(select, spread, afterShow) {
|
|
|
if (!data) { return }
|
|
|
|
|
|
const curBills = data[info.row];
|
|
|
- if (!curBills) { return }
|
|
|
+ if (!curBills || curBills[setting.keyId] === undefined) { return }
|
|
|
|
|
|
SpreadJsObj.locateTreeNode(searchSheet, curBills[setting.keyId], true);
|
|
|
if (setting.afterLocated) {
|