vxe-table 3.11.26 → 3.11.27-beta.1

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.
Files changed (151) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +3 -3
  4. package/es/locale/lang/de-DE.js +3 -3
  5. package/es/locale/lang/en-US.js +3 -3
  6. package/es/locale/lang/es-ES.js +3 -3
  7. package/es/locale/lang/fr-FR.js +3 -3
  8. package/es/locale/lang/hu-HU.js +3 -3
  9. package/es/locale/lang/hy-AM.js +3 -3
  10. package/es/locale/lang/ja-JP.js +3 -3
  11. package/es/locale/lang/ko-KR.js +3 -3
  12. package/es/locale/lang/nb-NO.js +3 -3
  13. package/es/locale/lang/pt-BR.js +3 -3
  14. package/es/locale/lang/ru-RU.js +3 -3
  15. package/es/locale/lang/ug-CN.js +3 -3
  16. package/es/locale/lang/uk-UA.js +3 -3
  17. package/es/locale/lang/vi-VN.js +3 -3
  18. package/es/locale/lang/zh-CHT.js +3 -3
  19. package/es/locale/lang/zh-CN.js +3 -3
  20. package/es/style.css +1 -1
  21. package/es/style.min.css +1 -1
  22. package/es/table/module/custom/mixin.js +2 -0
  23. package/es/table/module/custom/panel.js +433 -231
  24. package/es/table/src/body.js +2 -2
  25. package/es/table/src/cell.js +2 -2
  26. package/es/table/src/column.js +10 -8
  27. package/es/table/src/group.js +37 -6
  28. package/es/table/src/methods.js +167 -73
  29. package/es/table/src/table.js +1 -1
  30. package/es/table/src/util.js +0 -1
  31. package/es/table/style.css +106 -37
  32. package/es/table/style.min.css +1 -1
  33. package/es/ui/index.js +1 -1
  34. package/es/ui/src/dom.js +1 -0
  35. package/es/ui/src/log.js +1 -1
  36. package/es/vxe-table/style.css +106 -37
  37. package/es/vxe-table/style.min.css +1 -1
  38. package/lib/index.css +1 -1
  39. package/lib/index.min.css +1 -1
  40. package/lib/index.umd.js +618 -260
  41. package/lib/index.umd.min.js +1 -1
  42. package/lib/locale/lang/ar-EG.js +3 -3
  43. package/lib/locale/lang/ar-EG.min.js +1 -1
  44. package/lib/locale/lang/de-DE.js +3 -3
  45. package/lib/locale/lang/de-DE.min.js +1 -1
  46. package/lib/locale/lang/en-US.js +3 -3
  47. package/lib/locale/lang/en-US.min.js +1 -1
  48. package/lib/locale/lang/en-US.umd.js +3 -3
  49. package/lib/locale/lang/es-ES.js +3 -3
  50. package/lib/locale/lang/es-ES.min.js +1 -1
  51. package/lib/locale/lang/es-ES.umd.js +3 -3
  52. package/lib/locale/lang/fr-FR.js +3 -3
  53. package/lib/locale/lang/fr-FR.min.js +1 -1
  54. package/lib/locale/lang/hu-HU.js +3 -3
  55. package/lib/locale/lang/hu-HU.min.js +1 -1
  56. package/lib/locale/lang/hu-HU.umd.js +3 -3
  57. package/lib/locale/lang/hy-AM.js +3 -3
  58. package/lib/locale/lang/hy-AM.min.js +1 -1
  59. package/lib/locale/lang/ja-JP.js +3 -3
  60. package/lib/locale/lang/ja-JP.min.js +1 -1
  61. package/lib/locale/lang/ja-JP.umd.js +3 -3
  62. package/lib/locale/lang/ko-KR.js +3 -3
  63. package/lib/locale/lang/ko-KR.min.js +1 -1
  64. package/lib/locale/lang/ko-KR.umd.js +3 -3
  65. package/lib/locale/lang/nb-NO.js +3 -3
  66. package/lib/locale/lang/nb-NO.min.js +1 -1
  67. package/lib/locale/lang/pt-BR.js +3 -3
  68. package/lib/locale/lang/pt-BR.min.js +1 -1
  69. package/lib/locale/lang/pt-BR.umd.js +3 -3
  70. package/lib/locale/lang/ru-RU.js +3 -3
  71. package/lib/locale/lang/ru-RU.min.js +1 -1
  72. package/lib/locale/lang/ru-RU.umd.js +3 -3
  73. package/lib/locale/lang/ug-CN.js +3 -3
  74. package/lib/locale/lang/ug-CN.min.js +1 -1
  75. package/lib/locale/lang/uk-UA.js +3 -3
  76. package/lib/locale/lang/uk-UA.min.js +1 -1
  77. package/lib/locale/lang/uk-UA.umd.js +3 -3
  78. package/lib/locale/lang/vi-VN.js +3 -3
  79. package/lib/locale/lang/vi-VN.min.js +1 -1
  80. package/lib/locale/lang/zh-CHT.js +3 -3
  81. package/lib/locale/lang/zh-CHT.min.js +1 -1
  82. package/lib/locale/lang/zh-CHT.umd.js +3 -3
  83. package/lib/locale/lang/zh-CN.js +3 -3
  84. package/lib/locale/lang/zh-CN.min.js +1 -1
  85. package/lib/locale/lang/zh-CN.umd.js +3 -3
  86. package/lib/style.css +1 -1
  87. package/lib/style.min.css +1 -1
  88. package/lib/table/module/custom/mixin.js +2 -0
  89. package/lib/table/module/custom/mixin.min.js +1 -1
  90. package/lib/table/module/custom/panel.js +369 -156
  91. package/lib/table/module/custom/panel.min.js +1 -1
  92. package/lib/table/src/body.js +2 -2
  93. package/lib/table/src/body.min.js +1 -1
  94. package/lib/table/src/cell.js +2 -1
  95. package/lib/table/src/cell.min.js +1 -1
  96. package/lib/table/src/column.js +11 -9
  97. package/lib/table/src/column.min.js +1 -1
  98. package/lib/table/src/group.js +39 -6
  99. package/lib/table/src/group.min.js +1 -1
  100. package/lib/table/src/methods.js +181 -74
  101. package/lib/table/src/methods.min.js +1 -1
  102. package/lib/table/src/table.js +1 -1
  103. package/lib/table/src/table.min.js +1 -1
  104. package/lib/table/src/util.js +0 -1
  105. package/lib/table/src/util.min.js +1 -1
  106. package/lib/table/style/style.css +106 -37
  107. package/lib/table/style/style.min.css +1 -1
  108. package/lib/ui/index.js +1 -1
  109. package/lib/ui/index.min.js +1 -1
  110. package/lib/ui/src/dom.js +2 -0
  111. package/lib/ui/src/dom.min.js +1 -1
  112. package/lib/ui/src/log.js +1 -1
  113. package/lib/ui/src/log.min.js +1 -1
  114. package/lib/vxe-table/style/style.css +106 -37
  115. package/lib/vxe-table/style/style.min.css +1 -1
  116. package/package.json +2 -2
  117. package/packages/locale/lang/ar-EG.ts +3 -3
  118. package/packages/locale/lang/de-DE.ts +3 -3
  119. package/packages/locale/lang/en-US.ts +3 -3
  120. package/packages/locale/lang/es-ES.ts +3 -3
  121. package/packages/locale/lang/fr-FR.ts +3 -3
  122. package/packages/locale/lang/hu-HU.ts +3 -3
  123. package/packages/locale/lang/hy-AM.ts +3 -3
  124. package/packages/locale/lang/ja-JP.ts +3 -3
  125. package/packages/locale/lang/ko-KR.ts +3 -3
  126. package/packages/locale/lang/nb-NO.ts +3 -3
  127. package/packages/locale/lang/pt-BR.ts +3 -3
  128. package/packages/locale/lang/ru-RU.ts +3 -3
  129. package/packages/locale/lang/ug-CN.ts +3 -3
  130. package/packages/locale/lang/uk-UA.ts +3 -3
  131. package/packages/locale/lang/vi-VN.ts +3 -3
  132. package/packages/locale/lang/zh-CHT.ts +3 -3
  133. package/packages/locale/lang/zh-CN.ts +3 -3
  134. package/packages/table/module/custom/mixin.ts +2 -0
  135. package/packages/table/module/custom/panel.ts +458 -234
  136. package/packages/table/src/body.ts +2 -2
  137. package/packages/table/src/cell.ts +2 -2
  138. package/packages/table/src/column.ts +10 -8
  139. package/packages/table/src/group.ts +40 -6
  140. package/packages/table/src/methods.ts +182 -86
  141. package/packages/table/src/table.ts +1 -1
  142. package/packages/table/src/util.ts +0 -1
  143. package/packages/ui/src/dom.ts +2 -0
  144. package/styles/components/table-module/custom.scss +92 -12
  145. package/styles/components/table.scss +5 -0
  146. /package/es/{iconfont.1733885890565.ttf → iconfont.1734000397391.ttf} +0 -0
  147. /package/es/{iconfont.1733885890565.woff → iconfont.1734000397391.woff} +0 -0
  148. /package/es/{iconfont.1733885890565.woff2 → iconfont.1734000397391.woff2} +0 -0
  149. /package/lib/{iconfont.1733885890565.ttf → iconfont.1734000397391.ttf} +0 -0
  150. /package/lib/{iconfont.1733885890565.woff → iconfont.1734000397391.woff} +0 -0
  151. /package/lib/{iconfont.1733885890565.woff2 → iconfont.1734000397391.woff2} +0 -0
