zmdms-webui 1.0.2 → 1.0.3
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.
|
@@ -2,6 +2,7 @@ import { __assign } from '../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { Table } from 'antd';
|
|
5
|
+
import { plus } from 'zmdms-utils';
|
|
5
6
|
|
|
6
7
|
function useSummary(summaryConfig, columns, options) {
|
|
7
8
|
var summaryFixed = options.summaryFixed, rowSelection = options.rowSelection, expandable = options.expandable, isAdd = options.isAdd, isDel = options.isDel;
|
|
@@ -177,8 +178,7 @@ function getSubtotalObj(fields, dataSource) {
|
|
|
177
178
|
dataItem = isNaN(dataItem) ? 0 : dataItem;
|
|
178
179
|
var summaryItem = (summaryTotalObj === null || summaryTotalObj === void 0 ? void 0 : summaryTotalObj[field]) || 0;
|
|
179
180
|
summaryTotalObj[field] = summaryItem
|
|
180
|
-
?
|
|
181
|
-
plus(summaryItem, dataItem)
|
|
181
|
+
? plus(summaryItem, dataItem)
|
|
182
182
|
: dataItem;
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
@@ -312,10 +312,6 @@ function getTotalObj(fields) {
|
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
314
|
return summaryTotalObj;
|
|
315
|
-
}
|
|
316
|
-
// 暂时用这里的加法
|
|
317
|
-
function plus(a, b) {
|
|
318
|
-
return a + b;
|
|
319
315
|
}
|
|
320
316
|
|
|
321
317
|
export { useSummary as default };
|