vxe-table 4.13.46 → 4.13.48
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +12 -2
- package/es/locale/lang/de-DE.js +12 -2
- package/es/locale/lang/en-US.js +12 -2
- package/es/locale/lang/es-ES.js +12 -2
- package/es/locale/lang/fr-FR.js +12 -2
- package/es/locale/lang/hu-HU.js +12 -2
- package/es/locale/lang/hy-AM.js +12 -2
- package/es/locale/lang/id-ID.js +12 -2
- package/es/locale/lang/it-IT.js +12 -2
- package/es/locale/lang/ja-JP.js +12 -2
- package/es/locale/lang/ko-KR.js +12 -2
- package/es/locale/lang/ms-MY.js +12 -2
- package/es/locale/lang/nb-NO.js +12 -2
- package/es/locale/lang/pt-BR.js +12 -2
- package/es/locale/lang/ru-RU.js +12 -2
- package/es/locale/lang/th-TH.js +12 -2
- package/es/locale/lang/ug-CN.js +12 -2
- package/es/locale/lang/uk-UA.js +12 -2
- package/es/locale/lang/uz-UZ.js +12 -2
- package/es/locale/lang/vi-VN.js +12 -2
- package/es/locale/lang/zh-CHT.js +12 -2
- package/es/locale/lang/zh-CN.js +12 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +20 -5
- package/es/table/module/custom/panel.js +34 -15
- package/es/table/src/body.js +8 -5
- package/es/table/src/cell.js +19 -4
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/table.js +45 -7
- package/es/table/style.css +5 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +8 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +5 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +111 -53
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +12 -2
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +12 -2
- package/lib/locale/lang/de-DE.js +12 -2
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +12 -2
- package/lib/locale/lang/en-US.js +12 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +12 -2
- package/lib/locale/lang/es-ES.js +12 -2
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +12 -2
- package/lib/locale/lang/fr-FR.js +12 -2
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +12 -2
- package/lib/locale/lang/hu-HU.js +12 -2
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +12 -2
- package/lib/locale/lang/hy-AM.js +12 -2
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +12 -2
- package/lib/locale/lang/id-ID.js +12 -2
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +12 -2
- package/lib/locale/lang/it-IT.js +12 -2
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +12 -2
- package/lib/locale/lang/ja-JP.js +12 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +12 -2
- package/lib/locale/lang/ko-KR.js +12 -2
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +12 -2
- package/lib/locale/lang/ms-MY.js +12 -2
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +12 -2
- package/lib/locale/lang/nb-NO.js +12 -2
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +12 -2
- package/lib/locale/lang/pt-BR.js +12 -2
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +12 -2
- package/lib/locale/lang/ru-RU.js +12 -2
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +12 -2
- package/lib/locale/lang/th-TH.js +12 -2
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +12 -2
- package/lib/locale/lang/ug-CN.js +12 -2
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +12 -2
- package/lib/locale/lang/uk-UA.js +12 -2
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +12 -2
- package/lib/locale/lang/uz-UZ.js +12 -2
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +12 -2
- package/lib/locale/lang/vi-VN.js +12 -2
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +12 -2
- package/lib/locale/lang/zh-CHT.js +12 -2
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +12 -2
- package/lib/locale/lang/zh-CN.js +12 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +12 -2
- package/lib/style.css +1 -1
- package/lib/style.min.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 +32 -15
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/body.js +8 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +17 -6
- package/lib/table/src/cell.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 +11 -11
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +5 -1
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +8 -6
- 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 +5 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +1 -1
- package/packages/locale/lang/ar-EG.ts +12 -2
- package/packages/locale/lang/de-DE.ts +12 -2
- package/packages/locale/lang/en-US.ts +12 -2
- package/packages/locale/lang/es-ES.ts +12 -2
- package/packages/locale/lang/fr-FR.ts +12 -2
- package/packages/locale/lang/hu-HU.ts +12 -2
- package/packages/locale/lang/hy-AM.ts +12 -2
- package/packages/locale/lang/id-ID.ts +12 -2
- package/packages/locale/lang/it-IT.ts +12 -2
- package/packages/locale/lang/ja-JP.ts +12 -2
- package/packages/locale/lang/ko-KR.ts +12 -2
- package/packages/locale/lang/ms-MY.ts +12 -2
- package/packages/locale/lang/nb-NO.ts +12 -2
- package/packages/locale/lang/pt-BR.ts +12 -2
- package/packages/locale/lang/ru-RU.ts +12 -2
- package/packages/locale/lang/th-TH.ts +12 -2
- package/packages/locale/lang/ug-CN.ts +12 -2
- package/packages/locale/lang/uk-UA.ts +12 -2
- package/packages/locale/lang/uz-UZ.ts +12 -2
- package/packages/locale/lang/vi-VN.ts +12 -2
- package/packages/locale/lang/zh-CHT.ts +12 -2
- package/packages/locale/lang/zh-CN.ts +12 -2
- package/packages/table/module/custom/hook.ts +18 -5
- package/packages/table/module/custom/panel.ts +33 -15
- package/packages/table/src/body.ts +8 -5
- package/packages/table/src/cell.ts +23 -11
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/table.ts +46 -7
- package/packages/ui/index.ts +7 -5
- package/styles/components/table-module/custom.scss +5 -1
- /package/es/{iconfont.1750660623154.ttf → iconfont.1750813693750.ttf} +0 -0
- /package/es/{iconfont.1750660623154.woff → iconfont.1750813693750.woff} +0 -0
- /package/es/{iconfont.1750660623154.woff2 → iconfont.1750813693750.woff2} +0 -0
- /package/lib/{iconfont.1750660623154.ttf → iconfont.1750813693750.ttf} +0 -0
- /package/lib/{iconfont.1750660623154.woff → iconfont.1750813693750.woff} +0 -0
- /package/lib/{iconfont.1750660623154.woff2 → iconfont.1750813693750.woff2} +0 -0
|
@@ -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
|
-
customPanelInternalData.
|
|
316
|
-
customPanelInternalData.
|
|
325
|
+
customPanelInternalData.prevDragGroupField = null
|
|
326
|
+
customPanelInternalData.prevDragAggFnColid = null
|
|
317
327
|
}
|
|
318
328
|
|
|
319
329
|
const sortDragendEvent = (evnt: DragEvent) => {
|
|
@@ -326,10 +336,10 @@ export default defineVxeComponent({
|
|
|
326
336
|
const columnDragOpts = computeColumnDragOpts.value
|
|
327
337
|
const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
|
|
328
338
|
const { dragCol } = customPanelReactData
|
|
329
|
-
const { prevDragCol,
|
|
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
|
-
|
|
503
|
-
|
|
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
|
-
customPanelInternalData.
|
|
521
|
-
customPanelInternalData.
|
|
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) ||
|
|
@@ -737,7 +750,7 @@ export default defineVxeComponent({
|
|
|
737
750
|
class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
|
|
738
751
|
'is--active': customStore.visible
|
|
739
752
|
}],
|
|
740
|
-
style: maxHeight && !['left', 'right'].includes(placement
|
|
753
|
+
style: maxHeight && !['left', 'right'].includes(placement || '')
|
|
741
754
|
? {
|
|
742
755
|
maxHeight: `${maxHeight}px`
|
|
743
756
|
}
|
|
@@ -872,7 +885,7 @@ export default defineVxeComponent({
|
|
|
872
885
|
const $xeGrid = $xeTable.xeGrid
|
|
873
886
|
|
|
874
887
|
const { customStore } = props
|
|
875
|
-
const { resizable: allResizable } = tableProps
|
|
888
|
+
const { treeConfig, rowGroupConfig, aggregateConfig, resizable: allResizable } = tableProps
|
|
876
889
|
const { isCustomStatus, customColumnList } = tableReactData
|
|
877
890
|
const customOpts = computeCustomOpts.value
|
|
878
891
|
const { immediate } = customOpts
|
|
@@ -1152,7 +1165,12 @@ export default defineVxeComponent({
|
|
|
1152
1165
|
}, $xeTable.callSlot(bottomSlot, params))
|
|
1153
1166
|
: renderEmptyElement($xeTable),
|
|
1154
1167
|
renderDragTip()
|
|
1155
|
-
])
|
|
1168
|
+
]),
|
|
1169
|
+
!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel
|
|
1170
|
+
? h($xeTable.getPivotTableAggregatePopupPanel(), {
|
|
1171
|
+
customStore
|
|
1172
|
+
})
|
|
1173
|
+
: renderEmptyElement($xeTable)
|
|
1156
1174
|
])
|
|
1157
1175
|
},
|
|
1158
1176
|
footer: () => {
|
|
@@ -235,6 +235,7 @@ export default defineVxeComponent({
|
|
|
235
235
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams)
|
|
236
236
|
}
|
|
237
237
|
let isMergeCell = false
|
|
238
|
+
let mergeColspan = 1
|
|
238
239
|
let mergeRowspan = 1
|
|
239
240
|
// 合并行或列
|
|
240
241
|
if (mergeBodyFlag && mergeBodyList.length) {
|
|
@@ -251,6 +252,7 @@ export default defineVxeComponent({
|
|
|
251
252
|
}
|
|
252
253
|
if (colspan > 1) {
|
|
253
254
|
isMergeCell = true
|
|
255
|
+
mergeColspan = colspan
|
|
254
256
|
tdAttrs.colspan = colspan
|
|
255
257
|
}
|
|
256
258
|
}
|
|
@@ -267,6 +269,7 @@ export default defineVxeComponent({
|
|
|
267
269
|
}
|
|
268
270
|
if (colspan > 1) {
|
|
269
271
|
isMergeCell = true
|
|
272
|
+
mergeColspan = colspan
|
|
270
273
|
tdAttrs.colspan = colspan
|
|
271
274
|
}
|
|
272
275
|
}
|
|
@@ -310,16 +313,16 @@ export default defineVxeComponent({
|
|
|
310
313
|
|
|
311
314
|
const tcStyle: Record<string, string> = {}
|
|
312
315
|
if (hasEllipsis && resizeWidthFlag) {
|
|
313
|
-
let
|
|
314
|
-
if (
|
|
315
|
-
for (let index = 1; index <
|
|
316
|
+
let mergeColWidth = 0
|
|
317
|
+
if (mergeColspan > 1) {
|
|
318
|
+
for (let index = 1; index < mergeColspan; index++) {
|
|
316
319
|
const nextColumn = visibleColumn[columnIndex + index]
|
|
317
320
|
if (nextColumn) {
|
|
318
|
-
|
|
321
|
+
mergeColWidth += nextColumn.renderWidth
|
|
319
322
|
}
|
|
320
323
|
}
|
|
321
324
|
}
|
|
322
|
-
tcStyle.width = `${column.renderWidth -
|
|
325
|
+
tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`
|
|
323
326
|
}
|
|
324
327
|
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
325
328
|
tcStyle.height = `${cellHeight}px`
|
|
@@ -167,13 +167,26 @@ function renderHeaderCellBaseVNs (params: VxeTableDefines.CellRenderHeaderParams
|
|
|
167
167
|
return vns
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
function getRenderDefaultColumnTitle (column: VxeTableDefines.ColumnInfo, content: VxeComponentSlotType | VxeComponentSlotType[]) {
|
|
171
|
+
if (column.type === 'html' && XEUtils.isString(content)) {
|
|
172
|
+
return h('span', {
|
|
173
|
+
key: 'ch',
|
|
174
|
+
innerHTML: content
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
return h('span', {
|
|
178
|
+
key: 'ct'
|
|
179
|
+
}, getSlotVNs(content))
|
|
180
|
+
}
|
|
181
|
+
|
|
170
182
|
function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, content: VxeComponentSlotType | VxeComponentSlotType[]) {
|
|
171
183
|
const { $table, column } = params
|
|
172
184
|
const tableProps = $table.props
|
|
173
185
|
const tableReactData = $table.reactData
|
|
174
186
|
const { computeTooltipOpts } = $table.getComputeMaps()
|
|
175
187
|
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
|
|
176
|
-
const {
|
|
188
|
+
const { isRowGroupStatus } = tableReactData
|
|
189
|
+
const { showHeaderOverflow } = column
|
|
177
190
|
const tooltipOpts = computeTooltipOpts.value
|
|
178
191
|
const showAllTip = tooltipOpts.showAll
|
|
179
192
|
const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
@@ -202,17 +215,16 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
202
215
|
}
|
|
203
216
|
}
|
|
204
217
|
}
|
|
218
|
+
const titleVN = getRenderDefaultColumnTitle(column, content)
|
|
205
219
|
return [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
...ons
|
|
215
|
-
}, getSlotVNs(content))
|
|
220
|
+
h('span', {
|
|
221
|
+
class: 'vxe-cell--title',
|
|
222
|
+
...ons
|
|
223
|
+
}, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles
|
|
224
|
+
? $table.getPivotTableAggregateRenderColTitles(column, titleVN)
|
|
225
|
+
: [
|
|
226
|
+
titleVN
|
|
227
|
+
])
|
|
216
228
|
]
|
|
217
229
|
}
|
|
218
230
|
|
|
@@ -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,
|
|
@@ -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,7 +6241,6 @@ export default defineVxeComponent({
|
|
|
6226
6241
|
},
|
|
6227
6242
|
setRowGroups (fieldOrColumns) {
|
|
6228
6243
|
const { aggregateConfig, rowGroupConfig } = props
|
|
6229
|
-
const { rowGroupList } = reactData
|
|
6230
6244
|
const aggregateOpts = computeAggregateOpts.value
|
|
6231
6245
|
const { maxGroupSize } = aggregateOpts
|
|
6232
6246
|
if (!(aggregateConfig || rowGroupConfig)) {
|
|
@@ -6234,7 +6248,7 @@ export default defineVxeComponent({
|
|
|
6234
6248
|
return nextTick()
|
|
6235
6249
|
}
|
|
6236
6250
|
const confList = fieldOrColumns ? (XEUtils.isArray(fieldOrColumns) ? fieldOrColumns : [fieldOrColumns]) : []
|
|
6237
|
-
if (maxGroupSize &&
|
|
6251
|
+
if (maxGroupSize && confList.length > maxGroupSize) {
|
|
6238
6252
|
if (VxeUI.modal) {
|
|
6239
6253
|
VxeUI.modal.message({
|
|
6240
6254
|
status: 'error',
|
|
@@ -6769,15 +6783,18 @@ export default defineVxeComponent({
|
|
|
6769
6783
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
6770
6784
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
6771
6785
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
6786
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
6772
6787
|
const resizableData: Record<string, number> = {}
|
|
6773
6788
|
const sortData: Record<string, number> = {}
|
|
6774
6789
|
const visibleData: Record<string, boolean> = {}
|
|
6775
6790
|
const fixedData: Record<string, VxeColumnPropTypes.Fixed> = {}
|
|
6791
|
+
const aggFuncData: Record<string, VxeColumnPropTypes.AggFunc> = {}
|
|
6776
6792
|
const storeData: VxeTableDefines.CustomStoreData = {
|
|
6777
6793
|
resizableData: undefined,
|
|
6778
6794
|
sortData: undefined,
|
|
6779
6795
|
visibleData: undefined,
|
|
6780
|
-
fixedData: undefined
|
|
6796
|
+
fixedData: undefined,
|
|
6797
|
+
aggFuncData: undefined
|
|
6781
6798
|
}
|
|
6782
6799
|
if (!id) {
|
|
6783
6800
|
if (storage) {
|
|
@@ -6789,6 +6806,7 @@ export default defineVxeComponent({
|
|
|
6789
6806
|
let hasSort = 0
|
|
6790
6807
|
let hasFixed = 0
|
|
6791
6808
|
let hasVisible = 0
|
|
6809
|
+
let hasAggFunc = 0
|
|
6792
6810
|
XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
6793
6811
|
const colKey = column.getKey()
|
|
6794
6812
|
if (!colKey) {
|
|
@@ -6819,6 +6837,10 @@ export default defineVxeComponent({
|
|
|
6819
6837
|
visibleData[colKey] = true
|
|
6820
6838
|
}
|
|
6821
6839
|
}
|
|
6840
|
+
if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
|
|
6841
|
+
hasAggFunc = 1
|
|
6842
|
+
aggFuncData[colKey] = column.aggFunc
|
|
6843
|
+
}
|
|
6822
6844
|
})
|
|
6823
6845
|
if (hasResizable) {
|
|
6824
6846
|
storeData.resizableData = resizableData
|
|
@@ -6832,6 +6854,9 @@ export default defineVxeComponent({
|
|
|
6832
6854
|
if (hasVisible) {
|
|
6833
6855
|
storeData.visibleData = visibleData
|
|
6834
6856
|
}
|
|
6857
|
+
if (hasAggFunc) {
|
|
6858
|
+
storeData.aggFuncData = aggFuncData
|
|
6859
|
+
}
|
|
6835
6860
|
return storeData
|
|
6836
6861
|
},
|
|
6837
6862
|
focus () {
|
|
@@ -8260,11 +8285,12 @@ export default defineVxeComponent({
|
|
|
8260
8285
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom)
|
|
8261
8286
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom)
|
|
8262
8287
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom)
|
|
8288
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom)
|
|
8263
8289
|
if (type !== 'reset') {
|
|
8264
8290
|
// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
8265
8291
|
reactData.isCustomStatus = true
|
|
8266
8292
|
}
|
|
8267
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
8293
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
8268
8294
|
if (!tableId) {
|
|
8269
8295
|
errLog('vxe.error.reqProp', ['id'])
|
|
8270
8296
|
return nextTick()
|
|
@@ -10634,6 +10660,9 @@ export default defineVxeComponent({
|
|
|
10634
10660
|
}
|
|
10635
10661
|
}
|
|
10636
10662
|
},
|
|
10663
|
+
handleUpdateAggData () {
|
|
10664
|
+
return loadTableData(internalData.tableSynchData, true)
|
|
10665
|
+
},
|
|
10637
10666
|
updateZindex () {
|
|
10638
10667
|
if (props.zIndex) {
|
|
10639
10668
|
internalData.tZindex = props.zIndex
|
|
@@ -11651,6 +11680,16 @@ export default defineVxeComponent({
|
|
|
11651
11680
|
return
|
|
11652
11681
|
}
|
|
11653
11682
|
}
|
|
11683
|
+
if (!$xeTable.handlePivotTableAggregateData) {
|
|
11684
|
+
if (customOpts.allowGroup) {
|
|
11685
|
+
errLog('vxe.error.notProp', ['custom-config.allowGroup'])
|
|
11686
|
+
return
|
|
11687
|
+
}
|
|
11688
|
+
if (customOpts.allowValues) {
|
|
11689
|
+
errLog('vxe.error.notProp', ['custom-config.allowValues'])
|
|
11690
|
+
return
|
|
11691
|
+
}
|
|
11692
|
+
}
|
|
11654
11693
|
if (treeConfig && rowOpts.drag && !treeOpts.transform) {
|
|
11655
11694
|
errLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true'])
|
|
11656
11695
|
}
|
|
@@ -11663,8 +11702,8 @@ export default defineVxeComponent({
|
|
|
11663
11702
|
if (aggregateOpts.countFields) {
|
|
11664
11703
|
warnLog('vxe.error.delProp', ['row-group-config.countFields', 'column.agg-func'])
|
|
11665
11704
|
}
|
|
11666
|
-
if (aggregateOpts.
|
|
11667
|
-
warnLog('vxe.error.delProp', ['row-group-config.
|
|
11705
|
+
if (aggregateOpts.aggregateMethod) {
|
|
11706
|
+
warnLog('vxe.error.delProp', ['row-group-config.aggregateMethod', 'aggregate-config.countMethod'])
|
|
11668
11707
|
}
|
|
11669
11708
|
if (props.treeConfig && treeOpts.children) {
|
|
11670
11709
|
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,
|
|
@@ -148,7 +149,8 @@ VxeUI.setConfig({
|
|
|
148
149
|
mapChildrenField: '_X_ROW_CHILD_LIST',
|
|
149
150
|
indent: 20,
|
|
150
151
|
showIcon: true,
|
|
151
|
-
maxGroupSize: 4
|
|
152
|
+
maxGroupSize: 4,
|
|
153
|
+
showAggFuncTitle: true
|
|
152
154
|
},
|
|
153
155
|
treeConfig: {
|
|
154
156
|
padding: true,
|
|
@@ -321,10 +323,10 @@ VxeUI.setIcon({
|
|
|
321
323
|
TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
|
|
322
324
|
TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
|
|
323
325
|
TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
|
|
327
|
+
TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
|
|
328
|
+
TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
|
|
329
|
+
TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
|
|
328
330
|
|
|
329
331
|
// toolbar
|
|
330
332
|
TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
|
|
@@ -218,12 +218,16 @@
|
|
|
218
218
|
|
|
219
219
|
.vxe-table-custom-popup--body-wrapper {
|
|
220
220
|
position: relative;
|
|
221
|
-
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
overflow: hidden;
|
|
222
224
|
height: 100%;
|
|
223
225
|
outline: 0;
|
|
224
226
|
}
|
|
225
227
|
.vxe-table-custom-popup--handle-wrapper {
|
|
228
|
+
flex-grow: 1;
|
|
226
229
|
outline: 0;
|
|
230
|
+
overflow: auto;
|
|
227
231
|
}
|
|
228
232
|
|
|
229
233
|
.vxe-table-custom-popup--table-wrapper {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|