@@ -1,30 +1,94 @@
1
1
  import { CreateElement, VNode } from 'vue'
2
2
  import { VxeUI } from '../../../ui'
3
3
  import { formatText } from '../../../ui/src/utils'
4
- import { addClass, removeClass } from '../../../ui/src/dom'
4
+ import { tpImg, addClass, removeClass } from '../../../ui/src/dom'
5
5
  import { errLog } from '../../../ui/src/log'
6
6
  import XEUtils from 'xe-utils'
7
7
 
8
- import type { VxeModalComponent, VxeDrawerComponent, VxeButtonComponent, VxeRadioGroupComponent, VxeTooltipComponent, VxeInputComponent } from 'vxe-pc-ui'
8
+ import type { VxeTableDefines } from '../../../../types'
9
+ import type { VxeModalComponent, VxeDrawerComponent, VxeButtonComponent, VxeRadioGroupComponent, VxeInputComponent } from 'vxe-pc-ui'
9
10
 
10
11
  const { getI18n, getIcon, renderEmptyElement } = VxeUI
11
12
 
12
- function updateDropHint (_vm: any, evnt: any) {
13
- const { $refs } = _vm
14
- const dragHintEl = $refs.dragHintElemRef
15
- const bodyEl = $refs.bodyElemRef
16
- if (!bodyEl) {
13
+ function showDropTip (_vm: any, evnt: DragEvent | MouseEvent, optEl: HTMLElement | null, showLine: boolean, dragPos: string) {
14
+ const { prevDragToChild } = _vm
15
+
16
+ const el = _vm.$refs.bodyElemRef as HTMLDivElement
17
+ if (!el) {
17
18
  return
18
19
  }
19
- if (dragHintEl) {
20
- const wrapperEl = bodyEl.parentNode
21
- const wrapperRect = wrapperEl.getBoundingClientRect()
22
- dragHintEl.style.display = 'block'
23
- dragHintEl.style.top = `${Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - wrapperRect.y)}px`
24
- dragHintEl.style.left = `${Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`
20
+ const wrapperRect = el.getBoundingClientRect()
21
+ if (optEl) {
22
+ const dragLineEl = _vm.$refs.refDragLineElem as HTMLDivElement
23
+ if (dragLineEl) {
24
+ if (showLine) {
25
+ const optRect = optEl.getBoundingClientRect()
26
+ dragLineEl.style.display = 'block'
27
+ dragLineEl.style.top = `${Math.max(1, optRect.y - wrapperRect.y)}px`
28
+ dragLineEl.style.height = `${optRect.height}px`
29
+ dragLineEl.style.width = `${optRect.width}px`
30
+ dragLineEl.setAttribute('drag-pos', dragPos)
31
+ dragLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
32
+ } else {
33
+ dragLineEl.style.display = ''
34
+ }
35
+ }
36
+ }
37
+ const dragTipEl = _vm.$refs.refDragTipElem as HTMLDivElement
38
+ if (dragTipEl) {
39
+ dragTipEl.style.display = 'block'
40
+ dragTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - dragTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`
41
+ dragTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - dragTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`
42
+ dragTipEl.setAttribute('drag-status', showLine ? (prevDragToChild ? 'sub' : 'normal') : 'disabled')
43
+ }
44
+ }
45
+
46
+ function hideDropTip (_vm: any) {
47
+ const dragTipEl = _vm.$refs.refDragTipElem as HTMLDivElement
48
+ const dragLineEl = _vm.$refs.refDragLineElem as HTMLDivElement
49
+ if (dragTipEl) {
50
+ dragTipEl.style.display = ''
51
+ }
52
+ if (dragLineEl) {
53
+ dragLineEl.style.display = ''
25
54
  }
26
55
  }
27
56
 
57
+ const renderDragTip = (h: CreateElement, _vm: any) => {
58
+ const { dragCol } = _vm
59
+ return h('div', {}, [
60
+ h('div', {
61
+ ref: 'refDragLineElem',
62
+ class: 'vxe-table-custom-popup--drag-line'
63
+ }),
64
+ h('div', {
65
+ ref: 'refDragTipElem',
66
+ class: 'vxe-table-custom-popup--drag-tip'
67
+ }, [
68
+ h('div', {
69
+ class: 'vxe-table-custom-popup--drag-tip-wrapper'
70
+ }, [
71
+ h('div', {
72
+ class: 'vxe-table-custom-popup--drag-tip-status'
73
+ }, [
74
+ h('span', {
75
+ class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
76
+ }),
77
+ h('span', {
78
+ class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
79
+ }),
80
+ h('span', {
81
+ class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
82
+ })
83
+ ]),
84
+ h('div', {
85
+ class: 'vxe-table--drag-tip-content'
86
+ }, getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']))
87
+ ])
88
+ ])
89
+ ])
90
+ }
91
+
28
92
  const renderSimplePanel = (h: CreateElement, _vm: any) => {
29
93
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
30
94
 
@@ -36,9 +100,12 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
36
100
  const { customStore } = props
37
101
  const { isCustomStatus, customColumnList } = reactData
38
102
  const customOpts = $xeTable.computeCustomOpts
103
+ const { immediate } = customOpts
104
+ const columnDragOpts = $xeTable.computeColumnDragOpts
39
105
  const { maxHeight } = customStore
40
106
  const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
41
107
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
108
+ const { isCrossDrag } = columnDragOpts
42
109
  const slots = customOpts.slots || {}
43
110
  const headerSlot = slots.header
44
111
  const topSlot = slots.top
@@ -49,7 +116,6 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
49
116
  const customWrapperOns: any = {}
50
117
  const isAllChecked = customStore.isAll
51
118
  const isAllIndeterminate = customStore.isIndeterminate
52
- const dragColumn = _vm.dragColumn
53
119
  // hover 触发
54
120
  if (trigger === 'hover') {
55
121
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent
@@ -111,45 +177,49 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
111
177
  })
112
178
  ])
113
179
  : renderEmptyElement($xeTable),
114
- allowSort && column.level === 1
115
- ? h('div', {
116
- class: 'vxe-table-custom--sort-option'
117
- }, [
118
- h('span', {
119
- class: ['vxe-table-custom--sort-btn', {
120
- 'is--disabled': isDisabled || isHidden
121
- }],
122
- attrs: {
123
- title: getI18n('vxe.custom.setting.sortHelpTip')
124
- },
125
- on: isDisabled || isHidden
126
- ? {}
127
- : {
128
- mousedown: _vm.sortMousedownEvent,
129
- mouseup: _vm.sortMouseupEvent
130
- }
180
+ h('div', {
181
+ class: 'vxe-table-custom--name-option'
182
+ }, [
183
+ allowSort && ((isCrossDrag ? immediate : false) || column.level === 1)
184
+ ? h('div', {
185
+ class: 'vxe-table-custom--sort-option'
131
186
  }, [
132
- h('i', {
133
- class: getIcon().TABLE_CUSTOM_SORT
134
- })
187
+ h('span', {
188
+ class: ['vxe-table-custom--sort-btn', {
189
+ 'is--disabled': isDisabled || isHidden || column.renderFixed
190
+ }],
191
+ attrs: {
192
+ title: getI18n('vxe.custom.setting.sortHelpTip')
193
+ },
194
+ on: isDisabled || isHidden || column.renderFixed
195
+ ? {}
196
+ : {
197
+ mousedown: _vm.sortMousedownEvent,
198
+ mouseup: _vm.sortMouseupEvent
199
+ }
200
+ }, [
201
+ h('i', {
202
+ class: getIcon().TABLE_CUSTOM_SORT
203
+ })
204
+ ])
135
205
  ])
136
- ])
137
- : renderEmptyElement($xeTable),
138
- column.type === 'html'
139
- ? h('div', {
140
- key: '1',
141
- class: 'vxe-table-custom--checkbox-label',
142
- domProps: {
143
- innerHTML: colTitle
144
- }
145
- })
146
- : h('div', {
147
- key: '0',
148
- class: 'vxe-table-custom--checkbox-label',
149
- attrs: {
150
- title: colTitle
151
- }
152
- }, colTitle),
206
+ : renderEmptyElement($xeTable),
207
+ column.type === 'html'
208
+ ? h('div', {
209
+ key: '1',
210
+ class: 'vxe-table-custom--checkbox-label',
211
+ domProps: {
212
+ innerHTML: colTitle
213
+ }
214
+ })
215
+ : h('div', {
216
+ key: '0',
217
+ class: 'vxe-table-custom--checkbox-label',
218
+ attrs: {
219
+ title: colTitle
220
+ }
221
+ }, colTitle)
222
+ ]),
153
223
  !parent && allowFixed
154
224
  ? h('div', {
155
225
  class: 'vxe-table-custom--fixed-option'
@@ -263,10 +333,7 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
263
333
  class: 'vxe-table-custom--panel-bottom'
264
334
  }, $xeTable.callSlot(bottomSlot, params, h))
265
335
  : renderEmptyElement($xeTable),
266
- h('div', {
267
- ref: 'dragHintElemRef',
268
- class: 'vxe-table-custom-popup--drag-hint'
269
- }, getI18n('vxe.custom.cstmDragTarget', [dragColumn && dragColumn.type !== 'html' ? dragColumn.getTitle() : '']))
336
+ renderDragTip(h, _vm)
270
337
  ]),
271
338
  customOpts.showFooter
272
339
  ? h('div', {
@@ -287,7 +354,7 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
287
354
  click: _vm.resetCustomEvent
288
355
  }
289
356
  }),
290
- customOpts.immediate
357
+ immediate
291
358
  ? h(VxeUIButtonComponent, {
292
359
  props: {
293
360
  mode: 'text',
@@ -306,7 +373,7 @@ const renderSimplePanel = (h: CreateElement, _vm: any) => {
306
373
  click: _vm.cancelCustomEvent
307
374
  }
308
375
  }),
309
- customOpts.immediate
376
+ immediate
310
377
  ? renderEmptyElement($xeTable)
311
378
  : h(VxeUIButtonComponent, {
312
379
  props: {
@@ -330,7 +397,6 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
330
397
  const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
331
398
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
332
399
  const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeInput')
333
- const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
334
400
  const $xeTableCustomPanel = _vm
335
401
 
336
402
  const props = _vm
@@ -343,6 +409,8 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
343
409
  const { resizable: allResizable } = tableProps
344
410
  const { isCustomStatus, customColumnList } = reactData
345
411
  const customOpts = $xeTable.computeCustomOpts
412
+ const { immediate } = customOpts
413
+ const columnDragOpts = $xeTable.computeColumnDragOpts
346
414
  const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts
347
415
  const columnOpts = $xeTable.computeColumnOpts
348
416
  const { maxFixedSize } = columnOpts
@@ -351,6 +419,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
351
419
  const modalOpts = Object.assign({}, modalOptions)
352
420
  const drawerOpts = Object.assign({}, drawerOptions)
353
421
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
422
+ const { isCrossDrag } = columnDragOpts
354
423
  const slots = customOpts.slots || {}
355
424
  const headerSlot = slots.header
356
425
  const topSlot = slots.top
@@ -360,7 +429,6 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
360
429
  const trVNs: VNode[] = []
361
430
  const isAllChecked = customStore.isAll
362
431
  const isAllIndeterminate = customStore.isIndeterminate
363
- const dragColumn = _vm.dragColumn
364
432
  const params = {
365
433
  $table: $xeTable,
366
434
  $grid: $xeTable.xegrid,
@@ -439,50 +507,52 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
439
507
  ])
440
508
  ])
441
509
  : renderEmptyElement($xeTable),
442
- allowSort
443
- ? h('td', {
444
- class: 'vxe-table-custom-popup--column-item col--sort'
445
- }, [
446
- column.level === 1
447
- ? h('span', {
448
- class: ['vxe-table-custom-popup--column-sort-btn', {
449
- 'is--disabled': isDisabled || isHidden
450
- }],
451
- attrs: {
452
- title: getI18n('vxe.custom.setting.sortHelpTip')
453
- },
454
- on: isDisabled || isHidden
455
- ? {}
456
- : {
457
- mousedown: _vm.sortMousedownEvent,
458
- mouseup: _vm.sortMouseupEvent
459
- }
460
- }, [
461
- h('i', {
462
- class: getIcon().TABLE_CUSTOM_SORT
463
- })
464
- ])
465
- : h('span', '-')
466
- ])
467
- : renderEmptyElement($xeTable),
468
510
  h('td', {
469
511
  class: 'vxe-table-custom-popup--column-item col--name'
470
512
  }, [
471
- column.type === 'html'
472
- ? h('div', {
473
- key: '1',
474
- class: 'vxe-table-custom-popup--name',
475
- domProps: {
476
- innerHTML: colTitle
477
- }
478
- })
479
- : h('div', {
480
- key: '0',
481
- class: 'vxe-table-custom-popup--name',
482
- attrs: {
483
- title: colTitle
484
- }
485
- }, colTitle)
513
+ h('div', {
514
+ class: 'vxe-table-custom-popup--name'
515
+ }, [
516
+ allowSort
517
+ ? ((isCrossDrag ? immediate : false) || column.level === 1
518
+ ? h('div', {
519
+ class: ['vxe-table-custom-popup--column-sort-btn', {
520
+ 'is--disabled': isDisabled || isHidden || column.renderFixed
521
+ }],
522
+ attrs: {
523
+ title: getI18n('vxe.custom.setting.sortHelpTip')
524
+ },
525
+ on: (isDisabled || isHidden || column.renderFixed
526
+ ? {}
527
+ : {
528
+ mousedown: _vm.sortMousedownEvent,
529
+ mouseup: _vm.sortMouseupEvent
530
+ })
531
+ }, [
532
+ h('i', {
533
+ class: getIcon().TABLE_CUSTOM_SORT
534
+ })
535
+ ])
536
+ : h('div', {
537
+ class: 'vxe-table-custom-popup--column-sort-placeholder'
538
+ }))
539
+ : renderEmptyElement($xeTable),
540
+ column.type === 'html'
541
+ ? h('div', {
542
+ key: '1',
543
+ class: 'vxe-table-custom-popup--title',
544
+ domProps: {
545
+ innerHTML: colTitle
546
+ }
547
+ })
548
+ : h('div', {
549
+ key: '0',
550
+ class: 'vxe-table-custom-popup--title',
551
+ attrs: {
552
+ title: colTitle
553
+ }
554
+ }, colTitle)
555
+ ])
486
556
  ]),
487
557
  allowResizable
488
558
  ? h('td', {
@@ -497,6 +567,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
497
567
  ? h(VxeUINumberInputComponent, {
498
568
  props: {
499
569
  type: 'integer',
570
+ immediate: false,
500
571
  disabled: isDisabled || isHidden,
501
572
  value: column.renderResizeWidth,
502
573
  min: customMinWidth || undefined,
@@ -505,6 +576,9 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
505
576
  on: {
506
577
  modelValue (value: any) {
507
578
  column.renderResizeWidth = Math.max(0, Number(value))
579
+ },
580
+ change () {
581
+ _vm.changeColumnWidth(column)
508
582
  }
509
583
  }
510
584
  })
@@ -532,7 +606,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
532
606
  },
533
607
  on: {
534
608
  input (value: any) {
535
- column.renderFixed = value
609
+ _vm.changeFixedOption(column, value)
536
610
  }
537
611
  }
538
612
  })
@@ -566,11 +640,6 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
566
640
  class: 'vxe-table-custom-popup--table-col-seq'
567
641
  })
