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.
Files changed (62) hide show
  1. package/es/grid/src/grid.js +50 -17
  2. package/es/style.css +1 -1
  3. package/es/table/module/edit/mixin.js +2 -2
  4. package/es/table/module/validator/mixin.js +11 -2
  5. package/es/table/src/body.js +20 -3
  6. package/es/table/src/cell.js +52 -36
  7. package/es/table/src/column.js +2 -0
  8. package/es/table/src/columnInfo.js +2 -0
  9. package/es/table/src/methods.js +135 -76
  10. package/es/table/src/props.js +3 -1
  11. package/es/table/src/table.js +19 -6
  12. package/es/table/src/util.js +5 -2
  13. package/es/ui/index.js +4 -4
  14. package/es/ui/src/log.js +1 -1
  15. package/lib/grid/src/grid.js +57 -24
  16. package/lib/grid/src/grid.min.js +1 -1
  17. package/lib/index.umd.js +323 -149
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/style.css +1 -1
  20. package/lib/table/module/edit/mixin.js +2 -2
  21. package/lib/table/module/edit/mixin.min.js +1 -1
  22. package/lib/table/module/validator/mixin.js +14 -2
  23. package/lib/table/module/validator/mixin.min.js +1 -1
  24. package/lib/table/src/body.js +19 -2
  25. package/lib/table/src/body.min.js +1 -1
  26. package/lib/table/src/cell.js +43 -28
  27. package/lib/table/src/cell.min.js +1 -1
  28. package/lib/table/src/column.js +2 -0
  29. package/lib/table/src/column.min.js +1 -1
  30. package/lib/table/src/columnInfo.js +2 -0
  31. package/lib/table/src/columnInfo.min.js +1 -1
  32. package/lib/table/src/methods.js +151 -74
  33. package/lib/table/src/methods.min.js +1 -1
  34. package/lib/table/src/props.js +3 -1
  35. package/lib/table/src/props.min.js +1 -1
  36. package/lib/table/src/table.js +19 -6
  37. package/lib/table/src/table.min.js +1 -1
  38. package/lib/table/src/util.js +7 -4
  39. package/lib/table/src/util.min.js +1 -1
  40. package/lib/ui/index.js +4 -4
  41. package/lib/ui/index.min.js +1 -1
  42. package/lib/ui/src/log.js +1 -1
  43. package/lib/ui/src/log.min.js +1 -1
  44. package/package.json +1 -1
  45. package/packages/grid/src/grid.ts +56 -17
  46. package/packages/table/module/edit/mixin.ts +2 -2
  47. package/packages/table/module/validator/mixin.ts +11 -3
  48. package/packages/table/src/body.ts +20 -3
  49. package/packages/table/src/cell.ts +52 -36
  50. package/packages/table/src/column.ts +2 -0
  51. package/packages/table/src/columnInfo.ts +3 -0
  52. package/packages/table/src/methods.ts +143 -77
  53. package/packages/table/src/props.ts +3 -1
  54. package/packages/table/src/table.ts +20 -6
  55. package/packages/table/src/util.ts +6 -2
  56. package/packages/ui/index.ts +3 -3
  57. /package/es/{iconfont.1749092456241.ttf → iconfont.1749440099787.ttf} +0 -0
  58. /package/es/{iconfont.1749092456241.woff → iconfont.1749440099787.woff} +0 -0
  59. /package/es/{iconfont.1749092456241.woff2 → iconfont.1749440099787.woff2} +0 -0
  60. /package/lib/{iconfont.1749092456241.ttf → iconfont.1749440099787.ttf} +0 -0
  61. /package/lib/{iconfont.1749092456241.woff → iconfont.1749440099787.woff} +0 -0
  62. /package/lib/{iconfont.1749092456241.woff2 → iconfont.1749440099787.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.15.34";
2005
+ const version = "3.15.36";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2129,7 +2129,7 @@ core_.VxeUI.setConfig({
2129
2129
  // isEvery: false,
2130
2130
  showIcon: true
2131
2131
  },
2132
- rowGroupConfig: {
2132
+ aggregateConfig: {
2133
2133
  padding: true,
2134
2134
  rowField: 'id',
2135
2135
  parentField: '_X_ROW_PARENT_KEY',
@@ -2203,13 +2203,13 @@ core_.VxeUI.setConfig({
2203
2203
  isReplace: true
2204
2204
  },
2205
2205
  virtualXConfig: {
2206
- enabled: true,
2206
+ // enabled: false,
2207
2207
  gt: 24,
2208
2208
  preSize: 0,
2209
2209
  oSize: 0
2210
2210
  },
2211
2211
  virtualYConfig: {
2212
- enabled: true,
2212
+ // enabled: false,
2213
2213
  gt: 100,
2214
2214
  preSize: 1,
2215
2215
  oSize: 0
@@ -2646,7 +2646,7 @@ function isNodeElement(elem) {
2646
2646
  const {
2647
2647
  log: log_log
2648
2648
  } = core_.VxeUI;
2649
- const log_version = `table v${"3.15.34"}`;
2649
+ const log_version = `table v${"3.15.36"}`;
2650
2650
  const warnLog = log_log.create('warn', log_version);
2651
2651
  const errLog = log_log.create('error', log_version);
2652
2652
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2758,6 +2758,7 @@ class ColumnInfo {
2758
2758
  titleHelp: _vm.titleHelp,
2759
2759
  titlePrefix: _vm.titlePrefix,
2760
2760
  titleSuffix: _vm.titleSuffix,
2761
+ aggFunc: _vm.aggFunc,
2761
2762
  // 自定义参数
2762
2763
  params: _vm.params,
2763
2764
  // 渲染属性
@@ -2780,6 +2781,7 @@ class ColumnInfo {
2780
2781
  // 列排序
2781
2782
  sortNumber: 0,
2782
2783
  renderSortNumber: 0,
2784
+ renderAggFn: '',
2783
2785
  renderFixed: '',
2784
2786
  renderVisible: false,
2785
2787
  renderWidth: 0,
@@ -3015,13 +3017,16 @@ function handleFieldOrColumn($xeTable, fieldOrColumn) {
3015
3017
  }
3016
3018
  return null;
3017
3019
  }
3018
- const handleRowidOrRow = ($xeTable, rowidOrRow) => {
3020
+ function handleRowidOrRow($xeTable, rowidOrRow) {
3019
3021
  if (rowidOrRow) {
3020
3022
  const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowidOrRow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
3021
3023
  return $xeTable.getRowById(rowid);
3022
3024
  }
3023
3025
  return null;
3024
- };
3026
+ }
3027
+ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
3028
+ return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
3029
+ }
3025
3030
  // 组装列配置
3026
3031
  function assembleColumn(_vm) {
3027
3032
  const $xeTable = _vm.$xeTable;
@@ -3759,13 +3764,13 @@ function renderCellHandle(h, params) {
3759
3764
  rowGroupNode,
3760
3765
  editRender
3761
3766
  } = column;
3762
- const rowGroupOpts = $table.computeRowGroupOpts;
3767
+ const aggregateOpts = $table.computeAggregateOpts;
3763
3768
  const {
3764
3769
  mode
3765
- } = rowGroupOpts;
3770
+ } = aggregateOpts;
3766
3771
  const checkboxOpts = $table.computeCheckboxOpts;
3767
3772
  const editOpts = $table.computeEditOpts;
3768
- const isDeepCell = treeNode || isRowGroupStatus && row.isAggregate && (mode === 'column' ? column.field === row.groupField : rowGroupNode);
3773
+ const isDeepCell = treeNode || isRowGroupStatus && (mode === 'column' ? column.field === row.groupField : rowGroupNode);
3769
3774
  switch (type) {
3770
3775
  case 'seq':
3771
3776
  return isDeepCell ? Cell.renderDeepIndexCell(h, params) : Cell.renderSeqCell(h, params);
@@ -3889,7 +3894,8 @@ const Cell = {
3889
3894
  slots,
3890
3895
  editRender,
3891
3896
  cellRender,
3892
- rowGroupNode
3897
+ rowGroupNode,
3898
+ aggFunc
3893
3899
  } = column;
3894
3900
  const renderOpts = editRender || cellRender;
3895
3901
  if (slots && slots.default) {
@@ -3907,48 +3913,58 @@ const Cell = {
3907
3913
  }
3908
3914
  }
3909
3915
  let cellValue = '';
3910
- if (isRowGroupStatus && row.isAggregate) {
3916
+ if (isRowGroupStatus && field && row.isAggregate) {
3917
+ const aggRow = row;
3911
3918
  const {
3912
3919
  fullColumnFieldData
3913
3920
  } = tableInternalData;
3914
- const rowGroupOpts = $table.computeRowGroupOpts;
3921
+ const aggregateOpts = $table.computeAggregateOpts;
3915
3922
  const {
3916
3923
  mode,
3917
3924
  showTotal,
3918
3925
  totalMethod,
3919
3926
  countFields,
3920
- countMethod,
3921
3927
  contentMethod,
3922
3928
  mapChildrenField
3923
- } = rowGroupOpts;
3924
- const groupField = row.groupField;
3925
- const groupContent = row.groupContent;
3926
- const childList = mapChildrenField ? row[mapChildrenField] || [] : [];
3927
- const totalValue = row.childCount;
3929
+ } = aggregateOpts;
3930
+ const aggMethod = aggregateOpts.aggregateMethod || aggregateOpts.countMethod;
3931
+ const groupField = aggRow.groupField;
3932
+ const groupContent = aggRow.groupContent;
3933
+ const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
3934
+ const childCount = aggRow.childCount;
3928
3935
  const colRest = fullColumnFieldData[groupField] || {};
3929
- const params = {
3936
+ const ctParams = {
3930
3937
  $table,
3931
3938
  groupField,
3932
3939
  groupColumn: colRest ? colRest.column : null,
3933
3940
  column,
3934
3941
  groupValue: groupContent,
3935
3942
  children: childList,
3936
- totalValue: totalValue
3943
+ childCount,
3944
+ aggValue: null,
3945
+ /**
3946
+ * 已废弃
3947
+ * @deprecated
3948
+ */
3949
+ totalValue: childCount
3937
3950
  };
3938
- if (mode === 'column' ? column.field === row.groupField : rowGroupNode) {
3951
+ if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
3939
3952
  cellValue = groupContent;
3940
3953
  if (contentMethod) {
3941
- cellValue = `${contentMethod(params)}`;
3954
+ cellValue = `${contentMethod(ctParams)}`;
3942
3955
  }
3943
3956
  if (showTotal) {
3944
- cellValue = cell_getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(params) : totalValue, totalValue]);
3957
+ cellValue = cell_getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
3945
3958
  }
3946
- } else if (countFields && countFields.includes(field)) {
3947
- if (countMethod) {
3948
- cellValue = `${countMethod(params)}`;
3959
+ } else if ($table.getPivotTableAggregateCellAggValue) {
3960
+ cellValue = $table.getPivotTableAggregateCellAggValue(params);
3961
+ } else if (aggFunc === true || countFields && countFields.includes(field)) {
3962
+ if (aggMethod) {
3963
+ ctParams.aggValue = childCount;
3964
+ cellValue = `${aggMethod(ctParams)}`;
3949
3965
  }
3950
3966
  }
3951
- } else if (!(isRowGroupStatus && row.isAggregate)) {
3967
+ } else {
3952
3968
  cellValue = $table.getCellLabel(row, column);
3953
3969
  }
3954
3970
  const cellPlaceholder = editRender ? editRender.placeholder : '';
@@ -3985,11 +4001,11 @@ const Cell = {
3985
4001
  const {
3986
4002
  rowGroupExpandedMaps
3987
4003
  } = tableInternalData;
3988
- const rowGroupOpts = $table.computeRowGroupOpts;
4004
+ const aggregateOpts = $table.computeAggregateOpts;
3989
4005
  const {
3990
4006
  padding,
3991
4007
  indent
3992
- } = rowGroupOpts;
4008
+ } = aggregateOpts;
3993
4009
  const rowid = getRowid($table, row);
3994
4010
  const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
3995
4011
  return h('div', {
@@ -3999,7 +4015,7 @@ const Cell = {
3999
4015
  style: padding && indent ? {
4000
4016
  paddingLeft: `${level * indent}px`
4001
4017
  } : undefined
4002
- }, [h('span', {
4018
+ }, [row.isAggregate ? h('span', {
4003
4019
  class: 'vxe-row-group--node-btn',
4004
4020
  on: {
4005
4021
  click(evnt) {
@@ -4008,7 +4024,7 @@ const Cell = {
4008
4024
  }
4009
4025
  }, [h('i', {
4010
4026
  class: isExpand ? cell_getIcon().TABLE_ROW_GROUP_OPEN : cell_getIcon().TABLE_ROW_GROUP_CLOSE
4011
- })]), h('div', {
4027
+ })]) : renderEmptyElement($table), h('div', {
4012
4028
  class: 'vxe-row-group-cell'
4013
4029
  }, cellVNodes)]);
4014
4030
  },
@@ -4106,11 +4122,15 @@ const Cell = {
4106
4122
  const {
4107
4123
  rowGroupNode
4108
4124
  } = column;
4109
- if (row.isAggregate) {
4110
- const rowGroupOpts = $table.computeRowGroupOpts;
4125
+ const tableReactData = $table;
4126
+ const {
4127
+ rowGroupList
4128
+ } = tableReactData;
4129
+ if (rowGroupList.length) {
4130
+ const aggregateOpts = $table.computeAggregateOpts;
4111
4131
  const {
4112
4132
  mode
4113
- } = rowGroupOpts;
4133
+ } = aggregateOpts;
4114
4134
  if (mode === 'column' ? column.field === row.groupField : rowGroupNode) {
4115
4135
  return [Cell.renderRowGroupBtn(h, params, cellVNodes)];
4116
4136
  }
@@ -4968,6 +4988,8 @@ const columnProps = {
4968
4988
  editRender: Object,
4969
4989
  // 内容渲染配置项
4970
4990
  contentRender: Object,
4991
+ // 聚合函数
4992
+ aggFunc: [String, Boolean],
4971
4993
  // 额外的参数
4972
4994
  params: Object
4973
4995
  };
@@ -5619,11 +5641,11 @@ function handleRowGroupBaseExpand($xeTable, rows, expanded) {
5619
5641
  tableFullGroupData,
5620
5642
  rowGroupExpandedMaps
5621
5643
  } = internalData;
5622
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
5644
+ const aggregateOpts = $xeTable.computeAggregateOpts;
5623
5645
  const {
5624
5646
  mapChildrenField,
5625
5647
  accordion
5626
- } = rowGroupOpts;
5648
+ } = aggregateOpts;
5627
5649
  const {
5628
5650
  handleGetRowId
5629
5651
  } = createHandleGetRowId($xeTable);
@@ -5832,7 +5854,7 @@ function handleVirtualTreeToList($xeTable) {
5832
5854
  treeExpandedMaps,
5833
5855
  rowGroupExpandedMaps
5834
5856
  } = internalData;
5835
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
5857
+ const aggregateOpts = $xeTable.computeAggregateOpts;
5836
5858
  const treeOpts = $xeTable.computeTreeOpts;
5837
5859
  const {
5838
5860
  handleGetRowId
@@ -5861,7 +5883,7 @@ function handleVirtualTreeToList($xeTable) {
5861
5883
  } else if (isRowGroupStatus) {
5862
5884
  const {
5863
5885
  childrenField
5864
- } = rowGroupOpts;
5886
+ } = aggregateOpts;
5865
5887
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterGroupFullData, (row, index, items, path, parentRow) => {
5866
5888
  const rowid = handleGetRowId(row);
5867
5889
  const parentRowid = handleGetRowId(parentRow);
@@ -5904,7 +5926,7 @@ function updateAfterFullData($xeTable) {
5904
5926
  } = internalData;
5905
5927
  const filterOpts = $xeTable.computeFilterOpts;
5906
5928
  const sortOpts = $xeTable.computeSortOpts;
5907
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
5929
+ const aggregateOpts = $xeTable.computeAggregateOpts;
5908
5930
  const treeOpts = $xeTable.computeTreeOpts;
5909
5931
  const childrenField = treeOpts.children || treeOpts.childrenField;
5910
5932
  const {
@@ -6029,8 +6051,8 @@ function updateAfterFullData($xeTable) {
6029
6051
  tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData, handleFilter, {
6030
6052
  original: true,
6031
6053
  isEvery: true,
6032
- children: rowGroupOpts.mapChildrenField,
6033
- mapChildren: rowGroupOpts.childrenField
6054
+ children: aggregateOpts.mapChildrenField,
6055
+ mapChildren: aggregateOpts.childrenField
6034
6056
  });
6035
6057
  tableData = tableTree;
6036
6058
  } else if (treeConfig && transform) {
@@ -6052,8 +6074,8 @@ function updateAfterFullData($xeTable) {
6052
6074
  tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData, () => true, {
6053
6075
  original: true,
6054
6076
  isEvery: true,
6055
- children: rowGroupOpts.mapChildrenField,
6056
- mapChildren: rowGroupOpts.childrenField
6077
+ children: aggregateOpts.mapChildrenField,
6078
+ mapChildren: aggregateOpts.childrenField
6057
6079
  });
6058
6080
  tableData = tableTree;
6059
6081
  } else if (treeConfig && transform) {
@@ -6084,18 +6106,18 @@ function updateAfterFullData($xeTable) {
6084
6106
  tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests) ? sortRests : tableTree;
6085
6107
  } else {
6086
6108
  const treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree, {
6087
- key: rowGroupOpts.rowField,
6088
- parentKey: rowGroupOpts.parentField,
6089
- children: rowGroupOpts.mapChildrenField
6109
+ key: aggregateOpts.rowField,
6110
+ parentKey: aggregateOpts.parentField,
6111
+ children: aggregateOpts.mapChildrenField
6090
6112
  });
6091
6113
  tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList, orderColumns.map(({
6092
6114
  column,
6093
6115
  order
6094
6116
  }) => [getOrderField($xeTable, column), order])), {
6095
- key: rowGroupOpts.rowField,
6096
- parentKey: rowGroupOpts.parentField,
6097
- children: rowGroupOpts.childrenField,
6098
- mapChildren: rowGroupOpts.mapChildrenField
6117
+ key: aggregateOpts.rowField,
6118
+ parentKey: aggregateOpts.parentField,
6119
+ children: aggregateOpts.childrenField,
6120
+ mapChildren: aggregateOpts.mapChildrenField
6099
6121
  });
6100
6122
  }
6101
6123
  tableData = tableTree;
@@ -6165,8 +6187,8 @@ function updateAfterFullData($xeTable) {
6165
6187
  tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData, () => true, {
6166
6188
  original: true,
6167
6189
  isEvery: true,
6168
- children: rowGroupOpts.mapChildrenField,
6169
- mapChildren: rowGroupOpts.childrenField
6190
+ children: aggregateOpts.mapChildrenField,
6191
+ mapChildren: aggregateOpts.childrenField
6170
6192
  });
6171
6193
  tableData = tableTree;
6172
6194
  } else if (treeConfig && transform) {
@@ -6685,7 +6707,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
6685
6707
  selectCheckboxMaps
6686
6708
  } = internalData;
6687
6709
  const treeOpts = $xeTable.computeTreeOpts;
6688
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
6710
+ const aggregateOpts = $xeTable.computeAggregateOpts;
6689
6711
  const childrenField = treeOpts.children || treeOpts.childrenField;
6690
6712
  const checkboxOpts = $xeTable.computeCheckboxOpts;
6691
6713
  const {
@@ -6747,7 +6769,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
6747
6769
  selectRowMaps[rowid] = row;
6748
6770
  }
6749
6771
  }, {
6750
- children: rowGroupOpts.mapChildrenField
6772
+ children: aggregateOpts.mapChildrenField
6751
6773
  });
6752
6774
  } else {
6753
6775
  /**
@@ -6764,7 +6786,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
6764
6786
  selectRowMaps[rowid] = row;
6765
6787
  }
6766
6788
  }, {
6767
- children: rowGroupOpts.mapChildrenField
6789
+ children: aggregateOpts.mapChildrenField
6768
6790
  });
6769
6791
  }
6770
6792
  }
@@ -8231,17 +8253,69 @@ const handleUpdateRowGroup = ($xeTable, groupFields) => {
8231
8253
  };
8232
8254
  }) : [];
8233
8255
  };
8256
+ function handleeGroupSummary($xeTable, aggList) {
8257
+ const aggregateOpts = $xeTable.computeAggregateOpts;
8258
+ const {
8259
+ mapChildrenField
8260
+ } = aggregateOpts;
8261
+ if (mapChildrenField) {
8262
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList, aggRow => {
8263
+ let count = 0;
8264
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(aggRow[mapChildrenField], row => {
8265
+ if (row.isAggregate) {
8266
+ count += row.childCount || 0;
8267
+ } else {
8268
+ count++;
8269
+ }
8270
+ });
8271
+ aggRow.childCount = count;
8272
+ });
8273
+ if ($xeTable.handlePivotTableAggregateData) {
8274
+ $xeTable.handlePivotTableAggregateData(aggList);
8275
+ }
8276
+ }
8277
+ }
8278
+ function updateGroupData($xeTable) {
8279
+ const props = $xeTable;
8280
+ const reactData = $xeTable;
8281
+ const internalData = $xeTable;
8282
+ const {
8283
+ aggregateConfig,
8284
+ rowGroupConfig
8285
+ } = props;
8286
+ const {
8287
+ isRowGroupStatus
8288
+ } = reactData;
8289
+ const {
8290
+ tableFullGroupData
8291
+ } = internalData;
8292
+ const aggregateOpts = $xeTable.computeAggregateOpts;
8293
+ const {
8294
+ mapChildrenField
8295
+ } = aggregateOpts;
8296
+ if ((aggregateConfig || rowGroupConfig) && isRowGroupStatus) {
8297
+ const aggList = [];
8298
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData, row => {
8299
+ if (row.isAggregate) {
8300
+ aggList.push(row);
8301
+ }
8302
+ }, {
8303
+ children: mapChildrenField
8304
+ });
8305
+ handleeGroupSummary($xeTable, aggList);
8306
+ }
8307
+ }
8234
8308
  function handleGroupData($xeTable, list, rowGroups) {
8235
8309
  let fullData = list;
8236
8310
  let treeData = list;
8237
8311
  if (rowGroups) {
8238
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
8312
+ const aggregateOpts = $xeTable.computeAggregateOpts;
8239
8313
  const {
8240
8314
  rowField,
8241
8315
  parentField,
8242
8316
  childrenField,
8243
8317
  mapChildrenField
8244
- } = rowGroupOpts;
8318
+ } = aggregateOpts;
8245
8319
  const checkboxOpts = $xeTable.computeCheckboxOpts;
8246
8320
  const {
8247
8321
  checkField
@@ -8254,7 +8328,7 @@ function handleGroupData($xeTable, list, rowGroups) {
8254
8328
  const groupField = rgItem.field;
8255
8329
  const groupColumn = $xeTable.getColumnByField(groupField);
8256
8330
  const groupMaps = {};
8257
- const groupList = [];
8331
+ const aggList = [];
8258
8332
  const rowkey = getRowkey($xeTable);
8259
8333
  list.forEach(row => {
8260
8334
  const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, groupField);
@@ -8274,12 +8348,12 @@ function handleGroupData($xeTable, list, rowGroups) {
8274
8348
  fullData: childFullData,
8275
8349
  treeData: childTreeData
8276
8350
  } = handleGroupData($xeTable, childList, rowGroups.slice(1));
8277
- const childCount = 0;
8278
- const groupRow = {
8351
+ const aggRow = {
8279
8352
  isAggregate: true,
8280
- childCount,
8353
+ aggData: {},
8281
8354
  groupContent: groupValue,
8282
8355
  groupField,
8356
+ childCount: 0,
8283
8357
  [rowField]: getRowUniqueId(),
8284
8358
  [parentField]: null,
8285
8359
  [rowkey]: getRowUniqueId(),
@@ -8287,29 +8361,19 @@ function handleGroupData($xeTable, list, rowGroups) {
8287
8361
  [mapChildrenField]: childTreeData
8288
8362
  };
8289
8363
  if (checkField) {
8290
- groupRow[checkField] = false;
8364
+ aggRow[checkField] = false;
8291
8365
  }
8292
8366
  if (indeterminateField) {
8293
- groupRow[indeterminateField] = false;
8367
+ aggRow[indeterminateField] = false;
8294
8368
  }
8295
- groupList.push(groupRow);
8296
- treeData.push(groupRow);
8297
- fullData.push(groupRow);
8369
+ aggList.push(aggRow);
8370
+ treeData.push(aggRow);
8371
+ fullData.push(aggRow);
8298
8372
  if (childFullData.length) {
8299
8373
  fullData.push(...childFullData);
8300
8374
  }
8301
8375
  });
8302
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(groupList, groupItem => {
8303
- let count = 0;
8304
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(groupItem[childrenField], row => {
8305
- if (row.isAggregate) {
8306
- count += row[childrenField] ? row[childrenField].length : 0;
8307
- } else {
8308
- count++;
8309
- }
8310
- });
8311
- groupItem.childCount = count;
8312
- });
8376
+ handleeGroupSummary($xeTable, aggList);
8313
8377
  }
8314
8378
  }
8315
8379
  return {
@@ -8328,6 +8392,7 @@ function loadTableData($xeTable, datas, isReset) {
8328
8392
  const {
8329
8393
  keepSource,
8330
8394
  treeConfig,
8395
+ aggregateConfig,
8331
8396
  rowGroupConfig
8332
8397
  } = props;
8333
8398
  const {
@@ -8353,11 +8418,11 @@ function loadTableData($xeTable, datas, isReset) {
8353
8418
  errLog('vxe.error.errMaxRow', [supportMaxRow]);
8354
8419
  }
8355
8420
  if (treeConfig && rowGroupList.length) {
8356
- errLog('vxe.error.noTree', ['row-group-config']);
8421
+ errLog('vxe.error.noTree', ['aggregate-config']);
8357
8422
  return $xeTable.$nextTick();
8358
8423
  }
8359
8424
  if (rowOpts.drag && rowGroupList.length) {
8360
- errLog('vxe.error.errConflicts', ['row-config.drag', 'row-group-config']);
8425
+ errLog('vxe.error.errConflicts', ['row-config.drag', 'aggregate-config']);
8361
8426
  return $xeTable.$nextTick();
8362
8427
  }
8363
8428
  let isRGroup = false;
@@ -8394,7 +8459,7 @@ function loadTableData($xeTable, datas, isReset) {
8394
8459
  } else {
8395
8460
  treeData = fullData.slice(0);
8396
8461
  }
8397
- } else if (rowGroupConfig && rowGroupList.length) {
8462
+ } else if ((aggregateConfig || rowGroupConfig) && rowGroupList.length) {
8398
8463
  const groupRest = handleGroupData($xeTable, fullData, rowGroupList);
8399
8464
  treeData = groupRest.treeData;
8400
8465
  fullData = groupRest.fullData;
@@ -8499,11 +8564,15 @@ function loadTableData($xeTable, datas, isReset) {
8499
8564
  // 是否变更虚拟滚动
8500
8565
  if (oldScrollYLoad === sYLoad) {
8501
8566
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
8567
+ calcCellHeight($xeTable);
8568
+ updateRowOffsetTop($xeTable);
8502
8569
  resolve();
8503
8570
  });
8504
8571
  } else {
8505
8572
  setTimeout(() => {
8506
8573
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
8574
+ calcCellHeight($xeTable);
8575
+ updateRowOffsetTop($xeTable);
8507
8576
  resolve();
8508
8577
  });
8509
8578
  });
@@ -8786,6 +8855,7 @@ function handleColumn($xeTable, collectColumn) {
8786
8855
  $xeTable.clearMergeCells();
8787
8856
  $xeTable.clearMergeFooterItems();
8788
8857
  $xeTable.handleTableData(true);
8858
+ $xeTable.handleAggregateSummaryData();
8789
8859
  if ((scrollXLoad || scrollYLoad) && expandColumn && expandOpts.mode !== 'fixed') {
8790
8860
  warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
8791
8861
  }
@@ -9425,31 +9495,42 @@ const Methods = {
9425
9495
  * @param {String} field 字段名
9426
9496
  */
9427
9497
  reloadRow(row, record, field) {
9498
+ const $xeTable = this;
9499
+ const props = $xeTable;
9500
+ const reactData = $xeTable;
9501
+ const internalData = $xeTable;
9502
+ const {
9503
+ keepSource
9504
+ } = props;
9428
9505
  const {
9429
- keepSource,
9430
- tableSourceData,
9431
9506
  tableData
9432
- } = this;
9507
+ } = reactData;
9508
+ const {
9509
+ sourceDataRowIdData
9510
+ } = internalData;
9433
9511
  if (keepSource) {
9434
- const rowIndex = this.getRowIndex(row);
9435
- const oRow = tableSourceData[rowIndex];
9512
+ if ($xeTable.isAggregateRecord(row)) {
9513
+ return $xeTable.$nextTick();
9514
+ }
9515
+ const oRow = sourceDataRowIdData[getRowid($xeTable, row)];
9436
9516
  if (oRow && row) {
9437
9517
  if (field) {
9438
- const newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record || row, field);
9518
+ const newValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record || row, field), true);
9439
9519
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, newValue);
9440
9520
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(oRow, field, newValue);
9441
9521
  } else {
9442
- const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone({
9443
- ...record
9444
- }, true);
9522
+ const rowkey = getRowkey($xeTable);
9523
+ const rowid = getRowid($xeTable, row);
9524
+ const newRecord = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(Object.assign({}, record), true);
9525
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(newRecord, rowkey, rowid);
9445
9526
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(oRow, Object.assign(row, newRecord));
9446
9527
  }
9447
9528
  }
9448
- this.tableData = tableData.slice(0);
9529
+ reactData.tableData = tableData.slice(0);
9449
9530
  } else {
9450
9531
  errLog('vxe.error.reqProp', ['keep-source']);
9451
9532
  }
9452
- return this.$nextTick();
9533
+ return $xeTable.$nextTick();
9453
9534
  },
9454
9535
  /**
9455
9536
  * 加载列配置
@@ -9458,7 +9539,7 @@ const Methods = {
9458
9539
  */
9459
9540
  loadColumn(columns) {
9460
9541
  const $xeTable = this;
9461
- const collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(columns, column => cell.createColumn(this, column), {
9542
+ const collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(columns, column => cell.createColumn($xeTable, column), {
9462
9543
  children: 'children'
9463
9544
  });
9464
9545
  return handleColumn($xeTable, collectColumn);
@@ -9560,10 +9641,10 @@ const Methods = {
9560
9641
  children: childrenField
9561
9642
  });
9562
9643
  } else if (isRowGroupStatus) {
9563
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
9644
+ const aggregateOpts = $xeTable.computeAggregateOpts;
9564
9645
  const {
9565
9646
  mapChildrenField
9566
- } = rowGroupOpts;
9647
+ } = aggregateOpts;
9567
9648
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData, (row, index, items, path, parentRow, nodes) => {
9568
9649
  const rowid = handleUpdateRowId(row);
9569
9650
  handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
@@ -12299,6 +12380,10 @@ const Methods = {
12299
12380
  internalData.mergeFooterCellMaps = buildMergeData(mergeFooterList);
12300
12381
  reactData.mergeFootFlag++;
12301
12382
  },
12383
+ handleAggregateSummaryData() {
12384
+ const $xeTable = this;
12385
+ return updateGroupData($xeTable);
12386
+ },
12302
12387
  handleTargetLeaveEvent() {
12303
12388
  const $xeTable = this;
12304
12389
  const internalData = $xeTable;
@@ -12651,7 +12736,7 @@ const Methods = {
12651
12736
  const {
12652
12737
  selectCheckboxMaps
12653
12738
  } = internalData;
12654
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
12739
+ const aggregateOpts = $xeTable.computeAggregateOpts;
12655
12740
  const treeOpts = $xeTable.computeTreeOpts;
12656
12741
  const {
12657
12742
  transform,
@@ -12723,7 +12808,7 @@ const Methods = {
12723
12808
  handleCheckboxReserveRow($xeTable, row, checked);
12724
12809
  }
12725
12810
  }, {
12726
- children: rowGroupOpts.mapChildrenField
12811
+ children: aggregateOpts.mapChildrenField
12727
12812
  });
12728
12813
  reactData.updateCheckboxFlag++;
12729
12814
  return;
@@ -12914,7 +12999,7 @@ const Methods = {
12914
12999
  selectCheckboxMaps,
12915
13000
  treeIndeterminateRowMaps
12916
13001
  } = internalData;
12917
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
13002
+ const aggregateOpts = $xeTable.computeAggregateOpts;
12918
13003
  const treeOpts = $xeTable.computeTreeOpts;
12919
13004
  const childrenField = treeOpts.children || treeOpts.childrenField;
12920
13005
  const checkboxOpts = $xeTable.computeCheckboxOpts;
@@ -12934,7 +13019,7 @@ const Methods = {
12934
13019
  const childRowList = [];
12935
13020
  if (isRowGroupStatus) {
12936
13021
  // 行分组
12937
- const mapChildrenField = rowGroupOpts.mapChildrenField;
13022
+ const mapChildrenField = aggregateOpts.mapChildrenField;
12938
13023
  if (mapChildrenField) {
12939
13024
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData, row => {
12940
13025
  const rowid = handleGetRowId(row);
@@ -13666,7 +13751,7 @@ const Methods = {
13666
13751
  const radioOpts = $xeTable.computeRadioOpts;
13667
13752
  const checkboxOpts = $xeTable.computeCheckboxOpts;
13668
13753
  const keyboardOpts = $xeTable.computeKeyboardOpts;
13669
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
13754
+ const aggregateOpts = $xeTable.computeAggregateOpts;
13670
13755
  const rowOpts = $xeTable.computeRowOpts;
13671
13756
  const columnOpts = $xeTable.computeColumnOpts;
13672
13757
  const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
@@ -13709,7 +13794,7 @@ const Methods = {
13709
13794
  $xeTable.triggerTreeExpandEvent(evnt, params);
13710
13795
  }
13711
13796
  // 如果是行分组
13712
- if (rowGroupOpts.trigger === 'row' || rowGroupNode && rowGroupOpts.trigger === 'cell') {
13797
+ if (aggregateOpts.trigger === 'row' || rowGroupNode && aggregateOpts.trigger === 'cell') {
13713
13798
  $xeTable.triggerRowGroupExpandEvent(evnt, params);
13714
13799
  }
13715
13800
  }
@@ -15375,10 +15460,11 @@ const Methods = {
15375
15460
  const props = $xeTable;
15376
15461
  const internalData = $xeTable;
15377
15462
  const {
15463
+ aggregateConfig,
15378
15464
  rowGroupConfig
15379
15465
  } = props;
15380
- if (!rowGroupConfig) {
15381
- errLog('vxe.error.reqProp', ['row-group-config']);
15466
+ if (!(aggregateConfig || rowGroupConfig)) {
15467
+ errLog('vxe.error.reqProp', ['aggregate-config']);
15382
15468
  return $xeTable.$nextTick();
15383
15469
  }
15384
15470
  if (fieldOrColumns) {
@@ -15394,16 +15480,27 @@ const Methods = {
15394
15480
  const props = $xeTable;
15395
15481
  const internalData = $xeTable;
15396
15482
  const {
15483
+ aggregateConfig,
15397
15484
  rowGroupConfig
15398
15485
  } = props;
15399
- if (!rowGroupConfig) {
15400
- errLog('vxe.error.reqProp', ['row-group-config']);
15486
+ if (!(aggregateConfig || rowGroupConfig)) {
15487
+ errLog('vxe.error.reqProp', ['aggregate-config']);
15401
15488
  return $xeTable.$nextTick();
15402
15489
  }
15403
15490
  handleUpdateRowGroup($xeTable, []);
15404
15491
  return loadTableData($xeTable, internalData.tableSynchData, true);
15405
15492
  },
15406
15493
  isRowGroupRecord(row) {
15494
+ const $xeTable = this;
15495
+ warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord']);
15496
+ return $xeTable.isAggregateRecord(row);
15497
+ },
15498
+ isRowGroupExpandByRow(row) {
15499
+ const $xeTable = this;
15500
+ warnLog('vxe.error.delFunc', ['isRowGroupExpandByRow', 'isAggregateExpandByRow']);
15501
+ return $xeTable.isAggregateExpandByRow(row);
15502
+ },
15503
+ isAggregateRecord(row) {
15407
15504
  const $xeTable = this;
15408
15505
  const reactData = $xeTable;
15409
15506
  const {
@@ -15411,7 +15508,7 @@ const Methods = {
15411
15508
  } = reactData;
15412
15509
  return isRowGroupStatus && row.isAggregate;
15413
15510
  },
15414
- isRowGroupExpandByRow(row) {
15511
+ isAggregateExpandByRow(row) {
15415
15512
  const $xeTable = this;
15416
15513
  const reactData = $xeTable;
15417
15514
  const internalData = $xeTable;
@@ -15440,10 +15537,10 @@ const Methods = {
15440
15537
  const {
15441
15538
  tableFullGroupData
15442
15539
  } = internalData;
15443
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
15540
+ const aggregateOpts = $xeTable.computeAggregateOpts;
15444
15541
  const {
15445
15542
  mapChildrenField
15446
- } = rowGroupOpts;
15543
+ } = aggregateOpts;
15447
15544
  const rgExpandedMaps = {};
15448
15545
  if (expanded && mapChildrenField) {
15449
15546
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData, row => {
@@ -15592,14 +15689,14 @@ const Methods = {
15592
15689
  const {
15593
15690
  rowGroupExpandedMaps
15594
15691
  } = internalData;
15595
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
15692
+ const aggregateOpts = $xeTable.computeAggregateOpts;
15596
15693
  const {
15597
15694
  row,
15598
15695
  column
15599
15696
  } = params;
15600
15697
  const {
15601
15698
  trigger
15602
- } = rowGroupOpts;
15699
+ } = aggregateOpts;
15603
15700
  if (trigger === 'manual') {
15604
15701
  return;
15605
15702
  }
@@ -16716,11 +16813,11 @@ const Methods = {
16716
16813
  } = internalData;
16717
16814
  const rests = [];
16718
16815
  if (treeConfig || isRowGroupStatus) {
16719
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
16816
+ const aggregateOpts = $xeTable.computeAggregateOpts;
16720
16817
  const treeOpts = $xeTable.computeTreeOpts;
16721
16818
  const childrenField = treeOpts.children || treeOpts.childrenField;
16722
16819
  const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData, item => $xeTable.eqRow(item, row), {
16723
- children: isRowGroupStatus ? rowGroupOpts.mapChildrenField : childrenField
16820
+ children: isRowGroupStatus ? aggregateOpts.mapChildrenField : childrenField
16724
16821
  });
16725
16822
  if (matchObj) {
16726
16823
  const nodes = matchObj.nodes;
@@ -17318,6 +17415,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17318
17415
  $xeTable.triggerCellDblclickEvent(evnt, cellParams);
17319
17416
  };
17320
17417
  let isMergeCell = false;
17418
+ let mergeRowspan = 1;
17321
17419
  // 合并行或列
17322
17420
  if (mergeBodyFlag && mergeBodyList.length) {
17323
17421
  const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
@@ -17331,6 +17429,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17331
17429
  }
17332
17430
  if (rowspan > 1) {
17333
17431
  isMergeCell = true;
17432
+ mergeRowspan = rowspan;
17334
17433
  tdAttrs.rowspan = rowspan;
17335
17434
  }
17336
17435
  if (colspan > 1) {
@@ -17348,9 +17447,12 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17348
17447
  return null;
17349
17448
  }
17350
17449
  if (rowspan > 1) {
17450
+ isMergeCell = true;
17451
+ mergeRowspan = rowspan;
17351
17452
  tdAttrs.rowspan = rowspan;
17352
17453
  }
17353
17454
  if (colspan > 1) {
17455
+ isMergeCell = true;
17354
17456
  tdAttrs.colspan = colspan;
17355
17457
  }
17356
17458
  }
@@ -17365,7 +17467,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17365
17467
  isDirty = $xeTable.isUpdateByRow(row, column.field);
17366
17468
  }
17367
17469
  const isVNAutoHeight = scrollYLoad && !hasEllipsis;
17368
- const cellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
17470
+ let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
17369
17471
  const isLastColumn = $columnIndex === columns.length - 1;
17370
17472
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
17371
17473
  let isVNPreEmptyStatus = false;
@@ -17378,6 +17480,15 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17378
17480
  }
17379
17481
  }
17380
17482
  }
17483
+ if (mergeRowspan > 1) {
17484
+ const mEndRow = afterFullData[_rowIndex + mergeRowspan - 1];
17485
+ if (mEndRow) {
17486
+ const meRowRest = fullAllDataRowIdData[getRowid($xeTable, mEndRow)];
17487
+ if (meRowRest) {
17488
+ cellHeight += meRowRest.oTop - rowRest.oTop + getCellRestHeight(meRowRest, cellOpts, rowOpts, defaultRowHeight);
17489
+ }
17490
+ }
17491
+ }
17381
17492
  const tcStyle = {};
17382
17493
  if (hasEllipsis && resizeWidthFlag) {
17383
17494
  let tsColspan = tdAttrs.colspan || 0;
@@ -17409,7 +17520,10 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17409
17520
  }));
17410
17521
  } else {
17411
17522
  // 渲染单元格
17412
- tdVNs.push(...renderLine(h, $xeTable, rowid, cellParams, cellHeight), h('div', {
17523
+ if (treeConfig) {
17524
+ tdVNs.push(...renderLine(h, $xeTable, rowid, cellParams, cellHeight));
17525
+ }
17526
+ tdVNs.push(h('div', {
17413
17527
  key: 'tc',
17414
17528
  class: ['vxe-cell', {
17415
17529
  'c--title': showTitle,
@@ -19140,7 +19254,9 @@ const {
19140
19254
  footerCellConfig: Object,
19141
19255
  // 行配置项
19142
19256
  rowConfig: Object,
19143
- // 行分组配置项
19257
+ // 数据聚合配置项
19258
+ aggregateConfig: Object,
19259
+ // 已废弃,被 aggregateConfig 替换
19144
19260
  rowGroupConfig: Object,
19145
19261
  // 当前行配置项
19146
19262
  currentRowConfig: Object,
@@ -22797,7 +22913,7 @@ function handleEditActive($xeTable, params, evnt, isFocus, isPos) {
22797
22913
  params.cell = cell;
22798
22914
  if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
22799
22915
  // 激活编辑
22800
- if (!$xeTable.isPendingByRow(row)) {
22916
+ if (!$xeTable.isPendingByRow(row) && !$xeTable.isAggregateRecord(row)) {
22801
22917
  if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
22802
22918
  // 判断是否禁用编辑
22803
22919
  let type = 'edit-disabled';
@@ -22905,7 +23021,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22905
23021
  editConfig
22906
23022
  } = props;
22907
23023
  const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
22908
- if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
23024
+ if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender) && !$xeTable.isAggregateRecord(row)) {
22909
23025
  return Promise.resolve(isPos ? $xeTable.scrollToRow(row, column) : null).then(() => {
22910
23026
  const cell = $xeTable.getCellElement(row, column);
22911
23027
  if (cell) {
@@ -26248,19 +26364,23 @@ function checkRuleStatus(rule, val) {
26248
26364
  beginValidate(rows, cols, cb, isFull) {
26249
26365
  const $xeTable = this;
26250
26366
  const props = $xeTable;
26367
+ const reactData = $xeTable;
26251
26368
  const internalData = $xeTable;
26252
26369
  const validRest = {};
26253
26370
  const {
26254
26371
  editRules,
26255
26372
  treeConfig
26256
26373
  } = props;
26374
+ const {
26375
+ isRowGroupStatus
26376
+ } = reactData;
26257
26377
  const {
26258
26378
  afterFullData,
26259
26379
  pendingRowMaps,
26260
26380
  removeRowMaps
26261
26381
  } = internalData;
26262
26382
  const treeOpts = $xeTable.computeTreeOpts;
26263
- const childrenField = treeOpts.children || treeOpts.childrenField;
26383
+ const aggregateOpts = $xeTable.computeAggregateOpts;
26264
26384
  let validList;
26265
26385
  if (rows === true) {
26266
26386
  validList = afterFullData;
@@ -26291,6 +26411,9 @@ function checkRuleStatus(rule, val) {
26291
26411
  if (pendingRowMaps[rowid]) {
26292
26412
  return;
26293
26413
  }
26414
+ if ($xeTable.isAggregateRecord(row)) {
26415
+ return;
26416
+ }
26294
26417
  if (isFull || !this.validRuleErr) {
26295
26418
  const colVailds = [];
26296
26419
  columns.forEach(column => {
@@ -26330,7 +26453,12 @@ function checkRuleStatus(rule, val) {
26330
26453
  rowValidErrs.push(Promise.all(colVailds));
26331
26454
  }
26332
26455
  };
26333
- if (treeConfig) {
26456
+ if (isRowGroupStatus) {
26457
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(validList, handleVaild, {
26458
+ children: aggregateOpts.mapChildrenField
26459
+ });
26460
+ } else if (treeConfig) {
26461
+ const childrenField = treeOpts.children || treeOpts.childrenField;
26334
26462
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(validList, handleVaild, {
26335
26463
  children: childrenField
26336
26464
  });
@@ -27836,10 +27964,14 @@ function renderBody(h, $xeTable) {
27836
27964
  const props = $xeTable;
27837
27965
  return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
27838
27966
  },
27839
- computeRowGroupOpts() {
27967
+ computeAggregateOpts() {
27840
27968
  const $xeTable = this;
27841
27969
  const props = $xeTable;
27842
- return Object.assign({}, table_getConfig().table.rowGroupConfig, props.rowGroupConfig);
27970
+ return Object.assign({}, table_getConfig().table.aggregateConfig || table_getConfig().table.rowGroupConfig, props.aggregateConfig || props.rowGroupConfig);
27971
+ },
27972
+ computeRowGroupOpts() {
27973
+ const $xeTable = this;
27974
+ return $xeTable.computeAggregateOpts;
27843
27975
  },
27844
27976
  computeCurrentRowOpts() {
27845
27977
  const $xeTable = this;
@@ -28267,8 +28399,8 @@ function renderBody(h, $xeTable) {
28267
28399
  },
28268
28400
  computeRowGroupFields() {
28269
28401
  const $xeTable = this;
28270
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
28271
- return rowGroupOpts.groupFields;
28402
+ const aggregateOpts = $xeTable.computeAggregateOpts;
28403
+ return aggregateOpts.groupFields;
28272
28404
  },
28273
28405
  tabsResizeFlag() {
28274
28406
  const $xeTable = this;
@@ -28554,10 +28686,10 @@ function renderBody(h, $xeTable) {
28554
28686
  const currentRowOpts = $xeTable.computeCurrentRowOpts;
28555
28687
  const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
28556
28688
  const keyboardOpts = $xeTable.computeKeyboardOpts;
28557
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
28689
+ const aggregateOpts = $xeTable.computeAggregateOpts;
28558
28690
  const {
28559
28691
  groupFields
28560
- } = rowGroupOpts;
28692
+ } = aggregateOpts;
28561
28693
  if (props.rowId) {
28562
28694
  warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
28563
28695
  }
@@ -28648,6 +28780,15 @@ function renderBody(h, $xeTable) {
28648
28780
  if (props.dragConfig) {
28649
28781
  warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
28650
28782
  }
28783
+ if (props.rowGroupConfig) {
28784
+ warnLog('vxe.error.delProp', ['row-group-config', 'aggregate-config']);
28785
+ }
28786
+ if (aggregateOpts.countFields) {
28787
+ warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func']);
28788
+ }
28789
+ if (aggregateOpts.countMethod) {
28790
+ warnLog('vxe.error.delProp', ['row-group-config.countMethod', 'aggregate-config.aggregateMethod']);
28791
+ }
28651
28792
  if (props.treeConfig && treeOpts.children) {
28652
28793
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
28653
28794
  }
@@ -29965,6 +30106,39 @@ const {
29965
30106
  const grid_methods = {};
29966
30107
  const propKeys = Object.keys(props);
29967
30108
  const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Table', 'Bottom', 'Pager']];
30109
+ function initPages($xeGrid, propKey) {
30110
+ const props = $xeGrid;
30111
+ const reactData = $xeGrid;
30112
+ const {
30113
+ tablePage
30114
+ } = reactData;
30115
+ const {
30116
+ pagerConfig
30117
+ } = props;
30118
+ const pagerOpts = $xeGrid.computePagerOpts;
30119
+ if (pagerConfig && isEnableConf(pagerOpts)) {
30120
+ if (propKey) {
30121
+ if (pagerOpts[propKey]) {
30122
+ tablePage[propKey] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(pagerOpts[propKey]);
30123
+ }
30124
+ } else {
30125
+ const {
30126
+ currentPage,
30127
+ pageSize,
30128
+ total
30129
+ } = pagerOpts;
30130
+ if (currentPage) {
30131
+ tablePage.currentPage = currentPage;
30132
+ }
30133
+ if (pageSize) {
30134
+ tablePage.pageSize = pageSize;
30135
+ }
30136
+ if (total) {
30137
+ tablePage.pageSize = total;
30138
+ }
30139
+ }
30140
+ }
30141
+ }
29968
30142
  function renderDefaultForm(h, $xeGrid) {
29969
30143
  const VxeUIFormComponent = core_.VxeUI.getComponent('VxeForm');
29970
30144
  const props = $xeGrid;
@@ -30534,10 +30708,20 @@ Object.keys(table.methods).forEach(name => {
30534
30708
  footKeys
30535
30709
  };
30536
30710
  },
30537
- computePageConfFlag() {
30711
+ computeCustomCurrentPageFlag() {
30712
+ const $xeGrid = this;
30713
+ const pagerOpts = $xeGrid.computePagerOpts;
30714
+ return pagerOpts.currentPage;
30715
+ },
30716
+ computeCustomPageSizeFlag() {
30717
+ const $xeGrid = this;
30718
+ const pagerOpts = $xeGrid.computePagerOpts;
30719
+ return pagerOpts.pageSize;
30720
+ },
30721
+ computeCustomTotalFlag() {
30538
30722
  const $xeGrid = this;
30539
30723
  const pagerOpts = $xeGrid.computePagerOpts;
30540
- return `${pagerOpts.currentPage}${pagerOpts.pageSize}`;
30724
+ return pagerOpts.total;
30541
30725
  }
30542
30726
  },
30543
30727
  watch: {
@@ -30557,8 +30741,17 @@ Object.keys(table.methods).forEach(name => {
30557
30741
  proxyConfig() {
30558
30742
  this.initProxy();
30559
30743
  },
30560
- computePageConfFlag() {
30561
- this.initPages();
30744
+ computeCustomCurrentPageFlag() {
30745
+ const $xeGrid = this;
30746
+ initPages($xeGrid, 'currentPage');
30747
+ },
30748
+ computeCustomPageSizeFlag() {
30749
+ const $xeGrid = this;
30750
+ initPages($xeGrid, 'pageSize');
30751
+ },
30752
+ computeCustomTotalFlag() {
30753
+ const $xeGrid = this;
30754
+ initPages($xeGrid, 'total');
30562
30755
  }
30563
30756
  },
30564
30757
  created() {
@@ -30592,7 +30785,7 @@ Object.keys(table.methods).forEach(name => {
30592
30785
  }
30593
30786
  }
30594
30787
  });
30595
- this.initPages();
30788
+ initPages($xeGrid);
30596
30789
  grid_globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent);
30597
30790
  },
30598
30791
  mounted() {
@@ -30685,25 +30878,6 @@ Object.keys(table.methods).forEach(name => {
30685
30878
  }
30686
30879
  });
30687
30880
  },
30688
- initPages() {
30689
- const {
30690
- tablePage,
30691
- pagerConfig,
30692
- pagerOpts
30693
- } = this;
30694
- const {
30695
- currentPage,
30696
- pageSize
30697
- } = pagerOpts;
30698
- if (pagerConfig) {
30699
- if (currentPage) {
30700
- tablePage.currentPage = currentPage;
30701
- }
30702
- if (pageSize) {
30703
- tablePage.pageSize = pageSize;
30704
- }
30705
- }
30706
- },
30707
30881
  initProxy() {
30708
30882
  const {
30709
30883
  proxyInited,