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.
Files changed (50) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/src/body.js +20 -3
  3. package/es/table/src/cell.js +52 -36
  4. package/es/table/src/column.js +2 -0
  5. package/es/table/src/columnInfo.js +2 -0
  6. package/es/table/src/methods.js +117 -69
  7. package/es/table/src/props.js +3 -1
  8. package/es/table/src/table.js +19 -6
  9. package/es/table/src/util.js +5 -2
  10. package/es/ui/index.js +4 -4
  11. package/es/ui/src/log.js +1 -1
  12. package/lib/index.umd.js +227 -109
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/style.css +1 -1
  15. package/lib/table/src/body.js +19 -2
  16. package/lib/table/src/body.min.js +1 -1
  17. package/lib/table/src/cell.js +43 -28
  18. package/lib/table/src/cell.min.js +1 -1
  19. package/lib/table/src/column.js +2 -0
  20. package/lib/table/src/column.min.js +1 -1
  21. package/lib/table/src/columnInfo.js +2 -0
  22. package/lib/table/src/columnInfo.min.js +1 -1
  23. package/lib/table/src/methods.js +129 -65
  24. package/lib/table/src/methods.min.js +1 -1
  25. package/lib/table/src/props.js +3 -1
  26. package/lib/table/src/props.min.js +1 -1
  27. package/lib/table/src/table.js +19 -6
  28. package/lib/table/src/table.min.js +1 -1
  29. package/lib/table/src/util.js +7 -4
  30. package/lib/table/src/util.min.js +1 -1
  31. package/lib/ui/index.js +4 -4
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/package.json +1 -1
  36. package/packages/table/src/body.ts +20 -3
  37. package/packages/table/src/cell.ts +52 -36
  38. package/packages/table/src/column.ts +2 -0
  39. package/packages/table/src/columnInfo.ts +3 -0
  40. package/packages/table/src/methods.ts +122 -68
  41. package/packages/table/src/props.ts +3 -1
  42. package/packages/table/src/table.ts +20 -6
  43. package/packages/table/src/util.ts +6 -2
  44. package/packages/ui/index.ts +3 -3
  45. /package/es/{iconfont.1749092456241.ttf → iconfont.1749202936550.ttf} +0 -0
  46. /package/es/{iconfont.1749092456241.woff → iconfont.1749202936550.woff} +0 -0
  47. /package/es/{iconfont.1749092456241.woff2 → iconfont.1749202936550.woff2} +0 -0
  48. /package/lib/{iconfont.1749092456241.ttf → iconfont.1749202936550.ttf} +0 -0
  49. /package/lib/{iconfont.1749092456241.woff → iconfont.1749202936550.woff} +0 -0
  50. /package/lib/{iconfont.1749092456241.woff2 → iconfont.1749202936550.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.35";
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.35"}`;
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
  }
@@ -9560,10 +9630,10 @@ const Methods = {
9560
9630
  children: childrenField
9561
9631
  });
