vxe-table 3.21.2 → 3.21.4

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 (170) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +6 -2
  4. package/es/locale/lang/de-DE.js +5 -1
  5. package/es/locale/lang/en-US.js +5 -1
  6. package/es/locale/lang/es-ES.js +4 -0
  7. package/es/locale/lang/fr-FR.js +6 -2
  8. package/es/locale/lang/hu-HU.js +5 -1
  9. package/es/locale/lang/hy-AM.js +5 -1
  10. package/es/locale/lang/id-ID.js +6 -2
  11. package/es/locale/lang/it-IT.js +5 -1
  12. package/es/locale/lang/ja-JP.js +4 -0
  13. package/es/locale/lang/ko-KR.js +5 -1
  14. package/es/locale/lang/ms-MY.js +6 -2
  15. package/es/locale/lang/nb-NO.js +6 -2
  16. package/es/locale/lang/pt-BR.js +6 -2
  17. package/es/locale/lang/ru-RU.js +4 -0
  18. package/es/locale/lang/th-TH.js +5 -1
  19. package/es/locale/lang/ug-CN.js +5 -1
  20. package/es/locale/lang/uk-UA.js +5 -1
  21. package/es/locale/lang/uz-UZ.js +5 -1
  22. package/es/locale/lang/vi-VN.js +4 -0
  23. package/es/locale/lang/zh-CHT.js +4 -0
  24. package/es/locale/lang/zh-CN.js +4 -0
  25. package/es/style.css +1 -1
  26. package/es/style.min.css +1 -1
  27. package/es/table/module/custom/panel.js +28 -20
  28. package/es/table/module/export/export-panel.js +29 -16
  29. package/es/table/module/export/mixin.js +183 -28
  30. package/es/table/src/cell.js +7 -1
  31. package/es/table/src/methods.js +82 -31
  32. package/es/table/src/table.js +16 -0
  33. package/es/table/src/util.js +3 -1
  34. package/es/table/style.css +1 -1
  35. package/es/table/style.min.css +1 -1
  36. package/es/ui/index.js +1 -1
  37. package/es/ui/src/log.js +1 -1
  38. package/es/vxe-table/style.css +1 -1
  39. package/es/vxe-table/style.min.css +1 -1
  40. package/lib/index.css +1 -1
  41. package/lib/index.min.css +1 -1
  42. package/lib/index.umd.js +304 -67
  43. package/lib/index.umd.min.js +1 -1
  44. package/lib/locale/lang/ar-EG.js +6 -2
  45. package/lib/locale/lang/ar-EG.min.js +1 -1
  46. package/lib/locale/lang/ar-EG.umd.js +6 -2
  47. package/lib/locale/lang/de-DE.js +5 -1
  48. package/lib/locale/lang/de-DE.min.js +1 -1
  49. package/lib/locale/lang/de-DE.umd.js +5 -1
  50. package/lib/locale/lang/en-US.js +5 -1
  51. package/lib/locale/lang/en-US.min.js +1 -1
  52. package/lib/locale/lang/en-US.umd.js +5 -1
  53. package/lib/locale/lang/es-ES.js +4 -0
  54. package/lib/locale/lang/es-ES.min.js +1 -1
  55. package/lib/locale/lang/es-ES.umd.js +4 -0
  56. package/lib/locale/lang/fr-FR.js +6 -2
  57. package/lib/locale/lang/fr-FR.min.js +1 -1
  58. package/lib/locale/lang/fr-FR.umd.js +6 -2
  59. package/lib/locale/lang/hu-HU.js +5 -1
  60. package/lib/locale/lang/hu-HU.min.js +1 -1
  61. package/lib/locale/lang/hu-HU.umd.js +5 -1
  62. package/lib/locale/lang/hy-AM.js +5 -1
  63. package/lib/locale/lang/hy-AM.min.js +1 -1
  64. package/lib/locale/lang/hy-AM.umd.js +5 -1
  65. package/lib/locale/lang/id-ID.js +6 -2
  66. package/lib/locale/lang/id-ID.min.js +1 -1
  67. package/lib/locale/lang/id-ID.umd.js +6 -2
  68. package/lib/locale/lang/it-IT.js +5 -1
  69. package/lib/locale/lang/it-IT.min.js +1 -1
  70. package/lib/locale/lang/it-IT.umd.js +5 -1
  71. package/lib/locale/lang/ja-JP.js +4 -0
  72. package/lib/locale/lang/ja-JP.min.js +1 -1
  73. package/lib/locale/lang/ja-JP.umd.js +4 -0
  74. package/lib/locale/lang/ko-KR.js +5 -1
  75. package/lib/locale/lang/ko-KR.min.js +1 -1
  76. package/lib/locale/lang/ko-KR.umd.js +5 -1
  77. package/lib/locale/lang/ms-MY.js +6 -2
  78. package/lib/locale/lang/ms-MY.min.js +1 -1
  79. package/lib/locale/lang/ms-MY.umd.js +6 -2
  80. package/lib/locale/lang/nb-NO.js +6 -2
  81. package/lib/locale/lang/nb-NO.min.js +1 -1
  82. package/lib/locale/lang/nb-NO.umd.js +6 -2
  83. package/lib/locale/lang/pt-BR.js +6 -2
  84. package/lib/locale/lang/pt-BR.min.js +1 -1
  85. package/lib/locale/lang/pt-BR.umd.js +6 -2
  86. package/lib/locale/lang/ru-RU.js +4 -0
  87. package/lib/locale/lang/ru-RU.min.js +1 -1
  88. package/lib/locale/lang/ru-RU.umd.js +4 -0
  89. package/lib/locale/lang/th-TH.js +5 -1
  90. package/lib/locale/lang/th-TH.min.js +1 -1
  91. package/lib/locale/lang/th-TH.umd.js +5 -1
  92. package/lib/locale/lang/ug-CN.js +5 -1
  93. package/lib/locale/lang/ug-CN.min.js +1 -1
  94. package/lib/locale/lang/ug-CN.umd.js +5 -1
  95. package/lib/locale/lang/uk-UA.js +5 -1
  96. package/lib/locale/lang/uk-UA.min.js +1 -1
  97. package/lib/locale/lang/uk-UA.umd.js +5 -1
  98. package/lib/locale/lang/uz-UZ.js +5 -1
  99. package/lib/locale/lang/uz-UZ.min.js +1 -1
  100. package/lib/locale/lang/uz-UZ.umd.js +5 -1
  101. package/lib/locale/lang/vi-VN.js +4 -0
  102. package/lib/locale/lang/vi-VN.min.js +1 -1
  103. package/lib/locale/lang/vi-VN.umd.js +4 -0
  104. package/lib/locale/lang/zh-CHT.js +4 -0
  105. package/lib/locale/lang/zh-CHT.min.js +1 -1
  106. package/lib/locale/lang/zh-CHT.umd.js +4 -0
  107. package/lib/locale/lang/zh-CN.js +4 -0
  108. package/lib/locale/lang/zh-CN.min.js +1 -1
  109. package/lib/locale/lang/zh-CN.umd.js +4 -0
  110. package/lib/style.css +1 -1
  111. package/lib/style.min.css +1 -1
  112. package/lib/table/module/custom/panel.js +29 -18
  113. package/lib/table/module/custom/panel.min.js +1 -1
  114. package/lib/table/module/export/export-panel.js +26 -13
  115. package/lib/table/module/export/export-panel.min.js +1 -1
  116. package/lib/table/module/export/mixin.js +216 -30
  117. package/lib/table/module/export/mixin.min.js +1 -1
  118. package/lib/table/src/cell.js +6 -1
  119. package/lib/table/src/cell.min.js +1 -1
  120. package/lib/table/src/methods.js +2 -2
  121. package/lib/table/src/methods.min.js +1 -1
  122. package/lib/table/src/table.js +16 -0
  123. package/lib/table/src/table.min.js +1 -1
  124. package/lib/table/src/util.js +3 -1
  125. package/lib/table/src/util.min.js +1 -1
  126. package/lib/table/style/style.css +1 -1
  127. package/lib/table/style/style.min.css +1 -1
  128. package/lib/ui/index.js +1 -1
  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 +1 -1
  133. package/lib/vxe-table/style/style.min.css +1 -1
  134. package/package.json +2 -2
  135. package/packages/locale/lang/ar-EG.ts +850 -846
  136. package/packages/locale/lang/de-DE.ts +850 -846
  137. package/packages/locale/lang/en-US.ts +850 -846
  138. package/packages/locale/lang/es-ES.ts +850 -846
  139. package/packages/locale/lang/fr-FR.ts +850 -846
  140. package/packages/locale/lang/hu-HU.ts +850 -846
  141. package/packages/locale/lang/hy-AM.ts +850 -846
  142. package/packages/locale/lang/id-ID.ts +850 -846
  143. package/packages/locale/lang/it-IT.ts +850 -846
  144. package/packages/locale/lang/ja-JP.ts +850 -846
  145. package/packages/locale/lang/ko-KR.ts +850 -846
  146. package/packages/locale/lang/ms-MY.ts +850 -846
  147. package/packages/locale/lang/nb-NO.ts +850 -846
  148. package/packages/locale/lang/pt-BR.ts +850 -846
  149. package/packages/locale/lang/ru-RU.ts +850 -846
  150. package/packages/locale/lang/th-TH.ts +850 -846
  151. package/packages/locale/lang/ug-CN.ts +850 -846
  152. package/packages/locale/lang/uk-UA.ts +850 -846
  153. package/packages/locale/lang/uz-UZ.ts +850 -846
  154. package/packages/locale/lang/vi-VN.ts +850 -846
  155. package/packages/locale/lang/zh-CHT.ts +850 -846
  156. package/packages/locale/lang/zh-CN.ts +4 -0
  157. package/packages/table/module/custom/panel.ts +29 -21
  158. package/packages/table/module/export/export-panel.ts +29 -17
  159. package/packages/table/module/export/mixin.ts +183 -30
  160. package/packages/table/src/cell.ts +6 -1
  161. package/packages/table/src/methods.ts +82 -31
  162. package/packages/table/src/table.ts +18 -0
  163. package/packages/table/src/util.ts +3 -1
  164. package/styles/components/table-module/export.scss +1 -1
  165. /package/es/{iconfont.1779778409753.ttf → iconfont.1779936730544.ttf} +0 -0
  166. /package/es/{iconfont.1779778409753.woff → iconfont.1779936730544.woff} +0 -0
  167. /package/es/{iconfont.1779778409753.woff2 → iconfont.1779936730544.woff2} +0 -0
  168. /package/lib/{iconfont.1779778409753.ttf → iconfont.1779936730544.ttf} +0 -0
  169. /package/lib/{iconfont.1779778409753.woff → iconfont.1779936730544.woff} +0 -0
  170. /package/lib/{iconfont.1779778409753.woff2 → iconfont.1779936730544.woff2} +0 -0
