vxe-table 4.13.46 → 4.13.48

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 (171) hide show
  1. package/es/grid/src/grid.js +1 -1
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/locale/lang/ar-EG.js +12 -2
  5. package/es/locale/lang/de-DE.js +12 -2
  6. package/es/locale/lang/en-US.js +12 -2
  7. package/es/locale/lang/es-ES.js +12 -2
  8. package/es/locale/lang/fr-FR.js +12 -2
  9. package/es/locale/lang/hu-HU.js +12 -2
  10. package/es/locale/lang/hy-AM.js +12 -2
  11. package/es/locale/lang/id-ID.js +12 -2
  12. package/es/locale/lang/it-IT.js +12 -2
  13. package/es/locale/lang/ja-JP.js +12 -2
  14. package/es/locale/lang/ko-KR.js +12 -2
  15. package/es/locale/lang/ms-MY.js +12 -2
  16. package/es/locale/lang/nb-NO.js +12 -2
  17. package/es/locale/lang/pt-BR.js +12 -2
  18. package/es/locale/lang/ru-RU.js +12 -2
  19. package/es/locale/lang/th-TH.js +12 -2
  20. package/es/locale/lang/ug-CN.js +12 -2
  21. package/es/locale/lang/uk-UA.js +12 -2
  22. package/es/locale/lang/uz-UZ.js +12 -2
  23. package/es/locale/lang/vi-VN.js +12 -2
  24. package/es/locale/lang/zh-CHT.js +12 -2
  25. package/es/locale/lang/zh-CN.js +12 -2
  26. package/es/style.css +1 -1
  27. package/es/style.min.css +1 -1
  28. package/es/table/module/custom/hook.js +20 -5
  29. package/es/table/module/custom/panel.js +34 -15
  30. package/es/table/src/body.js +8 -5
  31. package/es/table/src/cell.js +19 -4
  32. package/es/table/src/columnInfo.js +1 -0
  33. package/es/table/src/table.js +45 -7
  34. package/es/table/style.css +5 -1
  35. package/es/table/style.min.css +1 -1
  36. package/es/ui/index.js +8 -6
  37. package/es/ui/src/log.js +1 -1
  38. package/es/vxe-table/style.css +5 -1
  39. package/es/vxe-table/style.min.css +1 -1
  40. package/lib/grid/src/grid.js +1 -1
  41. package/lib/grid/src/grid.min.js +1 -1
  42. package/lib/index.css +1 -1
  43. package/lib/index.min.css +1 -1
  44. package/lib/index.umd.js +111 -53
  45. package/lib/index.umd.min.js +1 -1
  46. package/lib/locale/lang/ar-EG.js +12 -2
  47. package/lib/locale/lang/ar-EG.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.umd.js +12 -2
  49. package/lib/locale/lang/de-DE.js +12 -2
  50. package/lib/locale/lang/de-DE.min.js +1 -1
  51. package/lib/locale/lang/de-DE.umd.js +12 -2
  52. package/lib/locale/lang/en-US.js +12 -2
  53. package/lib/locale/lang/en-US.min.js +1 -1
  54. package/lib/locale/lang/en-US.umd.js +12 -2
  55. package/lib/locale/lang/es-ES.js +12 -2
  56. package/lib/locale/lang/es-ES.min.js +1 -1
  57. package/lib/locale/lang/es-ES.umd.js +12 -2
  58. package/lib/locale/lang/fr-FR.js +12 -2
  59. package/lib/locale/lang/fr-FR.min.js +1 -1
  60. package/lib/locale/lang/fr-FR.umd.js +12 -2
  61. package/lib/locale/lang/hu-HU.js +12 -2
  62. package/lib/locale/lang/hu-HU.min.js +1 -1
  63. package/lib/locale/lang/hu-HU.umd.js +12 -2
  64. package/lib/locale/lang/hy-AM.js +12 -2
  65. package/lib/locale/lang/hy-AM.min.js +1 -1
  66. package/lib/locale/lang/hy-AM.umd.js +12 -2
  67. package/lib/locale/lang/id-ID.js +12 -2
  68. package/lib/locale/lang/id-ID.min.js +1 -1
  69. package/lib/locale/lang/id-ID.umd.js +12 -2
  70. package/lib/locale/lang/it-IT.js +12 -2
  71. package/lib/locale/lang/it-IT.min.js +1 -1
  72. package/lib/locale/lang/it-IT.umd.js +12 -2
  73. package/lib/locale/lang/ja-JP.js +12 -2
  74. package/lib/locale/lang/ja-JP.min.js +1 -1
  75. package/lib/locale/lang/ja-JP.umd.js +12 -2
  76. package/lib/locale/lang/ko-KR.js +12 -2
  77. package/lib/locale/lang/ko-KR.min.js +1 -1
  78. package/lib/locale/lang/ko-KR.umd.js +12 -2
  79. package/lib/locale/lang/ms-MY.js +12 -2
  80. package/lib/locale/lang/ms-MY.min.js +1 -1
  81. package/lib/locale/lang/ms-MY.umd.js +12 -2
  82. package/lib/locale/lang/nb-NO.js +12 -2
  83. package/lib/locale/lang/nb-NO.min.js +1 -1
  84. package/lib/locale/lang/nb-NO.umd.js +12 -2
  85. package/lib/locale/lang/pt-BR.js +12 -2
  86. package/lib/locale/lang/pt-BR.min.js +1 -1
  87. package/lib/locale/lang/pt-BR.umd.js +12 -2
  88. package/lib/locale/lang/ru-RU.js +12 -2
  89. package/lib/locale/lang/ru-RU.min.js +1 -1
  90. package/lib/locale/lang/ru-RU.umd.js +12 -2
  91. package/lib/locale/lang/th-TH.js +12 -2
  92. package/lib/locale/lang/th-TH.min.js +1 -1
  93. package/lib/locale/lang/th-TH.umd.js +12 -2
  94. package/lib/locale/lang/ug-CN.js +12 -2
  95. package/lib/locale/lang/ug-CN.min.js +1 -1
  96. package/lib/locale/lang/ug-CN.umd.js +12 -2
  97. package/lib/locale/lang/uk-UA.js +12 -2
  98. package/lib/locale/lang/uk-UA.min.js +1 -1
  99. package/lib/locale/lang/uk-UA.umd.js +12 -2
  100. package/lib/locale/lang/uz-UZ.js +12 -2
  101. package/lib/locale/lang/uz-UZ.min.js +1 -1
  102. package/lib/locale/lang/uz-UZ.umd.js +12 -2
  103. package/lib/locale/lang/vi-VN.js +12 -2
  104. package/lib/locale/lang/vi-VN.min.js +1 -1
  105. package/lib/locale/lang/vi-VN.umd.js +12 -2
  106. package/lib/locale/lang/zh-CHT.js +12 -2
  107. package/lib/locale/lang/zh-CHT.min.js +1 -1
  108. package/lib/locale/lang/zh-CHT.umd.js +12 -2
  109. package/lib/locale/lang/zh-CN.js +12 -2
  110. package/lib/locale/lang/zh-CN.min.js +1 -1
  111. package/lib/locale/lang/zh-CN.umd.js +12 -2
  112. package/lib/style.css +1 -1
  113. package/lib/style.min.css +1 -1
  114. package/lib/table/module/custom/hook.js +20 -5
  115. package/lib/table/module/custom/hook.min.js +1 -1
  116. package/lib/table/module/custom/panel.js +32 -15
  117. package/lib/table/module/custom/panel.min.js +1 -1
  118. package/lib/table/src/body.js +8 -5
  119. package/lib/table/src/body.min.js +1 -1
  120. package/lib/table/src/cell.js +17 -6
  121. package/lib/table/src/cell.min.js +1 -1
  122. package/lib/table/src/columnInfo.js +1 -0
  123. package/lib/table/src/columnInfo.min.js +1 -1
  124. package/lib/table/src/table.js +11 -11
  125. package/lib/table/src/table.min.js +1 -1
  126. package/lib/table/style/style.css +5 -1
  127. package/lib/table/style/style.min.css +1 -1
  128. package/lib/ui/index.js +8 -6
  129. package/lib/ui/index.min.js +1 -1
  130. package/lib/ui/src/log.js +1 -1
  131. package/lib/ui/src/log.min.js +1 -1
  132. package/lib/vxe-table/style/style.css +5 -1
  133. package/lib/vxe-table/style/style.min.css +1 -1
  134. package/package.json +1 -1
  135. package/packages/grid/src/grid.ts +1 -1
  136. package/packages/locale/lang/ar-EG.ts +12 -2
  137. package/packages/locale/lang/de-DE.ts +12 -2
  138. package/packages/locale/lang/en-US.ts +12 -2
  139. package/packages/locale/lang/es-ES.ts +12 -2
  140. package/packages/locale/lang/fr-FR.ts +12 -2
  141. package/packages/locale/lang/hu-HU.ts +12 -2
  142. package/packages/locale/lang/hy-AM.ts +12 -2
  143. package/packages/locale/lang/id-ID.ts +12 -2
  144. package/packages/locale/lang/it-IT.ts +12 -2
  145. package/packages/locale/lang/ja-JP.ts +12 -2
  146. package/packages/locale/lang/ko-KR.ts +12 -2
  147. package/packages/locale/lang/ms-MY.ts +12 -2
  148. package/packages/locale/lang/nb-NO.ts +12 -2
  149. package/packages/locale/lang/pt-BR.ts +12 -2
  150. package/packages/locale/lang/ru-RU.ts +12 -2
  151. package/packages/locale/lang/th-TH.ts +12 -2
  152. package/packages/locale/lang/ug-CN.ts +12 -2
  153. package/packages/locale/lang/uk-UA.ts +12 -2
  154. package/packages/locale/lang/uz-UZ.ts +12 -2
  155. package/packages/locale/lang/vi-VN.ts +12 -2
  156. package/packages/locale/lang/zh-CHT.ts +12 -2
  157. package/packages/locale/lang/zh-CN.ts +12 -2
  158. package/packages/table/module/custom/hook.ts +18 -5
  159. package/packages/table/module/custom/panel.ts +33 -15
  160. package/packages/table/src/body.ts +8 -5
  161. package/packages/table/src/cell.ts +23 -11
  162. package/packages/table/src/columnInfo.ts +1 -0
  163. package/packages/table/src/table.ts +46 -7
  164. package/packages/ui/index.ts +7 -5
  165. package/styles/components/table-module/custom.scss +5 -1
  166. /package/es/{iconfont.1750660623154.ttf → iconfont.1750813693750.ttf} +0 -0
  167. /package/es/{iconfont.1750660623154.woff → iconfont.1750813693750.woff} +0 -0
  168. /package/es/{iconfont.1750660623154.woff2 → iconfont.1750813693750.woff2} +0 -0
  169. /package/lib/{iconfont.1750660623154.ttf → iconfont.1750813693750.ttf} +0 -0
  170. /package/lib/{iconfont.1750660623154.woff → iconfont.1750813693750.woff} +0 -0
  171. /package/lib/{iconfont.1750660623154.woff2 → iconfont.1750813693750.woff2} +0 -0
