vxe-table 3.15.43 → 3.15.45
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/{iconfont.1750301122777.ttf → iconfont.1750641764687.ttf} +0 -0
- package/es/iconfont.1750641764687.woff +0 -0
- package/es/iconfont.1750641764687.woff2 +0 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +9 -0
- package/es/table/module/custom/panel.js +395 -300
- package/es/table/module/edit/mixin.js +27 -10
- package/es/table/module/export/mixin.js +19 -6
- package/es/table/src/cell.js +4 -4
- package/es/table/src/methods.js +23 -7
- package/es/table/style.css +37 -9
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +7 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +37 -9
- package/es/vxe-table/style.min.css +1 -1
- package/lib/{iconfont.1750301122777.ttf → iconfont.1750641764687.ttf} +0 -0
- package/lib/iconfont.1750641764687.woff +0 -0
- package/lib/iconfont.1750641764687.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +355 -151
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +11 -0
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +234 -122
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +49 -10
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +19 -4
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/cell.js +4 -4
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +30 -7
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +37 -9
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +7 -3
- 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 +37 -9
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/mixin.ts +10 -0
- package/packages/table/module/custom/panel.ts +413 -313
- package/packages/table/module/edit/mixin.ts +28 -10
- package/packages/table/module/export/mixin.ts +18 -6
- package/packages/table/src/cell.ts +4 -4
- package/packages/table/src/methods.ts +26 -7
- package/packages/ui/index.ts +6 -2
- package/styles/components/icon.scss +9 -1
- package/styles/components/table-module/custom.scss +26 -3
- package/styles/helpers/baseMixin.scss +16 -2
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/es/iconfont.1750301122777.woff +0 -0
- package/es/iconfont.1750301122777.woff2 +0 -0
- package/lib/iconfont.1750301122777.woff +0 -0
- package/lib/iconfont.1750301122777.woff2 +0 -0
|
@@ -5,26 +5,33 @@ import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/
|
|
|
5
5
|
import { errLog } from '../../../ui/src/log'
|
|
6
6
|
import XEUtils from 'xe-utils'
|
|
7
7
|
|
|
8
|
-
import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, TableReactData, TableInternalData } from '../../../../types'
|
|
9
|
-
import type { VxeModalComponent, VxeDrawerComponent, VxeButtonComponent, VxeRadioGroupComponent, VxeInputComponent } from 'vxe-pc-ui'
|
|
8
|
+
import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, TableReactData, TableInternalData, VxeColumnPropTypes, VxeTableCustomPanelConstructor, TableCustomPanelReactData, TableCustomPanelInternalData } from '../../../../types'
|
|
9
|
+
import type { VxeModalComponent, VxeDrawerComponent, VxeButtonComponent, VxeRadioGroupComponent, VxeInputComponent, VxeButtonDefines, VxeRadioGroupDefines } from 'vxe-pc-ui'
|
|
10
10
|
|
|
11
11
|
const { getI18n, getIcon, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
13
|
-
function showDropTip (
|
|
14
|
-
const
|
|
13
|
+
function showDropTip ($xeTableCustomPanel: VxeTableCustomPanelConstructor, evnt: DragEvent | MouseEvent, optEl: HTMLElement | null, showLine: boolean, dragPos: string) {
|
|
14
|
+
const customPanelInternalData = $xeTableCustomPanel.internalData
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
16
|
+
const bodyWrapperElem = $xeTableCustomPanel.$refs.refBodyWrapperElem as HTMLDivElement
|
|
17
|
+
if (!bodyWrapperElem) {
|
|
18
18
|
return
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const customBodyElem = $xeTableCustomPanel.$refs.refCustomBodyElem as HTMLDivElement
|
|
21
|
+
if (!customBodyElem) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
const { prevDragToChild } = customPanelInternalData
|
|
25
|
+
const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect()
|
|
26
|
+
const customBodyRect = customBodyElem.getBoundingClientRect()
|
|
21
27
|
if (optEl) {
|
|
22
|
-
const dragLineEl =
|
|
28
|
+
const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem as HTMLDivElement
|
|
23
29
|
if (dragLineEl) {
|
|
24
30
|
if (showLine) {
|
|
25
31
|
const optRect = optEl.getBoundingClientRect()
|
|
26
32
|
dragLineEl.style.display = 'block'
|
|
27
|
-
dragLineEl.style.
|
|
33
|
+
dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`
|
|
34
|
+
dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`
|
|
28
35
|
dragLineEl.style.height = `${optRect.height}px`
|
|
29
36
|
dragLineEl.style.width = `${optRect.width}px`
|
|
30
37
|
dragLineEl.setAttribute('drag-pos', dragPos)
|
|
@@ -34,18 +41,18 @@ function showDropTip (_vm: any, evnt: DragEvent | MouseEvent, optEl: HTMLElement
|
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
|
-
const dragTipEl =
|
|
44
|
+
const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem as HTMLDivElement
|
|
38
45
|
if (dragTipEl) {
|
|
39
46
|
dragTipEl.style.display = 'block'
|
|
40
|
-
dragTipEl.style.top = `${Math.min(
|
|
41
|
-
dragTipEl.style.left = `${Math.min(
|
|
47
|
+
dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`
|
|
48
|
+
dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`
|
|
42
49
|
dragTipEl.setAttribute('drag-status', showLine ? (prevDragToChild ? 'sub' : 'normal') : 'disabled')
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
52
|
|
|
46
|
-
function hideDropTip (
|
|
47
|
-
const dragTipEl =
|
|
48
|
-
const dragLineEl =
|
|
53
|
+
function hideDropTip ($xeTableCustomPanel: VxeTableCustomPanelConstructor) {
|
|
54
|
+
const dragTipEl = $xeTableCustomPanel.$refs.refDragTipElem as HTMLDivElement
|
|
55
|
+
const dragLineEl = $xeTableCustomPanel.$refs.refDragLineElem as HTMLDivElement
|
|
49
56
|
if (dragTipEl) {
|
|
50
57
|
dragTipEl.style.display = ''
|
|
51
58
|
}
|
|
@@ -54,10 +61,11 @@ function hideDropTip (_vm: any) {
|
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
|
|
57
|
-
const renderDragTip = (h: CreateElement,
|
|
58
|
-
const $xeTable =
|
|
64
|
+
const renderDragTip = (h: CreateElement, $xeTableCustomPanel: VxeTableCustomPanelConstructor) => {
|
|
65
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
66
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
59
67
|
|
|
60
|
-
const
|
|
68
|
+
const { dragTipText } = customPanelReactData
|
|
61
69
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
62
70
|
return h('div', {}, [
|
|
63
71
|
h('div', {
|
|
@@ -82,13 +90,19 @@ const renderDragTip = (h: CreateElement, _vm: any) => {
|
|
|
82
90
|
h('span', {
|
|
83
91
|
class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
|
|
84
92
|
}),
|
|
93
|
+
h('span', {
|
|
94
|
+
class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
|
|
95
|
+
}),
|
|
96
|
+
h('span', {
|
|
97
|
+
class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
|
|
98
|
+
}),
|
|
85
99
|
h('span', {
|
|
86
100
|
class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
|
|
87
101
|
})
|
|
88
102
|
]),
|
|
89
103
|
h('div', {
|
|
90
104
|
class: 'vxe-table-custom-popup--drag-tip-content'
|
|
91
|
-
},
|
|
105
|
+
}, `${dragTipText || ''}`)
|
|
92
106
|
])
|
|
93
107
|
])
|
|
94
108
|
])
|
|
@@ -101,12 +115,12 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
|
|
|
101
115
|
|
|
102
116
|
const $xeTable = _vm.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
103
117
|
const tableProps = $xeTable
|
|
104
|
-
const
|
|
118
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
105
119
|
const $xeGrid = $xeTable.$xeGrid
|
|
106
120
|
|
|
107
121
|
const { customStore } = props
|
|
108
122
|
const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
|
|
109
|
-
const { isCustomStatus, customColumnList } =
|
|
123
|
+
const { isCustomStatus, customColumnList } = tableReactData
|
|
110
124
|
const customOpts = $xeTable.computeCustomOpts
|
|
111
125
|
const { immediate } = customOpts
|
|
112
126
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
@@ -173,9 +187,9 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
|
|
|
173
187
|
title: getI18n('vxe.custom.setting.colVisible')
|
|
174
188
|
},
|
|
175
189
|
on: {
|
|
176
|
-
click: () => {
|
|
190
|
+
click: (evnt: MouseEvent) => {
|
|
177
191
|
if (!isDisabled) {
|
|
178
|
-
_vm.changeCheckboxOption(column)
|
|
192
|
+
_vm.changeCheckboxOption(column, evnt)
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
195
|
}
|
|
@@ -241,8 +255,8 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
|
|
|
241
255
|
title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
|
|
242
256
|
},
|
|
243
257
|
on: {
|
|
244
|
-
click: () => {
|
|
245
|
-
_vm.changeFixedOption(column, 'left')
|
|
258
|
+
click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
|
|
259
|
+
_vm.changeFixedOption(column, 'left', $event)
|
|
246
260
|
}
|
|
247
261
|
}
|
|
248
262
|
}),
|
|
@@ -255,8 +269,8 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
|
|
|
255
269
|
title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
|
|
256
270
|
},
|
|
257
271
|
on: {
|
|
258
|
-
click: () => {
|
|
259
|
-
_vm.changeFixedOption(column, 'right')
|
|
272
|
+
click: ({ $event }: VxeButtonDefines.ClickEventParams) => {
|
|
273
|
+
_vm.changeFixedOption(column, 'right', $event)
|
|
260
274
|
}
|
|
261
275
|
}
|
|
262
276
|
})
|
|
@@ -278,156 +292,161 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
|
|
|
278
292
|
: {}
|
|
279
293
|
}, customStore.visible
|
|
280
294
|
? [
|
|
281
|
-
!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
|
|
282
|
-
? h($xeTable.getPivotTableAggregateSimplePanel(), {
|
|
283
|
-
props: {
|
|
284
|
-
customStore
|
|
285
|
-
}
|
|
286
|
-
})
|
|
287
|
-
: renderEmptyElement($xeTable),
|
|
288
295
|
h('div', {
|
|
289
|
-
|
|
296
|
+
ref: 'refBodyWrapperElem',
|
|
297
|
+
class: 'vxe-table-custom-body-wrapper'
|
|
290
298
|
}, [
|
|
299
|
+
!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel
|
|
300
|
+
? h($xeTable.getPivotTableAggregateSimplePanel(), {
|
|
301
|
+
props: {
|
|
302
|
+
customStore
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
: renderEmptyElement($xeTable),
|
|
291
306
|
h('div', {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
307
|
+
ref: 'refCustomBodyElem',
|
|
308
|
+
class: 'vxe-table-custom--handle-wrapper'
|
|
309
|
+
}, [
|
|
310
|
+
h('div', {
|
|
311
|
+
class: 'vxe-table-custom--header'
|
|
312
|
+
}, headerSlot
|
|
313
|
+
? $xeTable.callSlot(headerSlot, params, h)
|
|
314
|
+
: [
|
|
315
|
+
h('ul', {
|
|
316
|
+
class: 'vxe-table-custom--panel-list'
|
|
301
317
|
}, [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
|
|
318
|
+
h('li', {
|
|
319
|
+
class: 'vxe-table-custom--option'
|
|
320
|
+
}, [
|
|
321
|
+
allowVisible
|
|
322
|
+
? h('div', {
|
|
323
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
324
|
+
'is--checked': isAllChecked,
|
|
325
|
+
'is--indeterminate': isAllIndeterminate
|
|
326
|
+
}],
|
|
327
|
+
attrs: {
|
|
328
|
+
title: getI18n('vxe.table.allTitle')
|
|
329
|
+
},
|
|
330
|
+
on: {
|
|
331
|
+
click: _vm.allOptionEvent
|
|
332
|
+
}
|
|
333
|
+
}, [
|
|
334
|
+
h('span', {
|
|
335
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
336
|
+
}),
|
|
337
|
+
h('span', {
|
|
338
|
+
class: 'vxe-checkbox--label'
|
|
339
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
340
|
+
])
|
|
341
|
+
: h('span', {
|
|
319
342
|
class: 'vxe-checkbox--label'
|
|
320
|
-
}, getI18n('vxe.
|
|
321
|
-
|
|
322
|
-
: h('span', {
|
|
323
|
-
class: 'vxe-checkbox--label'
|
|
324
|
-
}, getI18n('vxe.table.customTitle'))
|
|
343
|
+
}, getI18n('vxe.table.customTitle'))
|
|
344
|
+
])
|
|
325
345
|
])
|
|
326
|
-
])
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
},
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
346
|
+
]),
|
|
347
|
+
h('div', {
|
|
348
|
+
class: 'vxe-table-custom--body'
|
|
349
|
+
}, [
|
|
350
|
+
topSlot
|
|
351
|
+
? h('div', {
|
|
352
|
+
class: 'vxe-table-custom--panel-top'
|
|
353
|
+
}, $xeTable.callSlot(topSlot, params, h))
|
|
354
|
+
: renderEmptyElement($xeTable),
|
|
355
|
+
defaultSlot
|
|
356
|
+
? h('div', {
|
|
357
|
+
class: 'vxe-table-custom--panel-body'
|
|
358
|
+
}, $xeTable.callSlot(defaultSlot, params, h))
|
|
359
|
+
: h('transition-group', {
|
|
360
|
+
class: 'vxe-table-custom--panel-list',
|
|
361
|
+
props: {
|
|
362
|
+
name: 'vxe-table-custom--list',
|
|
363
|
+
tag: 'ul'
|
|
364
|
+
},
|
|
365
|
+
on: customWrapperOns
|
|
366
|
+
}, colVNs),
|
|
367
|
+
bottomSlot
|
|
368
|
+
? h('div', {
|
|
369
|
+
class: 'vxe-table-custom--panel-bottom'
|
|
370
|
+
}, $xeTable.callSlot(bottomSlot, params, h))
|
|
371
|
+
: renderEmptyElement($xeTable)
|
|
372
|
+
]),
|
|
373
|
+
customOpts.showFooter
|
|
350
374
|
? h('div', {
|
|
351
|
-
class: 'vxe-table-custom--
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}, footerSlot
|
|
360
|
-
? $xeTable.callSlot(footerSlot, params, h)
|
|
361
|
-
: [
|
|
362
|
-
h('div', {
|
|
363
|
-
class: 'vxe-table-custom--footer-buttons'
|
|
364
|
-
}, [
|
|
365
|
-
h(VxeUIButtonComponent, {
|
|
366
|
-
props: {
|
|
367
|
-
mode: 'text',
|
|
368
|
-
content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
|
|
369
|
-
disabled: !isCustomStatus
|
|
370
|
-
},
|
|
371
|
-
on: {
|
|
372
|
-
click: _vm.resetCustomEvent
|
|
373
|
-
}
|
|
374
|
-
}),
|
|
375
|
-
immediate
|
|
376
|
-
? h(VxeUIButtonComponent, {
|
|
377
|
-
props: {
|
|
378
|
-
mode: 'text',
|
|
379
|
-
content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
|
|
380
|
-
},
|
|
381
|
-
on: {
|
|
382
|
-
click: _vm.cancelCloseEvent
|
|
383
|
-
}
|
|
384
|
-
})
|
|
385
|
-
: h(VxeUIButtonComponent, {
|
|
375
|
+
class: 'vxe-table-custom--footer'
|
|
376
|
+
}, footerSlot
|
|
377
|
+
? $xeTable.callSlot(footerSlot, params, h)
|
|
378
|
+
: [
|
|
379
|
+
h('div', {
|
|
380
|
+
class: 'vxe-table-custom--footer-buttons'
|
|
381
|
+
}, [
|
|
382
|
+
h(VxeUIButtonComponent, {
|
|
386
383
|
props: {
|
|
387
384
|
mode: 'text',
|
|
388
|
-
content: customOpts.resetButtonText || getI18n('vxe.table.
|
|
385
|
+
content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
|
|
386
|
+
disabled: !isCustomStatus
|
|
389
387
|
},
|
|
390
388
|
on: {
|
|
391
|
-
click: _vm.
|
|
389
|
+
click: _vm.resetCustomEvent
|
|
392
390
|
}
|
|
393
391
|
}),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
392
|
+
immediate
|
|
393
|
+
? h(VxeUIButtonComponent, {
|
|
394
|
+
props: {
|
|
395
|
+
mode: 'text',
|
|
396
|
+
content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
|
|
397
|
+
},
|
|
398
|
+
on: {
|
|
399
|
+
click: _vm.cancelCloseEvent
|
|
400
|
+
}
|
|
401
|
+
})
|
|
402
|
+
: h(VxeUIButtonComponent, {
|
|
403
|
+
props: {
|
|
404
|
+
mode: 'text',
|
|
405
|
+
content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
|
|
406
|
+
},
|
|
407
|
+
on: {
|
|
408
|
+
click: _vm.cancelCustomEvent
|
|
409
|
+
}
|
|
410
|
+
}),
|
|
411
|
+
immediate
|
|
412
|
+
? renderEmptyElement($xeTable)
|
|
413
|
+
: h(VxeUIButtonComponent, {
|
|
414
|
+
props: {
|
|
415
|
+
mode: 'text',
|
|
416
|
+
status: 'primary',
|
|
417
|
+
content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
|
|
418
|
+
},
|
|
419
|
+
on: {
|
|
420
|
+
click: _vm.confirmCustomEvent
|
|
421
|
+
}
|
|
422
|
+
})
|
|
423
|
+
])
|
|
406
424
|
])
|
|
407
|
-
|
|
408
|
-
|
|
425
|
+
: null
|
|
426
|
+
]),
|
|
427
|
+
renderDragTip(h, _vm)
|
|
409
428
|
])
|
|
410
429
|
]
|
|
411
430
|
: [])
|
|
412
431
|
}
|
|
413
432
|
|
|
414
|
-
const renderPopupPanel = (h: CreateElement,
|
|
433
|
+
const renderPopupPanel = (h: CreateElement, $xeTableCustomPanel: VxeTableCustomPanelConstructor) => {
|
|
415
434
|
const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
|
|
416
435
|
const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
|
|
417
436
|
const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
|
|
418
437
|
const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeInput')
|
|
419
|
-
const $xeTableCustomPanel = _vm
|
|
420
438
|
|
|
421
|
-
const
|
|
439
|
+
const _vm = $xeTableCustomPanel as any
|
|
440
|
+
const props = $xeTableCustomPanel
|
|
422
441
|
|
|
423
|
-
const $xeTable =
|
|
442
|
+
const $xeTable = $xeTableCustomPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
424
443
|
const tableProps = $xeTable
|
|
425
|
-
const
|
|
444
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
426
445
|
const $xeGrid = $xeTable.$xeGrid
|
|
427
446
|
|
|
428
447
|
const { customStore } = props
|
|
429
448
|
const { resizable: allResizable } = tableProps
|
|
430
|
-
const { isCustomStatus, customColumnList } =
|
|
449
|
+
const { isCustomStatus, customColumnList } = tableReactData
|
|
431
450
|
const customOpts = $xeTable.computeCustomOpts
|
|
432
451
|
const { immediate } = customOpts
|
|
433
452
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
@@ -514,9 +533,9 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
|
|
|
514
533
|
title: getI18n('vxe.custom.setting.colVisible')
|
|
515
534
|
},
|
|
516
535
|
on: {
|
|
517
|
-
click: () => {
|
|
536
|
+
click: (evnt: MouseEvent) => {
|
|
518
537
|
if (!isDisabled) {
|
|
519
|
-
_vm.changeCheckboxOption(column)
|
|
538
|
+
_vm.changeCheckboxOption(column, evnt)
|
|
520
539
|
}
|
|
521
540
|
}
|
|
522
541
|
}
|
|
@@ -625,8 +644,8 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
|
|
|
625
644
|
]
|
|
626
645
|
},
|
|
627
646
|
on: {
|
|
628
|
-
|
|
629
|
-
_vm.changeFixedOption(column,
|
|
647
|
+
change ({ label, $event }: VxeRadioGroupDefines.ChangeEventParams) {
|
|
648
|
+
_vm.changeFixedOption(column, label, $event)
|
|
630
649
|
}
|
|
631
650
|
}
|
|
632
651
|
})
|
|
@@ -638,93 +657,97 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
|
|
|
638
657
|
})
|
|
639
658
|
const scopedSlots: Record<string, any> = {
|
|
640
659
|
default: () => {
|
|
641
|
-
if (defaultSlot) {
|
|
642
|
-
return $xeTable.callSlot(defaultSlot, params, h)
|
|
643
|
-
}
|
|
644
660
|
return h('div', {
|
|
645
|
-
ref: '
|
|
646
|
-
class: 'vxe-table-custom-popup--body'
|
|
647
|
-
},
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
allowVisible
|
|
659
|
-
? h('col', {
|
|
660
|
-
class: 'vxe-table-custom-popup--table-col-seq'
|
|
661
|
-
})
|
|
662
|
-
: renderEmptyElement($xeTable),
|
|
663
|
-
h('col', {
|
|
664
|
-
class: 'vxe-table-custom-popup--table-col-title'
|
|
665
|
-
}),
|
|
666
|
-
allowResizable
|
|
667
|
-
? h('col', {
|
|
668
|
-
class: 'vxe-table-custom-popup--table-col-width'
|
|
669
|
-
})
|
|
661
|
+
ref: 'refBodyWrapperElem',
|
|
662
|
+
class: 'vxe-table-custom-popup--body-wrapper'
|
|
663
|
+
}, defaultSlot
|
|
664
|
+
? $xeTable.callSlot(defaultSlot, params, h)
|
|
665
|
+
: [
|
|
666
|
+
h('div', {
|
|
667
|
+
ref: 'refCustomBodyElem',
|
|
668
|
+
class: 'vxe-table-custom-popup--handle-wrapper'
|
|
669
|
+
}, [
|
|
670
|
+
topSlot
|
|
671
|
+
? h('div', {
|
|
672
|
+
class: 'vxe-table-custom-popup--table-top'
|
|
673
|
+
}, $xeTable.callSlot(topSlot, params, h))
|
|
670
674
|
: renderEmptyElement($xeTable),
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
h('
|
|
682
|
-
class:
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
675
|
+
h('div', {
|
|
676
|
+
class: 'vxe-table-custom-popup--table-wrapper'
|
|
677
|
+
}, [
|
|
678
|
+
h('table', {}, [
|
|
679
|
+
h('colgroup', {}, [
|
|
680
|
+
allowVisible
|
|
681
|
+
? h('col', {
|
|
682
|
+
class: 'vxe-table-custom-popup--table-col-seq'
|
|
683
|
+
})
|
|
684
|
+
: renderEmptyElement($xeTable),
|
|
685
|
+
h('col', {
|
|
686
|
+
class: 'vxe-table-custom-popup--table-col-title'
|
|
687
|
+
}),
|
|
688
|
+
allowResizable
|
|
689
|
+
? h('col', {
|
|
690
|
+
class: 'vxe-table-custom-popup--table-col-width'
|
|
691
|
+
})
|
|
692
|
+
: renderEmptyElement($xeTable),
|
|
693
|
+
allowFixed
|
|
694
|
+
? h('col', {
|
|
695
|
+
class: 'vxe-table-custom-popup--table-col-fixed'
|
|
696
|
+
})
|
|
697
|
+
: renderEmptyElement($xeTable)
|
|
698
|
+
]),
|
|
699
|
+
h('thead', {}, [
|
|
700
|
+
h('tr', {}, [
|
|
701
|
+
allowVisible
|
|
702
|
+
? h('th', {}, [
|
|
703
|
+
h('div', {
|
|
704
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
705
|
+
'is--checked': isAllChecked,
|
|
706
|
+
'is--indeterminate': isAllIndeterminate
|
|
707
|
+
}],
|
|
708
|
+
attrs: {
|
|
709
|
+
title: getI18n('vxe.table.allTitle')
|
|
710
|
+
},
|
|
711
|
+
on: {
|
|
712
|
+
click: _vm.allOptionEvent
|
|
713
|
+
}
|
|
692
714
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
715
|
+
}, [
|
|
716
|
+
h('span', {
|
|
717
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
718
|
+
}),
|
|
719
|
+
h('span', {
|
|
720
|
+
class: 'vxe-checkbox--label'
|
|
721
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
722
|
+
])
|
|
723
|
+
])
|
|
724
|
+
: renderEmptyElement($xeTable),
|
|
725
|
+
h('th', {}, getI18n('vxe.custom.setting.colTitle')),
|
|
726
|
+
allowResizable
|
|
727
|
+
? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
|
|
728
|
+
: renderEmptyElement($xeTable),
|
|
729
|
+
allowFixed
|
|
730
|
+
? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
|
|
731
|
+
: renderEmptyElement($xeTable)
|
|
700
732
|
])
|
|
701
|
-
])
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
])
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}, trVNs)
|
|
733
|
+
]),
|
|
734
|
+
h('transition-group', {
|
|
735
|
+
class: 'vxe-table-custom--panel-list',
|
|
736
|
+
props: {
|
|
737
|
+
tag: 'tbody',
|
|
738
|
+
name: 'vxe-table-custom--list'
|
|
739
|
+
}
|
|
740
|
+
}, trVNs)
|
|
741
|
+
])
|
|
742
|
+
]),
|
|
743
|
+
bottomSlot
|
|
744
|
+
? h('div', {
|
|
745
|
+
class: 'vxe-table-custom-popup--table-bottom'
|
|
746
|
+
}, $xeTable.callSlot(bottomSlot, params, h))
|
|
747
|
+
: renderEmptyElement($xeTable),
|
|
748
|
+
renderDragTip(h, _vm)
|
|
749
|
+
])
|
|
719
750
|
])
|
|
720
|
-
]),
|
|
721
|
-
bottomSlot
|
|
722
|
-
? h('div', {
|
|
723
|
-
class: 'vxe-table-custom-popup--table-bottom'
|
|
724
|
-
}, $xeTable.callSlot(bottomSlot, params, h))
|
|
725
|
-
: renderEmptyElement($xeTable),
|
|
726
|
-
renderDragTip(h, _vm)
|
|
727
|
-
])
|
|
728
751
|
},
|
|
729
752
|
footer: () => {
|
|
730
753
|
if (footerSlot) {
|
|
@@ -841,29 +864,50 @@ export default {
|
|
|
841
864
|
default: () => ({})
|
|
842
865
|
}
|
|
843
866
|
},
|
|
867
|
+
provide () {
|
|
868
|
+
const $xeTableCustomPanel = this
|
|
869
|
+
|
|
870
|
+
return {
|
|
871
|
+
$xeTableCustomPanel
|
|
872
|
+
}
|
|
873
|
+
},
|
|
844
874
|
inject: {
|
|
845
875
|
$xeTable: {
|
|
846
876
|
default: null
|
|
847
877
|
}
|
|
848
878
|
},
|
|
849
879
|
data () {
|
|
880
|
+
const reactData: TableCustomPanelReactData = {
|
|
881
|
+
dragCol: null,
|
|
882
|
+
dragGroup: null,
|
|
883
|
+
dragValues: null,
|
|
884
|
+
dragTipText: ''
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
const internalData: TableCustomPanelInternalData = {
|
|
888
|
+
// prevDragCol: undefined,
|
|
889
|
+
// prevDragToChild: false,
|
|
890
|
+
// prevDragPos: null
|
|
891
|
+
}
|
|
892
|
+
|
|
850
893
|
return {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
prevDragPos: null
|
|
894
|
+
reactData,
|
|
895
|
+
internalData
|
|
854
896
|
}
|
|
855
897
|
},
|
|
856
898
|
computed: {
|
|
857
899
|
},
|
|
858
|
-
created (
|
|
900
|
+
created () {
|
|
901
|
+
const $xeTableCustomPanel = this as any
|
|
902
|
+
|
|
859
903
|
const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
|
|
860
904
|
const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
|
|
861
905
|
const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
|
|
862
906
|
const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeNumberInput')
|
|
863
907
|
const VxeUIRadioGroupComponent = VxeUI.getComponent<VxeRadioGroupComponent>('VxeRadioGroup')
|
|
864
908
|
|
|
865
|
-
|
|
866
|
-
const $xeTable =
|
|
909
|
+
$xeTableCustomPanel.$nextTick(() => {
|
|
910
|
+
const $xeTable = $xeTableCustomPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
867
911
|
|
|
868
912
|
const { customOpts } = $xeTable
|
|
869
913
|
const { mode } = customOpts
|
|
@@ -884,27 +928,31 @@ export default {
|
|
|
884
928
|
}
|
|
885
929
|
})
|
|
886
930
|
},
|
|
887
|
-
render (
|
|
888
|
-
const $
|
|
931
|
+
render (h: CreateElement) {
|
|
932
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
933
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
889
934
|
|
|
890
935
|
const customOpts = $xeTable.computeCustomOpts
|
|
891
936
|
if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
|
|
892
|
-
return renderPopupPanel(h,
|
|
937
|
+
return renderPopupPanel(h, $xeTableCustomPanel)
|
|
893
938
|
}
|
|
894
|
-
return renderSimplePanel(h,
|
|
939
|
+
return renderSimplePanel(h, $xeTableCustomPanel)
|
|
895
940
|
},
|
|
896
941
|
methods: {
|
|
897
942
|
handleWrapperMouseenterEvent (evnt: any) {
|
|
898
|
-
const $
|
|
943
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
944
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
899
945
|
|
|
900
946
|
const { customStore } = this
|
|
901
947
|
customStore.activeWrapper = true
|
|
902
948
|
$xeTable.customOpenEvent(evnt)
|
|
903
949
|
},
|
|
904
950
|
handleWrapperMouseleaveEvent (evnt: any) {
|
|
905
|
-
const $
|
|
951
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
952
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
953
|
+
const props = $xeTableCustomPanel
|
|
906
954
|
|
|
907
|
-
const { customStore } =
|
|
955
|
+
const { customStore } = props
|
|
908
956
|
customStore.activeWrapper = false
|
|
909
957
|
setTimeout(() => {
|
|
910
958
|
if (!customStore.activeBtn && !customStore.activeWrapper) {
|
|
@@ -915,36 +963,40 @@ export default {
|
|
|
915
963
|
getStoreData () {
|
|
916
964
|
return {}
|
|
917
965
|
},
|
|
918
|
-
confirmCustomEvent ({ $event }:
|
|
919
|
-
const $
|
|
920
|
-
const
|
|
966
|
+
confirmCustomEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
|
|
967
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
968
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
969
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
921
970
|
|
|
922
|
-
|
|
971
|
+
tableReactData.isCustomStatus = true
|
|
923
972
|
$xeTable.saveCustom()
|
|
924
973
|
$xeTable.closeCustom()
|
|
925
974
|
$xeTable.emitCustomEvent('confirm', $event)
|
|
926
975
|
},
|
|
927
|
-
cancelCloseEvent ({ $event }:
|
|
928
|
-
const $
|
|
976
|
+
cancelCloseEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
|
|
977
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
978
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
929
979
|
|
|
930
980
|
$xeTable.closeCustom()
|
|
931
981
|
$xeTable.emitCustomEvent('close', $event)
|
|
932
982
|
},
|
|
933
|
-
cancelCustomEvent ({ $event }:
|
|
934
|
-
const $
|
|
983
|
+
cancelCustomEvent ({ $event }: VxeButtonDefines.ClickEventParams) {
|
|
984
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
985
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
935
986
|
|
|
936
987
|
$xeTable.cancelCustom()
|
|
937
988
|
$xeTable.closeCustom()
|
|
938
989
|
$xeTable.emitCustomEvent('cancel', $event)
|
|
939
990
|
},
|
|
940
|
-
handleResetCustomEvent (evnt:
|
|
941
|
-
const $
|
|
991
|
+
handleResetCustomEvent (evnt: Event) {
|
|
992
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
993
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
942
994
|
|
|
943
995
|
$xeTable.resetCustom(true)
|
|
944
996
|
$xeTable.closeCustom()
|
|
945
997
|
$xeTable.emitCustomEvent('reset', evnt)
|
|
946
998
|
},
|
|
947
|
-
resetCustomEvent (evnt:
|
|
999
|
+
resetCustomEvent (evnt: Event) {
|
|
948
1000
|
if (VxeUI.modal) {
|
|
949
1001
|
VxeUI.modal.confirm({
|
|
950
1002
|
content: getI18n('vxe.custom.cstmConfirmRestore'),
|
|
@@ -959,26 +1011,12 @@ export default {
|
|
|
959
1011
|
this.handleResetCustomEvent(evnt)
|
|
960
1012
|
}
|
|
961
1013
|
},
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
className: 'vxe-table--ignore-clear',
|
|
967
|
-
escClosable: true
|
|
968
|
-
}).then(type => {
|
|
969
|
-
if (type === 'confirm') {
|
|
970
|
-
this.resetCustomEvent(evnt)
|
|
971
|
-
}
|
|
972
|
-
})
|
|
973
|
-
} else {
|
|
974
|
-
this.resetCustomEvent(evnt)
|
|
975
|
-
}
|
|
976
|
-
},
|
|
977
|
-
handleOptionCheck (column: any) {
|
|
978
|
-
const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
979
|
-
const reactData = $xeTable as unknown as TableReactData
|
|
1014
|
+
handleOptionCheck (column: VxeTableDefines.ColumnInfo) {
|
|
1015
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1016
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1017
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
980
1018
|
|
|
981
|
-
const { customColumnList } =
|
|
1019
|
+
const { customColumnList } = tableReactData
|
|
982
1020
|
const matchObj = XEUtils.findTree(customColumnList, item => item === column) as any
|
|
983
1021
|
if (matchObj && matchObj.parent) {
|
|
984
1022
|
const { parent } = matchObj
|
|
@@ -989,9 +1027,10 @@ export default {
|
|
|
989
1027
|
}
|
|
990
1028
|
}
|
|
991
1029
|
},
|
|
992
|
-
changeCheckboxOption (column:
|
|
993
|
-
const $
|
|
994
|
-
const
|
|
1030
|
+
changeCheckboxOption (column: VxeTableDefines.ColumnInfo, evnt: MouseEvent) {
|
|
1031
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1032
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1033
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
995
1034
|
|
|
996
1035
|
const customOpts = $xeTable.computeCustomOpts
|
|
997
1036
|
const isChecked = !column.renderVisible
|
|
@@ -1001,7 +1040,7 @@ export default {
|
|
|
1001
1040
|
item.renderVisible = isChecked
|
|
1002
1041
|
item.halfVisible = false
|
|
1003
1042
|
})
|
|
1004
|
-
|
|
1043
|
+
tableReactData.isCustomStatus = true
|
|
1005
1044
|
$xeTable.handleCustom()
|
|
1006
1045
|
$xeTable.saveCustomStore('update:visible')
|
|
1007
1046
|
} else {
|
|
@@ -1012,66 +1051,104 @@ export default {
|
|
|
1012
1051
|
}
|
|
1013
1052
|
this.handleOptionCheck(column)
|
|
1014
1053
|
$xeTable.checkCustomStatus()
|
|
1054
|
+
$xeTable.dispatchEvent('custom-visible-change', { column, checked: isChecked }, evnt)
|
|
1015
1055
|
},
|
|
1016
1056
|
changeColumnWidth (column: VxeTableDefines.ColumnInfo) {
|
|
1017
|
-
const $
|
|
1018
|
-
const
|
|
1057
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1058
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1059
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
1019
1060
|
|
|
1020
1061
|
const customOpts = $xeTable.computeCustomOpts
|
|
1021
1062
|
if (customOpts.immediate) {
|
|
1022
1063
|
if (column.renderResizeWidth !== column.renderWidth) {
|
|
1023
1064
|
column.resizeWidth = column.renderResizeWidth
|
|
1024
1065
|
column.renderWidth = column.renderResizeWidth
|
|
1025
|
-
|
|
1066
|
+
tableReactData.isCustomStatus = true
|
|
1026
1067
|
$xeTable.handleCustom()
|
|
1027
1068
|
$xeTable.saveCustomStore('update:width')
|
|
1028
1069
|
}
|
|
1029
1070
|
}
|
|
1030
1071
|
},
|
|
1031
|
-
changeFixedOption (column:
|
|
1032
|
-
const $
|
|
1033
|
-
const
|
|
1072
|
+
changeFixedOption (column: VxeTableDefines.ColumnInfo, colFixed: VxeColumnPropTypes.Fixed, evnt: Event) {
|
|
1073
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1074
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1075
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
1034
1076
|
|
|
1035
1077
|
const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
|
|
1036
1078
|
const customOpts = $xeTable.computeCustomOpts
|
|
1079
|
+
let targetFixed: VxeColumnPropTypes.Fixed = null
|
|
1037
1080
|
if (customOpts.immediate) {
|
|
1038
1081
|
if (column.renderFixed === colFixed) {
|
|
1082
|
+
targetFixed = ''
|
|
1039
1083
|
XEUtils.eachTree([column], col => {
|
|
1040
1084
|
col.fixed = ''
|
|
1041
1085
|
col.renderFixed = ''
|
|
1042
1086
|
})
|
|
1043
1087
|
} else {
|
|
1044
1088
|
if (!isMaxFixedColumn || column.renderFixed) {
|
|
1089
|
+
targetFixed = colFixed
|
|
1045
1090
|
XEUtils.eachTree([column], col => {
|
|
1046
1091
|
col.fixed = colFixed
|
|
1047
1092
|
col.renderFixed = colFixed
|
|
1048
1093
|
})
|
|
1049
1094
|
}
|
|
1050
1095
|
}
|
|
1051
|
-
|
|
1096
|
+
tableReactData.isCustomStatus = true
|
|
1052
1097
|
$xeTable.handleCustom()
|
|
1053
1098
|
$xeTable.saveCustomStore('update:fixed')
|
|
1054
1099
|
} else {
|
|
1055
1100
|
if (column.renderFixed === colFixed) {
|
|
1101
|
+
targetFixed = ''
|
|
1056
1102
|
XEUtils.eachTree([column], col => {
|
|
1057
1103
|
col.renderFixed = ''
|
|
1058
1104
|
})
|
|
1059
1105
|
} else {
|
|
1060
1106
|
if (!isMaxFixedColumn || column.renderFixed) {
|
|
1107
|
+
targetFixed = colFixed
|
|
1061
1108
|
XEUtils.eachTree([column], col => {
|
|
1062
1109
|
col.renderFixed = colFixed
|
|
1063
1110
|
})
|
|
1064
1111
|
}
|
|
1065
1112
|
}
|
|
1066
1113
|
}
|
|
1114
|
+
if (!targetFixed !== null) {
|
|
1115
|
+
$xeTable.dispatchEvent('custom-fixed-change', { column, fixed: targetFixed }, evnt)
|
|
1116
|
+
}
|
|
1067
1117
|
},
|
|
1068
|
-
allOptionEvent () {
|
|
1069
|
-
const $
|
|
1118
|
+
allOptionEvent (evnt: MouseEvent) {
|
|
1119
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1120
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1121
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
1070
1122
|
|
|
1123
|
+
const { customStore } = tableReactData
|
|
1124
|
+
const isAll = !customStore.isAll
|
|
1071
1125
|
$xeTable.toggleCustomAllCheckbox()
|
|
1126
|
+
$xeTable.dispatchEvent('custom-visible-all', { checked: isAll }, evnt)
|
|
1127
|
+
},
|
|
1128
|
+
updateColDropTipContent () {
|
|
1129
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1130
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1131
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
1132
|
+
|
|
1133
|
+
const { dragCol } = customPanelReactData
|
|
1134
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
1135
|
+
const { tooltipMethod } = columnDragOpts
|
|
1136
|
+
let tipContent = ''
|
|
1137
|
+
if (tooltipMethod) {
|
|
1138
|
+
const dtParams = {
|
|
1139
|
+
$table: $xeTable,
|
|
1140
|
+
column: dragCol as VxeTableDefines.ColumnInfo
|
|
1141
|
+
}
|
|
1142
|
+
tipContent = `${tooltipMethod(dtParams) || ''}`
|
|
1143
|
+
} else {
|
|
1144
|
+
tipContent = getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : ''])
|
|
1145
|
+
}
|
|
1146
|
+
customPanelReactData.dragTipText = tipContent
|
|
1072
1147
|
},
|
|
1073
1148
|
sortMousedownEvent (evnt: MouseEvent) {
|
|
1074
|
-
const $
|
|
1149
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1150
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1151
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
1075
1152
|
|
|
1076
1153
|
const btnEl = evnt.currentTarget as HTMLElement
|
|
1077
1154
|
const cellEl = btnEl.parentElement as HTMLElement
|
|
@@ -1080,42 +1157,59 @@ export default {
|
|
|
1080
1157
|
const colid = trEl.getAttribute('colid')
|
|
1081
1158
|
const column = $xeTable.getColumnById(colid)
|
|
1082
1159
|
trEl.draggable = true
|
|
1083
|
-
|
|
1160
|
+
customPanelReactData.dragCol = column
|
|
1161
|
+
this.updateColDropTipContent()
|
|
1084
1162
|
addClass(trEl, 'active--drag-origin')
|
|
1085
1163
|
},
|
|
1086
1164
|
sortMouseupEvent (evnt: MouseEvent) {
|
|
1165
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1166
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
1167
|
+
|
|
1087
1168
|
const btnEl = evnt.currentTarget as HTMLElement
|
|
1088
1169
|
const cellEl = btnEl.parentElement as HTMLElement
|
|
1089
1170
|
const tdEl = cellEl.parentElement as HTMLElement
|
|
1090
1171
|
const trEl = tdEl.parentElement as HTMLElement
|
|
1091
|
-
hideDropTip(
|
|
1172
|
+
hideDropTip($xeTableCustomPanel)
|
|
1092
1173
|
trEl.draggable = false
|
|
1093
|
-
|
|
1174
|
+
customPanelReactData.dragCol = null
|
|
1094
1175
|
removeClass(trEl, 'active--drag-origin')
|
|
1095
1176
|
},
|
|
1096
1177
|
sortDragstartEvent (evnt: any) {
|
|
1178
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1179
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
1180
|
+
|
|
1097
1181
|
if (evnt.dataTransfer) {
|
|
1098
1182
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
|
|
1099
1183
|
}
|
|
1184
|
+
customPanelReactData.dragGroup = null
|
|
1185
|
+
customPanelReactData.dragValues = null
|
|
1100
1186
|
},
|
|
1101
1187
|
sortDragendEvent (evnt: any) {
|
|
1102
|
-
const $
|
|
1188
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1189
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1103
1190
|
const tableProps = $xeTable
|
|
1104
|
-
const
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
const
|
|
1191
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
1192
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
1193
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
1194
|
+
const customPanelInternalData = $xeTableCustomPanel.internalData
|
|
1108
1195
|
|
|
1109
1196
|
const { mouseConfig } = tableProps
|
|
1110
|
-
const { customColumnList } =
|
|
1111
|
-
const { collectColumn } =
|
|
1197
|
+
const { customColumnList } = tableReactData
|
|
1198
|
+
const { collectColumn } = tableInternalData
|
|
1112
1199
|
const customOpts = $xeTable.computeCustomOpts
|
|
1113
1200
|
const { immediate } = customOpts
|
|
1114
1201
|
const trEl = evnt.currentTarget as HTMLElement
|
|
1115
1202
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
1116
1203
|
const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
|
|
1204
|
+
const { dragCol, dragGroup, dragValues } = customPanelReactData
|
|
1205
|
+
const { prevDragCol, prevDragPos, prevDragToChild } = customPanelInternalData
|
|
1117
1206
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
|
|
1118
|
-
|
|
1207
|
+
|
|
1208
|
+
if (dragGroup || dragValues) {
|
|
1209
|
+
if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
|
|
1210
|
+
$xeTable.handlePivotTableAggregatePanelDragendEvent(evnt)
|
|
1211
|
+
}
|
|
1212
|
+
} else if (prevDragCol && dragCol) {
|
|
1119
1213
|
// 判断是否有拖动
|
|
1120
1214
|
if (prevDragCol !== dragCol) {
|
|
1121
1215
|
const dragColumn: VxeTableDefines.ColumnInfo = dragCol
|
|
@@ -1247,7 +1341,7 @@ export default {
|
|
|
1247
1341
|
customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn)
|
|
1248
1342
|
}
|
|
1249
1343
|
|
|
1250
|
-
|
|
1344
|
+
tableReactData.isDragColMove = true
|
|
1251
1345
|
if (mouseConfig) {
|
|
1252
1346
|
if ($xeTable.clearSelected) {
|
|
1253
1347
|
$xeTable.clearSelected()
|
|
@@ -1271,7 +1365,7 @@ export default {
|
|
|
1271
1365
|
}, evnt)
|
|
1272
1366
|
|
|
1273
1367
|
if (immediate) {
|
|
1274
|
-
|
|
1368
|
+
tableReactData.customColumnList = collectColumn.slice(0)
|
|
1275
1369
|
$xeTable.handleColDragSwapColumn()
|
|
1276
1370
|
}
|
|
1277
1371
|
}).catch(() => {
|
|
@@ -1279,18 +1373,22 @@ export default {
|
|
|
1279
1373
|
}
|
|
1280
1374
|
}
|
|
1281
1375
|
|
|
1282
|
-
hideDropTip(
|
|
1283
|
-
|
|
1376
|
+
hideDropTip($xeTableCustomPanel)
|
|
1377
|
+
customPanelReactData.dragCol = null
|
|
1378
|
+
customPanelReactData.dragGroup = null
|
|
1379
|
+
customPanelReactData.dragValues = null
|
|
1284
1380
|
trEl.draggable = false
|
|
1285
1381
|
trEl.removeAttribute('drag-pos')
|
|
1286
1382
|
removeClass(trEl, 'active--drag-target')
|
|
1287
1383
|
removeClass(trEl, 'active--drag-origin')
|
|
1288
1384
|
},
|
|
1289
1385
|
sortDragoverEvent (evnt: DragEvent) {
|
|
1290
|
-
const $
|
|
1291
|
-
|
|
1292
|
-
const
|
|
1386
|
+
const $xeTableCustomPanel = this as unknown as VxeTableCustomPanelConstructor
|
|
1387
|
+
const $xeTable = $xeTableCustomPanel.$xeTable
|
|
1388
|
+
const customPanelReactData = $xeTableCustomPanel.reactData
|
|
1389
|
+
const customPanelInternalData = $xeTableCustomPanel.internalData
|
|
1293
1390
|
|
|
1391
|
+
const { dragCol } = customPanelReactData
|
|
1294
1392
|
const customOpts = $xeTable.computeCustomOpts
|
|
1295
1393
|
const { immediate } = customOpts
|
|
1296
1394
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
@@ -1299,6 +1397,8 @@ export default {
|
|
|
1299
1397
|
const isControlKey = hasControlKey(evnt)
|
|
1300
1398
|
const colid = optEl.getAttribute('colid')
|
|
1301
1399
|
const column = $xeTable.getColumnById(colid)
|
|
1400
|
+
customPanelReactData.dragGroup = null
|
|
1401
|
+
customPanelReactData.dragValues = null
|
|
1302
1402
|
// 是否移入有效列
|
|
1303
1403
|
if (column && (isCrossDrag || column.level === 1)) {
|
|
1304
1404
|
evnt.preventDefault()
|
|
@@ -1310,13 +1410,13 @@ export default {
|
|
|
1310
1410
|
(!immediate && column.level > 1) ||
|
|
1311
1411
|
column.renderFixed
|
|
1312
1412
|
) {
|
|
1313
|
-
showDropTip(
|
|
1413
|
+
showDropTip($xeTableCustomPanel, evnt, optEl, false, dragPos)
|
|
1314
1414
|
return
|
|
1315
1415
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
showDropTip(
|
|
1416
|
+
customPanelInternalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && isControlKey && immediate)
|
|
1417
|
+
customPanelInternalData.prevDragCol = column
|
|
1418
|
+
customPanelInternalData.prevDragPos = dragPos
|
|
1419
|
+
showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos)
|
|
1320
1420
|
}
|
|
1321
1421
|
}
|
|
1322
1422
|
} as any
|