568
642
  : renderEmptyElement($xeTable),
569
- allowSort
570
- ? h('col', {
571
- class: 'vxe-table-custom-popup--table-col-sort'
572
- })
573
- : renderEmptyElement($xeTable),
574
643
  h('col', {
575
644
  class: 'vxe-table-custom-popup--table-col-title'
576
645
  }),
@@ -611,29 +680,6 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
611
680
  ])
612
681
  ])
613
682
  : renderEmptyElement($xeTable),
614
- allowSort
615
- ? h('th', {}, [
616
- h('span', {
617
- class: 'vxe-table-custom-popup--table-sort-help-title'
618
- }, getI18n('vxe.custom.setting.colSort')),
619
- VxeUITooltipComponent
620
- ? h(VxeUITooltipComponent, {
621
- props: {
622
- enterable: true,
623
- content: getI18n('vxe.custom.setting.sortHelpTip'),
624
- popupClassName: 'vxe-table--ignore-clear'
625
- },
626
- scopedSlots: {
627
- default: () => {
628
- return h('i', {
629
- class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
630
- })
631
- }
632
- }
633
- })
634
- : renderEmptyElement($xeTableCustomPanel)
635
- ])
636
- : renderEmptyElement($xeTable),
637
683
  h('th', {}, getI18n('vxe.custom.setting.colTitle')),
