vxe-table 3.21.2 → 3.21.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.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +4 -0
- package/es/locale/lang/de-DE.js +4 -0
- package/es/locale/lang/en-US.js +4 -0
- package/es/locale/lang/es-ES.js +4 -0
- package/es/locale/lang/fr-FR.js +4 -0
- package/es/locale/lang/hu-HU.js +4 -0
- package/es/locale/lang/hy-AM.js +4 -0
- package/es/locale/lang/id-ID.js +4 -0
- package/es/locale/lang/it-IT.js +4 -0
- package/es/locale/lang/ja-JP.js +4 -0
- package/es/locale/lang/ko-KR.js +4 -0
- package/es/locale/lang/ms-MY.js +4 -0
- package/es/locale/lang/nb-NO.js +4 -0
- package/es/locale/lang/pt-BR.js +4 -0
- package/es/locale/lang/ru-RU.js +4 -0
- package/es/locale/lang/th-TH.js +4 -0
- package/es/locale/lang/ug-CN.js +4 -0
- package/es/locale/lang/uk-UA.js +4 -0
- package/es/locale/lang/uz-UZ.js +4 -0
- package/es/locale/lang/vi-VN.js +4 -0
- package/es/locale/lang/zh-CHT.js +4 -0
- package/es/locale/lang/zh-CN.js +4 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +28 -20
- package/es/table/module/export/export-panel.js +29 -16
- package/es/table/module/export/mixin.js +121 -26
- package/es/table/src/methods.js +82 -31
- package/es/table/src/table.js +16 -0
- package/es/table/src/util.js +3 -1
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +221 -63
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +4 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +4 -0
- package/lib/locale/lang/de-DE.js +4 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +4 -0
- package/lib/locale/lang/en-US.js +4 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -0
- package/lib/locale/lang/es-ES.js +4 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -0
- package/lib/locale/lang/fr-FR.js +4 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +4 -0
- package/lib/locale/lang/hu-HU.js +4 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -0
- package/lib/locale/lang/hy-AM.js +4 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +4 -0
- package/lib/locale/lang/id-ID.js +4 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +4 -0
- package/lib/locale/lang/it-IT.js +4 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +4 -0
- package/lib/locale/lang/ja-JP.js +4 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -0
- package/lib/locale/lang/ko-KR.js +4 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -0
- package/lib/locale/lang/ms-MY.js +4 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +4 -0
- package/lib/locale/lang/nb-NO.js +4 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +4 -0
- package/lib/locale/lang/pt-BR.js +4 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -0
- package/lib/locale/lang/ru-RU.js +4 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -0
- package/lib/locale/lang/th-TH.js +4 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +4 -0
- package/lib/locale/lang/ug-CN.js +4 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +4 -0
- package/lib/locale/lang/uk-UA.js +4 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -0
- package/lib/locale/lang/uz-UZ.js +4 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +4 -0
- package/lib/locale/lang/vi-VN.js +4 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +4 -0
- package/lib/locale/lang/zh-CHT.js +4 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +4 -0
- package/lib/locale/lang/zh-CN.js +4 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +29 -18
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +26 -13
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +139 -27
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/methods.js +2 -2
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +16 -0
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +3 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +4 -0
- package/packages/locale/lang/de-DE.ts +4 -0
- package/packages/locale/lang/en-US.ts +4 -0
- package/packages/locale/lang/es-ES.ts +4 -0
- package/packages/locale/lang/fr-FR.ts +4 -0
- package/packages/locale/lang/hu-HU.ts +4 -0
- package/packages/locale/lang/hy-AM.ts +4 -0
- package/packages/locale/lang/id-ID.ts +4 -0
- package/packages/locale/lang/it-IT.ts +4 -0
- package/packages/locale/lang/ja-JP.ts +4 -0
- package/packages/locale/lang/ko-KR.ts +4 -0
- package/packages/locale/lang/ms-MY.ts +4 -0
- package/packages/locale/lang/nb-NO.ts +4 -0
- package/packages/locale/lang/pt-BR.ts +4 -0
- package/packages/locale/lang/ru-RU.ts +4 -0
- package/packages/locale/lang/th-TH.ts +4 -0
- package/packages/locale/lang/ug-CN.ts +4 -0
- package/packages/locale/lang/uk-UA.ts +4 -0
- package/packages/locale/lang/uz-UZ.ts +4 -0
- package/packages/locale/lang/vi-VN.ts +4 -0
- package/packages/locale/lang/zh-CHT.ts +4 -0
- package/packages/locale/lang/zh-CN.ts +4 -0
- package/packages/table/module/custom/panel.ts +29 -21
- package/packages/table/module/export/export-panel.ts +29 -17
- package/packages/table/module/export/mixin.ts +122 -27
- package/packages/table/src/methods.ts +82 -31
- package/packages/table/src/table.ts +18 -0
- package/packages/table/src/util.ts +3 -1
- package/styles/components/table-module/export.scss +1 -1
- /package/es/{iconfont.1779778409753.ttf → iconfont.1779843521280.ttf} +0 -0
- /package/es/{iconfont.1779778409753.woff → iconfont.1779843521280.woff} +0 -0
- /package/es/{iconfont.1779778409753.woff2 → iconfont.1779843521280.woff2} +0 -0
- /package/lib/{iconfont.1779778409753.ttf → iconfont.1779843521280.ttf} +0 -0
- /package/lib/{iconfont.1779778409753.woff → iconfont.1779843521280.woff} +0 -0
- /package/lib/{iconfont.1779778409753.woff2 → iconfont.1779843521280.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
|
-
|
|
434
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
435
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
436
|
+
// 非同级
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
436
439
|
}
|
|
437
|
-
|
|
438
|
-
|
|
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 = (
|
|
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 = (
|
|
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.
|
|
552
|
+
value: hasTree ? defaultOptions.isTreeAllExpanded : false,
|
|
536
553
|
disabled: hasEmptyData || !hasTree,
|
|
537
|
-
title: getI18n('vxe.export.
|
|
538
|
-
content: getI18n('vxe.export.
|
|
554
|
+
title: getI18n('vxe.export.expTreeAllExpandTitle'),
|
|
555
|
+
content: getI18n('vxe.export.expOptTreeAllExpand')
|
|
539
556
|
},
|
|
540
557
|
on: {
|
|
541
558
|
input(value) {
|
|
542
|
-
defaultOptions.
|
|
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.
|
|
553
|
-
disabled: !
|
|
554
|
-
title: getI18n('vxe.export.
|
|
555
|
-
content: getI18n('vxe.export.
|
|
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.
|
|
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,121 @@ const toStringValue = (cellValue) => {
|
|
|
52
47
|
};
|
|
53
48
|
function getBodyLabelData($xeTable, opts, columns, datas) {
|
|
54
49
|
const props = $xeTable;
|
|
55
|
-
const
|
|
50
|
+
const reactData = $xeTable;
|
|
51
|
+
const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts;
|
|
56
52
|
const { treeConfig } = props;
|
|
53
|
+
const { isRowGroupStatus } = reactData;
|
|
57
54
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
58
55
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
59
56
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
60
57
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
58
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
61
59
|
if (!htmlCellElem) {
|
|
62
60
|
htmlCellElem = document.createElement('div');
|
|
63
61
|
}
|
|
62
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
63
|
+
if (isRowGroupStatus) {
|
|
64
|
+
// 如果是数据分组
|
|
65
|
+
// 如果是数据分组
|
|
66
|
+
const { mapChildrenField } = aggregateOpts;
|
|
67
|
+
const rest = [];
|
|
68
|
+
const expandMaps = {};
|
|
69
|
+
const useMaps = {};
|
|
70
|
+
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
|
|
71
|
+
const row = item._row || item;
|
|
72
|
+
const rowid = handleGetRowId(row);
|
|
73
|
+
if (useMaps[rowid]) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
|
|
77
|
+
const pRowid = parentRow ? handleGetRowId(parentRow) : '';
|
|
78
|
+
if ((isRowGroupAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)))) {
|
|
79
|
+
const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length;
|
|
80
|
+
const item = {
|
|
81
|
+
_row: row,
|
|
82
|
+
_level: nodes.length - 1,
|
|
83
|
+
_hasChild: hasRowChild,
|
|
84
|
+
_expand: hasRowChild && $xeTable.isRowExpandByRow(row)
|
|
85
|
+
};
|
|
86
|
+
columns.forEach((column, $columnIndex) => {
|
|
87
|
+
let cellValue = '';
|
|
88
|
+
const renderOpts = column.editRender || column.cellRender;
|
|
89
|
+
let bodyExportMethod = column.exportMethod || columnOpts.exportMethod;
|
|
90
|
+
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
91
|
+
const compConf = renderer.get(renderOpts.name);
|
|
92
|
+
if (compConf) {
|
|
93
|
+
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (!bodyExportMethod) {
|
|
97
|
+
bodyExportMethod = columnOpts.exportMethod;
|
|
98
|
+
}
|
|
99
|
+
if (bodyExportMethod) {
|
|
100
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts });
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
switch (column.type) {
|
|
104
|
+
case 'seq': {
|
|
105
|
+
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
|
|
106
|
+
cellValue = mode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
case 'checkbox':
|
|
110
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row));
|
|
111
|
+
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : '';
|
|
112
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row });
|
|
113
|
+
break;
|
|
114
|
+
case 'radio':
|
|
115
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row));
|
|
116
|
+
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : '';
|
|
117
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row });
|
|
118
|
+
break;
|
|
119
|
+
default:
|
|
120
|
+
if (opts.original) {
|
|
121
|
+
cellValue = getCellValue(row, column);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
cellValue = $xeTable.getCellLabel(row, column);
|
|
125
|
+
if (column.type === 'html') {
|
|
126
|
+
htmlCellElem.innerHTML = cellValue;
|
|
127
|
+
cellValue = htmlCellElem.innerText.trim();
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
131
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
132
|
+
cellValue = cell.innerText.trim();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
item[column.id] = toStringValue(cellValue);
|
|
139
|
+
});
|
|
140
|
+
useMaps[rowid] = true;
|
|
141
|
+
if (pRowid) {
|
|
142
|
+
expandMaps[pRowid] = true;
|
|
143
|
+
}
|
|
144
|
+
rest.push(Object.assign(item, row));
|
|
145
|
+
}
|
|
146
|
+
}, { children: mapChildrenField });
|
|
147
|
+
return rest;
|
|
148
|
+
}
|
|
64
149
|
if (treeConfig) {
|
|
65
150
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
66
|
-
//
|
|
151
|
+
// 如果是树结构
|
|
67
152
|
const rest = [];
|
|
68
153
|
const expandMaps = {};
|
|
69
154
|
const useMaps = {};
|
|
70
|
-
|
|
71
|
-
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
|
|
155
|
+
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
|
|
72
156
|
const row = item._row || item;
|
|
73
157
|
const rowid = handleGetRowId(row);
|
|
74
158
|
if (useMaps[rowid]) {
|
|
75
159
|
return;
|
|
76
160
|
}
|
|
77
|
-
const parentRow =
|
|
161
|
+
const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem;
|
|
78
162
|
const pRowid = parentRow ? handleGetRowId(parentRow) : '';
|
|
79
|
-
if ((
|
|
80
|
-
const hasRowChild =
|
|
163
|
+
if ((isTreeAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
|
|
164
|
+
const hasRowChild = row[childrenField] && row[childrenField].length;
|
|
81
165
|
const item = {
|
|
82
166
|
_row: row,
|
|
83
167
|
_level: nodes.length - 1,
|
|
@@ -937,10 +1021,11 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
937
1021
|
const $xeGantt = $xeTable.$xeGantt;
|
|
938
1022
|
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
939
1023
|
const { treeConfig, showHeader, showFooter } = props;
|
|
940
|
-
const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData;
|
|
1024
|
+
const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData;
|
|
941
1025
|
const { collectColumn, mergeBodyList, mergeFooterList } = internalData;
|
|
942
1026
|
const exportOpts = $xeTable.computeExportOpts;
|
|
943
|
-
const hasTree = treeConfig;
|
|
1027
|
+
const hasTree = !!treeConfig;
|
|
1028
|
+
const hasRowGroup = rowGroupList.length > 0;
|
|
944
1029
|
const customOpts = $xeTable.computeCustomOpts;
|
|
945
1030
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
946
1031
|
const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {};
|
|
@@ -957,6 +1042,11 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
957
1042
|
current: 'current',
|
|
958
1043
|
modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty'])
|
|
959
1044
|
}, options);
|
|
1045
|
+
// 已废弃,参数 isAllExpand
|
|
1046
|
+
if (XEUtils.isBoolean(defOpts.isAllExpand)) {
|
|
1047
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
|
|
1048
|
+
defOpts.isTreeAllExpanded = defOpts.isAllExpand;
|
|
1049
|
+
}
|
|
960
1050
|
const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps);
|
|
961
1051
|
const modes = defOpts.modes || [];
|
|
962
1052
|
const checkMethod = customOpts.checkMethod;
|
|
@@ -999,17 +1089,16 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
999
1089
|
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false);
|
|
1000
1090
|
});
|
|
1001
1091
|
// 更新条件
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
});
|
|
1092
|
+
exportStore.columns = exportColumns;
|
|
1093
|
+
exportStore.typeList = typeList;
|
|
1094
|
+
exportStore.modeList = modeList;
|
|
1095
|
+
exportStore.hasFooter = hasFooter;
|
|
1096
|
+
exportStore.hasMerge = hasMerge;
|
|
1097
|
+
exportStore.hasTree = hasTree;
|
|
1098
|
+
exportStore.hasRowGroup = hasRowGroup;
|
|
1099
|
+
exportStore.isPrint = !!isPrint;
|
|
1100
|
+
exportStore.hasColgroup = isGroup;
|
|
1101
|
+
exportStore.visible = true;
|
|
1013
1102
|
// 默认参数
|
|
1014
1103
|
Object.assign(exportParams, {
|
|
1015
1104
|
mode: selectRecords.length ? 'selected' : 'current'
|
|
@@ -1142,7 +1231,8 @@ export default {
|
|
|
1142
1231
|
// filename: '',
|
|
1143
1232
|
// sheetName: '',
|
|
1144
1233
|
// original: false,
|
|
1145
|
-
//
|
|
1234
|
+
// isTreeAllExpanded: false,
|
|
1235
|
+
// isRowGroupAllExpanded: false,
|
|
1146
1236
|
// data: null,
|
|
1147
1237
|
// remote: false,
|
|
1148
1238
|
// dataFilterMethod: null,
|
|
@@ -1152,6 +1242,11 @@ export default {
|
|
|
1152
1242
|
// beforeExportMethod: null,
|
|
1153
1243
|
// afterExportMethod: null
|
|
1154
1244
|
}, exportOpts, options);
|
|
1245
|
+
// 已废弃,参数 isAllExpand
|
|
1246
|
+
if (XEUtils.isBoolean(opts.isAllExpand)) {
|
|
1247
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
|
|
1248
|
+
opts.isTreeAllExpanded = opts.isAllExpand;
|
|
1249
|
+
}
|
|
1155
1250
|
let { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts;
|
|
1156
1251
|
let groups = [];
|
|
1157
1252
|
const selectRecords = $xeTable.getCheckboxRecords();
|
package/es/table/src/methods.js
CHANGED
|
@@ -3191,12 +3191,12 @@ function updateGroupData($xeTable) {
|
|
|
3191
3191
|
handleeGroupSummary($xeTable, aggList);
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
function handleGroupData($xeTable, list, rowGroups) {
|
|
3194
|
+
function handleGroupData($xeTable, list, rowGroups, isCombinedField) {
|
|
3195
3195
|
let fullData = list;
|
|
3196
3196
|
let treeData = list;
|
|
3197
3197
|
if (rowGroups) {
|
|
3198
3198
|
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
3199
|
-
const { rowField, parentField, childrenField, mapChildrenField } = aggregateOpts;
|
|
3199
|
+
const { rowField, parentField, separator, childrenField, mapChildrenField } = aggregateOpts;
|
|
3200
3200
|
const rowOpts = $xeTable.computeRowOpts;
|
|
3201
3201
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
3202
3202
|
const { checkField } = checkboxOpts;
|
|
@@ -3208,11 +3208,26 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
3208
3208
|
const groupField = rgItem.field;
|
|
3209
3209
|
const groupColumn = $xeTable.getColumnByField(groupField);
|
|
3210
3210
|
const groupMaps = {};
|
|
3211
|
+
const groupCombinedMaps = {};
|
|
3211
3212
|
const aggList = [];
|
|
3212
3213
|
const rowkey = getRowkey($xeTable);
|
|
3213
3214
|
list.forEach((row) => {
|
|
3214
3215
|
const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) : XEUtils.get(row, groupField);
|
|
3215
|
-
|
|
3216
|
+
let groupValue = XEUtils.eqNull(cellValue) ? '' : cellValue;
|
|
3217
|
+
if (isCombinedField) {
|
|
3218
|
+
const groupVals = [groupValue];
|
|
3219
|
+
rowGroups.slice(1).forEach(ogItem => {
|
|
3220
|
+
const ogField = ogItem.field;
|
|
3221
|
+
const ogColumn = $xeTable.getColumnByField(ogField);
|
|
3222
|
+
const ocValue = ogColumn ? $xeTable.getCellLabel(row, ogColumn) : XEUtils.get(row, ogField);
|
|
3223
|
+
const ogValue = XEUtils.eqNull(ocValue) ? '' : ocValue;
|
|
3224
|
+
groupValue += (separator || ' / ') + ogValue;
|
|
3225
|
+
groupVals.push(ogValue);
|
|
3226
|
+
});
|
|
3227
|
+
if (!groupCombinedMaps[groupValue]) {
|
|
3228
|
+
groupCombinedMaps[groupValue] = groupVals;
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3216
3231
|
let childList = groupMaps[groupValue];
|
|
3217
3232
|
if (!childList) {
|
|
3218
3233
|
childList = [];
|
|
@@ -3223,33 +3238,62 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
3223
3238
|
}
|
|
3224
3239
|
childList.push(row);
|
|
3225
3240
|
});
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3241
|
+
if (isCombinedField) {
|
|
3242
|
+
XEUtils.objectEach(groupMaps, (childList, groupValue) => {
|
|
3243
|
+
const aggRow = {
|
|
3244
|
+
isAggregate: true,
|
|
3245
|
+
aggData: {},
|
|
3246
|
+
groupContent: groupValue,
|
|
3247
|
+
groupCombineds: groupCombinedMaps[groupValue],
|
|
3248
|
+
groupField,
|
|
3249
|
+
childCount: 0,
|
|
3250
|
+
[rowField]: getRowUniqueId(),
|
|
3251
|
+
[parentField]: null,
|
|
3252
|
+
[childrenField]: childList,
|
|
3253
|
+
[mapChildrenField]: childList
|
|
3254
|
+
};
|
|
3255
|
+
aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey);
|
|
3256
|
+
if (checkField) {
|
|
3257
|
+
aggRow[checkField] = false;
|
|
3258
|
+
}
|
|
3259
|
+
if (indeterminateField) {
|
|
3260
|
+
aggRow[indeterminateField] = false;
|
|
3261
|
+
}
|
|
3262
|
+
aggList.push(aggRow);
|
|
3263
|
+
treeData.push(aggRow);
|
|
3264
|
+
fullData.push(aggRow);
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
3267
|
+
else {
|
|
3268
|
+
XEUtils.objectEach(groupMaps, (childList, groupValue) => {
|
|
3269
|
+
const { fullData: childFullData, treeData: childTreeData } = handleGroupData($xeTable, childList, rowGroups.slice(1));
|
|
3270
|
+
const aggRow = {
|
|
3271
|
+
isAggregate: true,
|
|
3272
|
+
aggData: {},
|
|
3273
|
+
groupContent: groupValue,
|
|
3274
|
+
groupCombineds: [],
|
|
3275
|
+
groupField,
|
|
3276
|
+
childCount: 0,
|
|
3277
|
+
[rowField]: getRowUniqueId(),
|
|
3278
|
+
[parentField]: null,
|
|
3279
|
+
[childrenField]: childTreeData,
|
|
3280
|
+
[mapChildrenField]: childTreeData
|
|
3281
|
+
};
|
|
3282
|
+
aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey);
|
|
3283
|
+
if (checkField) {
|
|
3284
|
+
aggRow[checkField] = false;
|
|
3285
|
+
}
|
|
3286
|
+
if (indeterminateField) {
|
|
3287
|
+
aggRow[indeterminateField] = false;
|
|
3288
|
+
}
|
|
3289
|
+
aggList.push(aggRow);
|
|
3290
|
+
treeData.push(aggRow);
|
|
3291
|
+
fullData.push(aggRow);
|
|
3292
|
+
if (childFullData.length) {
|
|
3293
|
+
fullData.push(...childFullData);
|
|
3294
|
+
}
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3253
3297
|
handleeGroupSummary($xeTable, aggList);
|
|
3254
3298
|
}
|
|
3255
3299
|
}
|
|
@@ -3258,6 +3302,13 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
3258
3302
|
fullData
|
|
3259
3303
|
};
|
|
3260
3304
|
}
|
|
3305
|
+
function initGroupData($xeTable, list, rowGroups) {
|
|
3306
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
3307
|
+
const { mode } = aggregateOpts;
|
|
3308
|
+
const isCombinedField = mode === 'combined';
|
|
3309
|
+
const groupRest = handleGroupData($xeTable, list, rowGroups, isCombinedField);
|
|
3310
|
+
return groupRest;
|
|
3311
|
+
}
|
|
3261
3312
|
/**
|
|
3262
3313
|
* 加载表格数据
|
|
3263
3314
|
* @param {Array} datas 数据
|
|
@@ -3324,7 +3375,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
|
|
|
3324
3375
|
}
|
|
3325
3376
|
}
|
|
3326
3377
|
else if ((aggregateConfig || rowGroupConfig) && rowGroupList.length) {
|
|
3327
|
-
const groupRest =
|
|
3378
|
+
const groupRest = initGroupData($xeTable, fullData, rowGroupList);
|
|
3328
3379
|
treeData = groupRest.treeData;
|
|
3329
3380
|
fullData = groupRest.fullData;
|
|
3330
3381
|
isRGroup = true;
|
package/es/table/src/table.js
CHANGED
|
@@ -758,6 +758,11 @@ export default {
|
|
|
758
758
|
const props = $xeTable;
|
|
759
759
|
return Object.assign({}, getConfig().table.aggregateConfig || getConfig().table.rowGroupConfig, props.aggregateConfig || props.rowGroupConfig);
|
|
760
760
|
},
|
|
761
|
+
computeAggregateMode() {
|
|
762
|
+
const $xeTable = this;
|
|
763
|
+
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
764
|
+
return aggregateOpts.mode;
|
|
765
|
+
},
|
|
761
766
|
computeAggregateAccuracyOpts() {
|
|
762
767
|
const $xeTable = this;
|
|
763
768
|
const props = $xeTable;
|
|
@@ -1523,6 +1528,14 @@ export default {
|
|
|
1523
1528
|
$xeTable.reloadData(tableFullData);
|
|
1524
1529
|
});
|
|
1525
1530
|
}
|
|
1531
|
+
},
|
|
1532
|
+
computeAggregateMode() {
|
|
1533
|
+
const $xeTable = this;
|
|
1534
|
+
const reactData = $xeTable;
|
|
1535
|
+
const internalData = $xeTable;
|
|
1536
|
+
if (reactData.isRowGroupStatus) {
|
|
1537
|
+
this.loadTableData(internalData.tableSynchData, false, true);
|
|
1538
|
+
}
|
|
1526
1539
|
}
|
|
1527
1540
|
},
|
|
1528
1541
|
created() {
|
|
@@ -1636,6 +1649,9 @@ export default {
|
|
|
1636
1649
|
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
1637
1650
|
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(',')]);
|
|
1638
1651
|
}
|
|
1652
|
+
if (exportConfig && XEUtils.isBoolean(exportOpts.isAllExpand)) {
|
|
1653
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
|
|
1654
|
+
}
|
|
1639
1655
|
if (!props.id) {
|
|
1640
1656
|
if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
1641
1657
|
errLog('vxe.error.reqProp', ['id']);
|
package/es/table/src/util.js
CHANGED
|
@@ -322,6 +322,7 @@ export function createReactData() {
|
|
|
322
322
|
hasFooter: false,
|
|
323
323
|
hasMerge: false,
|
|
324
324
|
hasTree: false,
|
|
325
|
+
hasRowGroup: false,
|
|
325
326
|
hasColgroup: false,
|
|
326
327
|
visible: false
|
|
327
328
|
},
|
|
@@ -332,7 +333,8 @@ export function createReactData() {
|
|
|
332
333
|
type: '',
|
|
333
334
|
isColgroup: false,
|
|
334
335
|
isMerge: false,
|
|
335
|
-
|
|
336
|
+
isTreeAllExpanded: false,
|
|
337
|
+
isRowGroupAllExpanded: false,
|
|
336
338
|
useStyle: false,
|
|
337
339
|
original: false,
|
|
338
340
|
message: true,
|
package/es/table/style.css
CHANGED
|
@@ -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.
|
|
1367
|
+
padding: 0.5em 0;
|
|
1368
1368
|
}
|
|
1369
1369
|
.vxe-table-export--panel .vxe-table-export--panel-column {
|
|
1370
1370
|
width: 80%;
|