vxe-table 3.11.21 → 3.11.22

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 (150) hide show
  1. package/es/{iconfont.1733469864818.ttf → iconfont.1733702408214.ttf} +0 -0
  2. package/es/iconfont.1733702408214.woff +0 -0
  3. package/es/iconfont.1733702408214.woff2 +0 -0
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/ar-EG.js +2 -0
  7. package/es/locale/lang/de-DE.js +2 -0
  8. package/es/locale/lang/en-US.js +3 -1
  9. package/es/locale/lang/es-ES.js +2 -0
  10. package/es/locale/lang/fr-FR.js +2 -0
  11. package/es/locale/lang/hu-HU.js +2 -0
  12. package/es/locale/lang/hy-AM.js +2 -0
  13. package/es/locale/lang/ja-JP.js +2 -0
  14. package/es/locale/lang/ko-KR.js +2 -0
  15. package/es/locale/lang/nb-NO.js +2 -0
  16. package/es/locale/lang/pt-BR.js +2 -0
  17. package/es/locale/lang/ru-RU.js +2 -0
  18. package/es/locale/lang/ug-CN.js +2 -0
  19. package/es/locale/lang/uk-UA.js +2 -0
  20. package/es/locale/lang/vi-VN.js +2 -0
  21. package/es/locale/lang/zh-CHT.js +2 -0
  22. package/es/locale/lang/zh-CN.js +2 -0
  23. package/es/style.css +1 -1
  24. package/es/style.min.css +1 -1
  25. package/es/table/module/custom/mixin.js +8 -3
  26. package/es/table/module/custom/panel.js +44 -27
  27. package/es/table/src/body.js +2 -2
  28. package/es/table/src/cell.js +7 -2
  29. package/es/table/src/header.js +1 -1
  30. package/es/table/src/methods.js +175 -43
  31. package/es/table/src/table.js +31 -4
  32. package/es/table/style.css +62 -4
  33. package/es/table/style.min.css +1 -1
  34. package/es/ui/index.js +4 -1
  35. package/es/ui/src/log.js +1 -1
  36. package/es/vxe-table/style.css +62 -4
  37. package/es/vxe-table/style.min.css +1 -1
  38. package/lib/{iconfont.1733469864818.ttf → iconfont.1733702408214.ttf} +0 -0
  39. package/lib/iconfont.1733702408214.woff +0 -0
  40. package/lib/iconfont.1733702408214.woff2 +0 -0
  41. package/lib/index.css +1 -1
  42. package/lib/index.min.css +1 -1
  43. package/lib/index.umd.js +297 -92
  44. package/lib/index.umd.min.js +1 -1
  45. package/lib/locale/lang/ar-EG.js +2 -0
  46. package/lib/locale/lang/ar-EG.min.js +1 -1
  47. package/lib/locale/lang/de-DE.js +2 -0
  48. package/lib/locale/lang/de-DE.min.js +1 -1
  49. package/lib/locale/lang/en-US.js +3 -1
  50. package/lib/locale/lang/en-US.min.js +1 -1
  51. package/lib/locale/lang/en-US.umd.js +3 -1
  52. package/lib/locale/lang/es-ES.js +2 -0
  53. package/lib/locale/lang/es-ES.min.js +1 -1
  54. package/lib/locale/lang/es-ES.umd.js +2 -0
  55. package/lib/locale/lang/fr-FR.js +2 -0
  56. package/lib/locale/lang/fr-FR.min.js +1 -1
  57. package/lib/locale/lang/hu-HU.js +2 -0
  58. package/lib/locale/lang/hu-HU.min.js +1 -1
  59. package/lib/locale/lang/hu-HU.umd.js +2 -0
  60. package/lib/locale/lang/hy-AM.js +2 -0
  61. package/lib/locale/lang/hy-AM.min.js +1 -1
  62. package/lib/locale/lang/ja-JP.js +2 -0
  63. package/lib/locale/lang/ja-JP.min.js +1 -1
  64. package/lib/locale/lang/ja-JP.umd.js +2 -0
  65. package/lib/locale/lang/ko-KR.js +2 -0
  66. package/lib/locale/lang/ko-KR.min.js +1 -1
  67. package/lib/locale/lang/ko-KR.umd.js +2 -0
  68. package/lib/locale/lang/nb-NO.js +2 -0
  69. package/lib/locale/lang/nb-NO.min.js +1 -1
  70. package/lib/locale/lang/pt-BR.js +2 -0
  71. package/lib/locale/lang/pt-BR.min.js +1 -1
  72. package/lib/locale/lang/pt-BR.umd.js +2 -0
  73. package/lib/locale/lang/ru-RU.js +2 -0
  74. package/lib/locale/lang/ru-RU.min.js +1 -1
  75. package/lib/locale/lang/ru-RU.umd.js +2 -0
  76. package/lib/locale/lang/ug-CN.js +2 -0
  77. package/lib/locale/lang/ug-CN.min.js +1 -1
  78. package/lib/locale/lang/uk-UA.js +2 -0
  79. package/lib/locale/lang/uk-UA.min.js +1 -1
  80. package/lib/locale/lang/uk-UA.umd.js +2 -0
  81. package/lib/locale/lang/vi-VN.js +2 -0
  82. package/lib/locale/lang/vi-VN.min.js +1 -1
  83. package/lib/locale/lang/zh-CHT.js +2 -0
  84. package/lib/locale/lang/zh-CHT.min.js +1 -1
  85. package/lib/locale/lang/zh-CHT.umd.js +2 -0
  86. package/lib/locale/lang/zh-CN.js +2 -0
  87. package/lib/locale/lang/zh-CN.min.js +1 -1
  88. package/lib/locale/lang/zh-CN.umd.js +2 -0
  89. package/lib/style.css +1 -1
  90. package/lib/style.min.css +1 -1
  91. package/lib/table/module/custom/mixin.js +8 -3
  92. package/lib/table/module/custom/mixin.min.js +1 -1
  93. package/lib/table/module/custom/panel.js +49 -37
  94. package/lib/table/module/custom/panel.min.js +1 -1
  95. package/lib/table/src/body.js +2 -2
  96. package/lib/table/src/body.min.js +1 -1
  97. package/lib/table/src/cell.js +6 -1
  98. package/lib/table/src/cell.min.js +1 -1
  99. package/lib/table/src/header.js +1 -1
  100. package/lib/table/src/header.min.js +1 -1
  101. package/lib/table/src/methods.js +199 -43
  102. package/lib/table/src/methods.min.js +1 -1
  103. package/lib/table/src/table.js +25 -3
  104. package/lib/table/src/table.min.js +1 -1
  105. package/lib/table/style/style.css +62 -4
  106. package/lib/table/style/style.min.css +1 -1
  107. package/lib/ui/index.js +4 -1
  108. package/lib/ui/index.min.js +1 -1
  109. package/lib/ui/src/log.js +1 -1
  110. package/lib/ui/src/log.min.js +1 -1
  111. package/lib/vxe-table/style/style.css +62 -4
  112. package/lib/vxe-table/style/style.min.css +1 -1
  113. package/package.json +2 -2
  114. package/packages/locale/lang/ar-EG.ts +2 -0
  115. package/packages/locale/lang/de-DE.ts +2 -0
  116. package/packages/locale/lang/en-US.ts +3 -1
  117. package/packages/locale/lang/es-ES.ts +2 -0
  118. package/packages/locale/lang/fr-FR.ts +2 -0
  119. package/packages/locale/lang/hu-HU.ts +2 -0
  120. package/packages/locale/lang/hy-AM.ts +2 -0
  121. package/packages/locale/lang/ja-JP.ts +2 -0
  122. package/packages/locale/lang/ko-KR.ts +2 -0
  123. package/packages/locale/lang/nb-NO.ts +2 -0
  124. package/packages/locale/lang/pt-BR.ts +2 -0
  125. package/packages/locale/lang/ru-RU.ts +2 -0
  126. package/packages/locale/lang/ug-CN.ts +2 -0
  127. package/packages/locale/lang/uk-UA.ts +2 -0
  128. package/packages/locale/lang/vi-VN.ts +2 -0
  129. package/packages/locale/lang/zh-CHT.ts +2 -0
  130. package/packages/locale/lang/zh-CN.ts +2 -0
  131. package/packages/table/module/custom/mixin.ts +9 -3
  132. package/packages/table/module/custom/panel.ts +48 -27
  133. package/packages/table/src/body.ts +2 -2
  134. package/packages/table/src/cell.ts +8 -2
  135. package/packages/table/src/header.ts +1 -1
  136. package/packages/table/src/methods.ts +187 -45
  137. package/packages/table/src/table.ts +34 -4
  138. package/packages/ui/index.ts +3 -0
  139. package/styles/components/icon.scss +13 -1
  140. package/styles/components/table.scss +53 -3
  141. package/styles/icon/iconfont.ttf +0 -0
  142. package/styles/icon/iconfont.woff +0 -0
  143. package/styles/icon/iconfont.woff2 +0 -0
  144. package/styles/theme/dark.scss +1 -0
  145. package/styles/theme/light.scss +1 -0
  146. package/styles/variable.scss +1 -0
  147. package/es/iconfont.1733469864818.woff +0 -0
  148. package/es/iconfont.1733469864818.woff2 +0 -0
  149. package/lib/iconfont.1733469864818.woff +0 -0
  150. package/lib/iconfont.1733469864818.woff2 +0 -0