638
684
  allowResizable
639
685
  ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
@@ -657,10 +703,7 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
657
703
  class: 'vxe-table-custom-popup--table-bottom'
658
704
  }, $xeTable.callSlot(bottomSlot, params, h))
659
705
  : renderEmptyElement($xeTable),
660
- h('div', {
661
- ref: 'dragHintElemRef',
662
- class: 'vxe-table-custom-popup--drag-hint'
663
- }, getI18n('vxe.custom.cstmDragTarget', [dragColumn ? dragColumn.getTitle() : '']))
706
+ renderDragTip(h, _vm)
664
707
  ])
665
708
  },
666
709
  footer: () => {
@@ -679,23 +722,34 @@ const renderPopupPanel = (h: CreateElement, _vm: any) => {
679
722
  click: _vm.resetCustomEvent
680
723
  }
681
724
  }),
682
- h(VxeUIButtonComponent, {
683
- props: {
684
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
685
- },
686
- on: {
687
- click: _vm.cancelCustomEvent
688
- }
689
- }),
690
- h(VxeUIButtonComponent, {
691
- props: {
692
- status: 'primary',
693
- content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
694
- },
695
- on: {
696
- click: _vm.confirmCustomEvent
697
- }
698
- })
725
+ immediate
726
+ ? h(VxeUIButtonComponent, {
727
+ props: {
728
+ content: customOpts.resetButtonText || getI18n('vxe.custom.customClose')
729
+ },
730
+ on: {
731
+ click: _vm.cancelCloseEvent
732
+ }
733
+ })
734
+ : h(VxeUIButtonComponent, {
735
+ props: {
736
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
737
+ },
738
+ on: {
739
+ click: _vm.cancelCustomEvent
740
+ }
741
+ }),
742
+ immediate
743
+ ? renderEmptyElement($xeTable)
744
+ : h(VxeUIButtonComponent, {
745
+ props: {
746
+ status: 'primary',
747
+ content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
748
+ },
749
+ on: {
750
+ click: _vm.confirmCustomEvent
751
+ }
752
+ })
699
753
  ])
