vxe-table 4.13.45 → 4.13.47
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/grid/src/grid.js +1 -1
- package/es/locale/lang/ar-EG.js +14 -1
- package/es/locale/lang/de-DE.js +14 -1
- package/es/locale/lang/en-US.js +14 -1
- package/es/locale/lang/es-ES.js +14 -1
- package/es/locale/lang/fr-FR.js +14 -1
- package/es/locale/lang/hu-HU.js +14 -1
- package/es/locale/lang/hy-AM.js +14 -1
- package/es/locale/lang/id-ID.js +14 -1
- package/es/locale/lang/it-IT.js +14 -1
- package/es/locale/lang/ja-JP.js +14 -1
- package/es/locale/lang/ko-KR.js +14 -1
- package/es/locale/lang/ms-MY.js +14 -1
- package/es/locale/lang/nb-NO.js +14 -1
- package/es/locale/lang/pt-BR.js +14 -1
- package/es/locale/lang/ru-RU.js +14 -1
- package/es/locale/lang/th-TH.js +14 -1
- package/es/locale/lang/ug-CN.js +14 -1
- package/es/locale/lang/uk-UA.js +14 -1
- package/es/locale/lang/uz-UZ.js +14 -1
- package/es/locale/lang/vi-VN.js +14 -1
- package/es/locale/lang/zh-CHT.js +15 -2
- package/es/locale/lang/zh-CN.js +14 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/hook.js +20 -5
- package/es/table/module/custom/panel.js +27 -13
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/table.js +69 -9
- package/es/ui/index.js +8 -5
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +84 -40
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +14 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +14 -1
- package/lib/locale/lang/de-DE.js +14 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +14 -1
- package/lib/locale/lang/en-US.js +14 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +14 -1
- package/lib/locale/lang/es-ES.js +14 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +14 -1
- package/lib/locale/lang/fr-FR.js +14 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +14 -1
- package/lib/locale/lang/hu-HU.js +14 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +14 -1
- package/lib/locale/lang/hy-AM.js +14 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +14 -1
- package/lib/locale/lang/id-ID.js +14 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +14 -1
- package/lib/locale/lang/it-IT.js +14 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +14 -1
- package/lib/locale/lang/ja-JP.js +14 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +14 -1
- package/lib/locale/lang/ko-KR.js +14 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +14 -1
- package/lib/locale/lang/ms-MY.js +14 -1
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +14 -1
- package/lib/locale/lang/nb-NO.js +14 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +14 -1
- package/lib/locale/lang/pt-BR.js +14 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +14 -1
- package/lib/locale/lang/ru-RU.js +14 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +14 -1
- package/lib/locale/lang/th-TH.js +14 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +14 -1
- package/lib/locale/lang/ug-CN.js +14 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +14 -1
- package/lib/locale/lang/uk-UA.js +14 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +14 -1
- package/lib/locale/lang/uz-UZ.js +14 -1
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +14 -1
- package/lib/locale/lang/vi-VN.js +14 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +14 -1
- package/lib/locale/lang/zh-CHT.js +15 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +15 -2
- package/lib/locale/lang/zh-CN.js +14 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +14 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +20 -5
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +26 -14
- package/lib/table/module/custom/panel.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/table.js +13 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +8 -5
- 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/package.json +1 -1
- package/packages/grid/src/grid.ts +1 -1
- package/packages/locale/lang/ar-EG.ts +14 -1
- package/packages/locale/lang/de-DE.ts +14 -1
- package/packages/locale/lang/en-US.ts +14 -1
- package/packages/locale/lang/es-ES.ts +14 -1
- package/packages/locale/lang/fr-FR.ts +14 -1
- package/packages/locale/lang/hu-HU.ts +14 -1
- package/packages/locale/lang/hy-AM.ts +14 -1
- package/packages/locale/lang/id-ID.ts +14 -1
- package/packages/locale/lang/it-IT.ts +14 -1
- package/packages/locale/lang/ja-JP.ts +14 -1
- package/packages/locale/lang/ko-KR.ts +14 -1
- package/packages/locale/lang/ms-MY.ts +14 -1
- package/packages/locale/lang/nb-NO.ts +14 -1
- package/packages/locale/lang/pt-BR.ts +14 -1
- package/packages/locale/lang/ru-RU.ts +14 -1
- package/packages/locale/lang/th-TH.ts +14 -1
- package/packages/locale/lang/ug-CN.ts +14 -1
- package/packages/locale/lang/uk-UA.ts +14 -1
- package/packages/locale/lang/uz-UZ.ts +14 -1
- package/packages/locale/lang/vi-VN.ts +14 -1
- package/packages/locale/lang/zh-CHT.ts +15 -2
- package/packages/locale/lang/zh-CN.ts +14 -1
- package/packages/table/module/custom/hook.ts +18 -5
- package/packages/table/module/custom/panel.ts +26 -13
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/table.ts +75 -13
- package/packages/ui/index.ts +7 -4
- /package/es/{iconfont.1750641793236.ttf → iconfont.1750732182259.ttf} +0 -0
- /package/es/{iconfont.1750641793236.woff → iconfont.1750732182259.woff} +0 -0
- /package/es/{iconfont.1750641793236.woff2 → iconfont.1750732182259.woff2} +0 -0
- /package/lib/{iconfont.1750641793236.ttf → iconfont.1750732182259.ttf} +0 -0
- /package/lib/{iconfont.1750641793236.woff → iconfont.1750732182259.woff} +0 -0
- /package/lib/{iconfont.1750641793236.woff2 → iconfont.1750732182259.woff2} +0 -0
|
@@ -79,6 +79,7 @@ export default {
|
|
|
79
79
|
customCancel: 'Скасувати',
|
|
80
80
|
customRestore: 'Відновити за замовчуванням',
|
|
81
81
|
maxFixedCol: 'Максимальна кількість заморожених стовпців не може перевищувати {0}',
|
|
82
|
+
maxGroupCol: '最大分组字段的数量不能超过 {0} 个',
|
|
82
83
|
dragTip: 'Перемістити: {0}',
|
|
83
84
|
resizeColTip: 'Ширина: {0} пікселів',
|
|
84
85
|
resizeRowTip: 'Висота: {0} пікселів',
|
|
@@ -561,7 +562,19 @@ export default {
|
|
|
561
562
|
extendPivotTable: {
|
|
562
563
|
aggregation: {
|
|
563
564
|
grouping: '分组',
|
|
564
|
-
values: '值'
|
|
565
|
+
values: '值',
|
|
566
|
+
groupPlaceholder: '拖至此处进行分组',
|
|
567
|
+
valuesPlaceholder: '拖至此处进行聚合',
|
|
568
|
+
dragExistCol: '该列已存在'
|
|
569
|
+
},
|
|
570
|
+
aggFuncs: {
|
|
571
|
+
sum: '求和',
|
|
572
|
+
count: '计数',
|
|
573
|
+
avg: '平均值',
|
|
574
|
+
min: '最小值',
|
|
575
|
+
max: '最大值',
|
|
576
|
+
first: '首个值',
|
|
577
|
+
last: '末尾值'
|
|
565
578
|
}
|
|
566
579
|
},
|
|
567
580
|
filterComplexInput: {
|
|
@@ -79,6 +79,7 @@ export default {
|
|
|
79
79
|
customCancel: 'Bekor qilmoq',
|
|
80
80
|
customRestore: 'Standartni tiklash',
|
|
81
81
|
maxFixedCol: 'Muzlatilgan ustunlarning maksimal soni {0} dan oshmaydi',
|
|
82
|
+
maxGroupCol: '最大分组字段的数量不能超过 {0} 个',
|
|
82
83
|
dragTip: "Ko'chiring: {0}",
|
|
83
84
|
resizeColTip: 'Kengligi: {0} piksel',
|
|
84
85
|
resizeRowTip: 'Yuqori: {0} piksel',
|
|
@@ -561,7 +562,19 @@ export default {
|
|
|
561
562
|
extendPivotTable: {
|
|
562
563
|
aggregation: {
|
|
563
564
|
grouping: '分组',
|
|
564
|
-
values: '值'
|
|
565
|
+
values: '值',
|
|
566
|
+
groupPlaceholder: '拖至此处进行分组',
|
|
567
|
+
valuesPlaceholder: '拖至此处进行聚合',
|
|
568
|
+
dragExistCol: '该列已存在'
|
|
569
|
+
},
|
|
570
|
+
aggFuncs: {
|
|
571
|
+
sum: '求和',
|
|
572
|
+
count: '计数',
|
|
573
|
+
avg: '平均值',
|
|
574
|
+
min: '最小值',
|
|
575
|
+
max: '最大值',
|
|
576
|
+
first: '首个值',
|
|
577
|
+
last: '末尾值'
|
|
565
578
|
}
|
|
566
579
|
},
|
|
567
580
|
filterComplexInput: {
|
|
@@ -79,6 +79,7 @@ export default {
|
|
|
79
79
|
customCancel: 'Hủy bỏ',
|
|
80
80
|
customRestore: 'Khôi phục mặc định',
|
|
81
81
|
maxFixedCol: 'Số lượng cột đóng băng tối đa không thể vượt quá {0}',
|
|
82
|
+
maxGroupCol: '最大分组字段的数量不能超过 {0} 个',
|
|
82
83
|
dragTip: 'Di chuyển: {0}',
|
|
83
84
|
resizeColTip: 'Chiều rộng: {0} pixel',
|
|
84
85
|
resizeRowTip: 'Chiều cao: {0} pixel',
|
|
@@ -561,7 +562,19 @@ export default {
|
|
|
561
562
|
extendPivotTable: {
|
|
562
563
|
aggregation: {
|
|
563
564
|
grouping: '分组',
|
|
564
|
-
values: '值'
|
|
565
|
+
values: '值',
|
|
566
|
+
groupPlaceholder: '拖至此处进行分组',
|
|
567
|
+
valuesPlaceholder: '拖至此处进行聚合',
|
|
568
|
+
dragExistCol: '该列已存在'
|
|
569
|
+
},
|
|
570
|
+
aggFuncs: {
|
|
571
|
+
sum: '求和',
|
|
572
|
+
count: '计数',
|
|
573
|
+
avg: '平均值',
|
|
574
|
+
min: '最小值',
|
|
575
|
+
max: '最大值',
|
|
576
|
+
first: '首个值',
|
|
577
|
+
last: '末尾值'
|
|
565
578
|
}
|
|
566
579
|
},
|
|
567
580
|
filterComplexInput: {
|
|
@@ -79,6 +79,7 @@ export default {
|
|
|
79
79
|
customCancel: '取消',
|
|
80
80
|
customRestore: '恢復默認',
|
|
81
81
|
maxFixedCol: '最大凍結列的數量不能超過 {0} 個',
|
|
82
|
+
maxGroupCol: '最大分組欄位的數量不能超過 {0} 個',
|
|
82
83
|
dragTip: '移動:{0}',
|
|
83
84
|
resizeColTip: '寬:{0} 像素',
|
|
84
85
|
resizeRowTip: '高:{0} 像素',
|
|
@@ -560,8 +561,20 @@ export default {
|
|
|
560
561
|
},
|
|
561
562
|
extendPivotTable: {
|
|
562
563
|
aggregation: {
|
|
563
|
-
grouping: '
|
|
564
|
-
values: '值'
|
|
564
|
+
grouping: '分組',
|
|
565
|
+
values: '值',
|
|
566
|
+
groupPlaceholder: '拖曳至此處進行分組',
|
|
567
|
+
valuesPlaceholder: '拖曳至此處進行聚合',
|
|
568
|
+
dragExistCol: '該列已存在'
|
|
569
|
+
},
|
|
570
|
+
aggFuncs: {
|
|
571
|
+
sum: '求和',
|
|
572
|
+
count: '计数',
|
|
573
|
+
avg: '平均值',
|
|
574
|
+
min: '最小值',
|
|
575
|
+
max: '最大值',
|
|
576
|
+
first: '首个值',
|
|
577
|
+
last: '末尾值'
|
|
565
578
|
}
|
|
566
579
|
},
|
|
567
580
|
filterComplexInput: {
|
|
@@ -79,6 +79,7 @@ export default {
|
|
|
79
79
|
customCancel: '取消',
|
|
80
80
|
customRestore: '恢复默认',
|
|
81
81
|
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
82
|
+
maxGroupCol: '最大分组字段的数量不能超过 {0} 个',
|
|
82
83
|
dragTip: '移动:{0}',
|
|
83
84
|
resizeColTip: '宽:{0} 像素',
|
|
84
85
|
resizeRowTip: '高:{0} 像素',
|
|
@@ -561,7 +562,19 @@ export default {
|
|
|
561
562
|
extendPivotTable: {
|
|
562
563
|
aggregation: {
|
|
563
564
|
grouping: '分组',
|
|
564
|
-
values: '值'
|
|
565
|
+
values: '值',
|
|
566
|
+
groupPlaceholder: '拖至此处进行分组',
|
|
567
|
+
valuesPlaceholder: '拖至此处进行聚合',
|
|
568
|
+
dragExistCol: '该列已存在'
|
|
569
|
+
},
|
|
570
|
+
aggFuncs: {
|
|
571
|
+
sum: '求和',
|
|
572
|
+
count: '计数',
|
|
573
|
+
avg: '平均值',
|
|
574
|
+
min: '最小值',
|
|
575
|
+
max: '最大值',
|
|
576
|
+
first: '首个值',
|
|
577
|
+
last: '末尾值'
|
|
565
578
|
}
|
|
566
579
|
},
|
|
567
580
|
filterComplexInput: {
|
|
@@ -81,7 +81,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
81
81
|
const saveCustom = () => {
|
|
82
82
|
const { customColumnList, aggHandleFields, rowGroupList } = reactData
|
|
83
83
|
const customOpts = computeCustomOpts.value
|
|
84
|
-
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts
|
|
84
|
+
const { allowVisible, allowSort, allowFixed, allowResizable, allowGroup, allowValues } = customOpts
|
|
85
85
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parentColumn) => {
|
|
86
86
|
if (parentColumn) {
|
|
87
87
|
// 更新子列信息
|
|
@@ -106,6 +106,9 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
106
106
|
if (allowVisible) {
|
|
107
107
|
column.visible = column.renderVisible
|
|
108
108
|
}
|
|
109
|
+
if (allowGroup && allowValues) {
|
|
110
|
+
column.aggFunc = column.renderAggFn
|
|
111
|
+
}
|
|
109
112
|
})
|
|
110
113
|
reactData.isCustomStatus = true
|
|
111
114
|
reactData.isDragColMove = true
|
|
@@ -113,14 +116,17 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
113
116
|
reactData.isDragColMove = false
|
|
114
117
|
}, 1000)
|
|
115
118
|
return $xeTable.saveCustomStore('confirm').then(() => {
|
|
116
|
-
if (($xeTable as any).handlePivotTableAggregateData) {
|
|
119
|
+
if (allowGroup && allowValues && ($xeTable as any).handlePivotTableAggregateData) {
|
|
117
120
|
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
118
|
-
|
|
121
|
+
// 更新数据分组
|
|
119
122
|
if (aggHandleFields.length) {
|
|
120
123
|
$xeTable.setRowGroups(aggHandleFields)
|
|
121
124
|
} else {
|
|
122
125
|
$xeTable.clearRowGroups()
|
|
123
126
|
}
|
|
127
|
+
} else {
|
|
128
|
+
// 更新聚合函数
|
|
129
|
+
$xeTable.handleUpdateAggData()
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
})
|
|
@@ -207,7 +213,8 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
207
213
|
visible: true,
|
|
208
214
|
resizable: options === true,
|
|
209
215
|
fixed: options === true,
|
|
210
|
-
sort: options === true
|
|
216
|
+
sort: options === true,
|
|
217
|
+
aggFunc: options === true
|
|
211
218
|
}, options)
|
|
212
219
|
XEUtils.eachTree(collectColumn, (column) => {
|
|
213
220
|
if (opts.resizable) {
|
|
@@ -222,12 +229,16 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
222
229
|
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
223
230
|
column.visible = column.defaultVisible
|
|
224
231
|
}
|
|
232
|
+
if (opts.aggFunc) {
|
|
233
|
+
column.aggFunc = column.defaultAggFunc
|
|
234
|
+
column.renderAggFn = column.defaultAggFunc
|
|
235
|
+
}
|
|
225
236
|
column.renderResizeWidth = column.renderWidth
|
|
226
237
|
})
|
|
227
238
|
reactData.isCustomStatus = false
|
|
228
239
|
$xeTable.saveCustomStore('reset')
|
|
229
240
|
return $xeTable.handleCustom().then(() => {
|
|
230
|
-
if (($xeTable as any).handlePivotTableAggregateData) {
|
|
241
|
+
if (opts.aggFunc && ($xeTable as any).handlePivotTableAggregateData) {
|
|
231
242
|
const rowGroupFields = computeRowGroupFields.value
|
|
232
243
|
if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
|
|
233
244
|
if (rowGroupFields && rowGroupFields.length) {
|
|
@@ -235,6 +246,8 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
235
246
|
} else {
|
|
236
247
|
$xeTable.clearRowGroups()
|
|
237
248
|
}
|
|
249
|
+
} else {
|
|
250
|
+
$xeTable.handleUpdateAggData()
|
|
238
251
|
}
|
|
239
252
|
}
|
|
240
253
|
})
|
|
@@ -39,15 +39,17 @@ export default defineVxeComponent({
|
|
|
39
39
|
const refDragLineElem = ref() as Ref<HTMLDivElement>
|
|
40
40
|
const refDragTipElem = ref() as Ref<HTMLDivElement>
|
|
41
41
|
|
|
42
|
-
const customPanelReactData
|
|
42
|
+
const customPanelReactData = reactive<TableCustomPanelReactData>({
|
|
43
43
|
dragCol: null,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
dragGroupField: null,
|
|
45
|
+
dragAggFnCol: null,
|
|
46
46
|
dragTipText: ''
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
const customPanelInternalData: TableCustomPanelInternalData = {
|
|
50
50
|
// prevDragCol: undefined,
|
|
51
|
+
// prevDragGroupField: undefined,
|
|
52
|
+
// prevDragAggFnColid: undefined,
|
|
51
53
|
// prevDragToChild: false,
|
|
52
54
|
// prevDragPos: null
|
|
53
55
|
}
|
|
@@ -230,8 +232,8 @@ export default defineVxeComponent({
|
|
|
230
232
|
const { prevDragToChild } = customPanelInternalData
|
|
231
233
|
const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect()
|
|
232
234
|
const customBodyRect = customBodyElem.getBoundingClientRect()
|
|
235
|
+
const dragLineEl = refDragLineElem.value
|
|
233
236
|
if (optEl) {
|
|
234
|
-
const dragLineEl = refDragLineElem.value
|
|
235
237
|
if (dragLineEl) {
|
|
236
238
|
if (showLine) {
|
|
237
239
|
const optRect = optEl.getBoundingClientRect()
|
|
@@ -246,6 +248,10 @@ export default defineVxeComponent({
|
|
|
246
248
|
dragLineEl.style.display = ''
|
|
247
249
|
}
|
|
248
250
|
}
|
|
251
|
+
} else {
|
|
252
|
+
if (dragLineEl) {
|
|
253
|
+
dragLineEl.style.display = 'node'
|
|
254
|
+
}
|
|
249
255
|
}
|
|
250
256
|
const dragTipEl = refDragTipElem.value
|
|
251
257
|
if (dragTipEl) {
|
|
@@ -293,6 +299,8 @@ export default defineVxeComponent({
|
|
|
293
299
|
const column = $xeTable.getColumnById(colid)
|
|
294
300
|
trEl.draggable = true
|
|
295
301
|
customPanelReactData.dragCol = column
|
|
302
|
+
customPanelReactData.dragGroupField = null
|
|
303
|
+
customPanelReactData.dragAggFnCol = null
|
|
296
304
|
updateColDropTipContent()
|
|
297
305
|
addClass(trEl, 'active--drag-origin')
|
|
298
306
|
}
|
|
@@ -305,6 +313,8 @@ export default defineVxeComponent({
|
|
|
305
313
|
hideDropTip()
|
|
306
314
|
trEl.draggable = false
|
|
307
315
|
customPanelReactData.dragCol = null
|
|
316
|
+
customPanelReactData.dragGroupField = null
|
|
317
|
+
customPanelReactData.dragAggFnCol = null
|
|
308
318
|
removeClass(trEl, 'active--drag-origin')
|
|
309
319
|
}
|
|
310
320
|
|
|
@@ -312,8 +322,8 @@ export default defineVxeComponent({
|
|
|
312
322
|
if (evnt.dataTransfer) {
|
|
313
323
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
|
|
314
324
|
}
|
|
315
|
-
|
|
316
|
-
|
|
325
|
+
customPanelInternalData.prevDragGroupField = null
|
|
326
|
+
customPanelInternalData.prevDragAggFnColid = null
|
|
317
327
|
}
|
|
318
328
|
|
|
319
329
|
const sortDragendEvent = (evnt: DragEvent) => {
|
|
@@ -325,11 +335,11 @@ export default defineVxeComponent({
|
|
|
325
335
|
const trEl = evnt.currentTarget as HTMLElement
|
|
326
336
|
const columnDragOpts = computeColumnDragOpts.value
|
|
327
337
|
const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
|
|
328
|
-
const { dragCol
|
|
329
|
-
const { prevDragCol, prevDragPos, prevDragToChild } = customPanelInternalData
|
|
338
|
+
const { dragCol } = customPanelReactData
|
|
339
|
+
const { prevDragCol, prevDragGroupField, prevDragAggFnColid, prevDragPos, prevDragToChild } = customPanelInternalData
|
|
330
340
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
|
|
331
341
|
|
|
332
|
-
if (
|
|
342
|
+
if (prevDragGroupField || prevDragAggFnColid) {
|
|
333
343
|
if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
|
|
334
344
|
$xeTable.handlePivotTableAggregatePanelDragendEvent(evnt)
|
|
335
345
|
}
|
|
@@ -499,8 +509,10 @@ export default defineVxeComponent({
|
|
|
499
509
|
|
|
500
510
|
hideDropTip()
|
|
501
511
|
customPanelReactData.dragCol = null
|
|
502
|
-
customPanelReactData.
|
|
503
|
-
customPanelReactData.
|
|
512
|
+
customPanelReactData.dragGroupField = null
|
|
513
|
+
customPanelReactData.dragAggFnCol = null
|
|
514
|
+
customPanelInternalData.prevDragGroupField = null
|
|
515
|
+
customPanelInternalData.prevDragAggFnColid = null
|
|
504
516
|
trEl.draggable = false
|
|
505
517
|
trEl.removeAttribute('drag-pos')
|
|
506
518
|
removeClass(trEl, 'active--drag-target')
|
|
@@ -517,14 +529,15 @@ export default defineVxeComponent({
|
|
|
517
529
|
const colid = optEl.getAttribute('colid')
|
|
518
530
|
const column = $xeTable.getColumnById(colid)
|
|
519
531
|
const { dragCol } = customPanelReactData
|
|
520
|
-
|
|
521
|
-
|
|
532
|
+
customPanelInternalData.prevDragGroupField = null
|
|
533
|
+
customPanelInternalData.prevDragAggFnColid = null
|
|
522
534
|
// 是否移入有效列
|
|
523
535
|
if (column && (isCrossDrag || column.level === 1)) {
|
|
524
536
|
evnt.preventDefault()
|
|
525
537
|
const offsetY = evnt.clientY - optEl.getBoundingClientRect().y
|
|
526
538
|
const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom'
|
|
527
539
|
if (
|
|
540
|
+
!dragCol ||
|
|
528
541
|
(dragCol && dragCol.id === column.id) ||
|
|
529
542
|
(!isCrossDrag && column.level > 1) ||
|
|
530
543
|
(!immediate && column.level > 1) ||
|
|
@@ -20,7 +20,7 @@ import TableExportPanelComponent from '../module/export/export-panel'
|
|
|
20
20
|
import TableMenuPanelComponent from '../module/menu/panel'
|
|
21
21
|
|
|
22
22
|
import type { VxeLoadingComponent, VxeTooltipInstance, VxeTooltipComponent, VxeTabsConstructor, VxeTabsPrivateMethods, ValueOf, VxeComponentSlotType } from 'vxe-pc-ui'
|
|
23
|
-
import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes } from '../../../types'
|
|
23
|
+
import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes, VxeTableCustomPanelConstructor } from '../../../types'
|
|
24
24
|
|
|
25
25
|
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
|
|
26
26
|
|
|
@@ -249,6 +249,7 @@ export default defineVxeComponent({
|
|
|
249
249
|
isRowGroupStatus: false,
|
|
250
250
|
rowGroupList: [],
|
|
251
251
|
aggHandleFields: [],
|
|
252
|
+
aggHandleAggColumns: [],
|
|
252
253
|
|
|
253
254
|
rowGroupExpandedFlag: 1,
|
|
254
255
|
rowExpandedFlag: 1,
|
|
@@ -422,7 +423,7 @@ export default defineVxeComponent({
|
|
|
422
423
|
const refValidTooltip = ref() as Ref<VxeTooltipInstance>
|
|
423
424
|
const refTableMenu = ref() as Ref<any>
|
|
424
425
|
const refTableFilter = ref() as Ref<any>
|
|
425
|
-
const refTableCustom = ref() as Ref<
|
|
426
|
+
const refTableCustom = ref() as Ref<VxeTableCustomPanelConstructor>
|
|
426
427
|
|
|
427
428
|
const refTableViewportElem = ref<HTMLDivElement>()
|
|
428
429
|
const refTableHeader = ref() as Ref<ComponentPublicInstance>
|
|
@@ -1544,7 +1545,8 @@ export default defineVxeComponent({
|
|
|
1544
1545
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
1545
1546
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
1546
1547
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
1547
|
-
|
|
1548
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
1549
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
1548
1550
|
if (!tableId) {
|
|
1549
1551
|
errLog('vxe.error.reqProp', ['id'])
|
|
1550
1552
|
return
|
|
@@ -3148,6 +3150,17 @@ export default defineVxeComponent({
|
|
|
3148
3150
|
})
|
|
3149
3151
|
}
|
|
3150
3152
|
|
|
3153
|
+
const handleUpdateAggValues = () => {
|
|
3154
|
+
const { visibleColumn } = internalData
|
|
3155
|
+
const aggCols: VxeTableDefines.ColumnInfo[] = []
|
|
3156
|
+
visibleColumn.forEach(column => {
|
|
3157
|
+
if (column.aggFunc) {
|
|
3158
|
+
aggCols.push(column)
|
|
3159
|
+
}
|
|
3160
|
+
})
|
|
3161
|
+
reactData.aggHandleAggColumns = aggCols
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3151
3164
|
const handleUpdateRowGroup = (groupFields?: string[]) => {
|
|
3152
3165
|
const aggFields: string[] = []
|
|
3153
3166
|
const aggConfs: { field: string }[] = []
|
|
@@ -3161,6 +3174,7 @@ export default defineVxeComponent({
|
|
|
3161
3174
|
}
|
|
3162
3175
|
reactData.rowGroupList = aggConfs
|
|
3163
3176
|
reactData.aggHandleFields = aggFields
|
|
3177
|
+
handleUpdateAggValues()
|
|
3164
3178
|
}
|
|
3165
3179
|
|
|
3166
3180
|
const handleeGroupSummary = (aggList: VxeTableDefines.AggregateRowInfo[]) => {
|
|
@@ -3645,6 +3659,7 @@ export default defineVxeComponent({
|
|
|
3645
3659
|
}
|
|
3646
3660
|
})
|
|
3647
3661
|
handleTableColumn()
|
|
3662
|
+
handleUpdateAggValues()
|
|
3648
3663
|
if (isReset) {
|
|
3649
3664
|
updateColumnOffsetLeft()
|
|
3650
3665
|
return $xeTable.updateFooter().then(() => {
|
|
@@ -6226,12 +6241,25 @@ export default defineVxeComponent({
|
|
|
6226
6241
|
},
|
|
6227
6242
|
setRowGroups (fieldOrColumns) {
|
|
6228
6243
|
const { aggregateConfig, rowGroupConfig } = props
|
|
6244
|
+
const { rowGroupList } = reactData
|
|
6245
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
6246
|
+
const { maxGroupSize } = aggregateOpts
|
|
6229
6247
|
if (!(aggregateConfig || rowGroupConfig)) {
|
|
6230
6248
|
errLog('vxe.error.reqProp', ['aggregate-config'])
|
|
6231
6249
|
return nextTick()
|
|
6232
6250
|
}
|
|
6233
|
-
|
|
6234
|
-
|
|
6251
|
+
const confList = fieldOrColumns ? (XEUtils.isArray(fieldOrColumns) ? fieldOrColumns : [fieldOrColumns]) : []
|
|
6252
|
+
if (maxGroupSize && (rowGroupList.length + confList.length > maxGroupSize)) {
|
|
6253
|
+
if (VxeUI.modal) {
|
|
6254
|
+
VxeUI.modal.message({
|
|
6255
|
+
status: 'error',
|
|
6256
|
+
content: getI18n('vxe.table.maxGroupCol', [maxGroupSize])
|
|
6257
|
+
})
|
|
6258
|
+
}
|
|
6259
|
+
return nextTick()
|
|
6260
|
+
}
|
|
6261
|
+
if (confList.length) {
|
|
6262
|
+
handleUpdateRowGroup(confList.map(fieldOrColumn => {
|
|
6235
6263
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field
|
|
6236
6264
|
}))
|
|
6237
6265
|
return loadTableData(internalData.tableSynchData, true)
|
|
@@ -6756,15 +6784,18 @@ export default defineVxeComponent({
|
|
|
6756
6784
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
6757
6785
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
6758
6786
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
6787
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
6759
6788
|
const resizableData: Record<string, number> = {}
|
|
6760
6789
|
const sortData: Record<string, number> = {}
|
|
6761
6790
|
const visibleData: Record<string, boolean> = {}
|
|
6762
6791
|
const fixedData: Record<string, VxeColumnPropTypes.Fixed> = {}
|
|
6792
|
+
const aggFuncData: Record<string, VxeColumnPropTypes.AggFunc> = {}
|
|
6763
6793
|
const storeData: VxeTableDefines.CustomStoreData = {
|
|
6764
6794
|
resizableData: undefined,
|
|
6765
6795
|
sortData: undefined,
|
|
6766
6796
|
visibleData: undefined,
|
|
6767
|
-
fixedData: undefined
|
|
6797
|
+
fixedData: undefined,
|
|
6798
|
+
aggFuncData: undefined
|
|
6768
6799
|
}
|
|
6769
6800
|
if (!id) {
|
|
6770
6801
|
if (storage) {
|
|
@@ -6776,6 +6807,7 @@ export default defineVxeComponent({
|
|
|
6776
6807
|
let hasSort = 0
|
|
6777
6808
|
let hasFixed = 0
|
|
6778
6809
|
let hasVisible = 0
|
|
6810
|
+
let hasAggFunc = 0
|
|
6779
6811
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
6780
6812
|
const colKey = column.getKey()
|
|
6781
6813
|
if (!colKey) {
|
|
@@ -6806,6 +6838,10 @@ export default defineVxeComponent({
|
|
|
6806
6838
|
visibleData[colKey] = true
|
|
6807
6839
|
}
|
|
6808
6840
|
}
|
|
6841
|
+
if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
|
|
6842
|
+
hasAggFunc = 1
|
|
6843
|
+
aggFuncData[colKey] = column.aggFunc
|
|
6844
|
+
}
|
|
6809
6845
|
})
|
|
6810
6846
|
if (hasResizable) {
|
|
6811
6847
|
storeData.resizableData = resizableData
|
|
@@ -6819,6 +6855,9 @@ export default defineVxeComponent({
|
|
|
6819
6855
|
if (hasVisible) {
|
|
6820
6856
|
storeData.visibleData = visibleData
|
|
6821
6857
|
}
|
|
6858
|
+
if (hasAggFunc) {
|
|
6859
|
+
storeData.aggFuncData = aggFuncData
|
|
6860
|
+
}
|
|
6822
6861
|
return storeData
|
|
6823
6862
|
},
|
|
6824
6863
|
focus () {
|
|
@@ -6863,7 +6902,7 @@ export default defineVxeComponent({
|
|
|
6863
6902
|
if (tableFilter) {
|
|
6864
6903
|
if (getEventTargetNode(evnt, el, 'vxe-cell--filter').flag) {
|
|
6865
6904
|
// 如果点击了筛选按钮
|
|
6866
|
-
} else if (getEventTargetNode(evnt, tableFilter.getRefMaps().refElem.value
|
|
6905
|
+
} else if (getEventTargetNode(evnt, tableFilter.getRefMaps().refElem.value).flag) {
|
|
6867
6906
|
// 如果点击筛选容器
|
|
6868
6907
|
} else {
|
|
6869
6908
|
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
|
|
@@ -6875,7 +6914,7 @@ export default defineVxeComponent({
|
|
|
6875
6914
|
if (tableCustom) {
|
|
6876
6915
|
if (customStore.btnEl === evnt.target || getEventTargetNode(evnt, document.body, 'vxe-toolbar-custom-target').flag) {
|
|
6877
6916
|
// 如果点击了自定义列按钮
|
|
6878
|
-
} else if (getEventTargetNode(evnt, tableCustom
|
|
6917
|
+
} else if (getEventTargetNode(evnt, tableCustom.getRefMaps().refElem.value).flag) {
|
|
6879
6918
|
// 如果点击自定义列容器
|
|
6880
6919
|
} else {
|
|
6881
6920
|
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
|
|
@@ -8247,11 +8286,12 @@ export default defineVxeComponent({
|
|
|
8247
8286
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
8248
8287
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
8249
8288
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
8289
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
8250
8290
|
if (type !== 'reset') {
|
|
8251
8291
|
// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
8252
8292
|
reactData.isCustomStatus = true
|
|
8253
8293
|
}
|
|
8254
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
8294
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
8255
8295
|
if (!tableId) {
|
|
8256
8296
|
errLog('vxe.error.reqProp', ['id'])
|
|
8257
8297
|
return nextTick()
|
|
@@ -8377,7 +8417,7 @@ export default defineVxeComponent({
|
|
|
8377
8417
|
}
|
|
8378
8418
|
|
|
8379
8419
|
childRowList.forEach(vals => {
|
|
8380
|
-
const row
|
|
8420
|
+
const row = vals[0]
|
|
8381
8421
|
const rowid: string = vals[1]
|
|
8382
8422
|
const childList: any[] = vals[2]
|
|
8383
8423
|
let sLen = 0 // 已选
|
|
@@ -8414,8 +8454,17 @@ export default defineVxeComponent({
|
|
|
8414
8454
|
vLen++
|
|
8415
8455
|
}
|
|
8416
8456
|
)
|
|
8417
|
-
|
|
8457
|
+
|
|
8458
|
+
let isSelected = (sLen >= vLen && (vLen >= 1 || hLen >= 1))
|
|
8459
|
+
if (checkMethod) {
|
|
8460
|
+
if (checkMethod({ $table: $xeTable, row })) {
|
|
8461
|
+
isSelected = sLen >= vLen
|
|
8462
|
+
} else {
|
|
8463
|
+
isSelected = selectCheckboxMaps[rowid]
|
|
8464
|
+
}
|
|
8465
|
+
}
|
|
8418
8466
|
const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1)
|
|
8467
|
+
|
|
8419
8468
|
if (checkField) {
|
|
8420
8469
|
XEUtils.set(row, checkField, isSelected)
|
|
8421
8470
|
}
|
|
@@ -10612,6 +10661,9 @@ export default defineVxeComponent({
|
|
|
10612
10661
|
}
|
|
10613
10662
|
}
|
|
10614
10663
|
},
|
|
10664
|
+
handleUpdateAggData () {
|
|
10665
|
+
return loadTableData(internalData.tableSynchData, true)
|
|
10666
|
+
},
|
|
10615
10667
|
updateZindex () {
|
|
10616
10668
|
if (props.zIndex) {
|
|
10617
10669
|
internalData.tZindex = props.zIndex
|
|
@@ -11629,6 +11681,16 @@ export default defineVxeComponent({
|
|
|
11629
11681
|
return
|
|
11630
11682
|
}
|
|
11631
11683
|
}
|
|
11684
|
+
if (!$xeTable.handlePivotTableAggregateData) {
|
|
11685
|
+
if (customOpts.allowGroup) {
|
|
11686
|
+
errLog('vxe.error.notProp', ['custom-config.allowGroup'])
|
|
11687
|
+
return
|
|
11688
|
+
}
|
|
11689
|
+
if (customOpts.allowValues) {
|
|
11690
|
+
errLog('vxe.error.notProp', ['custom-config.allowValues'])
|
|
11691
|
+
return
|
|
11692
|
+
}
|
|
11693
|
+
}
|
|
11632
11694
|
if (treeConfig && rowOpts.drag && !treeOpts.transform) {
|
|
11633
11695
|
errLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true'])
|
|
11634
11696
|
}
|
|
@@ -11641,8 +11703,8 @@ export default defineVxeComponent({
|
|
|
11641
11703
|
if (aggregateOpts.countFields) {
|
|
11642
11704
|
warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func'])
|
|
11643
11705
|
}
|
|
11644
|
-
if (aggregateOpts.
|
|
11645
|
-
warnLog('vxe.error.delProp', ['row-group-config.
|
|
11706
|
+
if (aggregateOpts.aggregateMethod) {
|
|
11707
|
+
warnLog('vxe.error.delProp', ['row-group-config.aggregateMethod', 'aggregate-config.countMethod'])
|
|
11646
11708
|
}
|
|
11647
11709
|
if (props.treeConfig && treeOpts.children) {
|
|
11648
11710
|
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
|
package/packages/ui/index.ts
CHANGED
|
@@ -108,6 +108,7 @@ VxeUI.setConfig({
|
|
|
108
108
|
// rowGroup: false,
|
|
109
109
|
// aggFunc: false
|
|
110
110
|
},
|
|
111
|
+
// autoAggGroupValues: false,
|
|
111
112
|
// checkMethod () {},
|
|
112
113
|
modalOptions: {
|
|
113
114
|
showMaximize: true,
|
|
@@ -147,7 +148,8 @@ VxeUI.setConfig({
|
|
|
147
148
|
childrenField: '_X_ROW_CHILDREN',
|
|
148
149
|
mapChildrenField: '_X_ROW_CHILD_LIST',
|
|
149
150
|
indent: 20,
|
|
150
|
-
showIcon: true
|
|
151
|
+
showIcon: true,
|
|
152
|
+
maxGroupSize: 4
|
|
151
153
|
},
|
|
152
154
|
treeConfig: {
|
|
153
155
|
padding: true,
|
|
@@ -320,9 +322,10 @@ VxeUI.setIcon({
|
|
|
320
322
|
TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
|
|
321
323
|
TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
|
|
322
324
|
TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
|
|
326
|
+
TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
|
|
327
|
+
TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
|
|
328
|
+
TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
|
|
326
329
|
|
|
327
330
|
// toolbar
|
|
328
331
|
TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|