@@ -21,11 +21,15 @@ function updateDropHint(_vm, evnt) {
21
21
  }
22
22
  const renderSimplePanel = (h, _vm) => {
23
23
  const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
24
+ const props = _vm;
24
25
  const $xeTable = _vm.$xeTable;
25
- const { _e, customStore, dragColumn } = _vm;
26
- const { customColumnList, customOpts, isMaxFixedColumn } = $xeTable;
26
+ const reactData = $xeTable;
27
+ const { customStore } = props;
28
+ const { isCustomStatus, customColumnList } = reactData;
29
+ const customOpts = $xeTable.computeCustomOpts;
27
30
  const { maxHeight } = customStore;
28
31
  const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts;
32
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
29
33
  const slots = customOpts.slots || {};
30
34
  const headerSlot = slots.header;
31
35
  const topSlot = slots.top;
@@ -34,19 +38,21 @@ const renderSimplePanel = (h, _vm) => {
34
38
  const footerSlot = slots.footer;
35
39
  const colVNs = [];
36
40
  const customWrapperOns = {};
41
+ const isAllChecked = customStore.isAll;
42
+ const isAllIndeterminate = customStore.isIndeterminate;
43
+ const dragColumn = _vm.dragColumn;
37
44
  // hover 触发
38
45
  if (trigger === 'hover') {
39
46
  customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
40
47
  customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
41
48
  }
42
- const isAllChecked = customStore.isAll;
43
- const isAllIndeterminate = customStore.isIndeterminate;
44
49
  const params = {
45
50
  $table: $xeTable,
46
51
  $grid: $xeTable.xegrid,
47
52
  columns: customColumnList,
48
53
  isAllChecked,
49
- isAllIndeterminate
54
+ isAllIndeterminate,
55
+ isCustomStatus
50
56
  };
51
57
  XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
52
58
  const isVisible = visibleMethod ? visibleMethod({ column }) : true;
@@ -94,7 +100,7 @@ const renderSimplePanel = (h, _vm) => {
94
100
  class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
95
101
  })
96
102
  ])
