vxe-table 3.21.1 → 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 +6 -2
- package/es/locale/lang/de-DE.js +6 -2
- package/es/locale/lang/en-US.js +6 -2
- package/es/locale/lang/es-ES.js +6 -2
- package/es/locale/lang/fr-FR.js +6 -2
- package/es/locale/lang/hu-HU.js +6 -2
- package/es/locale/lang/hy-AM.js +6 -2
- package/es/locale/lang/id-ID.js +6 -2
- package/es/locale/lang/it-IT.js +6 -2
- package/es/locale/lang/ja-JP.js +6 -2
- package/es/locale/lang/ko-KR.js +6 -2
- package/es/locale/lang/ms-MY.js +6 -2
- package/es/locale/lang/nb-NO.js +6 -2
- package/es/locale/lang/pt-BR.js +6 -2
- package/es/locale/lang/ru-RU.js +6 -2
- package/es/locale/lang/th-TH.js +6 -2
- package/es/locale/lang/ug-CN.js +6 -2
- package/es/locale/lang/uk-UA.js +6 -2
- package/es/locale/lang/uz-UZ.js +6 -2
- package/es/locale/lang/vi-VN.js +6 -2
- package/es/locale/lang/zh-CHT.js +6 -2
- package/es/locale/lang/zh-CN.js +6 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +29 -22
- package/es/table/module/export/export-panel.js +29 -16
- package/es/table/module/export/mixin.js +121 -26
- package/es/table/module/menu/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/src/cell.js +1 -1
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- 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 +235 -75
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +6 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +6 -2
- package/lib/locale/lang/de-DE.js +6 -2
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +6 -2
- package/lib/locale/lang/en-US.js +6 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -2
- package/lib/locale/lang/es-ES.js +6 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +6 -2
- package/lib/locale/lang/fr-FR.js +6 -2
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +6 -2
- package/lib/locale/lang/hu-HU.js +6 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +6 -2
- package/lib/locale/lang/hy-AM.js +6 -2
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +6 -2
- package/lib/locale/lang/id-ID.js +6 -2
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +6 -2
- package/lib/locale/lang/it-IT.js +6 -2
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +6 -2
- package/lib/locale/lang/ja-JP.js +6 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +6 -2
- package/lib/locale/lang/ko-KR.js +6 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +6 -2
- package/lib/locale/lang/ms-MY.js +6 -2
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +6 -2
- package/lib/locale/lang/nb-NO.js +6 -2
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +6 -2
- package/lib/locale/lang/pt-BR.js +6 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +6 -2
- package/lib/locale/lang/ru-RU.js +6 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +6 -2
- package/lib/locale/lang/th-TH.js +6 -2
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +6 -2
- package/lib/locale/lang/ug-CN.js +6 -2
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +6 -2
- package/lib/locale/lang/uk-UA.js +6 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +6 -2
- package/lib/locale/lang/uz-UZ.js +6 -2
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +6 -2
- package/lib/locale/lang/vi-VN.js +6 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +6 -2
- package/lib/locale/lang/zh-CHT.js +6 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +6 -2
- package/lib/locale/lang/zh-CN.js +6 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +6 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +30 -21
- 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/module/menu/mixin.js +3 -2
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +4 -4
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/cell.js +1 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.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 +6 -2
- package/packages/locale/lang/de-DE.ts +6 -2
- package/packages/locale/lang/en-US.ts +6 -2
- package/packages/locale/lang/es-ES.ts +6 -2
- package/packages/locale/lang/fr-FR.ts +6 -2
- package/packages/locale/lang/hu-HU.ts +6 -2
- package/packages/locale/lang/hy-AM.ts +6 -2
- package/packages/locale/lang/id-ID.ts +6 -2
- package/packages/locale/lang/it-IT.ts +6 -2
- package/packages/locale/lang/ja-JP.ts +6 -2
- package/packages/locale/lang/ko-KR.ts +6 -2
- package/packages/locale/lang/ms-MY.ts +6 -2
- package/packages/locale/lang/nb-NO.ts +6 -2
- package/packages/locale/lang/pt-BR.ts +6 -2
- package/packages/locale/lang/ru-RU.ts +6 -2
- package/packages/locale/lang/th-TH.ts +6 -2
- package/packages/locale/lang/ug-CN.ts +6 -2
- package/packages/locale/lang/uk-UA.ts +6 -2
- package/packages/locale/lang/uz-UZ.ts +6 -2
- package/packages/locale/lang/vi-VN.ts +6 -2
- package/packages/locale/lang/zh-CHT.ts +6 -2
- package/packages/locale/lang/zh-CN.ts +6 -2
- package/packages/table/module/custom/panel.ts +30 -23
- package/packages/table/module/export/export-panel.ts +29 -17
- package/packages/table/module/export/mixin.ts +122 -27
- package/packages/table/module/menu/mixin.ts +3 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/src/cell.ts +1 -1
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +1 -0
- 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.1779447236462.ttf → iconfont.1779843521280.ttf} +0 -0
- /package/es/{iconfont.1779447236462.woff → iconfont.1779843521280.woff} +0 -0
- /package/es/{iconfont.1779447236462.woff2 → iconfont.1779843521280.woff2} +0 -0
- /package/lib/{iconfont.1779447236462.ttf → iconfont.1779843521280.ttf} +0 -0
- /package/lib/{iconfont.1779447236462.woff → iconfont.1779843521280.woff} +0 -0
- /package/lib/{iconfont.1779447236462.woff2 → iconfont.1779843521280.woff2} +0 -0
|
@@ -166,7 +166,7 @@ export default {
|
|
|
166
166
|
cstmDragTarget: '移动:{0}',
|
|
167
167
|
setting: {
|
|
168
168
|
colSort: '排序',
|
|
169
|
-
sortHelpTip: '
|
|
169
|
+
sortHelpTip: '点击图标开始拖动',
|
|
170
170
|
colTitle: '列标题',
|
|
171
171
|
colResizable: '列宽(像素)',
|
|
172
172
|
colVisible: '是否显示',
|
|
@@ -240,6 +240,10 @@ export default {
|
|
|
240
240
|
expMergeTitle: '如果存在,则支持带有合并结构的单元格',
|
|
241
241
|
expOptAllExpand: '展开树',
|
|
242
242
|
expAllExpandTitle: '如果存在,则支持将带有层级结构的数据全部展开',
|
|
243
|
+
expOptTreeAllExpand: '展开树',
|
|
244
|
+
expTreeAllExpandTitle: '如果存在,则自动展开所有树层级',
|
|
245
|
+
expOptRowGroupAllExpand: '展开分组',
|
|
246
|
+
expRowGroupAllExpandTitle: '如果存在,则自动展开所有分组层级',
|
|
243
247
|
expOptUseStyle: '样式',
|
|
244
248
|
expUseStyleTitle: '如果存在,则支持带样式的单元格',
|
|
245
249
|
expOptOriginal: '源数据',
|
|
@@ -652,7 +656,7 @@ export default {
|
|
|
652
656
|
groupPlaceholder: '拖至此处进行分组',
|
|
653
657
|
valuesPlaceholder: '拖至此处进行聚合',
|
|
654
658
|
dragExistCol: '该列已存在',
|
|
655
|
-
sortHelpTip: '
|
|
659
|
+
sortHelpTip: '点击图标开始拖动'
|
|
656
660
|
},
|
|
657
661
|
aggFuncs: {
|
|
658
662
|
sum: '求和',
|
|
@@ -420,7 +420,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
420
420
|
const { immediate } = customOpts
|
|
421
421
|
const trEl = evnt.currentTarget as HTMLElement
|
|
422
422
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
423
|
-
const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
|
|
423
|
+
const { isCrossDrag, isPeerDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
|
|
424
424
|
const { dragCol } = customPanelReactData
|
|
425
425
|
const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData
|
|
426
426
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
|
|
@@ -465,20 +465,28 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
465
465
|
if (dragColumn.parentId && newColumn.parentId) {
|
|
466
466
|
// 子到子
|
|
467
467
|
|
|
468
|
-
if (!isCrossDrag) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
if (oldAllMaps[newColumn.id]) {
|
|
472
|
-
isSelfToChildStatus = true
|
|
473
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
474
|
-
if (VxeUI.modal) {
|
|
475
|
-
VxeUI.modal.message({
|
|
476
|
-
status: 'error',
|
|
477
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
478
|
-
})
|
|
479
|
-
}
|
|
468
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
469
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
470
|
+
// 非同级
|
|
480
471
|
return
|
|
481
472
|
}
|
|
473
|
+
} else {
|
|
474
|
+
if (!isCrossDrag) {
|
|
475
|
+
return
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (oldAllMaps[newColumn.id]) {
|
|
479
|
+
isSelfToChildStatus = true
|
|
480
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
481
|
+
if (VxeUI.modal) {
|
|
482
|
+
VxeUI.modal.message({
|
|
483
|
+
status: 'error',
|
|
484
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
485
|
+
})
|
|
486
|
+
}
|
|
487
|
+
return
|
|
488
|
+
}
|
|
489
|
+
}
|
|
482
490
|
}
|
|
483
491
|
} else if (dragColumn.parentId) {
|
|
484
492
|
// 子到根
|
|
@@ -616,7 +624,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
616
624
|
const customOpts = $xeTable.computeCustomOpts
|
|
617
625
|
const { showSortDragButton, allowSort, immediate } = customOpts
|
|
618
626
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
619
|
-
const { isCrossDrag, isToChildDrag } = columnDragOpts
|
|
627
|
+
const { isCrossDrag, isPeerDrag, isToChildDrag } = columnDragOpts
|
|
620
628
|
const optEl = evnt.currentTarget as HTMLElement
|
|
621
629
|
const isControlKey = hasControlKey(evnt)
|
|
622
630
|
const colid = optEl.getAttribute('colid')
|
|
@@ -624,7 +632,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
624
632
|
customPanelInternalData.prevDragGroupField = null
|
|
625
633
|
customPanelInternalData.prevDragAggFnColid = null
|
|
626
634
|
// 是否移入有效列
|
|
627
|
-
if (column && (isCrossDrag || column.level === 1)) {
|
|
635
|
+
if (column && (isCrossDrag || isPeerDrag || column.level === 1)) {
|
|
628
636
|
evnt.preventDefault()
|
|
629
637
|
const offsetY = evnt.clientY - optEl.getBoundingClientRect().y
|
|
630
638
|
const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom'
|
|
@@ -632,9 +640,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
632
640
|
!dragCol ||
|
|
633
641
|
!(showSortDragButton && allowSort) ||
|
|
634
642
|
(dragCol && dragCol.id === column.id) ||
|
|
635
|
-
(!isCrossDrag && column.level > 1) ||
|
|
643
|
+
(!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.level > 1)) ||
|
|
636
644
|
(!immediate && column.level > 1) ||
|
|
637
|
-
(!isCrossDrag && dragCol.level > 1) ||
|
|
645
|
+
(!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : dragCol.level > 1)) ||
|
|
638
646
|
(!immediate && dragCol.level > 1)
|
|
639
647
|
) {
|
|
640
648
|
showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos)
|
|
@@ -799,13 +807,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
799
807
|
const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
|
|
800
808
|
const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData
|
|
801
809
|
const customOpts = $xeTable.computeCustomOpts
|
|
802
|
-
const { immediate } = customOpts
|
|
803
810
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
804
811
|
const { popupStyle } = customStore
|
|
805
|
-
const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts
|
|
812
|
+
const { immediate, checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, allowGroup, allowValues, trigger, placement, showSortDragButton, showSortMoveButton, showSortPutButton } = customOpts
|
|
806
813
|
const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
|
|
807
814
|
const vSize = $xeTable.computeSize
|
|
808
|
-
const { isCrossDrag } = columnDragOpts
|
|
815
|
+
const { isCrossDrag, isPeerDrag } = columnDragOpts
|
|
809
816
|
const slots = customOpts.slots || {}
|
|
810
817
|
const headerSlot = slots.header
|
|
811
818
|
const topSlot = slots.top
|
|
@@ -839,7 +846,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
839
846
|
const colTitle = formatText(column.getTitle(), 1)
|
|
840
847
|
const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
|
|
841
848
|
const isHidden = !isChecked
|
|
842
|
-
const showSortBtn = (
|
|
849
|
+
const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1
|
|
843
850
|
colVNs.push(
|
|
844
851
|
h('li', {
|
|
845
852
|
key: column.id,
|
|
@@ -1208,7 +1215,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1208
1215
|
const modalOpts = Object.assign({}, modalOptions)
|
|
1209
1216
|
const drawerOpts = Object.assign({}, drawerOptions)
|
|
1210
1217
|
const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
|
|
1211
|
-
const { isCrossDrag } = columnDragOpts
|
|
1218
|
+
const { isCrossDrag, isPeerDrag } = columnDragOpts
|
|
1212
1219
|
const slots = customOpts.slots || {}
|
|
1213
1220
|
const headerSlot = slots.header
|
|
1214
1221
|
const topSlot = slots.top
|
|
@@ -1256,7 +1263,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
1256
1263
|
const isColGroup = column.children && column.children.length
|
|
1257
1264
|
const isDisabled = checkMethod ? !checkMethod({ $table: $xeTable, column }) : false
|
|
1258
1265
|
const isHidden = !isChecked
|
|
1259
|
-
const showSortBtn = (
|
|
1266
|
+
const showSortBtn = (isCrossDrag || isPeerDrag ? immediate : false) || column.level === 1
|
|
1260
1267
|
trVNs.push(
|
|
1261
1268
|
h('tr', {
|
|
1262
1269
|
key: column.id,
|
|
@@ -242,7 +242,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
242
242
|
|
|
243
243
|
const { defaultOptions, storeData } = props
|
|
244
244
|
const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData
|
|
245
|
-
const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData
|
|
245
|
+
const { hasTree, hasRowGroup, hasMerge, isPrint, hasColgroup, columns } = storeData
|
|
246
246
|
const { isHeader } = defaultOptions
|
|
247
247
|
const colVNs: VNode[] = []
|
|
248
248
|
const checkedAll = $xeExportPanel.computeCheckedAll
|
|
@@ -494,6 +494,19 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
}),
|
|
497
|
+
h('vxe-checkbox', {
|
|
498
|
+
props: {
|
|
499
|
+
value: defaultOptions.isFooter,
|
|
500
|
+
disabled: !storeData.hasFooter,
|
|
501
|
+
title: getI18n('vxe.export.expFooterTitle'),
|
|
502
|
+
content: getI18n('vxe.export.expOptFooter')
|
|
503
|
+
},
|
|
504
|
+
on: {
|
|
505
|
+
input (value: any) {
|
|
506
|
+
defaultOptions.isFooter = value
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}),
|
|
497
510
|
h('vxe-checkbox', {
|
|
498
511
|
props: {
|
|
499
512
|
value: isHeader ? defaultOptions.isTitle : false,
|
|
@@ -564,35 +577,34 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
564
577
|
defaultOptions.useStyle = value
|
|
565
578
|
}
|
|
566
579
|
}
|
|
567
|
-
})
|
|
580
|
+
})
|
|
581
|
+
]),
|
|
582
|
+
h('div', {
|
|
583
|
+
class: 'vxe-table-export--panel-option-row'
|
|
584
|
+
}, [
|
|
568
585
|
h('vxe-checkbox', {
|
|
569
586
|
props: {
|
|
570
|
-
value: hasTree ? defaultOptions.
|
|
587
|
+
value: hasTree ? defaultOptions.isTreeAllExpanded : false,
|
|
571
588
|
disabled: hasEmptyData || !hasTree,
|
|
572
|
-
title: getI18n('vxe.export.
|
|
573
|
-
content: getI18n('vxe.export.
|
|
589
|
+
title: getI18n('vxe.export.expTreeAllExpandTitle'),
|
|
590
|
+
content: getI18n('vxe.export.expOptTreeAllExpand')
|
|
574
591
|
},
|
|
575
592
|
on: {
|
|
576
593
|
input (value: any) {
|
|
577
|
-
defaultOptions.
|
|
594
|
+
defaultOptions.isTreeAllExpanded = value
|
|
578
595
|
}
|
|
579
596
|
}
|
|
580
|
-
})
|
|
581
|
-
]),
|
|
582
|
-
|
|
583
|
-
h('div', {
|
|
584
|
-
class: 'vxe-table-export--panel-option-row'
|
|
585
|
-
}, [
|
|
597
|
+
}),
|
|
586
598
|
h('vxe-checkbox', {
|
|
587
599
|
props: {
|
|
588
|
-
value: defaultOptions.
|
|
589
|
-
disabled: !
|
|
590
|
-
title: getI18n('vxe.export.
|
|
591
|
-
content: getI18n('vxe.export.
|
|
600
|
+
value: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
|
|
601
|
+
disabled: hasEmptyData || !hasRowGroup,
|
|
602
|
+
title: getI18n('vxe.export.expRowGroupAllExpandTitle'),
|
|
603
|
+
content: getI18n('vxe.export.expOptRowGroupAllExpand')
|
|
592
604
|
},
|
|
593
605
|
on: {
|
|
594
606
|
input (value: any) {
|
|
595
|
-
defaultOptions.
|
|
607
|
+
defaultOptions.isRowGroupAllExpanded = value
|
|
596
608
|
}
|
|
597
609
|
}
|
|
598
610
|
})
|
|
@@ -15,12 +15,6 @@ let htmlCellElem: any
|
|
|
15
15
|
const csvBOM = '\ufeff'
|
|
16
16
|
const enterSymbol = '\r\n'
|
|
17
17
|
|
|
18
|
-
function hasTreeChildren ($xeTable: VxeTableConstructor, row: any) {
|
|
19
|
-
const treeOpts = $xeTable.computeTreeOpts
|
|
20
|
-
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
21
|
-
return row[childrenField] && row[childrenField].length
|
|
22
|
-
}
|
|
23
|
-
|
|
24
18
|
function getSeq ($xeTable: VxeTableConstructor, cellValue: any, row: any, $rowIndex: number, column: VxeTableDefines.ColumnInfo, $columnIndex: number) {
|
|
25
19
|
const seqOpts = $xeTable.computeSeqOpts
|
|
26
20
|
const seqMd = seqOpts.seqMethod || (column as any).seqMethod
|
|
@@ -64,33 +58,119 @@ const toStringValue = (cellValue: any) => {
|
|
|
64
58
|
|
|
65
59
|
function getBodyLabelData ($xeTable: VxeTableConstructor, opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) {
|
|
66
60
|
const props = $xeTable
|
|
61
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
67
62
|
|
|
68
|
-
const {
|
|
63
|
+
const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts
|
|
69
64
|
const { treeConfig } = props
|
|
65
|
+
const { isRowGroupStatus } = reactData
|
|
70
66
|
const radioOpts = $xeTable.computeRadioOpts
|
|
71
67
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
72
68
|
const treeOpts = $xeTable.computeTreeOpts
|
|
73
69
|
const columnOpts = $xeTable.computeColumnOpts
|
|
70
|
+
const aggregateOpts = $xeTable.computeAggregateOpts
|
|
74
71
|
if (!htmlCellElem) {
|
|
75
72
|
htmlCellElem = document.createElement('div')
|
|
76
73
|
}
|
|
74
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
75
|
+
if (isRowGroupStatus) {
|
|
76
|
+
// 如果是数据分组
|
|
77
|
+
// 如果是数据分组
|
|
78
|
+
const { mapChildrenField } = aggregateOpts
|
|
79
|
+
const rest: any[] = []
|
|
80
|
+
const expandMaps: Record<string, boolean> = {}
|
|
81
|
+
const useMaps: Record<string, boolean> = {}
|
|
82
|
+
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
|
|
83
|
+
const row = item._row || item
|
|
84
|
+
const rowid = handleGetRowId(row)
|
|
85
|
+
if (useMaps[rowid]) {
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem
|
|
89
|
+
const pRowid = parentRow ? handleGetRowId(parentRow) : ''
|
|
90
|
+
if ((isRowGroupAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)))) {
|
|
91
|
+
const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length
|
|
92
|
+
const item: any = {
|
|
93
|
+
_row: row,
|
|
94
|
+
_level: nodes.length - 1,
|
|
95
|
+
_hasChild: hasRowChild,
|
|
96
|
+
_expand: hasRowChild && $xeTable.isRowExpandByRow(row)
|
|
97
|
+
}
|
|
98
|
+
columns.forEach((column, $columnIndex) => {
|
|
99
|
+
let cellValue: string | number | boolean | null = ''
|
|
100
|
+
const renderOpts = column.editRender || column.cellRender
|
|
101
|
+
let bodyExportMethod: VxeColumnPropTypes.ExportMethod | undefined = column.exportMethod || columnOpts.exportMethod
|
|
102
|
+
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
103
|
+
const compConf = renderer.get(renderOpts.name)
|
|
104
|
+
if (compConf) {
|
|
105
|
+
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!bodyExportMethod) {
|
|
109
|
+
bodyExportMethod = columnOpts.exportMethod
|
|
110
|
+
}
|
|
111
|
+
if (bodyExportMethod) {
|
|
112
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts })
|
|
113
|
+
} else {
|
|
114
|
+
switch (column.type) {
|
|
115
|
+
case 'seq': {
|
|
116
|
+
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
117
|
+
cellValue = mode === 'all' ? seqVal : getSeq($xeTable, seqVal, row, $rowIndex, column, $columnIndex)
|
|
118
|
+
break
|
|
119
|
+
}
|
|
120
|
+
case 'checkbox':
|
|
121
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
122
|
+
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
123
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
|
|
124
|
+
break
|
|
125
|
+
case 'radio':
|
|
126
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
127
|
+
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
128
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
|
|
129
|
+
break
|
|
130
|
+
default:
|
|
131
|
+
if (opts.original) {
|
|
132
|
+
cellValue = getCellValue(row, column)
|
|
133
|
+
} else {
|
|
134
|
+
cellValue = $xeTable.getCellLabel(row, column)
|
|
135
|
+
if (column.type === 'html') {
|
|
136
|
+
htmlCellElem.innerHTML = cellValue
|
|
137
|
+
cellValue = htmlCellElem.innerText.trim()
|
|
138
|
+
} else {
|
|
139
|
+
const cell = $xeTable.getCellElement(row, column)
|
|
140
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
141
|
+
cellValue = cell.innerText.trim()
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
item[column.id] = toStringValue(cellValue)
|
|
148
|
+
})
|
|
149
|
+
useMaps[rowid] = true
|
|
150
|
+
if (pRowid) {
|
|
151
|
+
expandMaps[pRowid] = true
|
|
152
|
+
}
|
|
153
|
+
rest.push(Object.assign(item, row))
|
|
154
|
+
}
|
|
155
|
+
}, { children: mapChildrenField })
|
|
156
|
+
return rest
|
|
157
|
+
}
|
|
77
158
|
if (treeConfig) {
|
|
78
159
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
79
|
-
//
|
|
160
|
+
// 如果是树结构
|
|
80
161
|
const rest: any[] = []
|
|
81
162
|
const expandMaps: Record<string, boolean> = {}
|
|
82
163
|
const useMaps: Record<string, boolean> = {}
|
|
83
|
-
|
|
84
|
-
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
|
|
164
|
+
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
|
|
85
165
|
const row = item._row || item
|
|
86
166
|
const rowid = handleGetRowId(row)
|
|
87
167
|
if (useMaps[rowid]) {
|
|
88
168
|
return
|
|
89
169
|
}
|
|
90
|
-
const parentRow =
|
|
170
|
+
const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem
|
|
91
171
|
const pRowid = parentRow ? handleGetRowId(parentRow) : ''
|
|
92
|
-
if ((
|
|
93
|
-
const hasRowChild =
|
|
172
|
+
if ((isTreeAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
|
|
173
|
+
const hasRowChild = row[childrenField] && row[childrenField].length
|
|
94
174
|
const item: any = {
|
|
95
175
|
_row: row,
|
|
96
176
|
_level: nodes.length - 1,
|
|
@@ -1005,10 +1085,11 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1005
1085
|
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
1006
1086
|
|
|
1007
1087
|
const { treeConfig, showHeader, showFooter } = props
|
|
1008
|
-
const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData
|
|
1088
|
+
const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData
|
|
1009
1089
|
const { collectColumn, mergeBodyList, mergeFooterList } = internalData
|
|
1010
1090
|
const exportOpts = $xeTable.computeExportOpts
|
|
1011
|
-
const hasTree = treeConfig
|
|
1091
|
+
const hasTree = !!treeConfig
|
|
1092
|
+
const hasRowGroup = rowGroupList.length > 0
|
|
1012
1093
|
const customOpts = $xeTable.computeCustomOpts
|
|
1013
1094
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
1014
1095
|
const proxyOpts = $xeGGWrapper ? $xeGGWrapper.computeProxyOpts : {}
|
|
@@ -1025,6 +1106,13 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1025
1106
|
current: 'current',
|
|
1026
1107
|
modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty'])
|
|
1027
1108
|
}, options)
|
|
1109
|
+
|
|
1110
|
+
// 已废弃,参数 isAllExpand
|
|
1111
|
+
if (XEUtils.isBoolean((defOpts as any).isAllExpand)) {
|
|
1112
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded'])
|
|
1113
|
+
defOpts.isTreeAllExpanded = (defOpts as any).isAllExpand
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1028
1116
|
const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps)
|
|
1029
1117
|
const modes = defOpts.modes || []
|
|
1030
1118
|
const checkMethod = customOpts.checkMethod
|
|
@@ -1065,17 +1153,16 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1065
1153
|
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false)
|
|
1066
1154
|
})
|
|
1067
1155
|
// 更新条件
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
})
|
|
1156
|
+
exportStore.columns = exportColumns
|
|
1157
|
+
exportStore.typeList = typeList
|
|
1158
|
+
exportStore.modeList = modeList
|
|
1159
|
+
exportStore.hasFooter = hasFooter
|
|
1160
|
+
exportStore.hasMerge = hasMerge
|
|
1161
|
+
exportStore.hasTree = hasTree
|
|
1162
|
+
exportStore.hasRowGroup = hasRowGroup
|
|
1163
|
+
exportStore.isPrint = !!isPrint
|
|
1164
|
+
exportStore.hasColgroup = isGroup
|
|
1165
|
+
exportStore.visible = true
|
|
1079
1166
|
// 默认参数
|
|
1080
1167
|
Object.assign(exportParams, {
|
|
1081
1168
|
mode: selectRecords.length ? 'selected' : 'current'
|
|
@@ -1212,7 +1299,8 @@ export default {
|
|
|
1212
1299
|
// filename: '',
|
|
1213
1300
|
// sheetName: '',
|
|
1214
1301
|
// original: false,
|
|
1215
|
-
//
|
|
1302
|
+
// isTreeAllExpanded: false,
|
|
1303
|
+
// isRowGroupAllExpanded: false,
|
|
1216
1304
|
// data: null,
|
|
1217
1305
|
// remote: false,
|
|
1218
1306
|
// dataFilterMethod: null,
|
|
@@ -1222,6 +1310,13 @@ export default {
|
|
|
1222
1310
|
// beforeExportMethod: null,
|
|
1223
1311
|
// afterExportMethod: null
|
|
1224
1312
|
}, exportOpts, options)
|
|
1313
|
+
|
|
1314
|
+
// 已废弃,参数 isAllExpand
|
|
1315
|
+
if (XEUtils.isBoolean((opts as any).isAllExpand)) {
|
|
1316
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded'])
|
|
1317
|
+
opts.isTreeAllExpanded = (opts as any).isAllExpand
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1225
1320
|
let { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts
|
|
1226
1321
|
let groups: any[] = []
|
|
1227
1322
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
@@ -312,8 +312,9 @@ export default {
|
|
|
312
312
|
if (!menu.loading && !menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
|
|
313
313
|
const gMenuOpts = menus.get(menu.code)
|
|
314
314
|
const params = Object.assign({}, internalData._currMenuParams, { menu, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt })
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
const tmMethod = gMenuOpts ? (gMenuOpts.tableMenuMethod || gMenuOpts.menuMethod) : null
|
|
316
|
+
if (tmMethod) {
|
|
317
|
+
tmMethod(params, evnt)
|
|
317
318
|
}
|
|
318
319
|
// 在 v4 中废弃事件 context-menu-click
|
|
319
320
|
if ($xeTable.$listeners['context-menu-click']) {
|
|
@@ -394,9 +394,9 @@ export default {
|
|
|
394
394
|
},
|
|
395
395
|
hasCellRules (type: any, row: any, column: any) {
|
|
396
396
|
const { editRules } = this
|
|
397
|
-
const {
|
|
398
|
-
if (
|
|
399
|
-
const rules = XEUtils.get(editRules,
|
|
397
|
+
const { field } = column
|
|
398
|
+
if (field && editRules) {
|
|
399
|
+
const rules = column.rules ? column.rules : XEUtils.get(editRules, field)
|
|
400
400
|
return rules && XEUtils.find(rules, rule => type === 'all' || !rule.trigger || type === rule.trigger)
|
|
401
401
|
}
|
|
402
402
|
return false
|
|
@@ -425,7 +425,7 @@ export default {
|
|
|
425
425
|
const errorRules: Rule[] = []
|
|
426
426
|
const syncValidList: Promise<any>[] = []
|
|
427
427
|
if (field && editRules) {
|
|
428
|
-
const rules = XEUtils.get(editRules, field)
|
|
428
|
+
const rules = column.rules ? column.rules : XEUtils.get(editRules, field)
|
|
429
429
|
if (rules) {
|
|
430
430
|
const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, field) : val
|
|
431
431
|
rules.forEach((rule: any) => {
|
|
@@ -1161,7 +1161,7 @@ export const Cell = {
|
|
|
1161
1161
|
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
1162
1162
|
let isRequired = false
|
|
1163
1163
|
if (editRules) {
|
|
1164
|
-
const columnRules = XEUtils.get(editRules, column.field)
|
|
1164
|
+
const columnRules = column.rules ? column.rules : XEUtils.get(editRules, column.field)
|
|
1165
1165
|
if (columnRules) {
|
|
1166
1166
|
isRequired = columnRules.some((rule: any) => rule.required)
|
|
1167
1167
|
}
|
|
@@ -103,6 +103,8 @@ export const columnProps = {
|
|
|
103
103
|
filterRender: Object as PropType<VxeColumnPropTypes.FilterRender>,
|
|
104
104
|
// 是否显示浮动筛选
|
|
105
105
|
floatingFilters: Object as PropType<VxeColumnPropTypes.FloatingFilters>,
|
|
106
|
+
// 列的校验规则
|
|
107
|
+
rules: Array as PropType<VxeColumnPropTypes.Rules>,
|
|
106
108
|
// 设置为分组节点
|
|
107
109
|
rowGroupNode: Boolean as PropType<VxeColumnPropTypes.RowGroupNode>,
|
|
108
110
|
// 设置为树节点
|
|
@@ -120,6 +120,7 @@ export class ColumnInfo {
|
|
|
120
120
|
filterRecoverMethod: _vm.filterRecoverMethod,
|
|
121
121
|
filterRender: filterRender,
|
|
122
122
|
floatingFilters: _vm.floatingFilters,
|
|
123
|
+
rules: _vm.rules,
|
|
123
124
|
rowGroupNode: _vm.rowGroupNode,
|
|
124
125
|
treeNode: _vm.treeNode,
|
|
125
126
|
dragSort: _vm.dragSort,
|