9562
9632
  } else if (isRowGroupStatus) {
9563
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
9633
+ const aggregateOpts = $xeTable.computeAggregateOpts;
9564
9634
  const {
9565
9635
  mapChildrenField
9566
- } = rowGroupOpts;
9636
+ } = aggregateOpts;
9567
9637
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData, (row, index, items, path, parentRow, nodes) => {
9568
9638
  const rowid = handleUpdateRowId(row);
9569
9639
  handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
@@ -12299,6 +12369,10 @@ const Methods = {
12299
12369
  internalData.mergeFooterCellMaps = buildMergeData(mergeFooterList);
12300
12370
  reactData.mergeFootFlag++;
12301
12371
  },
12372
+ handleAggregateSummaryData() {
12373
+ const $xeTable = this;
12374
+ return updateGroupData($xeTable);
12375
+ },
12302
12376
  handleTargetLeaveEvent() {
12303
12377
  const $xeTable = this;
12304
12378
  const internalData = $xeTable;
@@ -12651,7 +12725,7 @@ const Methods = {
12651
12725
  const {
12652
12726
  selectCheckboxMaps
12653
12727
  } = internalData;
12654
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
12728
+ const aggregateOpts = $xeTable.computeAggregateOpts;
12655
12729
  const treeOpts = $xeTable.computeTreeOpts;
12656
12730
  const {
12657
12731
  transform,
@@ -12723,7 +12797,7 @@ const Methods = {
12723
12797
  handleCheckboxReserveRow($xeTable, row, checked);
12724
12798
  }
12725
12799
  }, {
12726
- children: rowGroupOpts.mapChildrenField
12800
+ children: aggregateOpts.mapChildrenField
12727
12801
  });
12728
12802
  reactData.updateCheckboxFlag++;
12729
12803
  return;
@@ -12914,7 +12988,7 @@ const Methods = {
12914
12988
  selectCheckboxMaps,
12915
12989
  treeIndeterminateRowMaps
12916
12990
  } = internalData;
12917
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
12991
+ const aggregateOpts = $xeTable.computeAggregateOpts;
12918
12992
  const treeOpts = $xeTable.computeTreeOpts;
12919
12993
  const childrenField = treeOpts.children || treeOpts.childrenField;
12920
12994
  const checkboxOpts = $xeTable.computeCheckboxOpts;
@@ -12934,7 +13008,7 @@ const Methods = {
12934
13008
  const childRowList = [];
12935
13009
  if (isRowGroupStatus) {
12936
13010
  // 行分组
12937
- const mapChildrenField = rowGroupOpts.mapChildrenField;
13011
+ const mapChildrenField = aggregateOpts.mapChildrenField;
12938
13012
  if (mapChildrenField) {
12939
13013
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData, row => {
12940
13014
  const rowid = handleGetRowId(row);
@@ -13666,7 +13740,7 @@ const Methods = {
13666
13740
  const radioOpts = $xeTable.computeRadioOpts;
13667
13741
  const checkboxOpts = $xeTable.computeCheckboxOpts;
13668
13742
  const keyboardOpts = $xeTable.computeKeyboardOpts;
13669
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
13743
+ const aggregateOpts = $xeTable.computeAggregateOpts;
13670
13744
  const rowOpts = $xeTable.computeRowOpts;
13671
13745
  const columnOpts = $xeTable.computeColumnOpts;
13672
13746
  const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
@@ -13709,7 +13783,7 @@ const Methods = {
13709
13783
  $xeTable.triggerTreeExpandEvent(evnt, params);
13710
13784
  }
13711
13785
  // 如果是行分组
13712
- if (rowGroupOpts.trigger === 'row' || rowGroupNode && rowGroupOpts.trigger === 'cell') {
13786
+ if (aggregateOpts.trigger === 'row' || rowGroupNode && aggregateOpts.trigger === 'cell') {
13713
13787
  $xeTable.triggerRowGroupExpandEvent(evnt, params);
13714
13788
  }
13715
13789
  }
@@ -15375,10 +15449,11 @@ const Methods = {
15375
15449
  const props = $xeTable;
15376
15450
  const internalData = $xeTable;
15377
15451
  const {
15452
+ aggregateConfig,
15378
15453
  rowGroupConfig
15379
15454
  } = props;
15380
- if (!rowGroupConfig) {
15381
- errLog('vxe.error.reqProp', ['row-group-config']);
15455
+ if (!(aggregateConfig || rowGroupConfig)) {
15456
+ errLog('vxe.error.reqProp', ['aggregate-config']);
15382
15457
  return $xeTable.$nextTick();
15383
15458
  }
15384
15459
  if (fieldOrColumns) {
@@ -15394,16 +15469,27 @@ const Methods = {
15394
15469
  const props = $xeTable;
15395
15470
  const internalData = $xeTable;
15396
15471
  const {
15472
+ aggregateConfig,
15397
15473
  rowGroupConfig
15398
15474
  } = props;
15399
- if (!rowGroupConfig) {
15400
- errLog('vxe.error.reqProp', ['row-group-config']);
15475
+ if (!(aggregateConfig || rowGroupConfig)) {
15476
+ errLog('vxe.error.reqProp', ['aggregate-config']);
15401
15477
  return $xeTable.$nextTick();
15402
15478
  }
15403
15479
  handleUpdateRowGroup($xeTable, []);
15404
15480
  return loadTableData($xeTable, internalData.tableSynchData, true);
15405
15481
  },
15406
15482
  isRowGroupRecord(row) {
15483
+ const $xeTable = this;
15484
+ warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord']);
15485
+ return $xeTable.isAggregateRecord(row);
15486
+ },
15487
+ isRowGroupExpandByRow(row) {
15488
+ const $xeTable = this;
15489
+ warnLog('vxe.error.delFunc', ['isRowGroupExpandByRow', 'isAggregateExpandByRow']);
15490
+ return $xeTable.isAggregateExpandByRow(row);
15491
+ },
15492
+ isAggregateRecord(row) {
15407
15493
  const $xeTable = this;
15408
15494
  const reactData = $xeTable;
15409
15495
  const {
@@ -15411,7 +15497,7 @@ const Methods = {
15411
15497
  } = reactData;
15412
15498
  return isRowGroupStatus && row.isAggregate;
15413
15499
  },
15414
- isRowGroupExpandByRow(row) {
15500
+ isAggregateExpandByRow(row) {
15415
15501
  const $xeTable = this;
15416
15502
  const reactData = $xeTable;
15417
15503
  const internalData = $xeTable;
@@ -15440,10 +15526,10 @@ const Methods = {
15440
15526
  const {
15441
15527
  tableFullGroupData
15442
15528
  } = internalData;
15443
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
15529
+ const aggregateOpts = $xeTable.computeAggregateOpts;
15444
15530
  const {
15445
15531
  mapChildrenField
15446
- } = rowGroupOpts;
15532
+ } = aggregateOpts;
15447
15533
  const rgExpandedMaps = {};
15448
15534
  if (expanded && mapChildrenField) {
15449
15535
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData, row => {
@@ -15592,14 +15678,14 @@ const Methods = {
15592
15678
  const {
15593
15679
  rowGroupExpandedMaps
15594
15680
  } = internalData;
15595
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
15681
+ const aggregateOpts = $xeTable.computeAggregateOpts;
15596
15682
  const {
15597
15683
  row,
15598
15684
  column
15599
15685
  } = params;
15600
15686
  const {
15601
15687
  trigger
15602
- } = rowGroupOpts;
15688
+ } = aggregateOpts;
15603
15689
  if (trigger === 'manual') {
15604
15690
  return;
15605
15691
  }
@@ -16716,11 +16802,11 @@ const Methods = {
16716
16802
  } = internalData;
16717
16803
  const rests = [];
16718
16804
  if (treeConfig || isRowGroupStatus) {
16719
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
16805
+ const aggregateOpts = $xeTable.computeAggregateOpts;
16720
16806
  const treeOpts = $xeTable.computeTreeOpts;
16721
16807
  const childrenField = treeOpts.children || treeOpts.childrenField;
16722
16808
  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
16809
+ children: isRowGroupStatus ? aggregateOpts.mapChildrenField : childrenField
16724
16810
  });
16725
16811
  if (matchObj) {
16726
16812
  const nodes = matchObj.nodes;
@@ -17318,6 +17404,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17318
17404
  $xeTable.triggerCellDblclickEvent(evnt, cellParams);
17319
17405
  };
17320
17406
  let isMergeCell = false;
17407
+ let mergeRowspan = 1;
17321
17408
  // 合并行或列
17322
17409
  if (mergeBodyFlag && mergeBodyList.length) {
17323
17410
  const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
@@ -17331,6 +17418,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17331
17418
  }
17332
17419
  if (rowspan > 1) {
17333
17420
  isMergeCell = true;
17421
+ mergeRowspan = rowspan;
17334
17422
  tdAttrs.rowspan = rowspan;
17335
17423
  }
17336
17424
  if (colspan > 1) {
@@ -17348,9 +17436,12 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17348
17436
  return null;
17349
17437
  }
17350
17438
  if (rowspan > 1) {
17439
+ isMergeCell = true;
17440
+ mergeRowspan = rowspan;
17351
17441
  tdAttrs.rowspan = rowspan;
17352
17442
  }
17353
17443
  if (colspan > 1) {
17444
+ isMergeCell = true;
17354
17445
  tdAttrs.colspan = colspan;
17355
17446
  }
17356
17447
  }
@@ -17365,7 +17456,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17365
17456
  isDirty = $xeTable.isUpdateByRow(row, column.field);
17366
17457
  }
17367
17458
  const isVNAutoHeight = scrollYLoad && !hasEllipsis;
17368
- const cellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
17459
+ let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
17369
17460
  const isLastColumn = $columnIndex === columns.length - 1;
17370
17461
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
17371
17462
  let isVNPreEmptyStatus = false;
@@ -17378,6 +17469,15 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17378
17469
  }
17379
17470
  }
17380
17471
  }
17472
+ if (mergeRowspan > 1) {
17473
+ const mEndRow = afterFullData[_rowIndex + mergeRowspan - 1];
17474
+ if (mEndRow) {
17475
+ const meRowRest = fullAllDataRowIdData[getRowid($xeTable, mEndRow)];
17476
+ if (meRowRest) {
17477
+ cellHeight += meRowRest.oTop - rowRest.oTop + getCellRestHeight(meRowRest, cellOpts, rowOpts, defaultRowHeight);
17478
+ }
17479
+ }
17480
+ }
17381
17481
  const tcStyle = {};
17382
17482
  if (hasEllipsis && resizeWidthFlag) {
17383
17483
  let tsColspan = tdAttrs.colspan || 0;
@@ -17409,7 +17509,10 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17409
17509
  }));
17410
17510
  } else {
17411
17511
  // 渲染单元格
17412
- tdVNs.push(...renderLine(h, $xeTable, rowid, cellParams, cellHeight), h('div', {
17512
+ if (treeConfig) {
17513
+ tdVNs.push(...renderLine(h, $xeTable, rowid, cellParams, cellHeight));
17514
+ }
17515
+ tdVNs.push(h('div', {
17413
17516
  key: 'tc',
17414
17517
  class: ['vxe-cell', {
17415
17518
  'c--title': showTitle,
@@ -19140,7 +19243,9 @@ const {
19140
19243
  footerCellConfig: Object,
19141
19244
  // 行配置项
19142
19245
  rowConfig: Object,
19143
- // 行分组配置项
19246
+ // 数据聚合配置项
19247
+ aggregateConfig: Object,
19248
+ // 已废弃,被 aggregateConfig 替换
19144
19249
  rowGroupConfig: Object,
19145
19250
  // 当前行配置项
19146
19251
  currentRowConfig: Object,
@@ -27836,10 +27941,14 @@ function renderBody(h, $xeTable) {
27836
27941
  const props = $xeTable;
27837
27942
  return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
27838
27943
  },
27839
- computeRowGroupOpts() {
27944
+ computeAggregateOpts() {
27840
27945
  const $xeTable = this;
27841
27946
  const props = $xeTable;
27842
- return Object.assign({}, table_getConfig().table.rowGroupConfig, props.rowGroupConfig);
27947
+ return Object.assign({}, table_getConfig().table.aggregateConfig || table_getConfig().table.rowGroupConfig, props.aggregateConfig || props.rowGroupConfig);
27948
+ },
27949
+ computeRowGroupOpts() {
27950
+ const $xeTable = this;
27951
+ return $xeTable.computeAggregateOpts;
27843
27952
  },
27844
27953
  computeCurrentRowOpts() {
27845
27954
  const $xeTable = this;
@@ -28267,8 +28376,8 @@ function renderBody(h, $xeTable) {
28267
28376
  },
28268
28377
  computeRowGroupFields() {
28269
28378
  const $xeTable = this;
28270
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
28271
- return rowGroupOpts.groupFields;
28379
+ const aggregateOpts = $xeTable.computeAggregateOpts;
28380
+ return aggregateOpts.groupFields;
28272
28381
  },
28273
28382
  tabsResizeFlag() {
28274
28383
  const $xeTable = this;
@@ -28554,10 +28663,10 @@ function renderBody(h, $xeTable) {
28554
28663
  const currentRowOpts = $xeTable.computeCurrentRowOpts;
28555
28664
  const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
28556
28665
  const keyboardOpts = $xeTable.computeKeyboardOpts;
28557
- const rowGroupOpts = $xeTable.computeRowGroupOpts;
28666
+ const aggregateOpts = $xeTable.computeAggregateOpts;
28558
28667
  const {
28559
28668
  groupFields
28560
- } = rowGroupOpts;
28669
+ } = aggregateOpts;
28561
28670
  if (props.rowId) {
28562
28671
  warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField']);
28563
28672
  }
@@ -28648,6 +28757,15 @@ function renderBody(h, $xeTable) {
28648
28757
  if (props.dragConfig) {
28649
28758
  warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
28650
28759
  }
28760
+ if (props.rowGroupConfig) {
28761
+ warnLog('vxe.error.delProp', ['row-group-config', 'aggregate-config']);
28762
+ }
28763
+ if (aggregateOpts.countFields) {
28764
+ warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func']);
28765
+ }
28766
+ if (aggregateOpts.countMethod) {
28767
+ warnLog('vxe.error.delProp', ['row-group-config.countMethod', 'aggregate-config.aggregateMethod']);
28768
+ }
28651
28769
  if (props.treeConfig && treeOpts.children) {
28652
28770
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
28653
28771
  }