97
- : _e(),
103
+ : renderEmptyElement($xeTable),
98
104
  allowSort && column.level === 1
99
105
  ? h('div', {
100
106
  class: 'vxe-table-custom--sort-option'
@@ -118,7 +124,7 @@ const renderSimplePanel = (h, _vm) => {
118
124
  })
119
125
  ])
120
126
  ])
121
- : _e(),
127
+ : renderEmptyElement($xeTable),
122
128
  column.type === 'html'
123
129
  ? h('div', {
124
130
  key: '1',
@@ -167,7 +173,7 @@ const renderSimplePanel = (h, _vm) => {
167
173
  }
168
174
  })
169
175
  ])
170
- : _e()
176
+ : renderEmptyElement($xeTable)
171
177
  ]));
172
178
  }
173
179
  });
@@ -263,7 +269,8 @@ const renderSimplePanel = (h, _vm) => {
263
269
  h(VxeUIButtonComponent, {
264
270
  props: {
265
271
  mode: 'text',
266
- content: customOpts.resetButtonText || getI18n('vxe.table.customRestore')
272
+ content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
273
+ disabled: !isCustomStatus
267
274
  },
268
275
  on: {
269
276
  click: _vm.resetCustomEvent
@@ -289,7 +296,7 @@ const renderSimplePanel = (h, _vm) => {
289
296
  }
290
297
  }),
291
298
  customOpts.immediate
292
- ? _e()
299
+ ? renderEmptyElement($xeTable)
293
300
  : h(VxeUIButtonComponent, {
294
301
  props: {
295
302
  mode: 'text',
@@ -313,15 +320,22 @@ const renderPopupPanel = (h, _vm) => {
313
320
  const VxeUINumberInputComponent = VxeUI.getComponent('VxeInput');
314
321
  const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
315
322
  const $xeTableCustomPanel = _vm;
323
+ const props = _vm;
316
324
  const $xeTable = _vm.$xeTable;
317
- const { _e, customStore } = _vm;
318
- const { resizable: allResizable, customOpts, customColumnList, columnOpts, isMaxFixedColumn } = $xeTable;
325
+ const tableProps = $xeTable;
326
+ const reactData = $xeTable;
327
+ const { customStore } = props;
328
+ const { resizable: allResizable } = tableProps;
329
+ const { isCustomStatus, customColumnList } = reactData;
330
+ const customOpts = $xeTable.computeCustomOpts;
319
331
  const { mode, modalOptions, drawerOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts;
332
+ const columnOpts = $xeTable.computeColumnOpts;
320
333
  const { maxFixedSize } = columnOpts;
321
334
  const resizableOpts = $xeTable.computeResizableOpts;
322
335
  const { minWidth: reMinWidth, maxWidth: reMaxWidth } = resizableOpts;
323
336
  const modalOpts = Object.assign({}, modalOptions);
324
337
  const drawerOpts = Object.assign({}, drawerOptions);
338
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
325
339
  const slots = customOpts.slots || {};
326
340
  const headerSlot = slots.header;
327
341
  const topSlot = slots.top;
@@ -331,12 +345,14 @@ const renderPopupPanel = (h, _vm) => {
331
345
  const trVNs = [];
332
346
  const isAllChecked = customStore.isAll;
333
347
  const isAllIndeterminate = customStore.isIndeterminate;
348
+ const dragColumn = _vm.dragColumn;
334
349
  const params = {
335
350
  $table: $xeTable,
336
351
  $grid: $xeTable.xegrid,
337
352
  columns: customColumnList,
338
353
  isAllChecked,
339
- isAllIndeterminate
354
+ isAllIndeterminate,
355
+ isCustomStatus
340
356
  };
341
357
  XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
342
358
  const isVisible = visibleMethod ? visibleMethod({ column }) : true;
@@ -405,7 +421,7 @@ const renderPopupPanel = (h, _vm) => {
405
421
  })
406
422
  ])
407
423
  ])
408
- : _e(),
424
+ : renderEmptyElement($xeTable),
409
425
  allowSort
410
426
  ? h('td', {
411
427
  class: 'vxe-table-custom-popup--column-item col--sort'
@@ -431,7 +447,7 @@ const renderPopupPanel = (h, _vm) => {
431
447
  ])
432
448
  : h('span', '-')
433
449
  ])
434
- : _e(),
450
+ : renderEmptyElement($xeTable),
435
451
  h('td', {
436
452
  class: 'vxe-table-custom-popup--column-item col--name'
437
453
  }, [
@@ -475,7 +491,7 @@ const renderPopupPanel = (h, _vm) => {
475
491
  })
476
492
  : renderEmptyElement($xeTableCustomPanel))
477
493
  ])