700
754
  }
701
755
  }
@@ -777,7 +831,9 @@ export default {
777
831
  },
778
832
  data () {
779
833
  return {
780
- dragColumn: null
834
+ prevDragCol: undefined,
835
+ prevDragToChild: false,
836
+ prevDragPos: null
781
837
  }
782
838
  },
783
839
  computed: {
@@ -788,7 +844,6 @@ export default {
788
844
  const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
789
845
  const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
790
846
  const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeNumberInput')
791
- const VxeUITooltipComponent = VxeUI.getComponent<VxeTooltipComponent>('VxeTooltip')
792
847
  const VxeUIRadioGroupComponent = VxeUI.getComponent<VxeRadioGroupComponent>('VxeRadioGroup')
793
848
 
794
849
  this.$nextTick(() => {
@@ -807,9 +862,6 @@ export default {
807
862
  if (!VxeUINumberInputComponent) {
808
863
  errLog('vxe.error.reqComp', ['vxe-input'])
809
864
  }
810
- if (!VxeUITooltipComponent) {
811
- errLog('vxe.error.reqComp', ['vxe-tooltip'])
812
- }
813
865
  if (!VxeUIRadioGroupComponent) {
814
866
  errLog('vxe.error.reqComp', ['vxe-radio-group'])
815
867
  }
@@ -844,7 +896,9 @@ export default {
844
896
  },
845
897
  confirmCustomEvent ({ $event }: any) {
846
898
  const $xeTable = this.$xeTable
899
+ const reactData = $xeTable
847
900
 
901
+ reactData.isCustomStatus = true
848
902
  $xeTable.saveCustom()
849
903
  $xeTable.closeCustom()
850
904
  $xeTable.emitCustomEvent('confirm', $event)
@@ -912,8 +966,10 @@ export default {
912
966
  }
913
967
  },
914
968
  changeCheckboxOption (column: any) {
915
- const { $xetable } = this
916
- const { customOpts } = $xetable
969
+ const $xeTable = this.$xetable
970
+ const reactData = $xeTable
971
+
972
+ const { customOpts } = $xeTable.customOpts
917
973
  const isChecked = !column.renderVisible
918
974
  if (customOpts.immediate) {
919
975
  XEUtils.eachTree([column], (item) => {
@@ -921,8 +977,9 @@ export default {
921
977
  item.renderVisible = isChecked
922
978
  item.halfVisible = false
923
979
  })
924
- $xetable.handleCustom()
925
- $xetable.saveCustomStore('update:visible')
980
+ reactData.isCustomStatus = true
981
+ $xeTable.handleCustom()
982
+ $xeTable.saveCustomStore('update:visible')
926
983
  } else {
927
984
  XEUtils.eachTree([column], (item) => {
928
985
  item.renderVisible = isChecked
@@ -930,11 +987,29 @@ export default {
930
987
  })
931
988
  }
932
989
  this.handleOptionCheck(column)
933
- $xetable.checkCustomStatus()
990
+ $xeTable.checkCustomStatus()
991
+ },
992
+ changeColumnWidth (column: VxeTableDefines.ColumnInfo) {
993
+ const $xeTable = this.$xetable
994
+ const reactData = $xeTable
995
+
996
+ const customOpts = $xeTable.computeCustomOpts
997
+ if (customOpts.immediate) {
998
+ if (column.renderResizeWidth !== column.renderWidth) {
999
+ column.resizeWidth = column.renderResizeWidth
1000
+ column.renderWidth = column.renderResizeWidth
1001
+ reactData.isCustomStatus = true
1002
+ $xeTable.handleCustom()
1003
+ $xeTable.saveCustomStore('update:width')
1004
+ }
1005
+ }
934
1006
  },
935
1007
  changeFixedOption (column: any, colFixed: any) {
936
- const { $xetable } = this
937
- const { isMaxFixedColumn, customOpts } = $xetable
1008
+ const $xeTable = this.$xetable
1009
+ const reactData = $xeTable
1010
+
1011
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
1012
+ const customOpts = $xeTable.computeCustomOpts
938
1013
  if (customOpts.immediate) {
939
1014
  if (column.renderFixed === colFixed) {
940
1015
  XEUtils.eachTree([column], col => {
@@ -949,8 +1024,9 @@ export default {
949
1024
  })
950
1025
  }
951
1026
  }
952
- $xetable.handleCustom()
953
- $xetable.saveCustomStore('update:fixed')
1027
+ reactData.isCustomStatus = true
1028
+ $xeTable.handleCustom()
1029
+ $xeTable.saveCustomStore('update:fixed')
954
1030
  } else {
955
1031
  if (column.renderFixed === colFixed) {
956
1032
  XEUtils.eachTree([column], col => {
@@ -971,103 +1047,251 @@ export default {
971
1047
  $xetable.toggleCustomAllCheckbox()
972
1048
  },
973
1049
  sortMousedownEvent (evnt: MouseEvent) {
974
- const { $xetable } = this
1050
+ const $xeTable = this.$xetable
1051
+
975
1052
  const btnEl = evnt.currentTarget as HTMLElement
976
- const tdEl = btnEl.parentNode as HTMLElement
977
- const trEl = tdEl.parentNode as HTMLElement
1053
+ const cellEl = btnEl.parentElement as HTMLElement
1054
+ const tdEl = cellEl.parentElement as HTMLElement
1055
+ const trEl = tdEl.parentElement as HTMLElement
978
1056
  const colid = trEl.getAttribute('colid')
979
- const column = $xetable.getColumnById(colid)
1057
+ const column = $xeTable.getColumnById(colid)
980
1058
  trEl.draggable = true
981
- this.dragColumn = column
1059
+ this.dragCol = column
982
1060
  addClass(trEl, 'active--drag-origin')
983
- updateDropHint(this, evnt)
984
1061
  },
985
1062
  sortMouseupEvent (evnt: MouseEvent) {
986
1063
  const btnEl = evnt.currentTarget as HTMLElement
987
- const tdEl = btnEl.parentNode as HTMLElement
988
- const trEl = tdEl.parentNode as HTMLElement
989
- const dragHintEl = this.$refs.dragHintElemRef
1064
+ const cellEl = btnEl.parentElement as HTMLElement
1065
+ const tdEl = cellEl.parentElement as HTMLElement
1066
+ const trEl = tdEl.parentElement as HTMLElement
1067
+ hideDropTip(this)
990
1068
  trEl.draggable = false
991
- this.dragColumn = null
1069
+ this.dragCol = null
992
1070
  removeClass(trEl, 'active--drag-origin')
993
- if (dragHintEl) {
994
- dragHintEl.style.display = ''
995
- }
996
1071
  },
997
1072
  sortDragstartEvent (evnt: any) {
998
- const img = new Image()
999
1073
  if (evnt.dataTransfer) {
1074
+ const img = new Image()
1075
+ img.src = tpImg
1000
1076
  evnt.dataTransfer.setDragImage(img, 0, 0)
1001
1077
  }
1002
1078
  },
1003
1079
  sortDragendEvent (evnt: any) {
1004
- const { $xetable, prevDropTrEl } = this
1005
- const { customColumnList, customOpts } = $xetable
1006
- const trEl = evnt.currentTarget
1007
- const dragHintEl = this.$refs.dragHintElemRef
1008
- if (prevDropTrEl) {
1080
+ const $xeTable = this.$xetable
1081
+ const tableProps = $xeTable
1082
+ const reactData = $xeTable
1083
+ const internalData = $xeTable
1084
+
1085
+ const { dragCol, prevDragPos, prevDragCol, prevDragToChild } = this
1086
+
1087
+ const { mouseConfig } = tableProps
1088
+ const { customColumnList } = reactData
1089
+ const { collectColumn } = internalData
1090
+ const customOpts = $xeTable.computeCustomOpts
1091
+ const { immediate } = customOpts
1092
+ const trEl = evnt.currentTarget as HTMLElement
1093
+ const columnDragOpts = $xeTable.computeColumnDragOpts
1094
+ const { isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod } = columnDragOpts
1095
+ const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0
1096
+ if (prevDragCol && dragCol) {
1009
1097
  // 判断是否有拖动
1010
- if (prevDropTrEl !== trEl) {
1011
- const dragOffset = prevDropTrEl.getAttribute('drag-pos')
1012
- const colid = trEl.getAttribute('colid')
1013
- const column = $xetable.getColumnById(colid)
1014
- if (!column) {
1015
- return
1016
- }
1017
- const cIndex = XEUtils.findIndexOf(customColumnList, item => item.id === column.id)
1018
- const targetColid = prevDropTrEl.getAttribute('colid')
1019
- const targetColumn = $xetable.getColumnById(targetColid)
1020
- if (!targetColumn) {
1021
- return
1022
- }
1023
- // 移出源位置
1024
- customColumnList.splice(cIndex, 1)
1025
- const tcIndex = XEUtils.findIndexOf(customColumnList, item => item.id === targetColumn.id)
1026
- // 插新位置
1027
- customColumnList.splice(tcIndex + (dragOffset === 'bottom' ? 1 : 0), 0, column)
1098
+ if (prevDragCol !== dragCol) {
1099
+ const oldColumn: VxeTableDefines.ColumnInfo = dragCol
1100
+ const newColumn: VxeTableDefines.ColumnInfo = prevDragCol
1101
+ Promise.resolve(
1102
+ dragEndMethod
1103
+ ? dragEndMethod({
1104
+ oldColumn,
1105
+ newColumn,
1106
+ dragPos: prevDragPos as any,
1107
+ offsetIndex: dragOffsetIndex
1108
+ })
1109
+ : true
1110
+ ).then((status) => {
1111
+ if (!status) {
1112
+ return
1113
+ }
1114
+
1115
+ let oafIndex = -1
1116
+ let nafIndex = -1
1117
+
1118
+ const oldAllMaps: Record<string, any> = {}
1119
+ XEUtils.eachTree([oldColumn], column => {
1120
+ oldAllMaps[column.id] = column
1121
+ })
1122
+
1123
+ let isSelfToChildStatus = false
1124
+
1125
+ // 只有实时拖拽支持跨层级
1126
+ if (immediate) {
1127
+ if (oldColumn.parentId && newColumn.parentId) {
1128
+ // 子到子
1129
+
1130
+ if (!isCrossDrag) {
1131
+ return
1132
+ }
1133
+ if (oldAllMaps[newColumn.id]) {
1134
+ isSelfToChildStatus = true
1135
+ if (!isSelfToChildDrag) {
1136
+ if (VxeUI.modal) {
1137
+ VxeUI.modal.message({
1138
+ status: 'error',
1139
+ content: getI18n('vxe.error.treeDragChild')
1140
+ })
1141
+ }
1142
+ return
1143
+ }
1144
+ }
1145
+ } else if (oldColumn.parentId) {
1146
+ // 子到根
1147
+
1148
+ if (!isCrossDrag) {
1149
+ return
1150
+ }
1151
+ } else if (newColumn.parentId) {
1152
+ // 根到子
1153
+
1154
+ if (!isCrossDrag) {
1155
+ return
1156
+ }
1157
+ if (oldAllMaps[newColumn.id]) {
1158
+ isSelfToChildStatus = true
1159
+ if (!isSelfToChildDrag) {
1160
+ if (VxeUI.modal) {
1161
+ VxeUI.modal.message({
1162
+ status: 'error',
1163
+ content: getI18n('vxe.error.treeDragChild')
1164
+ })
1165
+ }
1166
+ return
1167
+ }
1168
+ }
1169
+ } else {
1170
+ // 根到根
1171
+ }
1172
+
1173
+ const oldewMatchRest = XEUtils.findTree(collectColumn as VxeTableDefines.ColumnInfo[], item => item.id === oldColumn.id)
1174
+
1175
+ // 改变层级
1176
+ if (isSelfToChildStatus && isSelfToChildDrag) {
1177
+ if (oldewMatchRest) {
1178
+ const { items: oCols, index: oIndex } = oldewMatchRest
1179
+ const childList = oldColumn.children || []
1180
+ childList.forEach(column => {
1181
+ column.parentId = oldColumn.parentId
1182
+ })
1183
+ oCols.splice(oIndex, 1, ...childList)
1184
+ oldColumn.children = []
1185
+ }
1186
+ } else {
1187
+ if (oldewMatchRest) {
1188
+ const { items: oCols, index: oIndex, parent: oParent } = oldewMatchRest
1189
+ oCols.splice(oIndex, 1)
1190
+ if (!oParent) {
1191
+ oafIndex = oIndex
1192
+ }
1193
+ }
1194
+ }
1195
+
1196
+ const newMatchRest = XEUtils.findTree(collectColumn as VxeTableDefines.ColumnInfo[], item => item.id === newColumn.id)
1197
+ if (newMatchRest) {
1198
+ const { items: nCols, index: nIndex, parent: nParent } = newMatchRest
1199
+ // 转子级
1200
+ if (isToChildDrag && prevDragToChild) {
1201
+ oldColumn.parentId = newColumn.id
1202
+ newColumn.children = (newColumn.children || []).concat([oldColumn])
1203
+ } else {
1204
+ oldColumn.parentId = newColumn.parentId
1205
+ nCols.splice(nIndex + dragOffsetIndex, 0, oldColumn)
1206
+ }
1207
+ if (!nParent) {
1208
+ nafIndex = nIndex
1209
+ }
1210
+ }
1211
+
1212
+ XEUtils.eachTree(collectColumn, (column, index, items, path, parent) => {
1213
+ if (!parent) {
1214
+ const sortIndex = index + 1
1215
+ column.renderSortNumber = sortIndex
1216
+ }
1217
+ })
1218
+ } else {
1219
+ oafIndex = XEUtils.findIndexOf(customColumnList, item => item.id === oldColumn.id)
1220
+ customColumnList.splice(oafIndex, 1)
1221
+
1222
+ nafIndex = XEUtils.findIndexOf(customColumnList, item => item.id === newColumn.id)
1223
+ customColumnList.splice(nafIndex + dragOffsetIndex, 0, oldColumn)
1224
+ }
1225
+
1226
+ reactData.isDragColMove = true
1227
+ if (mouseConfig) {
1228
+ if ($xeTable.clearSelected) {
1229
+ $xeTable.clearSelected()
1230
+ }
1231
+ if ($xeTable.clearCellAreas) {
1232
+ $xeTable.clearCellAreas()
1233
+ $xeTable.clearCopyCellArea()
1234
+ }
1235
+ }
1236
+
1237
+ $xeTable.dispatchEvent('column-dragend', {
1238
+ oldColumn,
1239
+ newColumn,
1240
+ dragPos: prevDragPos,
1241
+ offsetIndex: dragOffsetIndex,
1242
+ _index: {
1243
+ newIndex: nafIndex,
1244
+ oldIndex: oafIndex
1245
+ }
1246
+ }, evnt)
1247
+
1248
+ if (immediate) {
1249
+ reactData.customColumnList = collectColumn.slice(0)
1250
+ $xeTable.refreshColumn(true).then(() => {
1251
+ $xeTable.updateCellAreas()
1252
+ $xeTable.handleCustom()
1253
+ $xeTable.saveCustomStore('update:sort')
1254
+ })
1255
+ }
1256
+ }).catch(() => {
1257
+ })
1028
1258
  }
1029
- prevDropTrEl.draggable = false
1030
- prevDropTrEl.removeAttribute('drag-pos')
1031
- removeClass(prevDropTrEl, 'active--drag-target')
1032
1259
  }
1033
- this.dragColumn = null
1260
+
1261
+ hideDropTip(this)
1262
+ this.dragCol.value = null
1034
1263
  trEl.draggable = false
1035
1264
  trEl.removeAttribute('drag-pos')
1036
- if (dragHintEl) {
1037
- dragHintEl.style.display = ''
1038
- }
1039
1265
  removeClass(trEl, 'active--drag-target')
1040
1266
  removeClass(trEl, 'active--drag-origin')
1041
-
1042
- if (customOpts.immediate) {
1043
- XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
1044
- if (!parent) {
1045
- const sortIndex = index + 1
1046
- column.renderSortNumber = sortIndex
1047
- }
1048
- })
1049
- $xetable.handleCustom()
1050
- $xetable.saveCustomStore('update:sort')
1051
- }
1052
1267
  },
1053
1268
  sortDragoverEvent (evnt: any) {
1054
- const { $xetable, prevDropTrEl } = this
1055
- const trEl = evnt.currentTarget
1056
- if (prevDropTrEl !== trEl) {
1057
- removeClass(prevDropTrEl, 'active--drag-target')
1058
- }
1059
- const colid = trEl.getAttribute('colid')
1060
- const column = $xetable.getColumnById(colid)
1061
- // 是否移入有效元行
1062
- if (column && column.level === 1) {
1269
+ const $xeTable = this.$xetable
1270
+
1271
+ const { dragCol } = this
1272
+
1273
+ const customOpts = $xeTable.computeCustomOpts
1274
+ const { immediate } = customOpts
1275
+ const columnDragOpts = $xeTable.computeColumnDragOpts
1276
+ const { isCrossDrag, isToChildDrag } = columnDragOpts
1277
+ const optEl = evnt.currentTarget as HTMLElement
1278
+ const hasCtrlKey = evnt.ctrlKey
1279
+ const colid = optEl.getAttribute('colid')
1280
+ const column = $xeTable.getColumnById(colid)
1281
+ // 是否移入有效列
1282
+ if (column && (isCrossDrag || column.level === 1)) {
1063
1283
  evnt.preventDefault()
1064
- const offsetY = evnt.clientY - trEl.getBoundingClientRect().y
1065
- const dragOffset = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom'
1066
- addClass(trEl, 'active--drag-target')
1067
- trEl.setAttribute('drag-pos', dragOffset)
1068
- this.prevDropTrEl = trEl
1284
+ const offsetY = evnt.clientY - optEl.getBoundingClientRect().y
1285
+ const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom'
1286
+ if ((dragCol && dragCol.id === column.id) || (!isCrossDrag && column.level === 1) || (!immediate && column.level > 1) || column.renderFixed) {
1287
+ showDropTip(this, evnt, optEl, false, dragPos)
1288
+ return
1289
+ }
1290
+ this.prevDragToChild = !!(isToChildDrag && hasCtrlKey && immediate)
1291
+ this.prevDragCol = column
1292
+ this.prevDragPos = dragPos
1293
+ showDropTip(this, evnt, optEl, true, dragPos)
1069
1294
  }
1070
- updateDropHint(this, evnt)
1071
1295
  }
1072
1296
  } as any
1073
1297
  }