vxe-table 4.19.2 → 4.19.3

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 (165) hide show
  1. package/dist/all.esm.js +278 -97
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/ar-EG.js +4 -0
  7. package/es/locale/lang/de-DE.js +4 -0
  8. package/es/locale/lang/en-US.js +4 -0
  9. package/es/locale/lang/es-ES.js +4 -0
  10. package/es/locale/lang/fr-FR.js +4 -0
  11. package/es/locale/lang/hu-HU.js +4 -0
  12. package/es/locale/lang/hy-AM.js +4 -0
  13. package/es/locale/lang/id-ID.js +4 -0
  14. package/es/locale/lang/it-IT.js +4 -0
  15. package/es/locale/lang/ja-JP.js +4 -0
  16. package/es/locale/lang/ko-KR.js +4 -0
  17. package/es/locale/lang/ms-MY.js +4 -0
  18. package/es/locale/lang/nb-NO.js +4 -0
  19. package/es/locale/lang/pt-BR.js +4 -0
  20. package/es/locale/lang/ru-RU.js +4 -0
  21. package/es/locale/lang/th-TH.js +4 -0
  22. package/es/locale/lang/ug-CN.js +4 -0
  23. package/es/locale/lang/uk-UA.js +4 -0
  24. package/es/locale/lang/uz-UZ.js +4 -0
  25. package/es/locale/lang/vi-VN.js +4 -0
  26. package/es/locale/lang/zh-CHT.js +4 -0
  27. package/es/locale/lang/zh-CN.js +4 -0
  28. package/es/style.css +1 -1
  29. package/es/style.min.css +1 -1
  30. package/es/table/module/custom/panel.js +28 -20
  31. package/es/table/module/export/export-panel.js +27 -16
  32. package/es/table/module/export/hook.js +120 -27
  33. package/es/table/src/table.js +94 -31
  34. package/es/table/src/util.js +3 -1
  35. package/es/table/style.css +1 -1
  36. package/es/table/style.min.css +1 -1
  37. package/es/ui/index.js +1 -1
  38. package/es/ui/src/log.js +1 -1
  39. package/es/vxe-table/style.css +1 -1
  40. package/es/vxe-table/style.min.css +1 -1
  41. package/lib/index.css +1 -1
  42. package/lib/index.min.css +1 -1
  43. package/lib/index.umd.js +204 -67
  44. package/lib/index.umd.min.js +1 -1
  45. package/lib/locale/lang/ar-EG.js +4 -0
  46. package/lib/locale/lang/ar-EG.min.js +1 -1
  47. package/lib/locale/lang/ar-EG.umd.js +4 -0
  48. package/lib/locale/lang/de-DE.js +4 -0
  49. package/lib/locale/lang/de-DE.min.js +1 -1
  50. package/lib/locale/lang/de-DE.umd.js +4 -0
  51. package/lib/locale/lang/en-US.js +4 -0
  52. package/lib/locale/lang/en-US.min.js +1 -1
  53. package/lib/locale/lang/en-US.umd.js +4 -0
  54. package/lib/locale/lang/es-ES.js +4 -0
  55. package/lib/locale/lang/es-ES.min.js +1 -1
  56. package/lib/locale/lang/es-ES.umd.js +4 -0
  57. package/lib/locale/lang/fr-FR.js +4 -0
  58. package/lib/locale/lang/fr-FR.min.js +1 -1
  59. package/lib/locale/lang/fr-FR.umd.js +4 -0
  60. package/lib/locale/lang/hu-HU.js +4 -0
  61. package/lib/locale/lang/hu-HU.min.js +1 -1
  62. package/lib/locale/lang/hu-HU.umd.js +4 -0
  63. package/lib/locale/lang/hy-AM.js +4 -0
  64. package/lib/locale/lang/hy-AM.min.js +1 -1
  65. package/lib/locale/lang/hy-AM.umd.js +4 -0
  66. package/lib/locale/lang/id-ID.js +4 -0
  67. package/lib/locale/lang/id-ID.min.js +1 -1
  68. package/lib/locale/lang/id-ID.umd.js +4 -0
  69. package/lib/locale/lang/it-IT.js +4 -0
  70. package/lib/locale/lang/it-IT.min.js +1 -1
  71. package/lib/locale/lang/it-IT.umd.js +4 -0
  72. package/lib/locale/lang/ja-JP.js +4 -0
  73. package/lib/locale/lang/ja-JP.min.js +1 -1
  74. package/lib/locale/lang/ja-JP.umd.js +4 -0
  75. package/lib/locale/lang/ko-KR.js +4 -0
  76. package/lib/locale/lang/ko-KR.min.js +1 -1
  77. package/lib/locale/lang/ko-KR.umd.js +4 -0
  78. package/lib/locale/lang/ms-MY.js +4 -0
  79. package/lib/locale/lang/ms-MY.min.js +1 -1
  80. package/lib/locale/lang/ms-MY.umd.js +4 -0
  81. package/lib/locale/lang/nb-NO.js +4 -0
  82. package/lib/locale/lang/nb-NO.min.js +1 -1
  83. package/lib/locale/lang/nb-NO.umd.js +4 -0
  84. package/lib/locale/lang/pt-BR.js +4 -0
  85. package/lib/locale/lang/pt-BR.min.js +1 -1
  86. package/lib/locale/lang/pt-BR.umd.js +4 -0
  87. package/lib/locale/lang/ru-RU.js +4 -0
  88. package/lib/locale/lang/ru-RU.min.js +1 -1
  89. package/lib/locale/lang/ru-RU.umd.js +4 -0
  90. package/lib/locale/lang/th-TH.js +4 -0
  91. package/lib/locale/lang/th-TH.min.js +1 -1
  92. package/lib/locale/lang/th-TH.umd.js +4 -0
  93. package/lib/locale/lang/ug-CN.js +4 -0
  94. package/lib/locale/lang/ug-CN.min.js +1 -1
  95. package/lib/locale/lang/ug-CN.umd.js +4 -0
  96. package/lib/locale/lang/uk-UA.js +4 -0
  97. package/lib/locale/lang/uk-UA.min.js +1 -1
  98. package/lib/locale/lang/uk-UA.umd.js +4 -0
  99. package/lib/locale/lang/uz-UZ.js +4 -0
  100. package/lib/locale/lang/uz-UZ.min.js +1 -1
  101. package/lib/locale/lang/uz-UZ.umd.js +4 -0
  102. package/lib/locale/lang/vi-VN.js +4 -0
  103. package/lib/locale/lang/vi-VN.min.js +1 -1
  104. package/lib/locale/lang/vi-VN.umd.js +4 -0
  105. package/lib/locale/lang/zh-CHT.js +4 -0
  106. package/lib/locale/lang/zh-CHT.min.js +1 -1
  107. package/lib/locale/lang/zh-CHT.umd.js +4 -0
  108. package/lib/locale/lang/zh-CN.js +4 -0
  109. package/lib/locale/lang/zh-CN.min.js +1 -1
  110. package/lib/locale/lang/zh-CN.umd.js +4 -0
  111. package/lib/style.css +1 -1
  112. package/lib/style.min.css +1 -1
  113. package/lib/table/module/custom/panel.js +29 -18
  114. package/lib/table/module/custom/panel.min.js +1 -1
  115. package/lib/table/module/export/export-panel.js +22 -13
  116. package/lib/table/module/export/export-panel.min.js +1 -1
  117. package/lib/table/module/export/hook.js +139 -28
  118. package/lib/table/module/export/hook.min.js +1 -1
  119. package/lib/table/src/table.js +5 -5
  120. package/lib/table/src/table.min.js +1 -1
  121. package/lib/table/src/util.js +3 -1
  122. package/lib/table/src/util.min.js +1 -1
  123. package/lib/table/style/style.css +1 -1
  124. package/lib/table/style/style.min.css +1 -1
  125. package/lib/ui/index.js +1 -1
  126. package/lib/ui/index.min.js +1 -1
  127. package/lib/ui/src/log.js +1 -1
  128. package/lib/ui/src/log.min.js +1 -1
  129. package/lib/vxe-table/style/style.css +1 -1
  130. package/lib/vxe-table/style/style.min.css +1 -1
  131. package/package.json +2 -2
  132. package/packages/locale/lang/ar-EG.ts +4 -0
  133. package/packages/locale/lang/de-DE.ts +4 -0
  134. package/packages/locale/lang/en-US.ts +4 -0
  135. package/packages/locale/lang/es-ES.ts +4 -0
  136. package/packages/locale/lang/fr-FR.ts +4 -0
  137. package/packages/locale/lang/hu-HU.ts +4 -0
  138. package/packages/locale/lang/hy-AM.ts +4 -0
  139. package/packages/locale/lang/id-ID.ts +4 -0
  140. package/packages/locale/lang/it-IT.ts +4 -0
  141. package/packages/locale/lang/ja-JP.ts +4 -0
  142. package/packages/locale/lang/ko-KR.ts +4 -0
  143. package/packages/locale/lang/ms-MY.ts +4 -0
  144. package/packages/locale/lang/nb-NO.ts +4 -0
  145. package/packages/locale/lang/pt-BR.ts +4 -0
  146. package/packages/locale/lang/ru-RU.ts +4 -0
  147. package/packages/locale/lang/th-TH.ts +4 -0
  148. package/packages/locale/lang/ug-CN.ts +4 -0
  149. package/packages/locale/lang/uk-UA.ts +4 -0
  150. package/packages/locale/lang/uz-UZ.ts +4 -0
  151. package/packages/locale/lang/vi-VN.ts +4 -0
  152. package/packages/locale/lang/zh-CHT.ts +4 -0
  153. package/packages/locale/lang/zh-CN.ts +4 -0
  154. package/packages/table/module/custom/panel.ts +29 -21
  155. package/packages/table/module/export/export-panel.ts +27 -16
  156. package/packages/table/module/export/hook.ts +121 -28
  157. package/packages/table/src/table.ts +96 -31
  158. package/packages/table/src/util.ts +3 -1
  159. package/styles/components/table-module/export.scss +1 -1
  160. /package/es/{iconfont.1779778422561.ttf → iconfont.1779843543280.ttf} +0 -0
  161. /package/es/{iconfont.1779778422561.woff → iconfont.1779843543280.woff} +0 -0
  162. /package/es/{iconfont.1779778422561.woff2 → iconfont.1779843543280.woff2} +0 -0
  163. /package/lib/{iconfont.1779778422561.ttf → iconfont.1779843543280.ttf} +0 -0
  164. /package/lib/{iconfont.1779778422561.woff → iconfont.1779843543280.woff} +0 -0
  165. /package/lib/{iconfont.1779778422561.woff2 → iconfont.1779843543280.woff2} +0 -0