478
- : _e(),
494
+ : renderEmptyElement($xeTable),
479
495
  allowFixed
480
496
  ? h('td', {
481
497
  class: 'vxe-table-custom-popup--column-item col--fixed'
@@ -501,7 +517,7 @@ const renderPopupPanel = (h, _vm) => {
501
517
  }
502
518
  })
503
519
  ])
504
- : _e()
520
+ : renderEmptyElement($xeTable)
505
521
  ]));
506
522
  }
507
523
  });
@@ -528,12 +544,12 @@ const renderPopupPanel = (h, _vm) => {
528
544
  ? h('col', {
529
545
  class: 'vxe-table-custom-popup--table-col-seq'
530
546
  })
531
- : _e(),
547
+ : renderEmptyElement($xeTable),
532
548
  allowSort
533
549
  ? h('col', {
534
550
  class: 'vxe-table-custom-popup--table-col-sort'
535
551
  })
536
- : _e(),
552
+ : renderEmptyElement($xeTable),
537
553
  h('col', {
538
554
  class: 'vxe-table-custom-popup--table-col-title'
539
555
  }),
@@ -541,12 +557,12 @@ const renderPopupPanel = (h, _vm) => {
541
557
  ? h('col', {
542
558
  class: 'vxe-table-custom-popup--table-col-width'
543
559
  })
544
- : _e(),
560
+ : renderEmptyElement($xeTable),
545
561
  allowFixed
546
562
  ? h('col', {
547
563
  class: 'vxe-table-custom-popup--table-col-fixed'
548
564
  })
549
- : _e()
565
+ : renderEmptyElement($xeTable)
550
566
  ]),
551
567
  h('thead', {}, [
552
568
  h('tr', {}, [
@@ -572,7 +588,7 @@ const renderPopupPanel = (h, _vm) => {
572
588
  }, getI18n('vxe.toolbar.customAll'))
573
589
  ])
574
590
  ])
575
- : _e(),
591
+ : renderEmptyElement($xeTable),
576
592
  allowSort
577
593
  ? h('th', {}, [
578
594
  h('span', {
@@ -595,14 +611,14 @@ const renderPopupPanel = (h, _vm) => {
595
611
  })
596
612
  : renderEmptyElement($xeTableCustomPanel)
597
613
  ])
598
- : _e(),
614
+ : renderEmptyElement($xeTable),
599
615
  h('th', {}, getI18n('vxe.custom.setting.colTitle')),
600
616
  allowResizable
601
617
  ? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
602
- : _e(),
618
+ : renderEmptyElement($xeTable),
603
619
  allowFixed
604
620
  ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
605
- : _e()
621
+ : renderEmptyElement($xeTable)
606
622
  ])
607
623
  ]),
608
624
  h('transition-group', {
@@ -622,7 +638,7 @@ const renderPopupPanel = (h, _vm) => {
622
638
  h('div', {
623
639
  ref: 'dragHintElemRef',
624
640
  class: 'vxe-table-custom-popup--drag-hint'
625
- }, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
641
+ }, getI18n('vxe.custom.cstmDragTarget', [dragColumn ? dragColumn.getTitle() : '']))
626
642
  ]);
627
643
  },
