vxe-table 3.15.34 → 3.15.35
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/style.css +1 -1
- package/es/table/src/body.js +20 -3
- package/es/table/src/cell.js +52 -36
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +2 -0
- package/es/table/src/methods.js +117 -69
- package/es/table/src/props.js +3 -1
- package/es/table/src/table.js +19 -6
- package/es/table/src/util.js +5 -2
- package/es/ui/index.js +4 -4
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +227 -109
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +19 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +43 -28
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +129 -65
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +3 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +19 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +7 -4
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +4 -4
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/body.ts +20 -3
- package/packages/table/src/cell.ts +52 -36
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/methods.ts +122 -68
- package/packages/table/src/props.ts +3 -1
- package/packages/table/src/table.ts +20 -6
- package/packages/table/src/util.ts +6 -2
- package/packages/ui/index.ts +3 -3
- /package/es/{iconfont.1749092456241.ttf → iconfont.1749202936550.ttf} +0 -0
- /package/es/{iconfont.1749092456241.woff → iconfont.1749202936550.woff} +0 -0
- /package/es/{iconfont.1749092456241.woff2 → iconfont.1749202936550.woff2} +0 -0
- /package/lib/{iconfont.1749092456241.ttf → iconfont.1749202936550.ttf} +0 -0
- /package/lib/{iconfont.1749092456241.woff → iconfont.1749202936550.woff} +0 -0
- /package/lib/{iconfont.1749092456241.woff2 → iconfont.1749202936550.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -420,8 +420,8 @@ function handleRowGroupBaseExpand($xeTable, rows, expanded) {
|
|
|
420
420
|
const reactData = $xeTable;
|
|
421
421
|
const internalData = $xeTable;
|
|
422
422
|
const { fullAllDataRowIdData, tableFullGroupData, rowGroupExpandedMaps } = internalData;
|
|
423
|
-
const
|
|
424
|
-
const { mapChildrenField, accordion } =
|
|
423
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
424
|
+
const { mapChildrenField, accordion } = aggregateOpts;
|
|
425
425
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
426
426
|
let validRows = rows;
|
|
427
427
|
if (mapChildrenField) {
|
|
@@ -571,7 +571,7 @@ function handleVirtualTreeToList($xeTable) {
|
|
|
571
571
|
const { treeConfig } = props;
|
|
572
572
|
const { isRowGroupStatus } = reactData;
|
|
573
573
|
const { fullAllDataRowIdData, treeExpandedMaps, rowGroupExpandedMaps } = internalData;
|
|
574
|
-
const
|
|
574
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
575
575
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
576
576
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
577
577
|
const fullData = [];
|
|
@@ -595,7 +595,7 @@ function handleVirtualTreeToList($xeTable) {
|
|
|
595
595
|
return fullData;
|
|
596
596
|
}
|
|
597
597
|
else if (isRowGroupStatus) {
|
|
598
|
-
const { childrenField } =
|
|
598
|
+
const { childrenField } = aggregateOpts;
|
|
599
599
|
XEUtils.eachTree(internalData.afterGroupFullData, (row, index, items, path, parentRow) => {
|
|
600
600
|
const rowid = handleGetRowId(row);
|
|
601
601
|
const parentRowid = handleGetRowId(parentRow);
|
|
@@ -627,7 +627,7 @@ function updateAfterFullData($xeTable) {
|
|
|
627
627
|
const { tableFullColumn, tableFullData, tableFullTreeData, tableFullGroupData } = internalData;
|
|
628
628
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
629
629
|
const sortOpts = $xeTable.computeSortOpts;
|
|
630
|
-
const
|
|
630
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
631
631
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
632
632
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
633
633
|
const { transform, rowField, parentField, mapChildrenField } = treeOpts;
|
|
@@ -691,8 +691,8 @@ function updateAfterFullData($xeTable) {
|
|
|
691
691
|
tableTree = XEUtils.searchTree(tableFullGroupData, handleFilter, {
|
|
692
692
|
original: true,
|
|
693
693
|
isEvery: true,
|
|
694
|
-
children:
|
|
695
|
-
mapChildren:
|
|
694
|
+
children: aggregateOpts.mapChildrenField,
|
|
695
|
+
mapChildren: aggregateOpts.childrenField
|
|
696
696
|
});
|
|
697
697
|
tableData = tableTree;
|
|
698
698
|
}
|
|
@@ -717,8 +717,8 @@ function updateAfterFullData($xeTable) {
|
|
|
717
717
|
tableTree = XEUtils.searchTree(tableFullGroupData, () => true, {
|
|
718
718
|
original: true,
|
|
719
719
|
isEvery: true,
|
|
720
|
-
children:
|
|
721
|
-
mapChildren:
|
|
720
|
+
children: aggregateOpts.mapChildrenField,
|
|
721
|
+
mapChildren: aggregateOpts.childrenField
|
|
722
722
|
});
|
|
723
723
|
tableData = tableTree;
|
|
724
724
|
}
|
|
@@ -748,15 +748,15 @@ function updateAfterFullData($xeTable) {
|
|
|
748
748
|
}
|
|
749
749
|
else {
|
|
750
750
|
const treeList = XEUtils.toTreeArray(tableTree, {
|
|
751
|
-
key:
|
|
752
|
-
parentKey:
|
|
753
|
-
children:
|
|
751
|
+
key: aggregateOpts.rowField,
|
|
752
|
+
parentKey: aggregateOpts.parentField,
|
|
753
|
+
children: aggregateOpts.mapChildrenField
|
|
754
754
|
});
|
|
755
755
|
tableTree = XEUtils.toArrayTree(XEUtils.orderBy(treeList, orderColumns.map(({ column, order }) => [getOrderField($xeTable, column), order])), {
|
|
756
|
-
key:
|
|
757
|
-
parentKey:
|
|
758
|
-
children:
|
|
759
|
-
mapChildren:
|
|
756
|
+
key: aggregateOpts.rowField,
|
|
757
|
+
parentKey: aggregateOpts.parentField,
|
|
758
|
+
children: aggregateOpts.childrenField,
|
|
759
|
+
mapChildren: aggregateOpts.mapChildrenField
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
tableData = tableTree;
|
|
@@ -812,8 +812,8 @@ function updateAfterFullData($xeTable) {
|
|
|
812
812
|
tableTree = XEUtils.searchTree(tableFullGroupData, () => true, {
|
|
813
813
|
original: true,
|
|
814
814
|
isEvery: true,
|
|
815
|
-
children:
|
|
816
|
-
mapChildren:
|
|
815
|
+
children: aggregateOpts.mapChildrenField,
|
|
816
|
+
mapChildren: aggregateOpts.childrenField
|
|
817
817
|
});
|
|
818
818
|
tableData = tableTree;
|
|
819
819
|
}
|
|
@@ -1273,7 +1273,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1273
1273
|
const { isRowGroupStatus } = reactData;
|
|
1274
1274
|
const { afterFullData, afterTreeFullData, afterGroupFullData, checkboxReserveRowMap, selectCheckboxMaps } = internalData;
|
|
1275
1275
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
1276
|
-
const
|
|
1276
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
1277
1277
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1278
1278
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
1279
1279
|
const { checkField, reserve, checkMethod } = checkboxOpts;
|
|
@@ -1322,7 +1322,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1322
1322
|
const rowid = handleGetRowId(row);
|
|
1323
1323
|
selectRowMaps[rowid] = row;
|
|
1324
1324
|
}
|
|
1325
|
-
}, { children:
|
|
1325
|
+
}, { children: aggregateOpts.mapChildrenField });
|
|
1326
1326
|
}
|
|
1327
1327
|
else {
|
|
1328
1328
|
/**
|
|
@@ -1335,7 +1335,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1335
1335
|
if (checkMethod({ $table: $xeTable, row }) ? false : selectCheckboxMaps[rowid]) {
|
|
1336
1336
|
selectRowMaps[rowid] = row;
|
|
1337
1337
|
}
|
|
1338
|
-
}, { children:
|
|
1338
|
+
}, { children: aggregateOpts.mapChildrenField });
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
@@ -2608,12 +2608,52 @@ const handleUpdateRowGroup = ($xeTable, groupFields) => {
|
|
|
2608
2608
|
})
|
|
2609
2609
|
: [];
|
|
2610
2610
|
};
|
|
2611
|
+
function handleeGroupSummary($xeTable, aggList) {
|
|
2612
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
2613
|
+
const { mapChildrenField } = aggregateOpts;
|
|
2614
|
+
if (mapChildrenField) {
|
|
2615
|
+
XEUtils.lastEach(aggList, aggRow => {
|
|
2616
|
+
let count = 0;
|
|
2617
|
+
XEUtils.each(aggRow[mapChildrenField], (row) => {
|
|
2618
|
+
if (row.isAggregate) {
|
|
2619
|
+
count += row.childCount || 0;
|
|
2620
|
+
}
|
|
2621
|
+
else {
|
|
2622
|
+
count++;
|
|
2623
|
+
}
|
|
2624
|
+
});
|
|
2625
|
+
aggRow.childCount = count;
|
|
2626
|
+
});
|
|
2627
|
+
if ($xeTable.handlePivotTableAggregateData) {
|
|
2628
|
+
$xeTable.handlePivotTableAggregateData(aggList);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
function updateGroupData($xeTable) {
|
|
2633
|
+
const props = $xeTable;
|
|
2634
|
+
const reactData = $xeTable;
|
|
2635
|
+
const internalData = $xeTable;
|
|
2636
|
+
const { aggregateConfig, rowGroupConfig } = props;
|
|
2637
|
+
const { isRowGroupStatus } = reactData;
|
|
2638
|
+
const { tableFullGroupData } = internalData;
|
|
2639
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
2640
|
+
const { mapChildrenField } = aggregateOpts;
|
|
2641
|
+
if ((aggregateConfig || rowGroupConfig) && isRowGroupStatus) {
|
|
2642
|
+
const aggList = [];
|
|
2643
|
+
XEUtils.eachTree(tableFullGroupData, row => {
|
|
2644
|
+
if (row.isAggregate) {
|
|
2645
|
+
aggList.push(row);
|
|
2646
|
+
}
|
|
2647
|
+
}, { children: mapChildrenField });
|
|
2648
|
+
handleeGroupSummary($xeTable, aggList);
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2611
2651
|
function handleGroupData($xeTable, list, rowGroups) {
|
|
2612
2652
|
let fullData = list;
|
|
2613
2653
|
let treeData = list;
|
|
2614
2654
|
if (rowGroups) {
|
|
2615
|
-
const
|
|
2616
|
-
const { rowField, parentField, childrenField, mapChildrenField } =
|
|
2655
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
2656
|
+
const { rowField, parentField, childrenField, mapChildrenField } = aggregateOpts;
|
|
2617
2657
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
2618
2658
|
const { checkField } = checkboxOpts;
|
|
2619
2659
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
@@ -2624,7 +2664,7 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
2624
2664
|
const groupField = rgItem.field;
|
|
2625
2665
|
const groupColumn = $xeTable.getColumnByField(groupField);
|
|
2626
2666
|
const groupMaps = {};
|
|
2627
|
-
const
|
|
2667
|
+
const aggList = [];
|
|
2628
2668
|
const rowkey = getRowkey($xeTable);
|
|
2629
2669
|
list.forEach((row) => {
|
|
2630
2670
|
const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) : XEUtils.get(row, groupField);
|
|
@@ -2641,12 +2681,12 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
2641
2681
|
});
|
|
2642
2682
|
XEUtils.objectEach(groupMaps, (childList, groupValue) => {
|
|
2643
2683
|
const { fullData: childFullData, treeData: childTreeData } = handleGroupData($xeTable, childList, rowGroups.slice(1));
|
|
2644
|
-
const
|
|
2645
|
-
const groupRow = {
|
|
2684
|
+
const aggRow = {
|
|
2646
2685
|
isAggregate: true,
|
|
2647
|
-
|
|
2686
|
+
aggData: {},
|
|
2648
2687
|
groupContent: groupValue,
|
|
2649
2688
|
groupField,
|
|
2689
|
+
childCount: 0,
|
|
2650
2690
|
[rowField]: getRowUniqueId(),
|
|
2651
2691
|
[parentField]: null,
|
|
2652
2692
|
[rowkey]: getRowUniqueId(),
|
|
@@ -2654,30 +2694,19 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
2654
2694
|
[mapChildrenField]: childTreeData
|
|
2655
2695
|
};
|
|
2656
2696
|
if (checkField) {
|
|
2657
|
-
|
|
2697
|
+
aggRow[checkField] = false;
|
|
2658
2698
|
}
|
|
2659
2699
|
if (indeterminateField) {
|
|
2660
|
-
|
|
2700
|
+
aggRow[indeterminateField] = false;
|
|
2661
2701
|
}
|
|
2662
|
-
|
|
2663
|
-
treeData.push(
|
|
2664
|
-
fullData.push(
|
|
2702
|
+
aggList.push(aggRow);
|
|
2703
|
+
treeData.push(aggRow);
|
|
2704
|
+
fullData.push(aggRow);
|
|
2665
2705
|
if (childFullData.length) {
|
|
2666
2706
|
fullData.push(...childFullData);
|
|
2667
2707
|
}
|
|
2668
2708
|
});
|
|
2669
|
-
|
|
2670
|
-
let count = 0;
|
|
2671
|
-
XEUtils.each(groupItem[childrenField], row => {
|
|
2672
|
-
if (row.isAggregate) {
|
|
2673
|
-
count += row[childrenField] ? row[childrenField].length : 0;
|
|
2674
|
-
}
|
|
2675
|
-
else {
|
|
2676
|
-
count++;
|
|
2677
|
-
}
|
|
2678
|
-
});
|
|
2679
|
-
groupItem.childCount = count;
|
|
2680
|
-
});
|
|
2709
|
+
handleeGroupSummary($xeTable, aggList);
|
|
2681
2710
|
}
|
|
2682
2711
|
}
|
|
2683
2712
|
return {
|
|
@@ -2693,7 +2722,7 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
2693
2722
|
const props = $xeTable;
|
|
2694
2723
|
const reactData = $xeTable;
|
|
2695
2724
|
const internalData = $xeTable;
|
|
2696
|
-
const { keepSource, treeConfig, rowGroupConfig } = props;
|
|
2725
|
+
const { keepSource, treeConfig, aggregateConfig, rowGroupConfig } = props;
|
|
2697
2726
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData;
|
|
2698
2727
|
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
2699
2728
|
const rowOpts = $xeTable.computeRowOpts;
|
|
@@ -2707,11 +2736,11 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
2707
2736
|
errLog('vxe.error.errMaxRow', [supportMaxRow]);
|
|
2708
2737
|
}
|
|
2709
2738
|
if (treeConfig && rowGroupList.length) {
|
|
2710
|
-
errLog('vxe.error.noTree', ['
|
|
2739
|
+
errLog('vxe.error.noTree', ['aggregate-config']);
|
|
2711
2740
|
return $xeTable.$nextTick();
|
|
2712
2741
|
}
|
|
2713
2742
|
if (rowOpts.drag && rowGroupList.length) {
|
|
2714
|
-
errLog('vxe.error.errConflicts', ['row-config.drag', '
|
|
2743
|
+
errLog('vxe.error.errConflicts', ['row-config.drag', 'aggregate-config']);
|
|
2715
2744
|
return $xeTable.$nextTick();
|
|
2716
2745
|
}
|
|
2717
2746
|
let isRGroup = false;
|
|
@@ -2750,7 +2779,7 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
2750
2779
|
treeData = fullData.slice(0);
|
|
2751
2780
|
}
|
|
2752
2781
|
}
|
|
2753
|
-
else if (rowGroupConfig && rowGroupList.length) {
|
|
2782
|
+
else if ((aggregateConfig || rowGroupConfig) && rowGroupList.length) {
|
|
2754
2783
|
const groupRest = handleGroupData($xeTable, fullData, rowGroupList);
|
|
2755
2784
|
treeData = groupRest.treeData;
|
|
2756
2785
|
fullData = groupRest.fullData;
|
|
@@ -2859,6 +2888,8 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
2859
2888
|
if (oldScrollYLoad === sYLoad) {
|
|
2860
2889
|
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
|
|
2861
2890
|
.then(() => {
|
|
2891
|
+
calcCellHeight($xeTable);
|
|
2892
|
+
updateRowOffsetTop($xeTable);
|
|
2862
2893
|
resolve();
|
|
2863
2894
|
});
|
|
2864
2895
|
}
|
|
@@ -2866,6 +2897,8 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
2866
2897
|
setTimeout(() => {
|
|
2867
2898
|
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
|
|
2868
2899
|
.then(() => {
|
|
2900
|
+
calcCellHeight($xeTable);
|
|
2901
|
+
updateRowOffsetTop($xeTable);
|
|
2869
2902
|
resolve();
|
|
2870
2903
|
});
|
|
2871
2904
|
});
|
|
@@ -3113,6 +3146,7 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
3113
3146
|
$xeTable.clearMergeCells();
|
|
3114
3147
|
$xeTable.clearMergeFooterItems();
|
|
3115
3148
|
$xeTable.handleTableData(true);
|
|
3149
|
+
$xeTable.handleAggregateSummaryData();
|
|
3116
3150
|
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
3117
3151
|
warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
|
|
3118
3152
|
}
|
|
@@ -3781,8 +3815,8 @@ const Methods = {
|
|
|
3781
3815
|
}, { children: childrenField });
|
|
3782
3816
|
}
|
|
3783
3817
|
else if (isRowGroupStatus) {
|
|
3784
|
-
const
|
|
3785
|
-
const { mapChildrenField } =
|
|
3818
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
3819
|
+
const { mapChildrenField } = aggregateOpts;
|
|
3786
3820
|
XEUtils.eachTree(tableFullGroupData, (row, index, items, path, parentRow, nodes) => {
|
|
3787
3821
|
const rowid = handleUpdateRowId(row);
|
|
3788
3822
|
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
@@ -6193,6 +6227,10 @@ const Methods = {
|
|
|
6193
6227
|
internalData.mergeFooterCellMaps = buildMergeData(mergeFooterList);
|
|
6194
6228
|
reactData.mergeFootFlag++;
|
|
6195
6229
|
},
|
|
6230
|
+
handleAggregateSummaryData() {
|
|
6231
|
+
const $xeTable = this;
|
|
6232
|
+
return updateGroupData($xeTable);
|
|
6233
|
+
},
|
|
6196
6234
|
handleTargetLeaveEvent() {
|
|
6197
6235
|
const $xeTable = this;
|
|
6198
6236
|
const internalData = $xeTable;
|
|
@@ -6489,7 +6527,7 @@ const Methods = {
|
|
|
6489
6527
|
const { treeConfig } = props;
|
|
6490
6528
|
const { isRowGroupStatus } = reactData;
|
|
6491
6529
|
const { selectCheckboxMaps } = internalData;
|
|
6492
|
-
const
|
|
6530
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
6493
6531
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6494
6532
|
const { transform, mapChildrenField } = treeOpts;
|
|
6495
6533
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -6541,7 +6579,7 @@ const Methods = {
|
|
|
6541
6579
|
}
|
|
6542
6580
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
6543
6581
|
}
|
|
6544
|
-
}, { children:
|
|
6582
|
+
}, { children: aggregateOpts.mapChildrenField });
|
|
6545
6583
|
reactData.updateCheckboxFlag++;
|
|
6546
6584
|
return;
|
|
6547
6585
|
}
|
|
@@ -6690,7 +6728,7 @@ const Methods = {
|
|
|
6690
6728
|
const { treeConfig } = props;
|
|
6691
6729
|
const { isRowGroupStatus } = reactData;
|
|
6692
6730
|
const { afterTreeFullData, afterGroupFullData, selectCheckboxMaps, treeIndeterminateRowMaps } = internalData;
|
|
6693
|
-
const
|
|
6731
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
6694
6732
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6695
6733
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6696
6734
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
@@ -6704,7 +6742,7 @@ const Methods = {
|
|
|
6704
6742
|
const childRowList = [];
|
|
6705
6743
|
if (isRowGroupStatus) {
|
|
6706
6744
|
// 行分组
|
|
6707
|
-
const mapChildrenField =
|
|
6745
|
+
const mapChildrenField = aggregateOpts.mapChildrenField;
|
|
6708
6746
|
if (mapChildrenField) {
|
|
6709
6747
|
XEUtils.eachTree(afterGroupFullData, (row) => {
|
|
6710
6748
|
const rowid = handleGetRowId(row);
|
|
@@ -7311,7 +7349,7 @@ const Methods = {
|
|
|
7311
7349
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
7312
7350
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
7313
7351
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
7314
|
-
const
|
|
7352
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
7315
7353
|
const rowOpts = $xeTable.computeRowOpts;
|
|
7316
7354
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
7317
7355
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
@@ -7338,7 +7376,7 @@ const Methods = {
|
|
|
7338
7376
|
$xeTable.triggerTreeExpandEvent(evnt, params);
|
|
7339
7377
|
}
|
|
7340
7378
|
// 如果是行分组
|
|
7341
|
-
if ((
|
|
7379
|
+
if ((aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
|
|
7342
7380
|
$xeTable.triggerRowGroupExpandEvent(evnt, params);
|
|
7343
7381
|
}
|
|
7344
7382
|
}
|
|
@@ -8769,9 +8807,9 @@ const Methods = {
|
|
|
8769
8807
|
const $xeTable = this;
|
|
8770
8808
|
const props = $xeTable;
|
|
8771
8809
|
const internalData = $xeTable;
|
|
8772
|
-
const { rowGroupConfig } = props;
|
|
8773
|
-
if (!rowGroupConfig) {
|
|
8774
|
-
errLog('vxe.error.reqProp', ['
|
|
8810
|
+
const { aggregateConfig, rowGroupConfig } = props;
|
|
8811
|
+
if (!(aggregateConfig || rowGroupConfig)) {
|
|
8812
|
+
errLog('vxe.error.reqProp', ['aggregate-config']);
|
|
8775
8813
|
return $xeTable.$nextTick();
|
|
8776
8814
|
}
|
|
8777
8815
|
if (fieldOrColumns) {
|
|
@@ -8786,21 +8824,31 @@ const Methods = {
|
|
|
8786
8824
|
const $xeTable = this;
|
|
8787
8825
|
const props = $xeTable;
|
|
8788
8826
|
const internalData = $xeTable;
|
|
8789
|
-
const { rowGroupConfig } = props;
|
|
8790
|
-
if (!rowGroupConfig) {
|
|
8791
|
-
errLog('vxe.error.reqProp', ['
|
|
8827
|
+
const { aggregateConfig, rowGroupConfig } = props;
|
|
8828
|
+
if (!(aggregateConfig || rowGroupConfig)) {
|
|
8829
|
+
errLog('vxe.error.reqProp', ['aggregate-config']);
|
|
8792
8830
|
return $xeTable.$nextTick();
|
|
8793
8831
|
}
|
|
8794
8832
|
handleUpdateRowGroup($xeTable, []);
|
|
8795
8833
|
return loadTableData($xeTable, internalData.tableSynchData, true);
|
|
8796
8834
|
},
|
|
8797
8835
|
isRowGroupRecord(row) {
|
|
8836
|
+
const $xeTable = this;
|
|
8837
|
+
warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord']);
|
|
8838
|
+
return $xeTable.isAggregateRecord(row);
|
|
8839
|
+
},
|
|
8840
|
+
isRowGroupExpandByRow(row) {
|
|
8841
|
+
const $xeTable = this;
|
|
8842
|
+
warnLog('vxe.error.delFunc', ['isRowGroupExpandByRow', 'isAggregateExpandByRow']);
|
|
8843
|
+
return $xeTable.isAggregateExpandByRow(row);
|
|
8844
|
+
},
|
|
8845
|
+
isAggregateRecord(row) {
|
|
8798
8846
|
const $xeTable = this;
|
|
8799
8847
|
const reactData = $xeTable;
|
|
8800
8848
|
const { isRowGroupStatus } = reactData;
|
|
8801
8849
|
return isRowGroupStatus && row.isAggregate;
|
|
8802
8850
|
},
|
|
8803
|
-
|
|
8851
|
+
isAggregateExpandByRow(row) {
|
|
8804
8852
|
const $xeTable = this;
|
|
8805
8853
|
const reactData = $xeTable;
|
|
8806
8854
|
const internalData = $xeTable;
|
|
@@ -8823,8 +8871,8 @@ const Methods = {
|
|
|
8823
8871
|
const reactData = $xeTable;
|
|
8824
8872
|
const internalData = $xeTable;
|
|
8825
8873
|
const { tableFullGroupData } = internalData;
|
|
8826
|
-
const
|
|
8827
|
-
const { mapChildrenField } =
|
|
8874
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
8875
|
+
const { mapChildrenField } = aggregateOpts;
|
|
8828
8876
|
const rgExpandedMaps = {};
|
|
8829
8877
|
if (expanded && mapChildrenField) {
|
|
8830
8878
|
XEUtils.eachTree(tableFullGroupData, (row) => {
|
|
@@ -8958,9 +9006,9 @@ const Methods = {
|
|
|
8958
9006
|
const $xeTable = this;
|
|
8959
9007
|
const internalData = $xeTable;
|
|
8960
9008
|
const { rowGroupExpandedMaps } = internalData;
|
|
8961
|
-
const
|
|
9009
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
8962
9010
|
const { row, column } = params;
|
|
8963
|
-
const { trigger } =
|
|
9011
|
+
const { trigger } = aggregateOpts;
|
|
8964
9012
|
if (trigger === 'manual') {
|
|
8965
9013
|
return;
|
|
8966
9014
|
}
|
|
@@ -9928,10 +9976,10 @@ const Methods = {
|
|
|
9928
9976
|
const { tableFullData } = internalData;
|
|
9929
9977
|
const rests = [];
|
|
9930
9978
|
if (treeConfig || isRowGroupStatus) {
|
|
9931
|
-
const
|
|
9979
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
9932
9980
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
9933
9981
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9934
|
-
const matchObj = XEUtils.findTree(tableFullData, item => $xeTable.eqRow(item, row), { children: isRowGroupStatus ?
|
|
9982
|
+
const matchObj = XEUtils.findTree(tableFullData, item => $xeTable.eqRow(item, row), { children: isRowGroupStatus ? aggregateOpts.mapChildrenField : childrenField });
|
|
9935
9983
|
if (matchObj) {
|
|
9936
9984
|
const nodes = matchObj.nodes;
|
|
9937
9985
|
nodes.forEach((row, index) => {
|
package/es/table/src/props.js
CHANGED
package/es/table/src/table.js
CHANGED
|
@@ -823,10 +823,14 @@ export default {
|
|
|
823
823
|
const props = $xeTable;
|
|
824
824
|
return Object.assign({}, getConfig().table.rowConfig, props.rowConfig);
|
|
825
825
|
},
|
|
826
|
-
|
|
826
|
+
computeAggregateOpts() {
|
|
827
827
|
const $xeTable = this;
|
|
828
828
|
const props = $xeTable;
|
|
829
|
-
return Object.assign({}, getConfig().table.rowGroupConfig, props.rowGroupConfig);
|
|
829
|
+
return Object.assign({}, getConfig().table.aggregateConfig || getConfig().table.rowGroupConfig, props.aggregateConfig || props.rowGroupConfig);
|
|
830
|
+
},
|
|
831
|
+
computeRowGroupOpts() {
|
|
832
|
+
const $xeTable = this;
|
|
833
|
+
return $xeTable.computeAggregateOpts;
|
|
830
834
|
},
|
|
831
835
|
computeCurrentRowOpts() {
|
|
832
836
|
const $xeTable = this;
|
|
@@ -1196,8 +1200,8 @@ export default {
|
|
|
1196
1200
|
},
|
|
1197
1201
|
computeRowGroupFields() {
|
|
1198
1202
|
const $xeTable = this;
|
|
1199
|
-
const
|
|
1200
|
-
return
|
|
1203
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
1204
|
+
return aggregateOpts.groupFields;
|
|
1201
1205
|
},
|
|
1202
1206
|
tabsResizeFlag() {
|
|
1203
1207
|
const $xeTable = this;
|
|
@@ -1462,8 +1466,8 @@ export default {
|
|
|
1462
1466
|
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
1463
1467
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
1464
1468
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
1465
|
-
const
|
|
1466
|
-
const { groupFields } =
|
|
1469
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
1470
|
+
const { groupFields } = aggregateOpts;
|
|
1467
1471
|
if (props.rowId) {
|
|
1468
1472
|
warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
|
|
1469
1473
|
}
|
|
@@ -1554,6 +1558,15 @@ export default {
|
|
|
1554
1558
|
if (props.dragConfig) {
|
|
1555
1559
|
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
|
|
1556
1560
|
}
|
|
1561
|
+
if (props.rowGroupConfig) {
|
|
1562
|
+
warnLog('vxe.error.delProp', ['row-group-config', 'aggregate-config']);
|
|
1563
|
+
}
|
|
1564
|
+
if (aggregateOpts.countFields) {
|
|
1565
|
+
warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func']);
|
|
1566
|
+
}
|
|
1567
|
+
if (aggregateOpts.countMethod) {
|
|
1568
|
+
warnLog('vxe.error.delProp', ['row-group-config.countMethod', 'aggregate-config.aggregateMethod']);
|
|
1569
|
+
}
|
|
1557
1570
|
if (props.treeConfig && treeOpts.children) {
|
|
1558
1571
|
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
|
|
1559
1572
|
}
|
package/es/table/src/util.js
CHANGED
|
@@ -179,13 +179,16 @@ export function handleFieldOrColumn($xeTable, fieldOrColumn) {
|
|
|
179
179
|
}
|
|
180
180
|
return null;
|
|
181
181
|
}
|
|
182
|
-
export
|
|
182
|
+
export function handleRowidOrRow($xeTable, rowidOrRow) {
|
|
183
183
|
if (rowidOrRow) {
|
|
184
184
|
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
185
185
|
return $xeTable.getRowById(rowid);
|
|
186
186
|
}
|
|
187
187
|
return null;
|
|
188
|
-
}
|
|
188
|
+
}
|
|
189
|
+
export function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
|
|
190
|
+
return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
191
|
+
}
|
|
189
192
|
// 组装列配置
|
|
190
193
|
export function assembleColumn(_vm) {
|
|
191
194
|
const $xeTable = _vm.$xeTable;
|
package/es/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
export const version = "3.15.
|
|
3
|
+
export const version = "3.15.35";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -127,7 +127,7 @@ VxeUI.setConfig({
|
|
|
127
127
|
// isEvery: false,
|
|
128
128
|
showIcon: true
|
|
129
129
|
},
|
|
130
|
-
|
|
130
|
+
aggregateConfig: {
|
|
131
131
|
padding: true,
|
|
132
132
|
rowField: 'id',
|
|
133
133
|
parentField: '_X_ROW_PARENT_KEY',
|
|
@@ -201,13 +201,13 @@ VxeUI.setConfig({
|
|
|
201
201
|
isReplace: true
|
|
202
202
|
},
|
|
203
203
|
virtualXConfig: {
|
|
204
|
-
enabled:
|
|
204
|
+
// enabled: false,
|
|
205
205
|
gt: 24,
|
|
206
206
|
preSize: 0,
|
|
207
207
|
oSize: 0
|
|
208
208
|
},
|
|
209
209
|
virtualYConfig: {
|
|
210
|
-
enabled:
|
|
210
|
+
// enabled: false,
|
|
211
211
|
gt: 100,
|
|
212
212
|
preSize: 1,
|
|
213
213
|
oSize: 0
|
package/es/ui/src/log.js
CHANGED