@@ -393,7 +393,7 @@ export default {
393
393
  const { immediate } = customOpts;
394
394
  const trEl = evnt.currentTarget;
395
395
  const columnDragOpts = $xeTable.computeColumnDragOpts;
396
- const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
396
+ const { isCrossDrag, isPeerDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts;
397
397
  const { dragCol } = customPanelReactData;
398
398
  const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData;
399
399
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
@@ -431,20 +431,28 @@ export default {
431
431
  if (immediate) {
432
432
  if (dragColumn.parentId && newColumn.parentId) {
433
433
  // 子到子
434
- if (!isCrossDrag) {
435
- return;
434
+ if (isPeerDrag && !isCrossDrag) {
435
+ if (dragColumn.parentId !== newColumn.parentId) {
436
+ // 非同级
437
+ return;
438
+ }
436
439
  }
437
- if (oldAllMaps[newColumn.id]) {
438
- isSelfToChildStatus = true;
439
- if (!(isCrossDrag && isSelfToChildDrag)) {
440
- if (VxeUI.modal) {
441
- VxeUI.modal.message({
442
- status: 'error',
443
- content: getI18n('vxe.error.treeDragChild')
444
- });
445
- }
440
+ else {
441
+ if (!isCrossDrag) {
446
442
  return;
447
443
  }
444
+ if (oldAllMaps[newColumn.id]) {
445
+ isSelfToChildStatus = true;
446
+ if (!(isCrossDrag && isSelfToChildDrag)) {
447
+ if (VxeUI.modal) {
448
+ VxeUI.modal.message({
449
+ status: 'error',
450
+ content: getI18n('vxe.error.treeDragChild')
451
+ });
452
+ }
453
+ return;
454
+ }
455
+ }
448
456
  }
449
457
  }
450
458
  else if (dragColumn.parentId) {
@@ -576,7 +584,7 @@ export default {
576
584
  const customOpts = $xeTable.computeCustomOpts;
577
585
  const { showSortDragButton, allowSort, immediate } = customOpts;
578
586
  const columnDragOpts = $xeTable.computeColumnDragOpts;
579
- const { isCrossDrag, isToChildDrag } = columnDragOpts;
587
+ const { isCrossDrag, isPeerDrag, isToChildDrag } = columnDragOpts;
580
588
  const optEl = evnt.currentTarget;
581
589
  const isControlKey = hasControlKey(evnt);
582
590
  const colid = optEl.getAttribute('colid');
@@ -584,16 +592,16 @@ export default {
584
592
  customPanelInternalData.prevDragGroupField = null;
585
593
  customPanelInternalData.prevDragAggFnColid = null;
586
594
  // 是否移入有效列
587
- if (column && (isCrossDrag || column.level === 1)) {
595
+ if (column && (isCrossDrag || isPeerDrag || column.level === 1)) {
588
596
  evnt.preventDefault();
589
597
  const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
590
598
  const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
591
599
  if (!dragCol ||
592
600
  !(showSortDragButton && allowSort) ||
593
601
  (dragCol && dragCol.id === column.id) ||
594
- (!isCrossDrag && column.level > 1) ||
602
+ (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.level > 1)) ||
595
603
  (!immediate && column.level > 1) ||
596
- (!isCrossDrag && dragCol.level > 1) ||
604
+ (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : dragCol.level > 1)) ||
597
605
  (!immediate && dragCol.level > 1)) {
598
606
  showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos);
599
607
  return;
@@ -752,7 +760,7 @@ export default {
752
760
  const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts;
753
761
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
754
762
  const vSize = $xeTable.computeSize;
755
- const { isCrossDrag } = columnDragOpts;
763
+ const { isCrossDrag, isPeerDrag } = columnDragOpts;
756
764
  const slots = customOpts.slots || {};
757
765
  const headerSlot = slots.header;
758
766
  const topSlot = slots.top;
@@ -786,7 +794,7 @@ export default {
786
794
  const colTitle = formatText(column.getTitle(), 1);
787
795
  const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
788
796
  const isHidden = !isChecked;
789
- const showSortBtn = ((isCrossDrag ? immediate : false) || column.level === 1);
797
+ const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
790
798
  colVNs.push(h('li', {
791
799
  key: column.id,
792
800
  attrs: {
@@ -1149,7 +1157,7 @@ export default {
1149
1157
  const modalOpts = Object.assign({}, modalOptions);
1150
1158
  const drawerOpts = Object.assign({}, drawerOptions);
1151
1159
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
1152
- const { isCrossDrag } = columnDragOpts;
1160
+ const { isCrossDrag, isPeerDrag } = columnDragOpts;
1153
1161
  const slots = customOpts.slots || {};
1154
1162
  const headerSlot = slots.header;
1155
1163
  const topSlot = slots.top;
@@ -1196,7 +1204,7 @@ export default {
1196
1204
  const isColGroup = column.children && column.children.length;
1197
1205
  const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false;
1198
1206
  const isHidden = !isChecked;
1199
- const showSortBtn = ((isCrossDrag ? immediate : false) || column.level === 1);
1207
+ const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1;
1200
1208
  trVNs.push(h('tr', {
1201
1209
  key: column.id,
1202
1210
  attrs: {
@@ -210,7 +210,7 @@ export default {
210
210
  const $xeGantt = $xeTable.$xeGantt;
211
211
  const { defaultOptions, storeData } = props;
212
212
  const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData;
213
- const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData;
213
+ const { hasTree, hasRowGroup, hasMerge, isPrint, hasColgroup, columns } = storeData;
214
214
  const { isHeader } = defaultOptions;
215
215
  const colVNs = [];
216
216
  const checkedAll = $xeExportPanel.computeCheckedAll;
@@ -459,6 +459,19 @@ export default {
459
459
  }
460
460
  }
461
461
  }),
462
+ h('vxe-checkbox', {
463
+ props: {
464
+ value: defaultOptions.isFooter,
465
+ disabled: !storeData.hasFooter,
466
+ title: getI18n('vxe.export.expFooterTitle'),
467
+ content: getI18n('vxe.export.expOptFooter')
468
+ },
469
+ on: {
470
+ input(value) {
471
+ defaultOptions.isFooter = value;
472
+ }
473
+ }
474
+ }),
462
475
  h('vxe-checkbox', {
463
476
  props: {
464
477
  value: isHeader ? defaultOptions.isTitle : false,
@@ -529,34 +542,34 @@ export default {
529
542
  defaultOptions.useStyle = value;
530
543
  }
531
544
  }
532
- }),
545
+ })
546
+ ]),
547
+ h('div', {
548
+ class: 'vxe-table-export--panel-option-row'
549
+ }, [
533
550
  h('vxe-checkbox', {
534
551
  props: {
535
- value: hasTree ? defaultOptions.isAllExpand : false,
552
+ value: hasTree ? defaultOptions.isTreeAllExpanded : false,
536
553
  disabled: hasEmptyData || !hasTree,
537
- title: getI18n('vxe.export.expAllExpandTitle'),
538
- content: getI18n('vxe.export.expOptAllExpand')
554
+ title: getI18n('vxe.export.expTreeAllExpandTitle'),
555
+ content: getI18n('vxe.export.expOptTreeAllExpand')
539
556
  },
540
557
  on: {
541
558
  input(value) {
542
- defaultOptions.isAllExpand = value;
559
+ defaultOptions.isTreeAllExpanded = value;
543
560
  }
544
561
  }
545
- })
546
- ]),
547
- h('div', {
548
- class: 'vxe-table-export--panel-option-row'
549
- }, [
562
+ }),
550
563
  h('vxe-checkbox', {
551
564
  props: {
552
- value: defaultOptions.isFooter,
553
- disabled: !storeData.hasFooter,
554
- title: getI18n('vxe.export.expFooterTitle'),
555
- content: getI18n('vxe.export.expOptFooter')
565
+ value: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
566
+ disabled: hasEmptyData || !hasRowGroup,
567
+ title: getI18n('vxe.export.expRowGroupAllExpandTitle'),
568
+ content: getI18n('vxe.export.expOptRowGroupAllExpand')
556
569
  },
557
570
  on: {
558
571
  input(value) {
559
- defaultOptions.isFooter = value;
572
+ defaultOptions.isRowGroupAllExpanded = value;
560
573
  }
561
574
  }
562
575
  })
@@ -9,11 +9,6 @@ const { getI18n, renderer } = VxeUI;
9
9
  let htmlCellElem;
10
10
  const csvBOM = '\ufeff';
11
11
  const enterSymbol = '\r\n';
12
- function hasTreeChildren($xeTable, row) {
13
- const treeOpts = $xeTable.computeTreeOpts;
14
- const childrenField = treeOpts.children || treeOpts.childrenField;
15
- return row[childrenField] && row[childrenField].length;
16
- }
17
12
  function getSeq($xeTable, cellValue, row, $rowIndex, column, $columnIndex) {
18
13
  const seqOpts = $xeTable.computeSeqOpts;
19
14
  const seqMd = seqOpts.seqMethod || column.seqMethod;
@@ -52,32 +47,181 @@ const toStringValue = (cellValue) => {
52
47
  };
53
48
  function getBodyLabelData($xeTable, opts, columns, datas) {
54
49
  const props = $xeTable;
55
- const { isAllExpand, mode } = opts;
50
+ const reactData = $xeTable;
51
+ const internalData = $xeTable;
52
+ const { isTreeAllExpanded, isRowGroupAllExpanded, mode: expMode } = opts;
56
53
  const { treeConfig } = props;
54
+ const { isRowGroupStatus } = reactData;
55
+ const { fullColumnFieldData } = internalData;
57
56
  const radioOpts = $xeTable.computeRadioOpts;
58
57
  const checkboxOpts = $xeTable.computeCheckboxOpts;
59
58
  const treeOpts = $xeTable.computeTreeOpts;
60
59
  const columnOpts = $xeTable.computeColumnOpts;
60
+ const aggregateOpts = $xeTable.computeAggregateOpts;
61
61
  if (!htmlCellElem) {
62
62
  htmlCellElem = document.createElement('div');
63
63
  }
64
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
65
+ if (isRowGroupStatus) {
66
+ // 如果是数据分组
67
+ const { mode: aggMode, showTotal, totalMethod, countFields, contentMethod, formatValuesMethod, mapChildrenField } = aggregateOpts;
68
+ const rest = [];
69
+ const expandMaps = {};
70
+ const useMaps = {};
71
+ XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
72
+ const row = item._row || item;
73
+ const rowid = handleGetRowId(row);
74
+ if (useMaps[rowid]) {
75
+ return;
76
+ }
77
+ const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
78
+ const pRowid = parentRow ? handleGetRowId(parentRow) : '';
79
+ if ((isRowGroupAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)))) {
80
+ const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length;
81
+ const item = {
82
+ _row: row,
83
+ _level: nodes.length - 1,
84
+ _hasChild: hasRowChild,
85
+ _expand: hasRowChild && $xeTable.isRowExpandByRow(row)
86
+ };
87
+ columns.forEach((column, $columnIndex) => {
88
+ const { field, editRender, cellRender, aggFunc, rowGroupNode } = column;
89
+ let cellValue = '';
90
+ const renderOpts = editRender || cellRender;
91
+ let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
92
+ if (!bodyExportMethod && renderOpts && renderOpts.name) {
93
+ const compConf = renderer.get(renderOpts.name);
94
+ if (compConf) {
95
+ bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
96
+ }
97
+ }
98
+ if (!bodyExportMethod) {
99
+ bodyExportMethod = columnOpts.exportMethod;
100
+ }
101
+ if (bodyExportMethod) {
102
+ cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
103
+ }
104
+ else {
105
+ switch (column.type) {
106
+ case 'seq': {
107
+ const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
108
+ cellValue = expMode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex);
109
+ break;
110
+ }
111
+ case 'checkbox': {
112
+ cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
113
+ item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
114
+ item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
115
+ break;
116
+ }
117
+ case 'radio': {
118
+ cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
119
+ item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
120
+ item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
121
+ break;
122
+ }
123
+ default: {
124
+ if (field && row.isAggregate) {
125
+ const aggRow = row;
126
+ const aggData = aggRow.aggData;
127
+ const currAggData = aggData ? aggData[field] : null;
128
+ const groupField = aggRow.groupField;
129
+ const groupContent = aggRow.groupContent;
130
+ const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : [];
131
+ const childCount = aggRow.childCount;
132
+ const colRest = fullColumnFieldData[groupField] || {};
133
+ const ctParams = {
134
+ $table: $xeTable,
135
+ groupField,
136
+ groupColumn: (colRest ? colRest.column : null),
137
+ column,
138
+ groupValue: groupContent,
139
+ childList,
140
+ childCount,
141
+ aggValue: null,
142
+ /**
143
+ * 已废弃
144
+ * @deprecated
145
+ */
146
+ children: childList,
147
+ /**
148
+ * 已废弃
149
+ * @deprecated
150
+ */
151
+ totalValue: childCount
152
+ };
153
+ if (aggMode === 'column' ? field === aggRow.groupField : rowGroupNode) {
154
+ cellValue = groupContent;
155
+ if (contentMethod) {
156
+ cellValue = `${contentMethod(ctParams)}`;
157
+ }
158
+ if (showTotal) {
159
+ cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
160
+ }
161
+ }
162
+ else if ($xeTable.getPivotTableAggregateCellAggValue) {
163
+ const aggParams = {
164
+ $table: $xeTable,
165
+ row,
166
+ column
167
+ };
168
+ cellValue = $xeTable.getPivotTableAggregateCellAggValue(aggParams);
169
+ }
170
+ else if (aggFunc === true || (countFields && countFields.includes(field))) {
171
+ cellValue = currAggData ? currAggData.value : childCount;
172
+ ctParams.aggValue = cellValue;
173
+ if (formatValuesMethod) {
174
+ cellValue = formatValuesMethod(ctParams);
175
+ }
176
+ }
177
+ }
178
+ else if (opts.original) {
179
+ cellValue = getCellValue(row, column);
180
+ }
181
+ else {
182
+ cellValue = $xeTable.getCellLabel(row, column);
183
+ if (column.type === 'html') {
184
+ htmlCellElem.innerHTML = cellValue;
185
+ cellValue = htmlCellElem.innerText.trim();
186
+ }
187
+ else {
188
+ const cell = $xeTable.getCellElement(row, column);
189
+ if (cell && !hasClass(cell, 'is--progress')) {
190
+ cellValue = cell.innerText.trim();
191
+ }
192
+ }
193
+ }
194
+ break;
195
+ }
196
+ }
197
+ }
198
+ item[column.id] = toStringValue(cellValue);
199
+ });
200
+ useMaps[rowid] = true;
201
+ if (pRowid) {
202
+ expandMaps[pRowid] = true;
203
+ }
204
+ rest.push(Object.assign(item, row));
205
+ }
206
+ }, { children: mapChildrenField });
207
+ return rest;
208
+ }
64
209
  if (treeConfig) {
65
210
  const childrenField = treeOpts.children || treeOpts.childrenField;
66
- // 如果是树表格只允许导出数据源
211
+ // 如果是树结构
67
212
  const rest = [];
68
213
  const expandMaps = {};
69
214
  const useMaps = {};
70
- const { handleGetRowId } = createHandleGetRowId($xeTable);
71
- XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
215
+ XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
72
216
  const row = item._row || item;
73
217
  const rowid = handleGetRowId(row);
74
218
  if (useMaps[rowid]) {
75
219
  return;
76
220
  }
77
- const parentRow = parent && parent._row ? parent._row : parent;
221
+ const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
78
222
  const pRowid = parentRow ? handleGetRowId(parentRow) : '';
79
- if ((isAllExpand || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
80
- const hasRowChild = hasTreeChildren($xeTable, row);
223
+ if ((isTreeAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
224
+ const hasRowChild = row[childrenField] && row[childrenField].length;
81
225
  const item = {
82
226
  _row: row,
83
227
  _level: nodes.length - 1,
@@ -104,7 +248,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
104
248
  switch (column.type) {
105
249
  case 'seq': {
106
250
  const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
107
- cellValue = mode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex);
251
+ cellValue = expMode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex);
108
252
  break;
109
253
  }
110
254
  case 'checkbox':
@@ -168,7 +312,7 @@ function getBodyLabelData($xeTable, opts, columns, datas) {
168
312
  switch (column.type) {
169
313
  case 'seq': {
170
314
  const seqValue = $rowIndex + 1;
171
- cellValue = mode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
315
+ cellValue = expMode === 'all' ? seqValue : getSeq($xeTable, seqValue, row, $rowIndex, column, $columnIndex);
172
316
  break;
173
317
  }
174
318
  case 'checkbox':
@@ -937,10 +1081,11 @@ function handleExportAndPrint($xeTable, options, isPrint) {
937
1081
  const $xeGantt = $xeTable.$xeGantt;
938
1082
  const $xeGGWrapper = $xeGrid || $xeGantt;
939
1083
  const { treeConfig, showHeader, showFooter } = props;
940
- const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData;
1084
+ const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData;
941
1085
  const { collectColumn, mergeBodyList, mergeFooterList } = internalData;
942
1086
  const exportOpts = $xeTable.computeExportOpts;
943
- const hasTree = treeConfig;
1087
+ const hasTree = !!treeConfig;
1088
+ const hasRowGroup = rowGroupList.length > 0;
944
1089
  const customOpts = $xeTable.computeCustomOpts;
945
1090
  const selectRecords = $xeTable.getCheckboxRecords();
946
1091
  const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {};
@@ -957,6 +1102,11 @@ function handleExportAndPrint($xeTable, options, isPrint) {
957
1102
  current: 'current',
958
1103
  modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty'])
959
1104
  }, options);
1105
+ // 已废弃,参数 isAllExpand
1106
+ if (XEUtils.isBoolean(defOpts.isAllExpand)) {
1107
+ warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
1108
+ defOpts.isTreeAllExpanded = defOpts.isAllExpand;
1109
+ }
960
1110
  const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps);
961
1111
  const modes = defOpts.modes || [];
962
1112
  const checkMethod = customOpts.checkMethod;
@@ -999,17 +1149,16 @@ function handleExportAndPrint($xeTable, options, isPrint) {
999
1149
  column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false);
1000
1150
  });
1001
1151
  // 更新条件
1002
- Object.assign(exportStore, {
1003
- columns: exportColumns,
1004
- typeList,
1005
- modeList,
1006
- hasFooter,
1007
- hasMerge,
1008
- hasTree,
1009
- isPrint,
1010
- hasColgroup: isGroup,
1011
- visible: true
1012
- });
1152
+ exportStore.columns = exportColumns;
1153
+ exportStore.typeList = typeList;
1154
+ exportStore.modeList = modeList;
1155
+ exportStore.hasFooter = hasFooter;
1156
+ exportStore.hasMerge = hasMerge;
1157
+ exportStore.hasTree = hasTree;
1158
+ exportStore.hasRowGroup = hasRowGroup;
1159
+ exportStore.isPrint = !!isPrint;
1160
+ exportStore.hasColgroup = isGroup;
1161
+ exportStore.visible = true;
1013
1162
  // 默认参数
1014
1163
  Object.assign(exportParams, {
1015
1164
  mode: selectRecords.length ? 'selected' : 'current'
@@ -1142,7 +1291,8 @@ export default {
1142
1291
  // filename: '',
1143
1292
  // sheetName: '',
1144
1293
  // original: false,
1145
- // isAllExpand: false,
1294
+ // isTreeAllExpanded: false,
1295
+ // isRowGroupAllExpanded: false,
1146
1296
  // data: null,
1147
1297
  // remote: false,
1148
1298
  // dataFilterMethod: null,
@@ -1152,6 +1302,11 @@ export default {
1152
1302
  // beforeExportMethod: null,
1153
1303
  // afterExportMethod: null
1154
1304
  }, exportOpts, options);
1305
+ // 已废弃,参数 isAllExpand
1306
+ if (XEUtils.isBoolean(opts.isAllExpand)) {
1307
+ warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
1308
+ opts.isTreeAllExpanded = opts.isAllExpand;
1309
+ }
1155
1310
  let { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts;
1156
1311
  let groups = [];
1157
1312
  const selectRecords = $xeTable.getCheckboxRecords();
@@ -602,7 +602,13 @@ export const Cell = {
602
602
  if (rowGroupList.length) {
603
603
  const aggregateOpts = $table.computeAggregateOpts;
604
604
  const { mode } = aggregateOpts;
605
- if (mode === 'column' ? column.field === row.groupField : rowGroupNode) {
605
+ if (mode === 'column') {
606
+ if (row.groupField && column.field === row.groupField) {
607
+ return [Cell.renderRowGroupBtn(h, params, cellVNodes)];
608
+ }
609
+ return cellVNodes;
610
+ }
611
+ else if (rowGroupNode) {
606
612
  return [Cell.renderRowGroupBtn(h, params, cellVNodes)];
607
613
  }
608
614
  }