628
644
  footer: () => {
@@ -634,7 +650,8 @@ const renderPopupPanel = (h, _vm) => {
634
650
  }, [
635
651
  h(VxeUIButtonComponent, {
636
652
  props: {
637
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
653
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
654
+ disabled: !isCustomStatus
638
655
  },
639
656
  on: {
640
657
  click: _vm.resetCustomEvent
@@ -330,12 +330,12 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
330
330
  if (editConfig) {
331
331
  isNewRow = $xeTable.isInsertByRow(row);
332
332
  }
333
- if (treeConfig && !scrollYLoad && !treeOpts.transform) {
333
+ if (treeConfig && !scrollYLoad && !transform) {
334
334
  rowChildren = row[childrenField];
335
335
  isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid];
336
336
  }
337
337
  // 拖拽行事件
338
- if (rowOpts.drag && !rowLevel) {
338
+ if (rowOpts.drag && (!treeConfig || transform)) {
339
339
  trOn.dragstart = (evnt) => {
340
340
  $xeTable.handleRowDragDragstartEvent(evnt);
341
341
  };
@@ -75,11 +75,16 @@ function renderCellBaseVNs(h, params, content) {
75
75
  const { treeConfig, dragConfig } = tableProps;
76
76
  const rowOpts = $table.computeRowOpts;
77
77
  const rowDragOpts = $table.computeRowDragOpts;
78
- const { showIcon, visibleMethod } = rowDragOpts;
78
+ const { showIcon, isCrossDrag, visibleMethod } = rowDragOpts;
79
79
  const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
80
80
  const vns = XEUtils.isArray(content) ? content : [content];
81
81
  if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
82
- if (!treeConfig || !level) {
82
+ if (treeConfig) {
83
+ if (isCrossDrag || !level) {
84
+ vns.unshift(renderCellDragIcon(h, params));
85
+ }
86
+ }
87
+ else {
83
88
  vns.unshift(renderCellDragIcon(h, params));
84
89
  }
85
90
  }
@@ -42,7 +42,7 @@ const renderRows = (h, _vm, cols, $rowIndex) => {
42
42
  thOns.mousedown = (evnt) => $xetable.triggerHeaderCellMousedownEvent(evnt, params);
43
43
  }
44
44
  // 拖拽行事件
45
- if (columnOpts.drag && !column.parentId) {
45
+ if (columnOpts.drag) {
46
46
  thOns.dragstart = $xetable.handleHeaderCellDragDragstartEvent;
47
47
  thOns.dragend = $xetable.handleHeaderCellDragDragendEvent;
48
48
  thOns.dragover = $xetable.handleHeaderCellDragDragoverEvent;
@@ -414,7 +414,7 @@ const updateColDropTipContent = ($xeTable, tdEl) => {
414
414
  }
415
415
  reactData.dragTipText = tipContent;
416
416
  };
417
- function showDropTip($xeTable, evnt, trEl, thEl, dragPos) {
417
+ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
418
418
  const reactData = $xeTable;
419
419
  const el = $xeTable.$refs.refElem;
420
420
  if (!el) {
@@ -425,27 +425,33 @@ function showDropTip($xeTable, evnt, trEl, thEl, dragPos) {
425
425
  if (trEl) {
426
426
  const rdLineEl = $xeTable.$refs.refDragRowLineElem;
427
427
  if (rdLineEl) {
428
- const trRect = trEl.getBoundingClientRect();
429
- let top = Math.max(1, trRect.y - wrapperRect.y);
430
- if (dragPos === 'bottom') {
431
- top = Math.min(wrapperRect.height - 1, trRect.y - wrapperRect.y + trRect.height);
428
+ if (showLine) {
429
+ const trRect = trEl.getBoundingClientRect();
430
+ rdLineEl.style.display = 'block';
431
+ rdLineEl.style.top = `${Math.max(1, trRect.y - wrapperRect.y)}px`;
432
+ rdLineEl.style.height = `${trRect.height}px`;
433
+ rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
434
+ rdLineEl.setAttribute('drag-pos', dragPos);
435
+ }
436
+ else {
437
+ rdLineEl.style.display = '';
432
438
  }
433
- rdLineEl.style.top = `${top}px`;
434
- rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
435
- rdLineEl.style.display = 'block';
436
439
  }
437
440
  }
438
441
  else if (thEl) {
439
442
  const cdLineEl = $xeTable.$refs.refDragColLineElem;
440
443
  if (cdLineEl) {
441
- const thRect = thEl.getBoundingClientRect();
442
- let left = Math.max(1, thRect.x - wrapperRect.x);
443
- if (dragPos === 'right') {
444
- left = Math.min(wrapperRect.width - 2, thRect.x - wrapperRect.x + thRect.width);
444
+ if (showLine) {
445
+ const thRect = thEl.getBoundingClientRect();
446
+ cdLineEl.style.display = 'block';
447
+ cdLineEl.style.left = `${Math.max(1, thRect.x - wrapperRect.x)}px`;
448
+ cdLineEl.style.width = `${thRect.width}px`;
449
+ cdLineEl.style.height = `${wrapperRect.height - scrollbarHeight}px`;
450
+ cdLineEl.setAttribute('drag-pos', dragPos);
451
+ }
452
+ else {
453
+ cdLineEl.style.display = '';
445
454
  }
446
- cdLineEl.style.left = `${left}px`;
447
- cdLineEl.style.height = `${wrapperRect.height - scrollbarHeight}px`;
448
- cdLineEl.style.display = 'block';
449
455
  }
450
456
  }
451
457
  const rdTipEl = $xeTable.$refs.refDragTipElem;
@@ -453,6 +459,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, dragPos) {
453
459
  rdTipEl.style.display = 'block';
454
460
  rdTipEl.style.top = `${Math.min(el.clientHeight - el.scrollTop - rdTipEl.clientHeight, evnt.clientY - wrapperRect.y)}px`;
455
461
  rdTipEl.style.left = `${Math.min(el.clientWidth - el.scrollLeft - rdTipEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`;
462
+ rdTipEl.setAttribute('drag-status', showLine ? 'normal' : 'disabled');
456
463
  }
457
464
  }
458
465
  const hideDropTip = ($xeTable) => {
@@ -932,6 +939,7 @@ const Methods = {
932
939
  cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, items, parent, level, height: 0 };
933
940
  }
934
941
  if (isSource) {
942
+ cacheItem.level = level;
935
943
  cacheItem.index = treeConfig && parent ? -1 : index;
936
944
  fullDataRowIdMaps[rowid] = cacheItem;
937
945
  }
@@ -1634,6 +1642,15 @@ const Methods = {
1634
1642
  tableColumn: this.tableColumn.slice(0)
1635
1643
  };
1636
1644
  },
1645
+ /**
1646
+ * 获取表格的全量列
1647
+ */
1648
+ getFullColumns() {
1649
+ const $xeTable = this;
1650
+ const internalData = $xeTable;
1651
+ const { collectColumn } = internalData;
1652
+ return collectColumn.slice(0);
1653
+ },
1637
1654
  /**
1638
1655
  * 获取数据,和 data 的行为一致,也可以指定索引获取数据
1639
1656
  */
@@ -2000,6 +2017,28 @@ const Methods = {
2000
2017
  footerData: footerTableData.slice(0)
2001
2018
  };
2002
2019
  },
2020
+ /**
2021
+ * 获取表格的全量数据,如果是 tree-config 则返回带层级的树结构
2022
+ */
2023
+ getFullData() {
2024
+ const $xeTable = this;
2025
+ const props = $xeTable;
2026
+ const internalData = $xeTable;
2027
+ const { treeConfig } = props;
2028
+ const { tableFullData, tableFullTreeData } = internalData;
2029
+ if (treeConfig) {
2030
+ const treeOpts = $xeTable.computeTreeOpts;
2031
+ const { transform, mapChildrenField } = treeOpts;
2032
+ const childrenField = treeOpts.children || treeOpts.childrenField;
2033
+ if (transform) {
2034
+ return XEUtils.toArrayTree(XEUtils.toTreeArray(tableFullTreeData, {
2035
+ children: mapChildrenField
2036
+ }), { children: childrenField });
2037
+ }
2038
+ return tableFullTreeData.slice(0);
2039
+ }
2040
+ return tableFullData.slice(0);
2041
+ },
2003
2042
  /**
2004
2043
  * 处理数据加载默认行为
2005
2044
  * 默认执行一次,除非被重置
@@ -2197,7 +2236,10 @@ const Methods = {
2197
2236
  return this.refreshColumn(true);
2198
2237
  },
2199
2238
  handleCustomRestore(storeData) {
2200
- let { collectColumn } = this;
2239
+ const $xetable = this;
2240
+ const reactData = $xetable;
2241
+ const internalData = $xetable;
2242
+ let { collectColumn } = internalData;
2201
2243
  const { resizableData, sortData, visibleData, fixedData } = storeData;
2202
2244
  let hasCustomSort = false;
2203
2245
  // 处理还原
@@ -2224,9 +2266,13 @@ const Methods = {
2224
2266
  // 如果自定义了顺序
2225
2267
  if (hasCustomSort) {
2226
2268
  collectColumn = XEUtils.orderBy(collectColumn, 'renderSortNumber');
2227
- this.collectColumn = collectColumn;
2228
- this.tableFullColumn = getColumnList(collectColumn);
2269
+ internalData.collectColumn = collectColumn;
2270
+ internalData.tableFullColumn = getColumnList(collectColumn);
2229
2271
  }
2272
+ reactData.isCustomStatus = true;
2273
+ }
2274
+ else {
2275
+ reactData.isCustomStatus = false;
2230
2276
  }
2231
2277
  },
2232
2278
  /**
@@ -5012,11 +5058,13 @@ const Methods = {
5012
5058
  const internalData = $xeTable;
5013
5059
  const { treeConfig, dragConfig } = props;
5014
5060
  const rowDragOpts = $xeTable.computeRowDragOpts;
5015
- const { dragEndMethod } = rowDragOpts;
5061
+ const { fullAllDataRowIdData } = internalData;
5062
+ const { isCrossDrag, isSelfToChildDrag, dragEndMethod } = rowDragOpts;
5016
5063
  const treeOpts = $xeTable.computeTreeOpts;
5017
- const { transform } = treeOpts;
5064
+ const { transform, mapChildrenField, parentField } = treeOpts;
5065
+ const childrenField = treeOpts.children || treeOpts.childrenField;
5018
5066
  const { dragRow } = reactData;
5019
- const { afterFullData, afterTreeFullData, tableFullData, tableFullTreeData, prevDragRow, prevDragPos } = internalData;
5067
+ const { afterFullData, tableFullData, prevDragRow, prevDragPos } = internalData;
5020
5068
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
5021
5069
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
5022
5070
  if (prevDragRow && dragRow) {
@@ -5035,27 +5083,98 @@ const Methods = {
5035
5083
  }
5036
5084
  let oafIndex = -1;
5037
5085
  let nafIndex = -1;
5086
+ // 如果为树结构
5038
5087
  if (treeConfig) {
5039
- // 移出源位置
5040
- oafIndex = $xeTable.findRowIndexOf(afterTreeFullData, dragRow);
5041
- const otfIndex = $xeTable.findRowIndexOf(tableFullTreeData, dragRow);
5042
- afterTreeFullData.splice(oafIndex, 1);
5043
- tableFullTreeData.splice(otfIndex, 1);
5044
- // 插新位置
5045
- const pafIndex = $xeTable.findRowIndexOf(afterTreeFullData, prevDragRow);
5046
- const ptfIndex = $xeTable.findRowIndexOf(tableFullTreeData, prevDragRow);
5047
- nafIndex = pafIndex + dragOffsetIndex;
5048
- const ntfIndex = ptfIndex + dragOffsetIndex;
5049
- afterTreeFullData.splice(nafIndex, 0, dragRow);
5050
- tableFullTreeData.splice(ntfIndex, 0, dragRow);
5088
+ if (transform) {
5089
+ // 移出源位置
5090
+ const oldRowid = getRowid($xeTable, dragRow);
5091
+ const oldRest = fullAllDataRowIdData[oldRowid];
5092
+ const newRowid = getRowid($xeTable, prevDragRow);
5093
+ const newRest = fullAllDataRowIdData[newRowid];
5094
+ if (oldRest && newRest) {
5095
+ const { level: oldLevel } = oldRest;
5096
+ const { level: newLevel } = newRest;
5097
+ const oldAllMaps = {};
5098
+ XEUtils.eachTree([dragRow], item => {
5099
+ oldAllMaps[getRowid($xeTable, item)] = item;
5100
+ }, { children: mapChildrenField });
5101
+ let isSelfToChildStatus = false;
5102
+ if (oldLevel && newLevel) {
5103
+ // 子到子
5104
+ if (!isCrossDrag) {
5105
+ return;
5106
+ }
5107
+ if (oldAllMaps[newRowid]) {
5108
+ if (!isSelfToChildDrag) {
5109
+ isSelfToChildStatus = true;
5110
+ if (VxeUI.modal) {
5111
+ VxeUI.modal.message({
5112
+ status: 'error',
5113
+ content: getI18n('vxe.error.treeDragChild')
5114
+ });
5115
+ }
5116
+ return;
5117
+ }
5118
+ }
5119
+ }
5120
+ else if (oldLevel) {
5121
+ // 子到根
5122
+ if (!isCrossDrag) {
5123
+ return;
5124
+ }
5125
+ }
5126
+ else if (newLevel) {
5127
+ // 根到子
5128
+ if (!isCrossDrag) {
5129
+ return;
5130
+ }
5131
+ if (oldAllMaps[newRowid]) {
5132
+ isSelfToChildStatus = true;
5133
+ if (!isSelfToChildDrag) {
5134
+ if (VxeUI.modal) {
5135
+ VxeUI.modal.message({
5136
+ status: 'error',
5137
+ content: getI18n('vxe.error.treeDragChild')
5138
+ });
5139
+ }
5140
+ return;
5141
+ }
5142
+ }
5143
+ }
5144
+ else {
5145
+ // 根到根
5146
+ }
5147
+ const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, { children: childrenField });
5148
+ // 移出
5149
+ const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
5150
+ fullList.splice(otfIndex, 1);
5151
+ // 插入
5152
+ const ptfIndex = $xeTable.findRowIndexOf(fullList, prevDragRow);
5153
+ const ntfIndex = ptfIndex + dragOffsetIndex;
5154
+ fullList.splice(ntfIndex, 0, dragRow);
5155
+ // 改变层级
5156
+ if (isSelfToChildStatus && isSelfToChildDrag) {
5157
+ XEUtils.each(dragRow[childrenField], childRow => {
5158
+ childRow[parentField] = dragRow[parentField];
5159
+ });
5160
+ }
5161
+ dragRow[parentField] = prevDragRow[parentField];
5162
+ internalData.tableFullTreeData = XEUtils.toArrayTree(fullList, {
5163
+ key: treeOpts.rowField,
5164
+ parentKey: treeOpts.parentField,
5165
+ children: childrenField,
5166
+ mapChildren: treeOpts.mapChildrenField
5167
+ });
5168
+ }
5169
+ }
5051
5170
  }
5052
5171
  else {
5053
- // 移出源位置
5172
+ // 移出
5054
5173
  oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
5055
5174
  const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
5056
5175
  afterFullData.splice(oafIndex, 1);
5057
5176
  tableFullData.splice(otfIndex, 1);
5058
- // 插新位置
5177
+ // 插入
5059
5178
  const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
5060
5179
  const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
5061
5180
  nafIndex = pafIndex + dragOffsetIndex;
@@ -5064,9 +5183,9 @@ const Methods = {
5064
5183
  tableFullData.splice(ntfIndex, 0, dragRow);
5065
5184
  }
5066
5185
  reactData.isDragRowMove = true;
5067
- $xeTable.cacheRowMap();
5068
- $xeTable.updateScrollYStatus();
5069
5186
  $xeTable.handleTableData(treeConfig && transform);
5187
+ $xeTable.cacheRowMap(true);
5188
+ $xeTable.updateScrollYStatus();
5070
5189
  if (!(treeConfig && transform)) {
5071
5190
  $xeTable.updateAfterDataIndex();
5072
5191
  }
@@ -5102,25 +5221,34 @@ const Methods = {
5102
5221
  },
5103
5222
  handleRowDragDragoverEvent(evnt) {
5104
5223
  const $xeTable = this;
5224
+ const props = $xeTable;
5105
5225
  const internalData = $xeTable;
5106
5226
  const reactData = $xeTable;
5227
+ const { treeConfig } = props;
5228
+ const { fullAllDataRowIdData } = internalData;
5107
5229
  const { dragRow } = reactData;
5230
+ const rowDragOpts = $xeTable.computeRowDragOpts;
5231
+ const { isCrossDrag } = rowDragOpts;
5108
5232
  if (!dragRow) {
5109
5233
  evnt.preventDefault();
5110
5234
  return;
5111
5235
  }
5112
5236
  const trEl = evnt.currentTarget;
5113
- const rowid = trEl.getAttribute('rowid');
5114
- const row = $xeTable.getRowById(rowid);
5115
- if (row) {
5116
- evnt.preventDefault();
5237
+ const rowid = trEl.getAttribute('rowid') || '';
5238
+ const rest = fullAllDataRowIdData[rowid];
5239
+ if (rest) {
5240
+ const row = rest.row;
5117
5241
  evnt.preventDefault();
5118
5242
  const { dragRow } = reactData;
5119
5243
  const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
5120
5244
  const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
5245
+ if ($xeTable.eqRow(dragRow, row) || (!isCrossDrag && treeConfig && rest.level)) {
5246
+ showDropTip($xeTable, evnt, trEl, null, false, dragPos);
5247
+ return;
5248
+ }
5121
5249
  internalData.prevDragRow = row;
5122
5250
  internalData.prevDragPos = dragPos;
5123
- showDropTip($xeTable, evnt, trEl, null, dragPos);
5251
+ showDropTip($xeTable, evnt, trEl, null, true, dragPos);
5124
5252
  $xeTable.dispatchEvent('row-dragover', {
5125
5253
  oldRow: dragRow,
5126
5254
  targetRow: row,
@@ -5274,9 +5402,13 @@ const Methods = {
5274
5402
  const { dragCol } = reactData;
5275
5403
  const offsetX = evnt.clientX - thEl.getBoundingClientRect().x;
5276
5404
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
5405
+ if (dragCol.id === column.id || column.parentId) {
5406
+ showDropTip($xeTable, evnt, null, thEl, false, dragPos);
5407
+ return;
5408
+ }
5277
5409
  internalData.prevDragCol = column;
5278
5410
  internalData.prevDragPos = dragPos;
5279
- showDropTip($xeTable, evnt, null, thEl, dragPos);
5411
+ showDropTip($xeTable, evnt, null, thEl, true, dragPos);
5280
5412
  $xeTable.dispatchEvent('column-dragover', {
5281
5413
  oldColumn: dragCol,
5282
5414
  targetColumn: column,