@@ -70,7 +70,7 @@ VxeUI.hooks.add('tableCustomModule', {
70
70
  const saveCustom = () => {
71
71
  const { customColumnList, aggHandleFields, rowGroupList } = reactData;
72
72
  const customOpts = computeCustomOpts.value;
73
- const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
73
+ const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts;
74
74
  XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
75
75
  if (parentColumn) {
76
76
  // 更新子列信息
@@ -96,6 +96,9 @@ VxeUI.hooks.add('tableCustomModule', {
96
96
  if (allowVisible) {
97
97
  column.visible = column.renderVisible;
98
98
  }
99
+ if (allowGroup && allowValues) {
100
+ column.aggFunc = column.renderAggFn;
101
+ }
99
102
  });
100
103
  reactData.isCustomStatus = true;
101
104
  reactData.isDragColMove = true;
@@ -103,9 +106,9 @@ VxeUI.hooks.add('tableCustomModule', {
103
106
  reactData.isDragColMove = false;
104
107
  }, 1000);
105
108
  return $xeTable.saveCustomStore('confirm').then(() => {
106
- if ($xeTable.handlePivotTableAggregateData) {
109
+ if (allowGroup && allowValues && $xeTable.handlePivotTableAggregateData) {
107
110
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
108
- // 改动聚合分组
111
+ // 更新数据分组
109
112
  if (aggHandleFields.length) {
110
113
  $xeTable.setRowGroups(aggHandleFields);
111
114
  }
@@ -113,6 +116,10 @@ VxeUI.hooks.add('tableCustomModule', {
113
116
  $xeTable.clearRowGroups();
114
117
  }
115
118
  }
119
+ else {
120
+ // 更新聚合函数
121
+ $xeTable.handleUpdateAggData();
122
+ }
116
123
  }
117
124
  });
118
125
  };
@@ -196,7 +203,8 @@ VxeUI.hooks.add('tableCustomModule', {
196
203
  visible: true,
197
204
  resizable: options === true,
198
205
  fixed: options === true,
199
- sort: options === true
206
+ sort: options === true,
207
+ aggFunc: options === true
200
208
  }, options);
201
209
  XEUtils.eachTree(collectColumn, (column) => {
202
210
  if (opts.resizable) {
@@ -211,12 +219,16 @@ VxeUI.hooks.add('tableCustomModule', {
211
219
  if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
212
220
  column.visible = column.defaultVisible;
213
221
  }
222
+ if (opts.aggFunc) {
223
+ column.aggFunc = column.defaultAggFunc;
224
+ column.renderAggFn = column.defaultAggFunc;
225
+ }
214
226
  column.renderResizeWidth = column.renderWidth;
215
227
  });
216
228
  reactData.isCustomStatus = false;
217
229
  $xeTable.saveCustomStore('reset');
218
230
  return $xeTable.handleCustom().then(() => {
219
- if ($xeTable.handlePivotTableAggregateData) {
231
+ if (opts.aggFunc && $xeTable.handlePivotTableAggregateData) {
220
232
  const rowGroupFields = computeRowGroupFields.value;
221
233
  if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
222
234
  if (rowGroupFields && rowGroupFields.length) {
@@ -226,6 +238,9 @@ VxeUI.hooks.add('tableCustomModule', {
226
238
  $xeTable.clearRowGroups();
227
239
  }
228
240
  }
241
+ else {
242
+ $xeTable.handleUpdateAggData();
243
+ }
229
244
  }
230
245
  });
231
246
  },
@@ -31,12 +31,14 @@ export default defineVxeComponent({
31
31
  const refDragTipElem = ref();
32
32
  const customPanelReactData = reactive({
33
33
  dragCol: null,
34
- prevDragGroup: null,
35
- prevDragValues: null,
34
+ dragGroupField: null,
35
+ dragAggFnCol: null,
36
36
  dragTipText: ''
37
37
  });
38
38
  const customPanelInternalData = {
39
39
  // prevDragCol: undefined,
40
+ // prevDragGroupField: undefined,
41
+ // prevDragAggFnColid: undefined,
40
42
  // prevDragToChild: false,
41
43
  // prevDragPos: null
42
44
  };
@@ -208,8 +210,8 @@ export default defineVxeComponent({
208
210
  const { prevDragToChild } = customPanelInternalData;
209
211
  const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
210
212
  const customBodyRect = customBodyElem.getBoundingClientRect();
213
+ const dragLineEl = refDragLineElem.value;
211
214
  if (optEl) {
212
- const dragLineEl = refDragLineElem.value;
213
215
  if (dragLineEl) {
214
216
  if (showLine) {
215
217
  const optRect = optEl.getBoundingClientRect();
@@ -226,6 +228,11 @@ export default defineVxeComponent({
226
228
  }
227
229
  }
228
230
  }
231
+ else {
232
+ if (dragLineEl) {
233
+ dragLineEl.style.display = 'node';
234
+ }
235
+ }
229
236
  const dragTipEl = refDragTipElem.value;
230
237
  if (dragTipEl) {
231
238
  dragTipEl.style.display = 'block';
@@ -270,6 +277,8 @@ export default defineVxeComponent({
270
277
  const column = $xeTable.getColumnById(colid);
271
278
  trEl.draggable = true;
272
279
  customPanelReactData.dragCol = column;
280
+ customPanelReactData.dragGroupField = null;
281
+ customPanelReactData.dragAggFnCol = null;
273
282
  updateColDropTipContent();
274
283
  addClass(trEl, 'active--drag-origin');
275
284
  };
@@ -281,14 +290,16 @@ export default defineVxeComponent({
281
290
  hideDropTip();
282
291
  trEl.draggable = false;
283
292
  customPanelReactData.dragCol = null;
293
+ customPanelReactData.dragGroupField = null;
294
+ customPanelReactData.dragAggFnCol = null;
284
295
  removeClass(trEl, 'active--drag-origin');
285
296
  };
286
297
  const sortDragstartEvent = (evnt) => {
287
298
  if (evnt.dataTransfer) {
288
299
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
289
300
  }
290
- customPanelInternalData.prevDragGroup = null;
291
- customPanelInternalData.prevDragValues = null;
301
+ customPanelInternalData.prevDragGroupField = null;
302
+ customPanelInternalData.prevDragAggFnColid = null;
292
303
  };
293
304
  const sortDragendEvent = (evnt) => {
294
305
  const { mouseConfig } = tableProps;
@@ -300,9 +311,9 @@ export default defineVxeComponent({
300
311
  const columnDragOpts = computeColumnDragOpts.value;
301
312
  const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
302
313
  const { dragCol } = customPanelReactData;
303
- const { prevDragCol, prevDragGroup, prevDragValues, prevDragPos, prevDragToChild } = customPanelInternalData;
314
+ const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
304
315
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
305
- if (prevDragGroup || prevDragValues) {
316
+ if (prevDragGroupField || prevDragAggFnColid) {
306
317
  if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
307
318
  $xeTable.handlePivotTableAggregatePanelDragendEvent(evnt);
308
319
  }
@@ -461,8 +472,10 @@ export default defineVxeComponent({
461
472
  }
462
473
  hideDropTip();
463
474
  customPanelReactData.dragCol = null;
464
- customPanelInternalData.prevDragGroup = null;
465
- customPanelInternalData.prevDragValues = null;
475
+ customPanelReactData.dragGroupField = null;
476
+ customPanelReactData.dragAggFnCol = null;
477
+ customPanelInternalData.prevDragGroupField = null;
478
+ customPanelInternalData.prevDragAggFnColid = null;
466
479
  trEl.draggable = false;
467
480
  trEl.removeAttribute('drag-pos');
468
481
  removeClass(trEl, 'active--drag-target');
@@ -478,14 +491,15 @@ export default defineVxeComponent({
478
491
  const colid = optEl.getAttribute('colid');
479
492
  const column = $xeTable.getColumnById(colid);
480
493
  const { dragCol } = customPanelReactData;
481
- customPanelInternalData.prevDragGroup = null;
482
- customPanelInternalData.prevDragValues = null;
494
+ customPanelInternalData.prevDragGroupField = null;
495
+ customPanelInternalData.prevDragAggFnColid = null;
483
496
  // 是否移入有效列
484
497
  if (column && (isCrossDrag || column.level === 1)) {
485
498
  evnt.preventDefault();
486
499
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
487
500
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
488
- if ((dragCol && dragCol.id === column.id) ||
501
+ if (!dragCol ||
502
+ (dragCol && dragCol.id === column.id) ||
489
503
  (!isCrossDrag && column.level > 1) ||
490
504
  (!immediate && column.level > 1) ||
491
505
  column.renderFixed) {
@@ -687,7 +701,7 @@ export default defineVxeComponent({
687
701
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
688
702
  'is--active': customStore.visible
689
703
  }],
690
- style: maxHeight && !['left', 'right'].includes(placement)
704
+ style: maxHeight && !['left', 'right'].includes(placement || '')
691
705
  ? {
692
706
  maxHeight: `${maxHeight}px`
693
707
  }
@@ -815,7 +829,7 @@ export default defineVxeComponent({
815
829
  const renderPopupPanel = () => {
816
830
  const $xeGrid = $xeTable.xeGrid;
817
831
  const { customStore } = props;
818
- const { resizable: allResizable } = tableProps;
832
+ const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps;
819
833
  const { isCustomStatus, customColumnList } = tableReactData;
820
834
  const customOpts = computeCustomOpts.value;
821
835
  const { immediate } = customOpts;
@@ -1082,7 +1096,12 @@ export default defineVxeComponent({
1082
1096
  }, $xeTable.callSlot(bottomSlot, params))
1083
1097
  : renderEmptyElement($xeTable),
1084
1098
  renderDragTip()
1085
- ])
1099
+ ]),
1100
+ !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
1101
+ ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1102
+ customStore
1103
+ })
1104
+ : renderEmptyElement($xeTable)
1086
1105
  ]);
1087
1106
  },
1088
1107
  footer: () => {
@@ -209,6 +209,7 @@ export default defineVxeComponent({
209
209
  $xeTable.triggerCellDblclickEvent(evnt, cellParams);
210
210
  };
211
211
  let isMergeCell = false;
212
+ let mergeColspan = 1;
212
213
  let mergeRowspan = 1;
213
214
  // 合并行或列
214
215
  if (mergeBodyFlag && mergeBodyList.length) {
@@ -225,6 +226,7 @@ export default defineVxeComponent({
225
226
  }
226
227
  if (colspan > 1) {
227
228
  isMergeCell = true;
229
+ mergeColspan = colspan;
228
230
  tdAttrs.colspan = colspan;
229
231
  }
230
232
  }
@@ -242,6 +244,7 @@ export default defineVxeComponent({
242
244
  }
243
245
  if (colspan > 1) {
244
246
  isMergeCell = true;
247
+ mergeColspan = colspan;
245
248
  tdAttrs.colspan = colspan;
246
249
  }
247
250
  }
@@ -281,16 +284,16 @@ export default defineVxeComponent({
281
284
  }
282
285
  const tcStyle = {};
283
286
  if (hasEllipsis && resizeWidthFlag) {
284
- let tsColspan = tdAttrs.colspan || 0;
285
- if (tsColspan > 1) {
286
- for (let index = 1; index < tsColspan; index++) {
287
+ let mergeColWidth = 0;
288
+ if (mergeColspan > 1) {
289
+ for (let index = 1; index < mergeColspan; index++) {
287
290
  const nextColumn = visibleColumn[columnIndex + index];
288
291
  if (nextColumn) {
289
- tsColspan += nextColumn.renderWidth;
292
+ mergeColWidth += nextColumn.renderWidth;
290
293
  }
291
294
  }
292
295
  }
293
- tcStyle.width = `${column.renderWidth - (cellOffsetWidth * tsColspan)}px`;
296
+ tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`;
294
297
  }
295
298
  if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
296
299
  tcStyle.height = `${cellHeight}px`;
@@ -146,13 +146,25 @@ function renderHeaderCellBaseVNs(params, content) {
146
146
  ];
147
147
  return vns;
148
148
  }
149
+ function getRenderDefaultColumnTitle(column, content) {
150
+ if (column.type === 'html' && XEUtils.isString(content)) {
151
+ return h('span', {
152
+ key: 'ch',
153
+ innerHTML: content
154
+ });
155
+ }
156
+ return h('span', {
157
+ key: 'ct'
158
+ }, getSlotVNs(content));
159
+ }
149
160
  function renderTitleContent(params, content) {
150
161
  const { $table, column } = params;
151
162
  const tableProps = $table.props;
152
163
  const tableReactData = $table.reactData;
153
164
  const { computeTooltipOpts } = $table.getComputeMaps();
154
165
  const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
155
- const { type, showHeaderOverflow } = column;
166
+ const { isRowGroupStatus } = tableReactData;
167
+ const { showHeaderOverflow } = column;
156
168
  const tooltipOpts = computeTooltipOpts.value;
157
169
  const showAllTip = tooltipOpts.showAll;
158
170
  const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
@@ -182,10 +194,13 @@ function renderTitleContent(params, content) {
182
194
  }
183
195
  };
184
196
  }
197
+ const titleVN = getRenderDefaultColumnTitle(column, content);
185
198
  return [
186
- type === 'html' && XEUtils.isString(content)
187
- ? h('span', Object.assign({ class: 'vxe-cell--title', innerHTML: content }, ons))
188
- : h('span', Object.assign({ class: 'vxe-cell--title' }, ons), getSlotVNs(content))
199
+ h('span', Object.assign({ class: 'vxe-cell--title' }, ons), isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles
200
+ ? $table.getPivotTableAggregateRenderColTitles(column, titleVN)
201
+ : [
202
+ titleVN
203
+ ])
189
204
  ];
190
205
  }
191
206
  function getFooterContent(params) {
@@ -101,6 +101,7 @@ export class ColumnInfo {
101
101
  halfVisible: false,
102
102
  defaultVisible: visible,
103
103
  defaultFixed: _vm.fixed,
104
+ defaultAggFunc: _vm.aggFunc,
104
105
  checked: false,
105
106
  halfChecked: false,
106
107
  disabled: false,
@@ -235,6 +235,7 @@ export default defineVxeComponent({
235
235
  isRowGroupStatus: false,
236
236
  rowGroupList: [],
237
237
  aggHandleFields: [],
238
+ aggHandleAggColumns: [],
238
239
  rowGroupExpandedFlag: 1,
239
240
  rowExpandedFlag: 1,
240
241
  treeExpandedFlag: 1,
@@ -1431,7 +1432,8 @@ export default defineVxeComponent({
1431
1432
  const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
1432
1433
  const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
1433
1434
  const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
1434
- if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
1435
+ const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
1436
+ if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
1435
1437
  if (!tableId) {
1436
1438
  errLog('vxe.error.reqProp', ['id']);
1437
1439
  return;
@@ -3002,6 +3004,16 @@ export default defineVxeComponent({
3002
3004
  }
3003
3005
  });
3004
3006
  };
3007
+ const handleUpdateAggValues = () => {
3008
+ const { visibleColumn } = internalData;
3009
+ const aggCols = [];
3010
+ visibleColumn.forEach(column => {
3011
+ if (column.aggFunc) {
3012
+ aggCols.push(column);
3013
+ }
3014
+ });
3015
+ reactData.aggHandleAggColumns = aggCols;
3016
+ };
3005
3017
  const handleUpdateRowGroup = (groupFields) => {
3006
3018
  const aggFields = [];
3007
3019
  const aggConfs = [];
@@ -3015,6 +3027,7 @@ export default defineVxeComponent({
3015
3027
  }
3016
3028
  reactData.rowGroupList = aggConfs;
3017
3029
  reactData.aggHandleFields = aggFields;
3030
+ handleUpdateAggValues();
3018
3031
  };
3019
3032
  const handleeGroupSummary = (aggList) => {
3020
3033
  const aggregateOpts = computeAggregateOpts.value;
@@ -3497,6 +3510,7 @@ export default defineVxeComponent({
3497
3510
  }
3498
3511
  });
3499
3512
  handleTableColumn();
3513
+ handleUpdateAggValues();
3500
3514
  if (isReset) {
3501
3515
  updateColumnOffsetLeft();
3502
3516
  return $xeTable.updateFooter().then(() => {
@@ -6079,7 +6093,6 @@ export default defineVxeComponent({
6079
6093
  },
6080
6094
  setRowGroups(fieldOrColumns) {
6081
6095
  const { aggregateConfig, rowGroupConfig } = props;
6082
- const { rowGroupList } = reactData;
6083
6096
  const aggregateOpts = computeAggregateOpts.value;
6084
6097
  const { maxGroupSize } = aggregateOpts;
6085
6098
  if (!(aggregateConfig || rowGroupConfig)) {
@@ -6087,7 +6100,7 @@ export default defineVxeComponent({
6087
6100
  return nextTick();
6088
6101
  }
6089
6102
  const confList = fieldOrColumns ? (XEUtils.isArray(fieldOrColumns) ? fieldOrColumns : [fieldOrColumns]) : [];
6090
- if (maxGroupSize && (rowGroupList.length + confList.length > maxGroupSize)) {
6103
+ if (maxGroupSize && confList.length > maxGroupSize) {
6091
6104
  if (VxeUI.modal) {
6092
6105
  VxeUI.modal.message({
6093
6106
  status: 'error',
@@ -6619,15 +6632,18 @@ export default defineVxeComponent({
6619
6632
  const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
6620
6633
  const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
6621
6634
  const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
6635
+ const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
6622
6636
  const resizableData = {};
6623
6637
  const sortData = {};
6624
6638
  const visibleData = {};
6625
6639
  const fixedData = {};
6640
+ const aggFuncData = {};
6626
6641
  const storeData = {
6627
6642
  resizableData: undefined,
6628
6643
  sortData: undefined,
6629
6644
  visibleData: undefined,
6630
- fixedData: undefined
6645
+ fixedData: undefined,
6646
+ aggFuncData: undefined
6631
6647
  };
6632
6648
  if (!id) {
6633
6649
  if (storage) {
@@ -6639,6 +6655,7 @@ export default defineVxeComponent({
6639
6655
  let hasSort = 0;
6640
6656
  let hasFixed = 0;
6641
6657
  let hasVisible = 0;
6658
+ let hasAggFunc = 0;
6642
6659
  XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
6643
6660
  const colKey = column.getKey();
6644
6661
  if (!colKey) {
@@ -6670,6 +6687,10 @@ export default defineVxeComponent({
6670
6687
  visibleData[colKey] = true;
6671
6688
  }
6672
6689
  }
6690
+ if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
6691
+ hasAggFunc = 1;
6692
+ aggFuncData[colKey] = column.aggFunc;
6693
+ }
6673
6694
  });
6674
6695
  if (hasResizable) {
6675
6696
  storeData.resizableData = resizableData;
@@ -6683,6 +6704,9 @@ export default defineVxeComponent({
6683
6704
  if (hasVisible) {
6684
6705
  storeData.visibleData = visibleData;
6685
6706
  }
6707
+ if (hasAggFunc) {
6708
+ storeData.aggFuncData = aggFuncData;
6709
+ }
6686
6710
  return storeData;
6687
6711
  },
6688
6712
  focus() {
@@ -8126,11 +8150,12 @@ export default defineVxeComponent({
8126
8150
  const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
8127
8151
  const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
8128
8152
  const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
8153
+ const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
8129
8154
  if (type !== 'reset') {
8130
8155
  // fix:修复拖动列宽,重置按钮无法点击的问题
8131
8156
  reactData.isCustomStatus = true;
8132
8157
  }
8133
- if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
8158
+ if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
8134
8159
  if (!tableId) {
8135
8160
  errLog('vxe.error.reqProp', ['id']);
8136
8161
  return nextTick();
@@ -10484,6 +10509,9 @@ export default defineVxeComponent({
10484
10509
  }
10485
10510
  }
10486
10511
  },
10512
+ handleUpdateAggData() {
10513
+ return loadTableData(internalData.tableSynchData, true);
10514
+ },
10487
10515
  updateZindex() {
10488
10516
  if (props.zIndex) {
10489
10517
  internalData.tZindex = props.zIndex;
@@ -11460,6 +11488,16 @@ export default defineVxeComponent({
11460
11488
  return;
11461
11489
  }
11462
11490
  }
11491
+ if (!$xeTable.handlePivotTableAggregateData) {
11492
+ if (customOpts.allowGroup) {
11493
+ errLog('vxe.error.notProp', ['custom-config.allowGroup']);
11494
+ return;
11495
+ }
11496
+ if (customOpts.allowValues) {
11497
+ errLog('vxe.error.notProp', ['custom-config.allowValues']);
11498
+ return;
11499
+ }
11500
+ }
11463
11501
  if (treeConfig && rowOpts.drag && !treeOpts.transform) {
11464
11502
  errLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true']);
11465
11503
  }
@@ -11472,8 +11510,8 @@ export default defineVxeComponent({
11472
11510
  if (aggregateOpts.countFields) {
11473
11511
  warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func']);
11474
11512
  }
11475
- if (aggregateOpts.countMethod) {
11476
- warnLog('vxe.error.delProp', ['row-group-config.countMethod', 'aggregate-config.aggregateMethod']);
11513
+ if (aggregateOpts.aggregateMethod) {
11514
+ warnLog('vxe.error.delProp', ['row-group-config.aggregateMethod', 'aggregate-config.countMethod']);
11477
11515
  }
11478
11516
  if (props.treeConfig && treeOpts.children) {
11479
11517
  warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField']);
@@ -999,13 +999,17 @@
999
999
 
1000
1000
  .vxe-table-custom-popup--body-wrapper {
1001
1001
  position: relative;
1002
- overflow: auto;
1002
+ display: flex;
1003
+ flex-direction: column;
1004
+ overflow: hidden;
1003
1005
  height: 100%;
1004
1006
  outline: 0;
1005
1007
  }
1006
1008
 
1007
1009
  .vxe-table-custom-popup--handle-wrapper {
1010
+ flex-grow: 1;
1008
1011
  outline: 0;
1012
+ overflow: auto;
1009
1013
  }
1010
1014
 
1011
1015
  .vxe-table-custom-popup--table-wrapper {