@@ -322,7 +322,7 @@ export default defineVxeComponent({
322
322
  const { immediate } = customOpts;
323
323
  const trEl = evnt.currentTarget;
324
324
  const columnDragOpts = computeColumnDragOpts.value;
325
- const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
325
+ const { isCrossDrag, isPeerDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
326
326
  const { dragCol } = customPanelReactData;
327
327
  const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
328
328
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
@@ -360,20 +360,28 @@ export default defineVxeComponent({
360
360
  if (immediate) {
361
361
  if (dragColumn.parentId && newColumn.parentId) {
362
362
  // 子到子
363
- if (!isCrossDrag) {
364
- return;
363
+ if (isPeerDrag && !isCrossDrag) {
364
+ if (dragColumn.parentId !== newColumn.parentId) {
365
+ // 非同级
366
+ return;
367
+ }
365
368
  }
366
- if (oldAllMaps[newColumn.id]) {
367
- isSelfToChildStatus = true;
368
- if (!(isCrossDrag && isSelfToChildDrag)) {
369
- if (VxeUI.modal) {
370
- VxeUI.modal.message({
371
- status: 'error',
372
- content: getI18n('vxe.error.treeDragChild')
373
- });
374
- }
369
+ else {
370
+ if (!isCrossDrag) {
375
371
  return;
376
372
  }
373
+ if (oldAllMaps[newColumn.id]) {
374
+ isSelfToChildStatus = true;
375
+ if (!(isCrossDrag && isSelfToChildDrag)) {
376
+ if (VxeUI.modal) {
377
+ VxeUI.modal.message({
378
+ status: 'error',
379
+ content: getI18n('vxe.error.treeDragChild')
380
+ });
381
+ }
382
+ return;
383
+ }
384
+ }
377
385
  }
378
386
  }
379
387
  else if (dragColumn.parentId) {
@@ -500,7 +508,7 @@ export default defineVxeComponent({
500
508
  const customOpts = computeCustomOpts.value;
501
509
  const { showSortDragButton, allowSort, immediate } = customOpts;
502
510
  const columnDragOpts = computeColumnDragOpts.value;
503
- const { isCrossDrag, isToChildDrag } = columnDragOpts;
511
+ const { isCrossDrag, isPeerDrag, isToChildDrag } = columnDragOpts;
504
512
  const optEl = evnt.currentTarget;
505
513
  const isControlKey = hasControlKey(evnt);
506
514
  const colid = optEl.getAttribute('colid');
@@ -509,16 +517,16 @@ export default defineVxeComponent({
509
517
  customPanelInternalData.prevDragGroupField = null;
510
518
  customPanelInternalData.prevDragAggFnColid = null;
511
519
  // 是否移入有效列
512
- if (column && (isCrossDrag || column.level === 1)) {
520
+ if (column && (isCrossDrag || isPeerDrag || column.level === 1)) {
513
521
  evnt.preventDefault();
514
522
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
515
523
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
516
524
  if (!dragCol ||
517
525
  !(showSortDragButton && allowSort) ||
518
526
  (dragCol && dragCol.id === column.id) ||
519
- (!isCrossDrag && column.level > 1) ||
527
+ (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.level > 1)) ||
520
528
  (!immediate && column.level > 1) ||
521
- (!isCrossDrag && dragCol.level > 1) ||
529
+ (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : dragCol.level > 1)) ||
522
530
  (!immediate && dragCol.level > 1)) {
523
531
  showDropTip(evnt, optEl, false, dragPos);
524
532
  return;
@@ -653,7 +661,7 @@ export default defineVxeComponent({
653
661
  const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
654
662
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
655
663
  const vSize = computeSize.value;
656
- const { isCrossDrag } = columnDragOpts;
664
+ const { isCrossDrag, isPeerDrag } = columnDragOpts;
657
665
  const slots = customOpts.slots || {};
658
666
  const headerSlot = slots.header;
659
667
  const topSlot = slots.top;
@@ -687,7 +695,7 @@ export default defineVxeComponent({
687
695
  const colTitle = formatText(column.getTitle(), 1);
688
696
  const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
689
697
  const isHidden = !isChecked;
690
- const showSortBtn = ((isCrossDrag ? immediate : false) || column.level === 1);
698
+ const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
691
699
  colVNs.push(h('li', {
692
700
  key: column.id,
693
701
  colid: column.id,
@@ -983,7 +991,7 @@ export default defineVxeComponent({
983
991
  const modalOpts = Object.assign({}, modalOptions);
984
992
  const drawerOpts = Object.assign({}, drawerOptions);
985
993
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
986
- const { isCrossDrag } = columnDragOpts;
994
+ const { isCrossDrag, isPeerDrag } = columnDragOpts;
987
995
  const slots = customOpts.slots || {};
988
996
  const headerSlot = slots.header;
989
997
  const topSlot = slots.top;
@@ -1030,7 +1038,7 @@ export default defineVxeComponent({
1030
1038
  const isColGroup = column.children && column.children.length;
1031
1039
  const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
1032
1040
  const isHidden = !isChecked;
1033
- const showSortBtn = ((isCrossDrag ? immediate : false) || column.level === 1);
1041
+ const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
1034
1042
  trVNs.push(h('tr', {
1035
1043
  key: column.id,
1036
1044
  colid: column.id,
@@ -150,7 +150,7 @@ export default defineVxeComponent({
150
150
  const $xeGantt = $xeTable.xeGantt;
151
151
  const { defaultOptions, storeData } = props;
152
152
  const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData;
153
- const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData;
153
+ const { hasTree, hasRowGroup, hasMerge, isPrint, hasColgroup, columns } = storeData;
154
154
  const { isHeader } = defaultOptions;
155
155
  const colVNs = [];
156
156
  const checkedAll = computeCheckedAll.value;
@@ -380,6 +380,17 @@ export default defineVxeComponent({
380
380
  }
381
381
  })
382
382
  : renderEmptyElement($xeTable),
383
+ VxeUICheckboxComponent
384
+ ? h(VxeUICheckboxComponent, {
385
+ modelValue: defaultOptions.isFooter,
386
+ disabled: !storeData.hasFooter,
387
+ title: getI18n('vxe.export.expFooterTitle'),
388
+ content: getI18n('vxe.export.expOptFooter'),
389
+ 'onUpdate:modelValue'(value) {
390
+ defaultOptions.isFooter = value;
391
+ }
392
+ })
393
+ : renderEmptyElement($xeTable),
383
394
  VxeUICheckboxComponent
384
395
  ? h(VxeUICheckboxComponent, {
385
396
  modelValue: isHeader ? defaultOptions.isTitle : false,
@@ -438,30 +449,30 @@ export default defineVxeComponent({
438
449
  'onUpdate:modelValue'(value) {
439
450
  defaultOptions.useStyle = value;
440
451
  }
441
- }),
452
+ })
453
+ ]),
454
+ h('div', {
455
+ class: 'vxe-table-export--panel-option-row'
456
+ }, [
442
457
  VxeUICheckboxComponent
443
458
  ? h(VxeUICheckboxComponent, {
444
- modelValue: hasTree ? defaultOptions.isAllExpand : false,
459
+ modelValue: hasTree ? defaultOptions.isTreeAllExpanded : false,
445
460
  disabled: hasEmptyData || !hasTree,
446
- title: getI18n('vxe.export.expAllExpandTitle'),
447
- content: getI18n('vxe.export.expOptAllExpand'),
461
+ title: getI18n('vxe.export.expTreeAllExpandTitle'),
462
+ content: getI18n('vxe.export.expOptTreeAllExpand'),
448
463
  'onUpdate:modelValue'(value) {
449
- defaultOptions.isAllExpand = value;
464
+ defaultOptions.isTreeAllExpanded = value;
450
465
  }
451
466
  })
452
- : renderEmptyElement($xeTable)
453
- ]),
454
- h('div', {
455
- class: 'vxe-table-export--panel-option-row'
456
- }, [
467
+ : renderEmptyElement($xeTable),
457
468
  VxeUICheckboxComponent
458
469
  ? h(VxeUICheckboxComponent, {
459
- modelValue: defaultOptions.isFooter,
460
- disabled: !storeData.hasFooter,
461
- title: getI18n('vxe.export.expFooterTitle'),
462
- content: getI18n('vxe.export.expOptFooter'),
470
+ modelValue: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
471
+ disabled: hasEmptyData || !hasRowGroup,
472
+ title: getI18n('vxe.export.expRowGroupAllExpandTitle'),
473
+ content: getI18n('vxe.export.expOptRowGroupAllExpand'),
463
474
  'onUpdate:modelValue'(value) {
464
- defaultOptions.isFooter = value;
475
+ defaultOptions.isRowGroupAllExpanded = value;
465
476
  }
466
477
  })
467
478
  : renderEmptyElement($xeTable)
@@ -256,12 +256,7 @@ const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'save
256
256
  hooks.add('tableExportModule', {
257
257
  setupTable($xeTable) {
258
258
  const { props, reactData, internalData } = $xeTable;
259
- const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts } = $xeTable.getComputeMaps();
260
- const hasTreeChildren = (row) => {
261
- const treeOpts = computeTreeOpts.value;
262
- const childrenField = treeOpts.children || treeOpts.childrenField;
263
- return row[childrenField] && row[childrenField].length;
264
- };
259
+ const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts } = $xeTable.getComputeMaps();
265
260
  const getSeq = (cellValue, row, $rowIndex, column, $columnIndex) => {
266
261
  const seqOpts = computeSeqOpts.value;
267
262
  const seqMd = seqOpts.seqMethod || column.seqMethod;
@@ -292,32 +287,119 @@ hooks.add('tableExportModule', {
292
287
  return eqEmptyValue(cellValue) ? '' : `${cellValue}`;
293
288
  };
294
289
  const getBodyLabelData = (opts, columns, datas) => {
295
- const { isAllExpand, mode } = opts;
290
+ const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts;
296
291
  const { treeConfig } = props;
292
+ const { isRowGroupStatus } = reactData;
297
293
  const radioOpts = computeRadioOpts.value;
298
294
  const checkboxOpts = computeCheckboxOpts.value;
299
295
  const treeOpts = computeTreeOpts.value;
300
296
  const columnOpts = computeColumnOpts.value;
297
+ const aggregateOpts = computeAggregateOpts.value;
301
298
  if (!htmlCellElem) {
302
299
  htmlCellElem = document.createElement('div');
303
300
  }
301
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
302
+ if (isRowGroupStatus) {
303
+ // 如果是数据分组
304
+ const { mapChildrenField } = aggregateOpts;
305
+ const rest = [];
306
+ const expandMaps = {};
307
+ const useMaps = {};
308
+ XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
309
+ const row = item._row || item;
310
+ const rowid = handleGetRowId(row);
311
+ if (useMaps[rowid]) {
312
+ return;
313
+ }
314
+ const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
315
+ const pRowid = parentRow ? handleGetRowId(parentRow) : '';
316
+ if ((isRowGroupAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)))) {
317
+ const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length;
318
+ const item = {
319
+ _row: row,
320
+ _level: nodes.length - 1,
321
+ _hasChild: hasRowChild,
322
+ _expand: hasRowChild && $xeTable.isRowExpandByRow(row)
323
+ };
324
+ columns.forEach((column, $columnIndex) => {
325
+ let cellValue = '';
326
+ const renderOpts = column.editRender || column.cellRender;
327
+ let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
328
+ if (!bodyExportMethod && renderOpts && renderOpts.name) {
329
+ const compConf = renderer.get(renderOpts.name);
330
+ if (compConf) {
331
+ bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
332
+ }
333
+ }
334
+ if (!bodyExportMethod) {
335
+ bodyExportMethod = columnOpts.exportMethod;
336
+ }
337
+ if (bodyExportMethod) {
338
+ cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
339
+ }
340
+ else {
341
+ switch (column.type) {
342
+ case 'seq': {
343
+ const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
344
+ cellValue = mode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex);
345
+ break;
346
+ }
347
+ case 'checkbox':
348
+ cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
349
+ item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
350
+ item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
351
+ break;
352
+ case 'radio':
353
+ cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
354
+ item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
355
+ item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
356
+ break;
357
+ default:
358
+ if (opts.original) {
359
+ cellValue = getCellValue(row, column);
360
+ }
361
+ else {
362
+ cellValue = $xeTable.getCellLabel(row, column);
363
+ if (column.type === 'html') {
364
+ htmlCellElem.innerHTML = cellValue;
365
+ cellValue = htmlCellElem.innerText.trim();
366
+ }
367
+ else {
368
+ const cell = $xeTable.getCellElement(row, column);
369
+ if (cell && !hasClass(cell, 'is--progress')) {
370
+ cellValue = cell.innerText.trim();
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ item[column.id] = toStringValue(cellValue);
377
+ });
378
+ useMaps[rowid] = true;
379
+ if (pRowid) {
380
+ expandMaps[pRowid] = true;
381
+ }
382
+ rest.push(Object.assign(item, row));
383
+ }
384
+ }, { children: mapChildrenField });
385
+ return rest;
386
+ }
304
387
  if (treeConfig) {
388
+ // 如果是树结构
305
389
  const childrenField = treeOpts.children || treeOpts.childrenField;
306
- // 如果是树表格只允许导出数据源
307
390
  const rest = [];
308
391
  const expandMaps = {};
309
392
  const useMaps = {};
310
- const { handleGetRowId } = createHandleGetRowId($xeTable);
311
- XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
393
+ XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
312
394
  const row = item._row || item;
313
395
  const rowid = handleGetRowId(row);
314
396
  if (useMaps[rowid]) {
315
397
  return;
316
398
  }
317
- const parentRow = parent && parent._row ? parent._row : parent;
399
+ const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
318
400
  const pRowid = parentRow ? handleGetRowId(parentRow) : '';
319
- if ((isAllExpand || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
320
- const hasRowChild = hasTreeChildren(row);
401
+ if ((isTreeAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
402
+ const hasRowChild = row[childrenField] && row[childrenField].length;
321
403
  const item = {
322
404
  _row: row,
323
405
  _level: nodes.length - 1,
@@ -972,10 +1054,11 @@ hooks.add('tableExportModule', {
972
1054
  const $xeGantt = $xeTable.xeGantt;
973
1055
  const $xeGGWrapper = $xeGrid || $xeGantt;
974
1056
  const { treeConfig, showHeader, showFooter } = props;
975
- const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData;
1057
+ const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData;
976
1058
  const { collectColumn, mergeBodyList, mergeFooterList } = internalData;
977
1059
  const exportOpts = computeExportOpts.value;
978
- const hasTree = treeConfig;
1060
+ const hasTree = !!treeConfig;
1061
+ const hasRowGroup = rowGroupList.length > 0;
979
1062
  const customOpts = computeCustomOpts.value;
980
1063
  const selectRecords = $xeTable.getCheckboxRecords();
981
1064
  const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {};
@@ -992,6 +1075,11 @@ hooks.add('tableExportModule', {
992
1075
  current: 'current',
993
1076
  modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty'])
994
1077
  }, options);
1078
+ // 已废弃,参数 isAllExpand
1079
+ if (XEUtils.isBoolean(defOpts.isAllExpand)) {
1080
+ warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
1081
+ defOpts.isTreeAllExpanded = defOpts.isAllExpand;
1082
+ }
995
1083
  const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps);
996
1084
  const modes = defOpts.modes || [];
997
1085
  const checkMethod = customOpts.checkMethod;
@@ -1034,17 +1122,16 @@ hooks.add('tableExportModule', {
1034
1122
  column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false);
1035
1123
  });
1036
1124
  // 更新条件
1037
- Object.assign(exportStore, {
1038
- columns: exportColumns,
1039
- typeList,
1040
- modeList,
1041
- hasFooter,
1042
- hasMerge,
1043
- hasTree,
1044
- isPrint,
1045
- hasColgroup: isGroup,
1046
- visible: true
1047
- });
1125
+ exportStore.columns = exportColumns;
1126
+ exportStore.typeList = typeList;
1127
+ exportStore.modeList = modeList;
1128
+ exportStore.hasFooter = hasFooter;
1129
+ exportStore.hasMerge = hasMerge;
1130
+ exportStore.hasTree = hasTree;
1131
+ exportStore.hasRowGroup = hasRowGroup;
1132
+ exportStore.isPrint = !!isPrint;
1133
+ exportStore.hasColgroup = isGroup;
1134
+ exportStore.visible = true;
1048
1135
  // 默认参数
1049
1136
  Object.assign(exportParams, {
1050
1137
  mode: selectRecords.length ? 'selected' : 'current'
@@ -1124,7 +1211,8 @@ hooks.add('tableExportModule', {
1124
1211
  // filename: '',
1125
1212
  // sheetName: '',
1126
1213
  // original: false,
1127
- // isAllExpand: false,
1214
+ // isTreeAllExpanded: false,
1215
+ // isRowGroupAllExpanded: false,
1128
1216
  // data: null,
1129
1217
  // remote: false,
1130
1218
  // dataFilterMethod: null,
@@ -1134,6 +1222,11 @@ hooks.add('tableExportModule', {
1134
1222
  // beforeExportMethod: null,
1135
1223
  // afterExportMethod: null
1136
1224
  }, exportOpts, options);
1225
+ // 已废弃,参数 isAllExpand
1226
+ if (XEUtils.isBoolean(opts.isAllExpand)) {
1227
+ warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
1228
+ opts.isTreeAllExpanded = opts.isAllExpand;
1229
+ }
1137
1230
  let { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts;
1138
1231
  let groups = [];
1139
1232
  const selectRecords = $xeTable.getCheckboxRecords();
@@ -260,6 +260,10 @@ export default defineVxeComponent({
260
260
  const computeRowGroupOpts = computed(() => {
261
261
  return computeAggregateOpts.value;
262
262
  });
263
+ const computeAggregateMode = computed(() => {
264
+ const aggregateOpts = computeAggregateOpts.value;
265
+ return aggregateOpts.mode;
266
+ });
263
267
  const computeAggregateAccuracyOpts = computed(() => {
264
268
  return Object.assign({}, getConfig().table.aggregateAccuracyConfig, props.aggregateAccuracyConfig);
265
269
  });
@@ -3453,12 +3457,12 @@ export default defineVxeComponent({
3453
3457
  handleeGroupSummary(aggList);
3454
3458
  }
3455
3459
  };
3456
- const handleGroupData = (list, rowGroups) => {
3460
+ const handleGroupData = (list, rowGroups, isCombinedField) => {
3457
3461
  let fullData = list;
3458
3462
  let treeData = list;
3459
3463
  if (rowGroups) {
3460
3464
  const aggregateOpts = computeAggregateOpts.value;
3461
- const { rowField, parentField, childrenField, mapChildrenField } = aggregateOpts;
3465
+ const { rowField, parentField, separator, childrenField, mapChildrenField } = aggregateOpts;
3462
3466
  const rowOpts = computeRowOpts.value;
3463
3467
  const checkboxOpts = computeCheckboxOpts.value;
3464
3468
  const { checkField } = checkboxOpts;
@@ -3470,11 +3474,26 @@ export default defineVxeComponent({
3470
3474
  const groupField = rgItem.field;
3471
3475
  const groupColumn = $xeTable.getColumnByField(groupField);
3472
3476
  const groupMaps = {};
3477
+ const groupCombinedMaps = {};
3473
3478
  const aggList = [];
3474
3479
  const rowkey = getRowkey($xeTable);
3475
3480
  list.forEach((row) => {
3476
3481
  const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) : XEUtils.get(row, groupField);
3477
- const groupValue = XEUtils.eqNull(cellValue) ? '' : cellValue;
3482
+ let groupValue = XEUtils.eqNull(cellValue) ? '' : cellValue;
3483
+ if (isCombinedField) {
3484
+ const groupVals = [groupValue];
3485
+ rowGroups.slice(1).forEach(ogItem => {
3486
+ const ogField = ogItem.field;
3487
+ const ogColumn = $xeTable.getColumnByField(ogField);
3488
+ const ocValue = ogColumn ? $xeTable.getCellLabel(row, ogColumn) : XEUtils.get(row, ogField);
3489
+ const ogValue = XEUtils.eqNull(ocValue) ? '' : ocValue;
3490
+ groupValue += (separator || ' / ') + ogValue;
3491
+ groupVals.push(ogValue);
3492
+ });
3493
+ if (!groupCombinedMaps[groupValue]) {
3494
+ groupCombinedMaps[groupValue] = groupVals;
3495
+ }
3496
+ }
3478
3497
  let childList = groupMaps[groupValue];
3479
3498
  if (!childList) {
3480
3499
  childList = [];
@@ -3485,33 +3504,62 @@ export default defineVxeComponent({
3485
3504
  }
3486
3505
  childList.push(row);
3487
3506
  });
3488
- XEUtils.objectEach(groupMaps, (childList, groupValue) => {
3489
- const { fullData: childFullData, treeData: childTreeData } = handleGroupData(childList, rowGroups.slice(1));
3490
- const aggRow = {
3491
- isAggregate: true,
3492
- aggData: {},
3493
- groupContent: groupValue,
3494
- groupField,
3495
- childCount: 0,
3496
- [rowField]: getRowUniqueId(),
3497
- [parentField]: null,
3498
- [childrenField]: childTreeData,
3499
- [mapChildrenField]: childTreeData
3500
- };
3501
- aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey);
3502
- if (checkField) {
3503
- aggRow[checkField] = false;
3504
- }
3505
- if (indeterminateField) {
3506
- aggRow[indeterminateField] = false;
3507
- }
3508
- aggList.push(aggRow);
3509
- treeData.push(aggRow);
3510
- fullData.push(aggRow);
3511
- if (childFullData.length) {
3512
- fullData.push(...childFullData);
3513
- }
3514
- });
3507
+ if (isCombinedField) {
3508
+ XEUtils.objectEach(groupMaps, (childList, groupValue) => {
3509
+ const aggRow = {
3510
+ isAggregate: true,
3511
+ aggData: {},
3512
+ groupContent: groupValue,
3513
+ groupCombineds: groupCombinedMaps[groupValue],
3514
+ groupField,
3515
+ childCount: 0,
3516
+ [rowField]: getRowUniqueId(),
3517
+ [parentField]: null,
3518
+ [childrenField]: childList,
3519
+ [mapChildrenField]: childList
3520
+ };
3521
+ aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey);
3522
+ if (checkField) {
3523
+ aggRow[checkField] = false;
3524
+ }
3525
+ if (indeterminateField) {
3526
+ aggRow[indeterminateField] = false;
3527
+ }
3528
+ aggList.push(aggRow);
3529
+ treeData.push(aggRow);
3530
+ fullData.push(aggRow);
3531
+ });
3532
+ }
3533
+ else {
3534
+ XEUtils.objectEach(groupMaps, (childList, groupValue) => {
3535
+ const { fullData: childFullData, treeData: childTreeData } = handleGroupData(childList, rowGroups.slice(1));
3536
+ const aggRow = {
3537
+ isAggregate: true,
3538
+ aggData: {},
3539
+ groupContent: groupValue,
3540
+ groupCombineds: [],
3541
+ groupField,
3542
+ childCount: 0,
3543
+ [rowField]: getRowUniqueId(),
3544
+ [parentField]: null,
3545
+ [childrenField]: childTreeData,
3546
+ [mapChildrenField]: childTreeData
3547
+ };
3548
+ aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey);
3549
+ if (checkField) {
3550
+ aggRow[checkField] = false;
3551
+ }
3552
+ if (indeterminateField) {
3553
+ aggRow[indeterminateField] = false;
3554
+ }
3555
+ aggList.push(aggRow);
3556
+ treeData.push(aggRow);
3557
+ fullData.push(aggRow);
3558
+ if (childFullData.length) {
3559
+ fullData.push(...childFullData);
3560
+ }
3561
+ });
3562
+ }
3515
3563
  handleeGroupSummary(aggList);
3516
3564
  }
3517
3565
  }
@@ -3520,6 +3568,13 @@ export default defineVxeComponent({
3520
3568
  fullData
3521
3569
  };
3522
3570
  };
3571
+ const initGroupData = (list, rowGroups) => {
3572
+ const aggregateOpts = computeAggregateOpts.value;
3573
+ const { mode } = aggregateOpts;
3574
+ const isCombinedField = mode === 'combined';
3575
+ const groupRest = handleGroupData(list, rowGroups, isCombinedField);
3576
+ return groupRest;
3577
+ };
3523
3578
  const initData = () => {
3524
3579
  const { data } = props;
3525
3580
  loadTableData(data || [], true, true).then(() => {
@@ -3602,7 +3657,7 @@ export default defineVxeComponent({
3602
3657
  }
3603
3658
  }
3604
3659
  else if ((aggregateConfig || rowGroupConfig) && rowGroupList.length) {
3605
- const groupRest = handleGroupData(fullData, rowGroupList);
3660
+ const groupRest = initGroupData(fullData, rowGroupList);
3606
3661
  treeData = groupRest.treeData;
3607
3662
  fullData = groupRest.fullData;
3608
3663
  isRGroup = true;
@@ -13665,6 +13720,11 @@ export default defineVxeComponent({
13665
13720
  });
13666
13721
  internalData.keepUpdateFieldMaps = kpfMaps;
13667
13722
  });
13723
+ watch(computeAggregateMode, () => {
13724
+ if (reactData.isRowGroupStatus) {
13725
+ loadTableData(internalData.tableSynchData, false, true);
13726
+ }
13727
+ });
13668
13728
  if ($xeTabs) {
13669
13729
  watch(() => $xeTabs ? $xeTabs.reactData.resizeFlag : null, () => {
13670
13730
  handleGlobalResizeEvent();
@@ -13816,6 +13876,9 @@ export default defineVxeComponent({
13816
13876
  if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
13817
13877
  warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
13818
13878
  }
13879
+ if (exportConfig && XEUtils.isBoolean(exportOpts.isAllExpand)) {
13880
+ warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
13881
+ }
13819
13882
  if (!props.id) {
13820
13883
  if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
13821
13884
  errLog('vxe.error.reqProp', ['id']);
@@ -323,6 +323,7 @@ export function createReactData() {
323
323
  hasFooter: false,
324
324
  hasMerge: false,
325
325
  hasTree: false,
326
+ hasRowGroup: false,
326
327
  hasColgroup: false,
327
328
  visible: false
328
329
  },
@@ -333,7 +334,8 @@ export function createReactData() {
333
334
  type: '',
334
335
  isColgroup: false,
335
336
  isMerge: false,
336
- isAllExpand: false,
337
+ isTreeAllExpanded: false,
338
+ isRowGroupAllExpanded: false,
337
339
  useStyle: false,
338
340
  original: false,
339
341
  message: true,
@@ -1364,7 +1364,7 @@
1364
1364
  width: 80%;
1365
1365
  }
1366
1366
  .vxe-table-export--panel .vxe-table-export--panel-table tr td > .vxe-table-export--panel-option-row {
1367
- padding: 0.25em 0;
1367
+ padding: 0.5em 0;
1368
1368
  }
1369
1369
  .vxe-table-export--panel .vxe-table-export--panel-column {
1370
1370
  width: 80%;