vxe-table 3.15.34 → 3.15.36
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/grid/src/grid.js +50 -17
- package/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +11 -2
- 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 +135 -76
- 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/grid/src/grid.js +57 -24
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +323 -149
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +2 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +14 -2
- package/lib/table/module/validator/mixin.min.js +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 +151 -74
- 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/grid/src/grid.ts +56 -17
- package/packages/table/module/edit/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +11 -3
- 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 +143 -77
- 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.1749440099787.ttf} +0 -0
- /package/es/{iconfont.1749092456241.woff → iconfont.1749440099787.woff} +0 -0
- /package/es/{iconfont.1749092456241.woff2 → iconfont.1749440099787.woff2} +0 -0
- /package/lib/{iconfont.1749092456241.ttf → iconfont.1749440099787.ttf} +0 -0
- /package/lib/{iconfont.1749092456241.woff → iconfont.1749440099787.woff} +0 -0
- /package/lib/{iconfont.1749092456241.woff2 → iconfont.1749440099787.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
|
}
|
|
@@ -3684,27 +3718,38 @@ const Methods = {
|
|
|
3684
3718
|
* @param {String} field 字段名
|
|
3685
3719
|
*/
|
|
3686
3720
|
reloadRow(row, record, field) {
|
|
3687
|
-
const
|
|
3721
|
+
const $xeTable = this;
|
|
3722
|
+
const props = $xeTable;
|
|
3723
|
+
const reactData = $xeTable;
|
|
3724
|
+
const internalData = $xeTable;
|
|
3725
|
+
const { keepSource } = props;
|
|
3726
|
+
const { tableData } = reactData;
|
|
3727
|
+
const { sourceDataRowIdData } = internalData;
|
|
3688
3728
|
if (keepSource) {
|
|
3689
|
-
|
|
3690
|
-
|
|
3729
|
+
if ($xeTable.isAggregateRecord(row)) {
|
|
3730
|
+
return $xeTable.$nextTick();
|
|
3731
|
+
}
|
|
3732
|
+
const oRow = sourceDataRowIdData[getRowid($xeTable, row)];
|
|
3691
3733
|
if (oRow && row) {
|
|
3692
3734
|
if (field) {
|
|
3693
|
-
const newValue = XEUtils.get(record || row, field);
|
|
3735
|
+
const newValue = XEUtils.clone(XEUtils.get(record || row, field), true);
|
|
3694
3736
|
XEUtils.set(row, field, newValue);
|
|
3695
3737
|
XEUtils.set(oRow, field, newValue);
|
|
3696
3738
|
}
|
|
3697
3739
|
else {
|
|
3740
|
+
const rowkey = getRowkey($xeTable);
|
|
3741
|
+
const rowid = getRowid($xeTable, row);
|
|
3698
3742
|
const newRecord = XEUtils.clone(Object.assign({}, record), true);
|
|
3743
|
+
XEUtils.set(newRecord, rowkey, rowid);
|
|
3699
3744
|
XEUtils.destructuring(oRow, Object.assign(row, newRecord));
|
|
3700
3745
|
}
|
|
3701
3746
|
}
|
|
3702
|
-
|
|
3747
|
+
reactData.tableData = tableData.slice(0);
|
|
3703
3748
|
}
|
|
3704
3749
|
else {
|
|
3705
3750
|
errLog('vxe.error.reqProp', ['keep-source']);
|
|
3706
3751
|
}
|
|
3707
|
-
return
|
|
3752
|
+
return $xeTable.$nextTick();
|
|
3708
3753
|
},
|
|
3709
3754
|
/**
|
|
3710
3755
|
* 加载列配置
|
|
@@ -3713,7 +3758,7 @@ const Methods = {
|
|
|
3713
3758
|
*/
|
|
3714
3759
|
loadColumn(columns) {
|
|
3715
3760
|
const $xeTable = this;
|
|
3716
|
-
const collectColumn = XEUtils.mapTree(columns, column => Cell.createColumn(
|
|
3761
|
+
const collectColumn = XEUtils.mapTree(columns, column => Cell.createColumn($xeTable, column), { children: 'children' });
|
|
3717
3762
|
return handleColumn($xeTable, collectColumn);
|
|
3718
3763
|
},
|
|
3719
3764
|
/**
|
|
@@ -3781,8 +3826,8 @@ const Methods = {
|
|
|
3781
3826
|
}, { children: childrenField });
|
|
3782
3827
|
}
|
|
3783
3828
|
else if (isRowGroupStatus) {
|
|
3784
|
-
const
|
|
3785
|
-
const { mapChildrenField } =
|
|
3829
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
3830
|
+
const { mapChildrenField } = aggregateOpts;
|
|
3786
3831
|
XEUtils.eachTree(tableFullGroupData, (row, index, items, path, parentRow, nodes) => {
|
|
3787
3832
|
const rowid = handleUpdateRowId(row);
|
|
3788
3833
|
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
@@ -6193,6 +6238,10 @@ const Methods = {
|
|
|
6193
6238
|
internalData.mergeFooterCellMaps = buildMergeData(mergeFooterList);
|
|
6194
6239
|
reactData.mergeFootFlag++;
|
|
6195
6240
|
},
|
|
6241
|
+
handleAggregateSummaryData() {
|
|
6242
|
+
const $xeTable = this;
|
|
6243
|
+
return updateGroupData($xeTable);
|
|
6244
|
+
},
|
|
6196
6245
|
handleTargetLeaveEvent() {
|
|
6197
6246
|
const $xeTable = this;
|
|
6198
6247
|
const internalData = $xeTable;
|
|
@@ -6489,7 +6538,7 @@ const Methods = {
|
|
|
6489
6538
|
const { treeConfig } = props;
|
|
6490
6539
|
const { isRowGroupStatus } = reactData;
|
|
6491
6540
|
const { selectCheckboxMaps } = internalData;
|
|
6492
|
-
const
|
|
6541
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
6493
6542
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6494
6543
|
const { transform, mapChildrenField } = treeOpts;
|
|
6495
6544
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -6541,7 +6590,7 @@ const Methods = {
|
|
|
6541
6590
|
}
|
|
6542
6591
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
6543
6592
|
}
|
|
6544
|
-
}, { children:
|
|
6593
|
+
}, { children: aggregateOpts.mapChildrenField });
|
|
6545
6594
|
reactData.updateCheckboxFlag++;
|
|
6546
6595
|
return;
|
|
6547
6596
|
}
|
|
@@ -6690,7 +6739,7 @@ const Methods = {
|
|
|
6690
6739
|
const { treeConfig } = props;
|
|
6691
6740
|
const { isRowGroupStatus } = reactData;
|
|
6692
6741
|
const { afterTreeFullData, afterGroupFullData, selectCheckboxMaps, treeIndeterminateRowMaps } = internalData;
|
|
6693
|
-
const
|
|
6742
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
6694
6743
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6695
6744
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6696
6745
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
@@ -6704,7 +6753,7 @@ const Methods = {
|
|
|
6704
6753
|
const childRowList = [];
|
|
6705
6754
|
if (isRowGroupStatus) {
|
|
6706
6755
|
// 行分组
|
|
6707
|
-
const mapChildrenField =
|
|
6756
|
+
const mapChildrenField = aggregateOpts.mapChildrenField;
|
|
6708
6757
|
if (mapChildrenField) {
|
|
6709
6758
|
XEUtils.eachTree(afterGroupFullData, (row) => {
|
|
6710
6759
|
const rowid = handleGetRowId(row);
|
|
@@ -7311,7 +7360,7 @@ const Methods = {
|
|
|
7311
7360
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
7312
7361
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
7313
7362
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
7314
|
-
const
|
|
7363
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
7315
7364
|
const rowOpts = $xeTable.computeRowOpts;
|
|
7316
7365
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
7317
7366
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
@@ -7338,7 +7387,7 @@ const Methods = {
|
|
|
7338
7387
|
$xeTable.triggerTreeExpandEvent(evnt, params);
|
|
7339
7388
|
}
|
|
7340
7389
|
// 如果是行分组
|
|
7341
|
-
if ((
|
|
7390
|
+
if ((aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
|
|
7342
7391
|
$xeTable.triggerRowGroupExpandEvent(evnt, params);
|
|
7343
7392
|
}
|
|
7344
7393
|
}
|
|
@@ -8769,9 +8818,9 @@ const Methods = {
|
|
|
8769
8818
|
const $xeTable = this;
|
|
8770
8819
|
const props = $xeTable;
|
|
8771
8820
|
const internalData = $xeTable;
|
|
8772
|
-
const { rowGroupConfig } = props;
|
|
8773
|
-
if (!rowGroupConfig) {
|
|
8774
|
-
errLog('vxe.error.reqProp', ['
|
|
8821
|
+
const { aggregateConfig, rowGroupConfig } = props;
|
|
8822
|
+
if (!(aggregateConfig || rowGroupConfig)) {
|
|
8823
|
+
errLog('vxe.error.reqProp', ['aggregate-config']);
|
|
8775
8824
|
return $xeTable.$nextTick();
|
|
8776
8825
|
}
|
|
8777
8826
|
if (fieldOrColumns) {
|
|
@@ -8786,21 +8835,31 @@ const Methods = {
|
|
|
8786
8835
|
const $xeTable = this;
|
|
8787
8836
|
const props = $xeTable;
|
|
8788
8837
|
const internalData = $xeTable;
|
|
8789
|
-
const { rowGroupConfig } = props;
|
|
8790
|
-
if (!rowGroupConfig) {
|
|
8791
|
-
errLog('vxe.error.reqProp', ['
|
|
8838
|
+
const { aggregateConfig, rowGroupConfig } = props;
|
|
8839
|
+
if (!(aggregateConfig || rowGroupConfig)) {
|
|
8840
|
+
errLog('vxe.error.reqProp', ['aggregate-config']);
|
|
8792
8841
|
return $xeTable.$nextTick();
|
|
8793
8842
|
}
|
|
8794
8843
|
handleUpdateRowGroup($xeTable, []);
|
|
8795
8844
|
return loadTableData($xeTable, internalData.tableSynchData, true);
|
|
8796
8845
|
},
|
|
8797
8846
|
isRowGroupRecord(row) {
|
|
8847
|
+
const $xeTable = this;
|
|
8848
|
+
warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord']);
|
|
8849
|
+
return $xeTable.isAggregateRecord(row);
|
|
8850
|
+
},
|
|
8851
|
+
isRowGroupExpandByRow(row) {
|
|
8852
|
+
const $xeTable = this;
|
|
8853
|
+
warnLog('vxe.error.delFunc', ['isRowGroupExpandByRow', 'isAggregateExpandByRow']);
|
|
8854
|
+
return $xeTable.isAggregateExpandByRow(row);
|
|
8855
|
+
},
|
|
8856
|
+
isAggregateRecord(row) {
|
|
8798
8857
|
const $xeTable = this;
|
|
8799
8858
|
const reactData = $xeTable;
|
|
8800
8859
|
const { isRowGroupStatus } = reactData;
|
|
8801
8860
|
return isRowGroupStatus && row.isAggregate;
|
|
8802
8861
|
},
|
|
8803
|
-
|
|
8862
|
+
isAggregateExpandByRow(row) {
|
|
8804
8863
|
const $xeTable = this;
|
|
8805
8864
|
const reactData = $xeTable;
|
|
8806
8865
|
const internalData = $xeTable;
|
|
@@ -8823,8 +8882,8 @@ const Methods = {
|
|
|
8823
8882
|
const reactData = $xeTable;
|
|
8824
8883
|
const internalData = $xeTable;
|
|
8825
8884
|
const { tableFullGroupData } = internalData;
|
|
8826
|
-
const
|
|
8827
|
-
const { mapChildrenField } =
|
|
8885
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
8886
|
+
const { mapChildrenField } = aggregateOpts;
|
|
8828
8887
|
const rgExpandedMaps = {};
|
|
8829
8888
|
if (expanded && mapChildrenField) {
|
|
8830
8889
|
XEUtils.eachTree(tableFullGroupData, (row) => {
|
|
@@ -8958,9 +9017,9 @@ const Methods = {
|
|
|
8958
9017
|
const $xeTable = this;
|
|
8959
9018
|
const internalData = $xeTable;
|
|
8960
9019
|
const { rowGroupExpandedMaps } = internalData;
|
|
8961
|
-
const
|
|
9020
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
8962
9021
|
const { row, column } = params;
|
|
8963
|
-
const { trigger } =
|
|
9022
|
+
const { trigger } = aggregateOpts;
|
|
8964
9023
|
if (trigger === 'manual') {
|
|
8965
9024
|
return;
|
|
8966
9025
|
}
|
|
@@ -9928,10 +9987,10 @@ const Methods = {
|
|
|
9928
9987
|
const { tableFullData } = internalData;
|
|
9929
9988
|
const rests = [];
|
|
9930
9989
|
if (treeConfig || isRowGroupStatus) {
|
|
9931
|
-
const
|
|
9990
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
9932
9991
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
9933
9992
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9934
|
-
const matchObj = XEUtils.findTree(tableFullData, item => $xeTable.eqRow(item, row), { children: isRowGroupStatus ?
|
|
9993
|
+
const matchObj = XEUtils.findTree(tableFullData, item => $xeTable.eqRow(item, row), { children: isRowGroupStatus ? aggregateOpts.mapChildrenField : childrenField });
|
|
9935
9994
|
if (matchObj) {
|
|
9936
9995
|
const nodes = matchObj.nodes;
|
|
9937
9996
|
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.36";
|
|
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