vxe-table 3.16.0-beta.1 → 3.16.0-beta.2

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 (73) hide show
  1. package/es/grid/src/grid.js +17 -5
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/custom/mixin.js +0 -4
  7. package/es/table/module/custom/panel.js +0 -1
  8. package/es/table/src/anime.js +46 -0
  9. package/es/table/src/body.js +15 -40
  10. package/es/table/src/columnInfo.js +5 -0
  11. package/es/table/src/footer.js +1 -19
  12. package/es/table/src/header.js +1 -19
  13. package/es/table/src/methods.js +532 -346
  14. package/es/table/src/table.js +21 -2
  15. package/es/table/style.css +8 -8
  16. package/es/table/style.min.css +1 -1
  17. package/es/ui/index.js +2 -1
  18. package/es/ui/src/log.js +1 -1
  19. package/es/vxe-table/style.css +8 -8
  20. package/es/vxe-table/style.min.css +1 -1
  21. package/lib/grid/src/grid.js +22 -7
  22. package/lib/grid/src/grid.min.js +1 -1
  23. package/lib/index.css +1 -1
  24. package/lib/index.min.css +1 -1
  25. package/lib/index.umd.js +642 -436
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/module/custom/mixin.js +0 -4
  30. package/lib/table/module/custom/mixin.min.js +1 -1
  31. package/lib/table/module/custom/panel.js +0 -1
  32. package/lib/table/module/custom/panel.min.js +1 -1
  33. package/lib/table/src/anime.js +56 -0
  34. package/lib/table/src/anime.min.js +1 -0
  35. package/lib/table/src/body.js +3 -28
  36. package/lib/table/src/body.min.js +1 -1
  37. package/lib/table/src/columnInfo.js +5 -0
  38. package/lib/table/src/columnInfo.min.js +1 -1
  39. package/lib/table/src/footer.js +1 -19
  40. package/lib/table/src/footer.min.js +1 -1
  41. package/lib/table/src/header.js +1 -19
  42. package/lib/table/src/header.min.js +1 -1
  43. package/lib/table/src/methods.js +539 -355
  44. package/lib/table/src/methods.min.js +1 -1
  45. package/lib/table/src/table.js +21 -1
  46. package/lib/table/src/table.min.js +1 -1
  47. package/lib/table/style/style.css +8 -8
  48. package/lib/table/style/style.min.css +1 -1
  49. package/lib/ui/index.js +2 -1
  50. package/lib/ui/index.min.js +1 -1
  51. package/lib/ui/src/log.js +1 -1
  52. package/lib/ui/src/log.min.js +1 -1
  53. package/lib/vxe-table/style/style.css +8 -8
  54. package/lib/vxe-table/style/style.min.css +1 -1
  55. package/package.json +1 -1
  56. package/packages/grid/src/grid.ts +19 -6
  57. package/packages/table/module/custom/mixin.ts +0 -4
  58. package/packages/table/module/custom/panel.ts +0 -1
  59. package/packages/table/src/anime.ts +52 -0
  60. package/packages/table/src/body.ts +15 -40
  61. package/packages/table/src/columnInfo.ts +5 -0
  62. package/packages/table/src/footer.ts +1 -19
  63. package/packages/table/src/header.ts +1 -20
  64. package/packages/table/src/methods.ts +554 -360
  65. package/packages/table/src/table.ts +21 -2
  66. package/packages/ui/index.ts +1 -0
  67. package/styles/components/table.scss +9 -9
  68. /package/es/{iconfont.1750910486943.ttf → iconfont.1751194972120.ttf} +0 -0
  69. /package/es/{iconfont.1750910486943.woff → iconfont.1751194972120.woff} +0 -0
  70. /package/es/{iconfont.1750910486943.woff2 → iconfont.1751194972120.woff2} +0 -0
  71. /package/lib/{iconfont.1750910486943.ttf → iconfont.1751194972120.ttf} +0 -0
  72. /package/lib/{iconfont.1750910486943.woff → iconfont.1751194972120.woff} +0 -0
  73. /package/lib/{iconfont.1750910486943.woff2 → iconfont.1751194972120.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.16.0-beta.1";
2005
+ const version = "3.16.0-beta.2";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2253,6 +2253,7 @@ core_.VxeUI.setConfig({
2253
2253
  proxyConfig: {
2254
2254
  enabled: true,
2255
2255
  autoLoad: true,
2256
+ showLoading: true,
2256
2257
  showResponseMsg: true,
2257
2258
  showActiveMsg: true,
2258
2259
  response: {
@@ -2666,7 +2667,7 @@ function isNodeElement(elem) {
2666
2667
  const {
2667
2668
  log: log_log
2668
2669
  } = core_.VxeUI;
2669
- const log_version = `table v${"3.16.0-beta.1"}`;
2670
+ const log_version = `table v${"3.16.0-beta.2"}`;
2670
2671
  const warnLog = log_log.create('warn', log_version);
2671
2672
  const errLog = log_log.create('error', log_version);
2672
2673
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2729,6 +2730,11 @@ class ColumnInfo {
2729
2730
  }
2730
2731
  }
2731
2732
  }
2733
+ if (_vm.aggFunc) {
2734
+ if (!$xeTable.handlePivotTableAggregateData && _vm.aggFunc !== true) {
2735
+ errLog('vxe.error.errProp', [`column.agg-func=${_vm.aggFunc}`, 'column.agg-func=true']);
2736
+ }
2737
+ }
2732
2738
  Object.assign(this, {
2733
2739
  // 基本属性
2734
2740
  type: _vm.type,
@@ -5155,6 +5161,53 @@ if (core_.VxeUI.dynamicApp) {
5155
5161
  core_.VxeUI.component(group);
5156
5162
  const Colgroup = VxeColgroup;
5157
5163
  /* harmony default export */ var colgroup = ((/* unused pure expression or super */ null && (VxeColgroup)));
5164
+ ;// CONCATENATED MODULE: ./packages/table/src/anime.ts
5165
+
5166
+
5167
+ const rowMoveCls = 'row--drag-move';
5168
+ const colMoveClass = 'col--drag-move';
5169
+ /**
5170
+ * 上下拖拽
5171
+ */
5172
+ function moveRowAnimateToTb(elemList, offsetTop) {
5173
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elemList, trEl => {
5174
+ trEl.style.transform = `translateY(${offsetTop}px)`;
5175
+ });
5176
+ requestAnimationFrame(() => {
5177
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elemList, trEl => {
5178
+ addClass(trEl, rowMoveCls);
5179
+ trEl.style.transform = '';
5180
+ });
5181
+ });
5182
+ }
5183
+ function clearRowAnimate(elem) {
5184
+ setTimeout(() => {
5185
+ if (elem) {
5186
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elem.querySelectorAll(`.vxe-body--row.${rowMoveCls}`), elem => removeClass(elem, rowMoveCls));
5187
+ }
5188
+ }, 500);
5189
+ }
5190
+ /**
5191
+ * 左右拖拽
5192
+ */
5193
+ function moveColAnimateToLr(elemList, offsetLeft) {
5194
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elemList, trEl => {
5195
+ trEl.style.transform = `translateX(${offsetLeft}px)`;
5196
+ });
5197
+ requestAnimationFrame(() => {
5198
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elemList, trEl => {
5199
+ addClass(trEl, colMoveClass);
5200
+ trEl.style.transform = '';
5201
+ });
5202
+ });
5203
+ }
5204
+ function clearColAnimate(elem) {
5205
+ setTimeout(() => {
5206
+ if (elem) {
5207
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(elem.querySelectorAll(`.vxe-table--column.${colMoveClass}`), elem => removeClass(elem, colMoveClass));
5208
+ }
5209
+ }, 500);
5210
+ }
5158
5211
  ;// CONCATENATED MODULE: ./packages/table/src/methods.ts
5159
5212
 
5160
5213
 
@@ -5165,6 +5218,7 @@ const Colgroup = VxeColgroup;
5165
5218
 
5166
5219
 
5167
5220
 
5221
+
5168
5222
  const {
5169
5223
  getConfig: methods_getConfig,
5170
5224
  getI18n: methods_getI18n,
@@ -5666,7 +5720,7 @@ function handleVirtualTreeExpand($xeTable, rows, expanded) {
5666
5720
  updateAfterDataIndex($xeTable);
5667
5721
  return $xeTable.$nextTick();
5668
5722
  }).then(() => {
5669
- return $xeTable.recalculate(true);
5723
+ return handleLazyRecalculate($xeTable, true, true, true);
5670
5724
  }).then(() => {
5671
5725
  setTimeout(() => {
5672
5726
  $xeTable.updateCellAreas();
@@ -5751,7 +5805,7 @@ function handleRowGroupVirtualExpand($xeTable, rows, expanded) {
5751
5805
  updateAfterDataIndex($xeTable);
5752
5806
  return $xeTable.$nextTick();
5753
5807
  }).then(() => {
5754
- return $xeTable.recalculate(true);
5808
+ return handleLazyRecalculate($xeTable, true, true, true);
5755
5809
  }).then(() => {
5756
5810
  setTimeout(() => {
5757
5811
  $xeTable.updateCellAreas();
@@ -7871,8 +7925,6 @@ function clearDragStatus($xeTable) {
7871
7925
  hideDropTip($xeTable);
7872
7926
  reactData.dragRow = null;
7873
7927
  reactData.dragCol = null;
7874
- reactData.isDragColMove = false;
7875
- reactData.isDragRowMove = false;
7876
7928
  }
7877
7929
  }
7878
7930
  function clearRowDropOrigin($xeTable) {
@@ -8254,7 +8306,7 @@ function calcScrollbar($xeTable) {
8254
8306
  $xeTable.checkScrolling();
8255
8307
  }
8256
8308
  }
8257
- function handleRecalculateLayout($xeTable, reFull) {
8309
+ function handleRecalculateStyle($xeTable, reFull, reWidth, reHeight) {
8258
8310
  const internalData = $xeTable;
8259
8311
  const el = $xeTable.$refs.refElem;
8260
8312
  internalData.rceRunTime = Date.now();
@@ -8269,19 +8321,28 @@ function handleRecalculateLayout($xeTable, reFull) {
8269
8321
  calcVarRowHeightConfig($xeTable, 'small', smallEl);
8270
8322
  calcVarRowHeightConfig($xeTable, 'mini', miniEl);
8271
8323
  }
8272
- calcCellWidth($xeTable);
8273
- autoCellWidth($xeTable);
8324
+ if (reWidth) {
8325
+ calcCellWidth($xeTable);
8326
+ }
8327
+ if (reFull) {
8328
+ autoCellWidth($xeTable);
8329
+ }
8274
8330
  calcScrollbar($xeTable);
8275
8331
  updateStyle($xeTable);
8276
8332
  updateRowExpandStyle($xeTable);
8277
8333
  return computeScrollLoad($xeTable).then(() => {
8278
8334
  // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
8279
- calcCellWidth($xeTable);
8335
+ if (reWidth) {
8336
+ calcCellWidth($xeTable);
8337
+ }
8280
8338
  if (reFull) {
8281
8339
  autoCellWidth($xeTable);
8282
8340
  }
8283
- calcScrollbar($xeTable);
8341
+ if (reHeight) {
8342
+ calcCellHeight($xeTable);
8343
+ }
8284
8344
  updateStyle($xeTable);
8345
+ calcScrollbar($xeTable);
8285
8346
  if (reFull) {
8286
8347
  updateRowOffsetTop($xeTable);
8287
8348
  }
@@ -8291,6 +8352,38 @@ function handleRecalculateLayout($xeTable, reFull) {
8291
8352
  }
8292
8353
  });
8293
8354
  }
8355
+ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
8356
+ const internalData = $xeTable;
8357
+ return new Promise(resolve => {
8358
+ const {
8359
+ rceTimeout,
8360
+ rceRunTime
8361
+ } = internalData;
8362
+ const resizeOpts = $xeTable.computeResizeOpts;
8363
+ const refreshDelay = resizeOpts.refreshDelay || 20;
8364
+ const el = $xeTable.$refs.refElem;
8365
+ if (el && el.clientWidth) {
8366
+ autoCellWidth($xeTable);
8367
+ updateRowExpandStyle($xeTable);
8368
+ }
8369
+ if (rceTimeout) {
8370
+ clearTimeout(rceTimeout);
8371
+ if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
8372
+ resolve(handleRecalculateStyle($xeTable, !!reFull, reWidth, reHeight));
8373
+ } else {
8374
+ $xeTable.$nextTick(() => {
8375
+ resolve();
8376
+ });
8377
+ }
8378
+ } else {
8379
+ resolve(handleRecalculateStyle($xeTable, !!reFull, reWidth, reHeight));
8380
+ }
8381
+ internalData.rceTimeout = setTimeout(() => {
8382
+ internalData.rceTimeout = undefined;
8383
+ handleRecalculateStyle($xeTable, !!reFull, reWidth, reHeight);
8384
+ }, refreshDelay);
8385
+ });
8386
+ }
8294
8387
  function handleUpdateAggValues($xeTable) {
8295
8388
  const reactData = $xeTable;
8296
8389
  const internalData = $xeTable;
@@ -8550,8 +8643,6 @@ function loadTableData($xeTable, datas, isReset) {
8550
8643
  internalData.removeRowMaps = {};
8551
8644
  reactData.removeRowFlag++;
8552
8645
  const sYLoad = updateScrollYStatus($xeTable, fullData);
8553
- reactData.isDragColMove = false;
8554
- reactData.isDragRowMove = false;
8555
8646
  // 全量数据
8556
8647
  internalData.tableFullData = fullData;
8557
8648
  internalData.tableFullTreeData = isRGroup ? [] : treeData;
@@ -8611,10 +8702,10 @@ function loadTableData($xeTable, datas, isReset) {
8611
8702
  handleReserveStatus($xeTable);
8612
8703
  $xeTable.checkSelectionStatus();
8613
8704
  return new Promise(resolve => {
8614
- $xeTable.$nextTick().then(() => handleRecalculateLayout($xeTable, false)).then(() => {
8705
+ $xeTable.$nextTick().then(() => handleRecalculateStyle($xeTable, false, false, false)).then(() => {
8615
8706
  calcCellHeight($xeTable);
8616
8707
  updateRowOffsetTop($xeTable);
8617
- return handleRecalculateLayout($xeTable, false);
8708
+ return handleRecalculateStyle($xeTable, false, false, false);
8618
8709
  }).then(() => {
8619
8710
  let targetScrollLeft = lastScrollLeft;
8620
8711
  let targetScrollTop = lastScrollTop;
@@ -8628,7 +8719,7 @@ function loadTableData($xeTable, datas, isReset) {
8628
8719
  targetScrollTop = 0;
8629
8720
  }
8630
8721
  reactData.isRowLoading = false;
8631
- handleRecalculateLayout($xeTable, false);
8722
+ handleRecalculateStyle($xeTable, false, false, false);
8632
8723
  // 是否变更虚拟滚动
8633
8724
  if (oldScrollYLoad === sYLoad) {
8634
8725
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
@@ -8905,7 +8996,6 @@ function handleColumn($xeTable, collectColumn) {
8905
8996
  const tableFullColumn = getColumnList(collectColumn);
8906
8997
  internalData.tableFullColumn = tableFullColumn;
8907
8998
  reactData.isColLoading = true;
8908
- reactData.isDragColMove = false;
8909
8999
  initColumnSort($xeTable);
8910
9000
  return Promise.resolve(restoreCustomStorage($xeTable)).then(() => {
8911
9001
  const {
@@ -9461,10 +9551,10 @@ const Methods = {
9461
9551
  }
9462
9552
  }).then(() => {
9463
9553
  $xeTable.updateCellAreas();
9464
- return $xeTable.recalculate(true);
9554
+ return handleLazyRecalculate($xeTable, true, true, true);
9465
9555
  }).then(() => {
9466
9556
  // 存在滚动行为未结束情况
9467
- setTimeout(() => $xeTable.recalculate(), 50);
9557
+ setTimeout(() => handleLazyRecalculate($xeTable, false, true, true), 50);
9468
9558
  });
9469
9559
  },
9470
9560
  handleTableData(force) {
@@ -9523,7 +9613,7 @@ const Methods = {
9523
9613
  if (!initStatus) {
9524
9614
  handleLoadDefaults($xeTable);
9525
9615
  }
9526
- return this.recalculate();
9616
+ return handleLazyRecalculate($xeTable, false, true, true);
9527
9617
  });
9528
9618
  },
9529
9619
  /**
@@ -9538,7 +9628,7 @@ const Methods = {
9538
9628
  return loadTableData($xeTable, datas, true);
9539
9629
  }).then(() => {
9540
9630
  handleLoadDefaults($xeTable);
9541
- return this.recalculate();
9631
+ return handleLazyRecalculate($xeTable, false, true, true);
9542
9632
  });
9543
9633
  },
9544
9634
  /**
@@ -10133,7 +10223,7 @@ const Methods = {
10133
10223
  }
10134
10224
  return $xeTable.$nextTick().then(() => {
10135
10225
  $xeTable.updateCellAreas();
10136
- return $xeTable.recalculate();
10226
+ return handleLazyRecalculate($xeTable, false, true, true);
10137
10227
  });
10138
10228
  }
10139
10229
  return $xeTable.reloadData(tableSourceData);
@@ -11140,7 +11230,7 @@ const Methods = {
11140
11230
  return parseColumns($xeTable, true).then(() => {
11141
11231
  return this.refreshScroll();
11142
11232
  }).then(() => {
11143
- return this.recalculate();
11233
+ return handleLazyRecalculate($xeTable, false, true, true);
11144
11234
  });
11145
11235
  },
11146
11236
  /**
@@ -11750,36 +11840,8 @@ const Methods = {
11750
11840
  */
11751
11841
  recalculate(reFull) {
11752
11842
  const $xeTable = this;
11753
- const internalData = $xeTable;
11754
- return new Promise(resolve => {
11755
- const {
11756
- rceTimeout,
11757
- rceRunTime
11758
- } = internalData;
11759
- const resizeOpts = $xeTable.computeResizeOpts;
11760
- const refreshDelay = resizeOpts.refreshDelay || 20;
11761
- const el = $xeTable.$refs.refElem;
11762
- if (el && el.clientWidth) {
11763
- autoCellWidth($xeTable);
11764
- updateRowExpandStyle($xeTable);
11765
- }
11766
- if (rceTimeout) {
11767
- clearTimeout(rceTimeout);
11768
- if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
11769
- resolve(handleRecalculateLayout($xeTable, !!reFull));
11770
- } else {
11771
- $xeTable.$nextTick(() => {
11772
- resolve();
11773
- });
11774
- }
11775
- } else {
11776
- resolve(handleRecalculateLayout($xeTable, !!reFull));
11777
- }
11778
- internalData.rceTimeout = setTimeout(() => {
11779
- internalData.rceTimeout = undefined;
11780
- handleRecalculateLayout($xeTable, !!reFull);
11781
- }, refreshDelay);
11782
- });
11843
+ const isForce = !!reFull;
11844
+ return handleLazyRecalculate($xeTable, isForce, isForce, isForce);
11783
11845
  },
11784
11846
  updateStyle() {
11785
11847
  const $xeTable = this;
@@ -12453,9 +12515,11 @@ const Methods = {
12453
12515
  }
12454
12516
  },
12455
12517
  handleGlobalResizeEvent() {
12456
- this.closeMenu();
12457
- this.updateCellAreas();
12458
- this.recalculate(true);
12518
+ const $xeTable = this;
12519
+ $xeTable.closeMenu();
12520
+ $xeTable.updateCellAreas();
12521
+ handleLazyRecalculate($xeTable, true, true, true);
12522
+ $xeTable.updateCellAreas();
12459
12523
  },
12460
12524
  /**
12461
12525
  * 处理合并
@@ -13155,7 +13219,8 @@ const Methods = {
13155
13219
  const childList = vals[2];
13156
13220
  let sLen = 0; // 已选
13157
13221
  let hLen = 0; // 半选
13158
- let vLen = 0; // 有效行
13222
+ let vLen = 0; // 有效子行
13223
+ const cLen = childList.length; // 有效子行
13159
13224
  childList.forEach(checkMethod ? item => {
13160
13225
  const childRowid = handleGetRowId(item);
13161
13226
  const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) : selectCheckboxMaps[childRowid];
@@ -13186,18 +13251,25 @@ const Methods = {
13186
13251
  }
13187
13252
  vLen++;
13188
13253
  });
13189
- let isSelected = sLen >= vLen && (vLen >= 1 || hLen >= 1);
13190
- if (checkMethod) {
13191
- if (checkMethod({
13192
- $table: $xeTable,
13193
- row
13194
- })) {
13195
- isSelected = sLen >= vLen;
13254
+ let isSelected = false;
13255
+ if (cLen > 0) {
13256
+ if (vLen > 0) {
13257
+ isSelected = (sLen > 0 || hLen > 0) && sLen >= vLen;
13196
13258
  } else {
13197
- isSelected = selectCheckboxMaps[rowid];
13259
+ // 如果存在子项禁用
13260
+ if (sLen > 0 && sLen >= vLen) {
13261
+ isSelected = true;
13262
+ } else if (selectCheckboxMaps[rowid]) {
13263
+ isSelected = true;
13264
+ } else {
13265
+ isSelected = false;
13266
+ }
13198
13267
  }
13268
+ } else {
13269
+ // 如果无子项
13270
+ isSelected = selectCheckboxMaps[rowid];
13199
13271
  }
13200
- const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
13272
+ const halfSelect = !isSelected && (sLen > 0 || hLen > 0);
13201
13273
  if (checkField) {
13202
13274
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, isSelected);
13203
13275
  }
@@ -13255,7 +13327,9 @@ const Methods = {
13255
13327
  handleGetRowId
13256
13328
  } = createHandleGetRowId($xeTable);
13257
13329
  let sLen = 0; // 已选
13330
+ let dsLen = 0; // 禁用的已选
13258
13331
  let hLen = 0; // 半选
13332
+ let dhLen = 0; // 禁用的半选
13259
13333
  let vLen = 0; // 有效行
13260
13334
  const rootList = treeConfig ? afterTreeFullData : isRowGroupStatus ? afterGroupFullData : afterFullData;
13261
13335
  rootList.forEach(checkMethod ? row => {
@@ -13273,9 +13347,9 @@ const Methods = {
13273
13347
  vLen++;
13274
13348
  } else {
13275
13349
  if (selected) {
13276
- sLen++;
13350
+ dsLen++;
13277
13351
  } else if (treeIndeterminateRowMaps[childRowid]) {
13278
- hLen++;
13352
+ dhLen++;
13279
13353
  }
13280
13354
  }
13281
13355
  } : row => {
@@ -13289,7 +13363,7 @@ const Methods = {
13289
13363
  vLen++;
13290
13364
  });
13291
13365
  const isSelected = rootList.length > 0 ? vLen > 0 ? sLen >= vLen : sLen >= rootList.length : false;
13292
- let halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
13366
+ let halfSelect = !isSelected && (sLen > 0 || hLen > 0 || dsLen > 0 || dhLen > 0);
13293
13367
  // 如果复选框启用保留记录,当保留数据存在时显示半选
13294
13368
  if (!isSelected && !halfSelect && showReserveStatus) {
13295
13369
  halfSelect = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEmpty(checkboxReserveRowMap);
@@ -14231,6 +14305,7 @@ const Methods = {
14231
14305
  fullAllDataRowIdData
14232
14306
  } = internalData;
14233
14307
  const {
14308
+ animation,
14234
14309
  isPeerDrag,
14235
14310
  isCrossDrag,
14236
14311
  isSelfToChildDrag,
@@ -14238,6 +14313,9 @@ const Methods = {
14238
14313
  dragToChildMethod
14239
14314
  } = rowDragOpts;
14240
14315
  const treeOpts = $xeTable.computeTreeOpts;
14316
+ const cellOpts = $xeTable.computeCellOpts;
14317
+ const rowOpts = $xeTable.computeRowOpts;
14318
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
14241
14319
  const {
14242
14320
  transform,
14243
14321
  rowField,
@@ -14247,80 +14325,71 @@ const Methods = {
14247
14325
  const childrenField = treeOpts.children || treeOpts.childrenField;
14248
14326
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
14249
14327
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
14328
+ const el = $xeTable.$refs.refElem;
14250
14329
  const errRest = {
14251
14330
  status: false
14252
14331
  };
14253
- if (prevDragRow && dragRow) {
14254
- // 判断是否有拖动
14255
- if (prevDragRow !== dragRow) {
14256
- const dragParams = {
14257
- oldRow: dragRow,
14258
- newRow: prevDragRow,
14259
- dragRow,
14260
- dragPos: prevDragPos,
14261
- dragToChild: !!prevDragToChild,
14262
- offsetIndex: dragOffsetIndex
14263
- };
14264
- const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
14265
- return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
14266
- if (!status) {
14267
- return errRest;
14332
+ if (!(el && prevDragRow && dragRow)) {
14333
+ return Promise.resolve(errRest);
14334
+ }
14335
+ // 判断是否有拖动
14336
+ if (prevDragRow !== dragRow) {
14337
+ const dragParams = {
14338
+ oldRow: dragRow,
14339
+ newRow: prevDragRow,
14340
+ dragRow,
14341
+ dragPos: prevDragPos,
14342
+ dragToChild: !!prevDragToChild,
14343
+ offsetIndex: dragOffsetIndex
14344
+ };
14345
+ const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
14346
+ return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
14347
+ if (!status) {
14348
+ return errRest;
14349
+ }
14350
+ const dragRowid = getRowid($xeTable, dragRow);
14351
+ const dragRowRest = fullAllDataRowIdData[dragRowid] || {};
14352
+ const _dragRowIndex = dragRowRest._index;
14353
+ let dragRowHeight = 0;
14354
+ let dragOffsetTop = -1;
14355
+ if (animation) {
14356
+ dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight);
14357
+ const oldTrEl = el.querySelector(`.vxe-body--row[rowid="${dragRowid}"]`);
14358
+ if (oldTrEl) {
14359
+ dragOffsetTop = oldTrEl.offsetTop;
14268
14360
  }
14269
- let oafIndex = -1;
14270
- let nafIndex = -1;
14271
- // 如果为树结构
14272
- if (treeConfig) {
14273
- if (transform) {
14274
- // 移出源位置
14275
- const oldRowid = getRowid($xeTable, dragRow);
14276
- const oldRest = fullAllDataRowIdData[oldRowid];
14277
- const newRowid = getRowid($xeTable, prevDragRow);
14278
- const newRest = fullAllDataRowIdData[newRowid];
14279
- if (oldRest && newRest) {
14280
- const {
14281
- level: oldLevel
14282
- } = oldRest;
14283
- const {
14284
- level: newLevel
14285
- } = newRest;
14286
- const oldAllMaps = {};
14287
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([dragRow], item => {
14288
- oldAllMaps[getRowid($xeTable, item)] = item;
14289
- }, {
14290
- children: mapChildrenField
14291
- });
14292
- let isSelfToChildStatus = false;
14293
- if (oldLevel && newLevel) {
14294
- // 子到子
14295
- if (isPeerDrag && !isCrossDrag) {
14296
- if (oldRest.row[parentField] !== newRest.row[parentField]) {
14297
- // 非同级
14298
- return errRest;
14299
- }
14300
- } else {
14301
- if (!isCrossDrag) {
14302
- return errRest;
14303
- }
14304
- if (oldAllMaps[newRowid]) {
14305
- isSelfToChildStatus = true;
14306
- if (!(isCrossDrag && isSelfToChildDrag)) {
14307
- if (core_.VxeUI.modal) {
14308
- core_.VxeUI.modal.message({
14309
- status: 'error',
14310
- content: methods_getI18n('vxe.error.treeDragChild')
14311
- });
14312
- }
14313
- return errRest;
14314
- }
14315
- }
14316
- }
14317
- } else if (oldLevel) {
14318
- // 子到根
14319
- if (!isCrossDrag) {
14361
+ }
14362
+ let oafIndex = -1;
14363
+ let nafIndex = -1;
14364
+ // 如果为树结构
14365
+ if (treeConfig) {
14366
+ if (transform) {
14367
+ // 移出源位置
14368
+ const oldRest = dragRowRest;
14369
+ const newRowid = getRowid($xeTable, prevDragRow);
14370
+ const newRest = fullAllDataRowIdData[newRowid];
14371
+ if (oldRest && newRest) {
14372
+ const {
14373
+ level: oldLevel
14374
+ } = oldRest;
14375
+ const {
14376
+ level: newLevel
14377
+ } = newRest;
14378
+ const oldAllMaps = {};
14379
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([dragRow], item => {
14380
+ oldAllMaps[getRowid($xeTable, item)] = item;
14381
+ }, {
14382
+ children: mapChildrenField
14383
+ });
14384
+ let isSelfToChildStatus = false;
14385
+ if (oldLevel && newLevel) {
14386
+ // 子到子
14387
+ if (isPeerDrag && !isCrossDrag) {
14388
+ if (oldRest.row[parentField] !== newRest.row[parentField]) {
14389
+ // 非同级
14320
14390
  return errRest;
14321
14391
  }
14322
- } else if (newLevel) {
14323
- // 根到子
14392
+ } else {
14324
14393
  if (!isCrossDrag) {
14325
14394
  return errRest;
14326
14395
  }
@@ -14336,87 +14405,156 @@ const Methods = {
14336
14405
  return errRest;
14337
14406
  }
14338
14407
  }
14339
- } else {
14340
- // 根到根
14341
14408
  }
14342
- const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
14343
- key: rowField,
14344
- parentKey: parentField,
14345
- children: mapChildrenField
14346
- });
14347
- // 移出
14348
- const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
14349
- fullList.splice(otfIndex, 1);
14350
- // 插入
14351
- const ptfIndex = $xeTable.findRowIndexOf(fullList, prevDragRow);
14352
- const ntfIndex = ptfIndex + dragOffsetIndex;
14353
- fullList.splice(ntfIndex, 0, dragRow);
14354
- // 改变层级
14355
- if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
14356
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(dragRow[childrenField], childRow => {
14357
- childRow[parentField] = dragRow[parentField];
14358
- });
14409
+ } else if (oldLevel) {
14410
+ // 子到根
14411
+ if (!isCrossDrag) {
14412
+ return errRest;
14413
+ }
14414
+ } else if (newLevel) {
14415
+ // 根到子
14416
+ if (!isCrossDrag) {
14417
+ return errRest;
14418
+ }
14419
+ if (oldAllMaps[newRowid]) {
14420
+ isSelfToChildStatus = true;
14421
+ if (!(isCrossDrag && isSelfToChildDrag)) {
14422
+ if (core_.VxeUI.modal) {
14423
+ core_.VxeUI.modal.message({
14424
+ status: 'error',
14425
+ content: methods_getI18n('vxe.error.treeDragChild')
14426
+ });
14427
+ }
14428
+ return errRest;
14429
+ }
14359
14430
  }
14360
- dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
14361
- internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
14362
- key: rowField,
14363
- parentKey: parentField,
14364
- children: childrenField,
14365
- mapChildren: mapChildrenField
14431
+ } else {
14432
+ // 根到根
14433
+ }
14434
+ const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
14435
+ key: rowField,
14436
+ parentKey: parentField,
14437
+ children: mapChildrenField
14438
+ });
14439
+ // 移出
14440
+ const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
14441
+ fullList.splice(otfIndex, 1);
14442
+ // 插入
14443
+ const ptfIndex = $xeTable.findRowIndexOf(fullList, prevDragRow);
14444
+ const ntfIndex = ptfIndex + dragOffsetIndex;
14445
+ fullList.splice(ntfIndex, 0, dragRow);
14446
+ // 改变层级
14447
+ if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
14448
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(dragRow[childrenField], childRow => {
14449
+ childRow[parentField] = dragRow[parentField];
14366
14450
  });
14367
14451
  }
14452
+ dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
14453
+ internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
14454
+ key: rowField,
14455
+ parentKey: parentField,
14456
+ children: childrenField,
14457
+ mapChildren: mapChildrenField
14458
+ });
14368
14459
  }
14369
- } else {
14370
- // 移出
14371
- oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
14372
- const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
14373
- afterFullData.splice(oafIndex, 1);
14374
- tableFullData.splice(otfIndex, 1);
14375
- // 插入
14376
- const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
14377
- const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
14378
- nafIndex = pafIndex + dragOffsetIndex;
14379
- const ntfIndex = ptfIndex + dragOffsetIndex;
14380
- afterFullData.splice(nafIndex, 0, dragRow);
14381
- tableFullData.splice(ntfIndex, 0, dragRow);
14382
- }
14383
- reactData.isDragRowMove = true;
14384
- $xeTable.handleTableData(treeConfig && transform);
14385
- $xeTable.cacheRowMap(false);
14386
- updateScrollYStatus($xeTable);
14387
- if (!(treeConfig && transform)) {
14388
- updateAfterDataIndex($xeTable);
14389
- }
14390
- $xeTable.checkSelectionStatus();
14391
- if (reactData.scrollYLoad) {
14392
- $xeTable.updateScrollYSpace();
14393
14460
  }
14394
- if (evnt) {
14395
- $xeTable.dispatchEvent('row-dragend', {
14396
- oldRow: dragRow,
14397
- newRow: prevDragRow,
14398
- dragRow,
14399
- dragPos: prevDragPos,
14400
- dragToChild: isDragToChildFlag,
14401
- offsetIndex: dragOffsetIndex,
14402
- _index: {
14403
- newIndex: nafIndex,
14404
- oldIndex: oafIndex
14461
+ } else {
14462
+ // 移出
14463
+ oafIndex = $xeTable.findRowIndexOf(afterFullData, dragRow);
14464
+ const otfIndex = $xeTable.findRowIndexOf(tableFullData, dragRow);
14465
+ afterFullData.splice(oafIndex, 1);
14466
+ tableFullData.splice(otfIndex, 1);
14467
+ // 插入
14468
+ const pafIndex = $xeTable.findRowIndexOf(afterFullData, prevDragRow);
14469
+ const ptfIndex = $xeTable.findRowIndexOf(tableFullData, prevDragRow);
14470
+ nafIndex = pafIndex + dragOffsetIndex;
14471
+ const ntfIndex = ptfIndex + dragOffsetIndex;
14472
+ afterFullData.splice(nafIndex, 0, dragRow);
14473
+ tableFullData.splice(ntfIndex, 0, dragRow);
14474
+ }
14475
+ $xeTable.handleTableData(treeConfig && transform);
14476
+ $xeTable.cacheRowMap(false);
14477
+ updateScrollYStatus($xeTable);
14478
+ if (!(treeConfig && transform)) {
14479
+ updateAfterDataIndex($xeTable);
14480
+ }
14481
+ $xeTable.checkSelectionStatus();
14482
+ if (reactData.scrollYLoad) {
14483
+ $xeTable.updateScrollYSpace();
14484
+ }
14485
+ if (evnt) {
14486
+ $xeTable.dispatchEvent('row-dragend', {
14487
+ oldRow: dragRow,
14488
+ newRow: prevDragRow,
14489
+ dragRow,
14490
+ dragPos: prevDragPos,
14491
+ dragToChild: isDragToChildFlag,
14492
+ offsetIndex: dragOffsetIndex,
14493
+ _index: {
14494
+ newIndex: nafIndex,
14495
+ oldIndex: oafIndex
14496
+ }
14497
+ }, evnt);
14498
+ }
14499
+ return $xeTable.$nextTick().then(() => {
14500
+ if (animation) {
14501
+ const {
14502
+ tableData
14503
+ } = reactData;
14504
+ const dragRowRest = fullAllDataRowIdData[dragRowid];
14505
+ const _newRowIndex = dragRowRest._index;
14506
+ const firstRow = tableData[0];
14507
+ const firstRowRest = fullAllDataRowIdData[getRowid($xeTable, firstRow)];
14508
+ if (firstRowRest) {
14509
+ const _firstRowIndex = firstRowRest._index;
14510
+ const _lastRowIndex = _firstRowIndex + tableData.length;
14511
+ let rsIndex = -1;
14512
+ let reIndex = -1;
14513
+ let offsetRate = 1;
14514
+ if (_dragRowIndex < _firstRowIndex) {
14515
+ // 从上往下虚拟拖拽
14516
+ rsIndex = 0;
14517
+ reIndex = _newRowIndex - _firstRowIndex;
14518
+ } else if (_dragRowIndex > _lastRowIndex) {
14519
+ // 从下往上虚拟拖拽
14520
+ const $newRowIndex = dragRowRest.$index;
14521
+ rsIndex = $newRowIndex + 1;
14522
+ reIndex = tableData.length;
14523
+ offsetRate = -1;
14524
+ } else {
14525
+ if (_newRowIndex > _dragRowIndex) {
14526
+ // 从上往下拖拽
14527
+ rsIndex = _dragRowIndex - _firstRowIndex;
14528
+ reIndex = rsIndex + _newRowIndex - _dragRowIndex;
14529
+ } else {
14530
+ // 从下往上拖拽
14531
+ rsIndex = _newRowIndex - _firstRowIndex;
14532
+ reIndex = rsIndex + _dragRowIndex - _newRowIndex + 1;
14533
+ offsetRate = -1;
14534
+ }
14405
14535
  }
14406
- }, evnt);
14536
+ const dragRangeList = tableData.slice(rsIndex, reIndex);
14537
+ if (dragRangeList.length) {
14538
+ const dtTrList = el.querySelectorAll(dragRangeList.map(row => `.vxe-body--row[rowid="${getRowid($xeTable, row)}"]`).join(','));
14539
+ moveRowAnimateToTb(dtTrList, offsetRate * dragRowHeight);
14540
+ }
14541
+ }
14542
+ const newTrList = el.querySelectorAll(`.vxe-body--row[rowid="${dragRowid}"]`);
14543
+ const newTrEl = newTrList[0];
14544
+ if (dragOffsetTop > -1 && newTrEl) {
14545
+ moveRowAnimateToTb(newTrList, dragOffsetTop - newTrEl.offsetTop);
14546
+ }
14407
14547
  }
14408
- return $xeTable.$nextTick().then(() => {
14409
- $xeTable.updateCellAreas();
14410
- $xeTable.recalculate();
14411
- }).then(() => {
14412
- return {
14413
- status: true
14414
- };
14415
- });
14416
- }).catch(() => {
14417
- return errRest;
14548
+ $xeTable.updateCellAreas();
14549
+ $xeTable.recalculate();
14550
+ }).then(() => {
14551
+ return {
14552
+ status: true
14553
+ };
14418
14554
  });
14419
- }
14555
+ }).catch(() => {
14556
+ return errRest;
14557
+ });
14420
14558
  }
14421
14559
  return Promise.resolve(errRest);
14422
14560
  },
@@ -14444,6 +14582,7 @@ const Methods = {
14444
14582
  prevDragRow,
14445
14583
  prevDragPos
14446
14584
  } = internalData;
14585
+ const el = $xeTable.$refs.refElem;
14447
14586
  if (treeConfig && lazy && prevDragToChild) {
14448
14587
  // 懒加载
14449
14588
  const newRowid = getRowid($xeTable, prevDragRow);
@@ -14460,18 +14599,16 @@ const Methods = {
14460
14599
  }
14461
14600
  hideDropTip($xeTable);
14462
14601
  clearRowDropOrigin($xeTable);
14602
+ clearRowAnimate(el);
14463
14603
  internalData.prevDragToChild = false;
14464
14604
  reactData.dragRow = null;
14465
14605
  reactData.dragCol = null;
14466
- setTimeout(() => {
14467
- reactData.isDragRowMove = false;
14468
- }, 500);
14469
14606
  },
14470
14607
  handleRowDragDragoverEvent(evnt) {
14471
14608
  const $xeTable = this;
14472
14609
  const props = $xeTable;
14473
- const internalData = $xeTable;
14474
14610
  const reactData = $xeTable;
14611
+ const internalData = $xeTable;
14475
14612
  const {
14476
14613
  treeConfig
14477
14614
  } = props;
@@ -14547,7 +14684,6 @@ const Methods = {
14547
14684
  const tdEl = trigger === 'cell' || trigger === 'row' ? dragEl : dragEl.parentElement?.parentElement;
14548
14685
  const trEl = tdEl.parentElement;
14549
14686
  const dStartMethod = dragStartMethod || (dragConfig ? dragConfig.dragStartMethod : null);
14550
- reactData.isDragRowMove = false;
14551
14687
  clearRowDropOrigin($xeTable);
14552
14688
  if (dStartMethod && !dStartMethod(params)) {
14553
14689
  trEl.draggable = false;
@@ -14578,7 +14714,7 @@ const Methods = {
14578
14714
  handleColDragSwapColumn() {
14579
14715
  const $xeTable = this;
14580
14716
  handleUpdateColumn($xeTable);
14581
- parseColumns($xeTable, false).then(() => {
14717
+ return parseColumns($xeTable, false).then(() => {
14582
14718
  $xeTable.updateCellAreas();
14583
14719
  $xeTable.saveCustomStore('update:sort');
14584
14720
  });
@@ -14593,6 +14729,7 @@ const Methods = {
14593
14729
  } = props;
14594
14730
  const columnDragOpts = $xeTable.computeColumnDragOpts;
14595
14731
  const {
14732
+ animation,
14596
14733
  isPeerDrag,
14597
14734
  isCrossDrag,
14598
14735
  isSelfToChildDrag,
@@ -14601,68 +14738,73 @@ const Methods = {
14601
14738
  dragToChildMethod
14602
14739
  } = columnDragOpts;
14603
14740
  const {
14604
- collectColumn
14741
+ collectColumn,
14742
+ fullColumnIdData
14605
14743
  } = internalData;
14744
+ const el = $xeTable.$refs.refElem;
14606
14745
  const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
14607
14746
  const errRest = {
14608
14747
  status: false
14609
14748
  };
14610
- if (prevDragCol && dragCol) {
14611
- // 判断是否有拖动
14612
- if (prevDragCol !== dragCol) {
14613
- const dragColumn = dragCol;
14614
- const newColumn = prevDragCol;
14615
- const dragParams = {
14616
- oldColumn: dragColumn,
14617
- newColumn,
14618
- dragColumn,
14619
- dragPos: prevDragPos,
14620
- dragToChild: !!prevDragToChild,
14621
- offsetIndex: dragOffsetIndex
14622
- };
14623
- const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
14624
- return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
14625
- if (!status) {
14626
- return errRest;
14627
- }
14628
- let oafIndex = -1;
14629
- let nafIndex = -1;
14630
- const oldAllMaps = {};
14749
+ if (!(el && prevDragCol && dragCol)) {
14750
+ return Promise.resolve(errRest);
14751
+ }
14752
+ // 判断是否有拖动
14753
+ if (prevDragCol !== dragCol) {
14754
+ const dragColumn = dragCol;
14755
+ const newColumn = prevDragCol;
14756
+ const dragParams = {
14757
+ oldColumn: dragColumn,
14758
+ newColumn,
14759
+ dragColumn,
14760
+ dragPos: prevDragPos,
14761
+ dragToChild: !!prevDragToChild,
14762
+ offsetIndex: dragOffsetIndex
14763
+ };
14764
+ const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
14765
+ return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
14766
+ if (!status) {
14767
+ return errRest;
14768
+ }
14769
+ let dragTargetColumn = null;
14770
+ const dragAllTargetCols = [];
14771
+ let dragColWidth = 0;
14772
+ if (animation) {
14631
14773
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([dragColumn], column => {
14632
- oldAllMaps[column.id] = column;
14633
- });
14634
- let isSelfToChildStatus = false;
14635
- if (dragColumn.parentId && newColumn.parentId) {
14636
- // 子到子
14637
- if (isPeerDrag && !isCrossDrag) {
14638
- if (dragColumn.parentId !== newColumn.parentId) {
14639
- // 非同级
14640
- return errRest;
14641
- }
14642
- } else {
14643
- if (!isCrossDrag) {
14644
- return errRest;
14645
- }
14646
- if (oldAllMaps[newColumn.id]) {
14647
- isSelfToChildStatus = true;
14648
- if (!(isCrossDrag && isSelfToChildDrag)) {
14649
- if (core_.VxeUI.modal) {
14650
- core_.VxeUI.modal.message({
14651
- status: 'error',
14652
- content: methods_getI18n('vxe.error.treeDragChild')
14653
- });
14654
- }
14655
- return errRest;
14656
- }
14657
- }
14774
+ if (!dragTargetColumn && (!column.children || !column.children.length)) {
14775
+ dragTargetColumn = column;
14776
+ dragColWidth += column.renderWidth;
14658
14777
  }
14659
- } else if (dragColumn.parentId) {
14660
- // 子到根
14661
- if (!isCrossDrag) {
14778
+ dragAllTargetCols.push(column);
14779
+ });
14780
+ }
14781
+ if (!dragTargetColumn) {
14782
+ dragTargetColumn = dragColumn;
14783
+ }
14784
+ const dragColRest = fullColumnIdData[dragTargetColumn.id] || {};
14785
+ const _dragColIndex = dragColRest._index;
14786
+ let dragOffsetLeft = -1;
14787
+ if (animation) {
14788
+ const oldTrEl = el.querySelector(`.vxe-table--column[colid="${dragTargetColumn.id}"]`);
14789
+ if (oldTrEl) {
14790
+ dragOffsetLeft = oldTrEl.offsetLeft;
14791
+ }
14792
+ }
14793
+ let oafIndex = -1;
14794
+ let nafIndex = -1;
14795
+ const oldAllMaps = {};
14796
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([dragColumn], column => {
14797
+ oldAllMaps[column.id] = column;
14798
+ });
14799
+ let isSelfToChildStatus = false;
14800
+ if (dragColumn.parentId && newColumn.parentId) {
14801
+ // 子到子
14802
+ if (isPeerDrag && !isCrossDrag) {
14803
+ if (dragColumn.parentId !== newColumn.parentId) {
14804
+ // 非同级
14662
14805
  return errRest;
14663
14806
  }
14664
- } else if (newColumn.parentId) {
14665
- // 根到子
14807
+ } else {
14666
14808
  if (!isCrossDrag) {
14667
14809
  return errRest;
14668
14810
  }
@@ -14678,96 +14820,199 @@ const Methods = {
14678
14820
  return errRest;
14679
14821
  }
14680
14822
  }
14681
- } else {
14682
- // 根到根
14683
14823
  }
14684
- const oldewMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === dragColumn.id);
14685
- // 改变层级
14686
- if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
14687
- if (oldewMatchRest) {
14688
- const {
14689
- items: oCols,
14690
- index: oIndex
14691
- } = oldewMatchRest;
14692
- const childList = dragColumn.children || [];
14693
- childList.forEach(column => {
14694
- column.parentId = dragColumn.parentId;
14695
- });
14696
- oCols.splice(oIndex, 1, ...childList);
14697
- dragColumn.children = [];
14698
- }
14699
- } else {
14700
- if (oldewMatchRest) {
14701
- const {
14702
- items: oCols,
14703
- index: oIndex,
14704
- parent: oParent
14705
- } = oldewMatchRest;
14706
- oCols.splice(oIndex, 1);
14707
- if (!oParent) {
14708
- oafIndex = oIndex;
14824
+ } else if (dragColumn.parentId) {
14825
+ // 子到根
14826
+ if (!isCrossDrag) {
14827
+ return errRest;
14828
+ }
14829
+ } else if (newColumn.parentId) {
14830
+ // 根到子
14831
+ if (!isCrossDrag) {
14832
+ return errRest;
14833
+ }
14834
+ if (oldAllMaps[newColumn.id]) {
14835
+ isSelfToChildStatus = true;
14836
+ if (!(isCrossDrag && isSelfToChildDrag)) {
14837
+ if (core_.VxeUI.modal) {
14838
+ core_.VxeUI.modal.message({
14839
+ status: 'error',
14840
+ content: methods_getI18n('vxe.error.treeDragChild')
14841
+ });
14709
14842
  }
14843
+ return errRest;
14710
14844
  }
14711
14845
  }
14712
- const newMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === newColumn.id);
14713
- if (newMatchRest) {
14846
+ } else {
14847
+ // 根到根
14848
+ }
14849
+ const oldewMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === dragColumn.id);
14850
+ // 改变层级
14851
+ if (isSelfToChildStatus && isCrossDrag && isSelfToChildDrag) {
14852
+ if (oldewMatchRest) {
14714
14853
  const {
14715
- items: nCols,
14716
- index: nIndex,
14717
- parent: nParent
14718
- } = newMatchRest;
14719
- // 转子级
14720
- if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
14721
- dragColumn.parentId = newColumn.id;
14722
- newColumn.children = (newColumn.children || []).concat([dragColumn]);
14723
- } else {
14724
- dragColumn.parentId = newColumn.parentId;
14725
- nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
14726
- }
14727
- if (!nParent) {
14728
- nafIndex = nIndex;
14729
- }
14854
+ items: oCols,
14855
+ index: oIndex
14856
+ } = oldewMatchRest;
14857
+ const childList = dragColumn.children || [];
14858
+ childList.forEach(column => {
14859
+ column.parentId = dragColumn.parentId;
14860
+ });
14861
+ oCols.splice(oIndex, 1, ...childList);
14862
+ dragColumn.children = [];
14730
14863
  }
14731
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
14732
- if (!parentColumn) {
14733
- const sortIndex = index + 1;
14734
- column.renderSortNumber = sortIndex;
14735
- }
14736
- });
14737
- reactData.isDragColMove = true;
14738
- if (mouseConfig) {
14739
- if ($xeTable.clearSelected) {
14740
- $xeTable.clearSelected();
14741
- }
14742
- if ($xeTable.clearCellAreas) {
14743
- $xeTable.clearCellAreas();
14744
- $xeTable.clearCopyCellArea();
14864
+ } else {
14865
+ if (oldewMatchRest) {
14866
+ const {
14867
+ items: oCols,
14868
+ index: oIndex,
14869
+ parent: oParent
14870
+ } = oldewMatchRest;
14871
+ oCols.splice(oIndex, 1);
14872
+ if (!oParent) {
14873
+ oafIndex = oIndex;
14745
14874
  }
14746
14875
  }
14747
- if (evnt) {
14748
- $xeTable.dispatchEvent('column-dragend', {
14749
- oldColumn: dragColumn,
14750
- newColumn,
14751
- dragColumn,
14752
- dragPos: prevDragPos,
14753
- dragToChild: isDragToChildFlag,
14754
- offsetIndex: dragOffsetIndex,
14755
- _index: {
14756
- newIndex: nafIndex,
14757
- oldIndex: oafIndex
14758
- }
14759
- }, evnt);
14876
+ }
14877
+ const newMatchRest = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(collectColumn, item => item.id === newColumn.id);
14878
+ if (newMatchRest) {
14879
+ const {
14880
+ items: nCols,
14881
+ index: nIndex,
14882
+ parent: nParent
14883
+ } = newMatchRest;
14884
+ // 转子级
14885
+ if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
14886
+ dragColumn.parentId = newColumn.id;
14887
+ newColumn.children = (newColumn.children || []).concat([dragColumn]);
14888
+ } else {
14889
+ dragColumn.parentId = newColumn.parentId;
14890
+ nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn);
14891
+ }
14892
+ if (!nParent) {
14893
+ nafIndex = nIndex;
14894
+ }
14895
+ }
14896
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
14897
+ if (!parentColumn) {
14898
+ const sortIndex = index + 1;
14899
+ column.renderSortNumber = sortIndex;
14900
+ }
14901
+ });
14902
+ if (mouseConfig) {
14903
+ if ($xeTable.clearSelected) {
14904
+ $xeTable.clearSelected();
14760
14905
  }
14906
+ if ($xeTable.clearCellAreas) {
14907
+ $xeTable.clearCellAreas();
14908
+ $xeTable.clearCopyCellArea();
14909
+ }
14910
+ }
14911
+ if (evnt) {
14912
+ $xeTable.dispatchEvent('column-dragend', {
14913
+ oldColumn: dragColumn,
14914
+ newColumn,
14915
+ dragColumn,
14916
+ dragPos: prevDragPos,
14917
+ dragToChild: isDragToChildFlag,
14918
+ offsetIndex: dragOffsetIndex,
14919
+ _index: {
14920
+ newIndex: nafIndex,
14921
+ oldIndex: oafIndex
14922
+ }
14923
+ }, evnt);
14924
+ }
14925
+ return $xeTable.$nextTick().then(() => {
14761
14926
  if (isSyncColumn) {
14762
- $xeTable.handleColDragSwapColumn();
14927
+ return $xeTable.handleColDragSwapColumn();
14763
14928
  }
14929
+ }).then(() => {
14930
+ if (animation) {
14931
+ const {
14932
+ tableColumn
14933
+ } = reactData;
14934
+ const {
14935
+ visibleColumn,
14936
+ fullColumnIdData
14937
+ } = internalData;
14938
+ let dragNewColumn = null;
14939
+ const dragNewColMaps = {};
14940
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([dragColumn], column => {
14941
+ if (!dragNewColumn && (!column.children || !column.children.length)) {
14942
+ dragNewColumn = column;
14943
+ }
14944
+ dragNewColMaps[column.id] = column;
14945
+ });
14946
+ if (!dragNewColumn) {
14947
+ dragNewColumn = dragColumn;
14948
+ }
14949
+ if (dragColWidth && dragAllTargetCols.length) {
14950
+ const _newColIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(visibleColumn, column => !!dragNewColumn && column.id === dragNewColumn.id);
14951
+ const firstCol = tableColumn[0];
14952
+ const firstColRest = fullColumnIdData[firstCol.id];
14953
+ if (firstColRest) {
14954
+ const _firstColIndex = firstColRest._index;
14955
+ const _lastColIndex = _firstColIndex + tableColumn.length;
14956
+ let csIndex = -1;
14957
+ let ceIndex = -1;
14958
+ let offsetRate = 1;
14959
+ if (_dragColIndex < _firstColIndex) {
14960
+ // 从左往右虚拟拖拽
14961
+ csIndex = 0;
14962
+ ceIndex = _newColIndex - _firstColIndex;
14963
+ } else if (_dragColIndex > _lastColIndex) {
14964
+ // 从右往左虚拟拖拽
14965
+ const $newRowIndex = dragColRest.$index;
14966
+ csIndex = $newRowIndex + 1;
14967
+ ceIndex = tableColumn.length;
14968
+ offsetRate = -1;
14969
+ } else {
14970
+ if (_newColIndex > _dragColIndex) {
14971
+ // 从左往右拖拽
14972
+ csIndex = _dragColIndex - _firstColIndex;
14973
+ ceIndex = csIndex + _newColIndex - _dragColIndex;
14974
+ } else {
14975
+ // 从右往左拖拽
14976
+ csIndex = _newColIndex - _firstColIndex + 1;
14977
+ ceIndex = csIndex + _dragColIndex - _newColIndex;
14978
+ offsetRate = -1;
14979
+ }
14980
+ }
14981
+ const dragRangeList = [];
14982
+ const dragRangeMaps = {};
14983
+ for (let i = csIndex; i < ceIndex; i++) {
14984
+ const column = tableColumn[i];
14985
+ if (!dragRangeMaps[column.id] && !dragNewColMaps[column.id]) {
14986
+ dragRangeMaps[column.id] = column;
14987
+ dragRangeList.push(column);
14988
+ }
14989
+ }
14990
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([newColumn], column => {
14991
+ if (!dragRangeMaps[column.id]) {
14992
+ dragRangeMaps[column.id] = column;
14993
+ dragRangeList.push(column);
14994
+ }
14995
+ });
14996
+ if (dragRangeList.length) {
14997
+ const dtTrList = el.querySelectorAll(dragRangeList.map(column => `.vxe-table--column[colid="${column.id}"]`).join(','));
14998
+ moveColAnimateToLr(dtTrList, offsetRate * dragColWidth);
14999
+ }
15000
+ }
15001
+ const newTrList = el.querySelectorAll(dragAllTargetCols.map(column => `.vxe-table--column[colid="${column.id}"]`).join(','));
15002
+ const newTdEl = newTrList[0];
15003
+ if (dragOffsetLeft > -1 && newTdEl) {
15004
+ moveColAnimateToLr(newTrList, dragOffsetLeft - newTdEl.offsetLeft);
15005
+ }
15006
+ }
15007
+ }
15008
+ loadScrollXData($xeTable);
14764
15009
  return {
14765
15010
  status: true
14766
15011
  };
14767
- }).catch(() => {
14768
- return errRest;
14769
15012
  });
14770
- }
15013
+ }).catch(() => {
15014
+ return errRest;
15015
+ });
14771
15016
  }
14772
15017
  return Promise.resolve(errRest);
14773
15018
  },
@@ -14783,18 +15028,14 @@ const Methods = {
14783
15028
  prevDragPos,
14784
15029
  prevDragToChild
14785
15030
  } = internalData;
15031
+ const el = $xeTable.$refs.refElem;
14786
15032
  $xeTable.handleColDragSwapEvent(evnt, true, dragCol, prevDragCol, prevDragPos, prevDragToChild);
14787
15033
  hideDropTip($xeTable);
14788
15034
  clearColDropOrigin($xeTable);
15035
+ clearColAnimate(el);
14789
15036
  internalData.prevDragToChild = false;
14790
15037
  reactData.dragRow = null;
14791
15038
  reactData.dragCol = null;
14792
- setTimeout(() => {
14793
- reactData.isDragColMove = false;
14794
- $xeTable.recalculate().then(() => {
14795
- loadScrollXData($xeTable);
14796
- });
14797
- }, 500);
14798
15039
  },
14799
15040
  handleHeaderCellDragDragoverEvent(evnt) {
14800
15041
  const $xeTable = this;
@@ -14882,7 +15123,6 @@ const Methods = {
14882
15123
  } = params;
14883
15124
  const dragEl = evnt.currentTarget;
14884
15125
  const thEl = trigger === 'cell' ? dragEl : dragEl.parentElement?.parentElement;
14885
- reactData.isDragColMove = false;
14886
15126
  clearColDropOrigin($xeTable);
14887
15127
  if (dragStartMethod && !dragStartMethod(params)) {
14888
15128
  thEl.draggable = false;
@@ -14905,7 +15145,6 @@ const Methods = {
14905
15145
  hideDropTip($xeTable);
14906
15146
  reactData.dragRow = null;
14907
15147
  reactData.dragCol = null;
14908
- reactData.isDragColMove = false;
14909
15148
  },
14910
15149
  setPendingRow(rows, status) {
14911
15150
  const $xeTable = this;
@@ -15490,7 +15729,7 @@ const Methods = {
15490
15729
  }
15491
15730
  }
15492
15731
  reactData.rowExpandedFlag++;
15493
- return Promise.all(lazyRests).then(() => $xeTable.$nextTick()).then(() => $xeTable.recalculate(true)).then(() => {
15732
+ return Promise.all(lazyRests).then(() => $xeTable.$nextTick()).then(() => handleLazyRecalculate($xeTable, true, true, true)).then(() => {
15494
15733
  updateRowOffsetTop($xeTable);
15495
15734
  updateRowExpandStyle($xeTable);
15496
15735
  handleRowExpandScroll($xeTable);
@@ -15541,7 +15780,7 @@ const Methods = {
15541
15780
  }
15542
15781
  return $xeTable.$nextTick().then(() => {
15543
15782
  if (expList.length) {
15544
- return $xeTable.recalculate(true);
15783
+ return handleLazyRecalculate($xeTable, true, true, true);
15545
15784
  }
15546
15785
  }).then(() => {
15547
15786
  updateRowOffsetTop($xeTable);
@@ -15701,7 +15940,7 @@ const Methods = {
15701
15940
  $xeTable.handleTableData();
15702
15941
  updateAfterDataIndex($xeTable);
15703
15942
  reactData.rowGroupExpandedFlag++;
15704
- return $xeTable.recalculate(true);
15943
+ return handleLazyRecalculate($xeTable, true, true, true);
15705
15944
  },
15706
15945
  clearRowGroupExpand() {
15707
15946
  const $xeTable = this;
@@ -15712,7 +15951,7 @@ const Methods = {
15712
15951
  $xeTable.handleTableData();
15713
15952
  updateAfterDataIndex($xeTable);
15714
15953
  reactData.rowGroupExpandedFlag++;
15715
- return $xeTable.recalculate(true);
15954
+ return handleLazyRecalculate($xeTable, true, true, true);
15716
15955
  },
15717
15956
  getTreeExpandRecords() {
15718
15957
  const $xeTable = this;
@@ -16131,8 +16370,6 @@ const Methods = {
16131
16370
  }
16132
16371
  internalData.lastScrollTop = scrollTop;
16133
16372
  }
16134
- reactData.isDragColMove = false;
16135
- reactData.isDragRowMove = false;
16136
16373
  reactData.lastScrollTime = Date.now();
16137
16374
  const evntParams = {
16138
16375
  scrollTop,
@@ -17750,7 +17987,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
17750
17987
  }));
17751
17988
  }
17752
17989
  return h('td', {
17753
- class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
17990
+ class: ['vxe-table--column vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
17754
17991
  'col--last': isLastColumn,
17755
17992
  'col--tree-node': treeNode,
17756
17993
  'col--edit': isEdit,
@@ -17794,7 +18031,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
17794
18031
  const {
17795
18032
  hasFixedColumn,
17796
18033
  treeExpandedFlag,
17797
- isColLoading,
17798
18034
  scrollXLoad,
17799
18035
  scrollYLoad,
17800
18036
  isAllOverflow,
@@ -17802,7 +18038,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
17802
18038
  expandColumn,
17803
18039
  selectRadioRow,
17804
18040
  pendingRowFlag,
17805
- isDragColMove,
17806
18041
  rowExpandHeightFlag,
17807
18042
  isRowGroupStatus
17808
18043
  } = tableReactData;
@@ -17819,7 +18054,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
17819
18054
  const editOpts = $xeTable.computeEditOpts;
17820
18055
  const rowOpts = $xeTable.computeRowOpts;
17821
18056
  const columnOpts = $xeTable.computeColumnOpts;
17822
- const columnDragOpts = $xeTable.computeColumnDragOpts;
17823
18057
  const {
17824
18058
  transform,
17825
18059
  seqMode
@@ -17913,19 +18147,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
17913
18147
  const tdVNs = tableColumn.map((column, $columnIndex) => {
17914
18148
  return renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
17915
18149
  });
17916
- rows.push(!isColLoading && columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
17917
- props: {
17918
- tag: 'tr',
17919
- name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
17920
- },
17921
- class: trClass,
17922
- attrs: {
17923
- rowid
17924
- },
17925
- style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(params) : rowStyle : undefined,
17926
- key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
17927
- nativeOn: trOn
17928
- }, tdVNs) : h('tr', {
18150
+ rows.push(h('tr', {
17929
18151
  class: trClass,
17930
18152
  attrs: {
17931
18153
  rowid
@@ -18106,13 +18328,11 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
18106
18328
  const {
18107
18329
  isGroup,
18108
18330
  tableData,
18109
- isRowLoading,
18110
18331
  isColLoading,
18111
18332
  overflowX,
18112
18333
  scrollXLoad,
18113
18334
  scrollYLoad,
18114
18335
  isAllOverflow,
18115
- isDragRowMove,
18116
18336
  expandColumn,
18117
18337
  dragRow,
18118
18338
  dragCol
@@ -18122,10 +18342,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
18122
18342
  fullAllDataRowIdData,
18123
18343
  fullColumnIdData
18124
18344
  } = tableInternalData;
18125
- const rowOpts = $xeTable.computeRowOpts;
18126
18345
  const emptyOpts = $xeTable.computeEmptyOpts;
18127
18346
  const mouseOpts = $xeTable.computeMouseOpts;
18128
- const rowDragOpts = $xeTable.computeRowDragOpts;
18129
18347
  const expandOpts = $xeTable.computeExpandOpts;
18130
18348
  let renderDataList = tableData;
18131
18349
  let renderColumnList = tableColumn;
@@ -18260,13 +18478,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
18260
18478
  /**
18261
18479
  * 内容
18262
18480
  */
18263
- !(isRowLoading || isColLoading) && rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
18264
- ref: 'refBodyTBody',
18265
- props: {
18266
- tag: 'tbody',
18267
- name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
18268
- }
18269
- }, renderRows(h, this, fixedType, isOptimizeMode, renderDataList, renderColumnList)) : h('tbody', {
18481
+ h('tbody', {
18270
18482
  ref: 'refBodyTBody'
18271
18483
  }, renderRows(h, this, fixedType, isOptimizeMode, renderDataList, renderColumnList))]), h('div', {
18272
18484
  class: 'vxe-table--checkbox-range'
@@ -18450,7 +18662,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
18450
18662
  tcStyle.minHeight = `${currCellHeight}px`;
18451
18663
  }
18452
18664
  return h('th', {
18453
- class: ['vxe-header--column', colid, {
18665
+ class: ['vxe-table--column vxe-header--column', colid, {
18454
18666
  [`col--${headAlign}`]: headAlign,
18455
18667
  [`col--${type}`]: type,
18456
18668
  'col--last': isLastColumn,
@@ -18500,20 +18712,13 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
18500
18712
  const props = _vm;
18501
18713
  const $xeTable = _vm.$parent;
18502
18714
  const tableProps = $xeTable;
18503
- const tableReactData = $xeTable;
18504
18715
  const {
18505
18716
  fixedType
18506
18717
  } = props;
18507
- const columnOpts = $xeTable.computeColumnOpts;
18508
- const columnDragOpts = $xeTable.computeColumnDragOpts;
18509
18718
  const {
18510
18719
  headerRowClassName,
18511
18720
  headerRowStyle
18512
18721
  } = tableProps;
18513
- const {
18514
- isColLoading,
18515
- isDragColMove
18516
- } = tableReactData;
18517
18722
  return headerGroups.map((cols, $rowIndex) => {
18518
18723
  const params = {
18519
18724
  $table: $xeTable,
@@ -18521,17 +18726,6 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
18521
18726
  fixed: fixedType,
18522
18727
  type: cellType
18523
18728
  };
18524
- if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
18525
- return h('transition-group', {
18526
- key: $rowIndex,
18527
- props: {
18528
- tag: 'tr',
18529
- name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
18530
- class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
18531
- style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : null
18532
- }
18533
- }, header_renderRows(h, _vm, isGroup, isOptimizeMode, cols, $rowIndex));
18534
- }
18535
18729
  return h('tr', {
18536
18730
  key: $rowIndex,
18537
18731
  class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
@@ -18947,7 +19141,7 @@ function footer_renderRows(h, _vm, isOptimizeMode, tableColumn, footerTableData,
18947
19141
  tcStyle.minHeight = `${currCellHeight}px`;
18948
19142
  }
18949
19143
  return h('td', {
18950
- class: ['vxe-footer--column', column.id, {
19144
+ class: ['vxe-table--column vxe-footer--column', column.id, {
18951
19145
  [`col--${footAlign}`]: footAlign,
18952
19146
  [`col--${type}`]: type,
18953
19147
  'col--last': isLastColumn,
@@ -18992,7 +19186,6 @@ function footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
18992
19186
  const props = _vm;
18993
19187
  const $xeTable = _vm.$parent;
18994
19188
  const tableProps = $xeTable;
18995
- const tableReactData = $xeTable;
18996
19189
  const {
18997
19190
  fixedType,
18998
19191
  footerTableData
@@ -19001,12 +19194,6 @@ function footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
19001
19194
  footerRowClassName,
19002
19195
  footerRowStyle
19003
19196
  } = tableProps;
19004
- const {
19005
- isColLoading,
19006
- isDragColMove
19007
- } = tableReactData;
19008
- const columnOpts = $xeTable.computeColumnOpts;
19009
- const columnDragOpts = $xeTable.computeColumnDragOpts;
19010
19197
  return footerTableData.map((row, $rowIndex) => {
19011
19198
  const _rowIndex = $rowIndex;
19012
19199
  const rowParams = {
@@ -19017,17 +19204,6 @@ function footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
19017
19204
  fixed: fixedType,
19018
19205
  type: footer_renderType
19019
19206
  };
19020
- if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
19021
- return h('transition-group', {
19022
- key: $rowIndex,
19023
- props: {
19024
- tag: 'tr',
19025
- name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
19026
- class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
19027
- style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : undefined
19028
- }
19029
- }, footer_renderRows(h, _vm, isOptimizeMode, renderColumnList, footerTableData, row, $rowIndex, _rowIndex));
19030
- }
19031
19207
  return h('tr', {
19032
19208
  key: $rowIndex,
19033
19209
  class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
@@ -20768,7 +20944,6 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
20768
20944
  nafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, item => item.id === newColumn.id);
20769
20945
  customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
20770
20946
  }
20771
- tableReactData.isDragColMove = true;
20772
20947
  if (mouseConfig) {
20773
20948
  if ($xeTable.clearSelected) {
20774
20949
  $xeTable.clearSelected();
@@ -27272,10 +27447,6 @@ function emitCustomEvent($xeTable, type, evnt) {
27272
27447
  }
27273
27448
  });
27274
27449
  reactData.isCustomStatus = true;
27275
- reactData.isDragColMove = true;
27276
- setTimeout(() => {
27277
- reactData.isDragColMove = false;
27278
- }, 1000);
27279
27450
  return $xeTable.saveCustomStore('confirm').then(() => {
27280
27451
  if (allowGroup && allowValues && $xeTable.handlePivotTableAggregateData) {
27281
27452
  if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
@@ -28701,6 +28872,7 @@ function renderBody(h, $xeTable) {
28701
28872
  const reactData = $xeTable;
28702
28873
  const internalData = $xeTable;
28703
28874
  const {
28875
+ tableData,
28704
28876
  rowExpandedFlag,
28705
28877
  expandColumn,
28706
28878
  rowGroupExpandedFlag,
@@ -28711,7 +28883,7 @@ function renderBody(h, $xeTable) {
28711
28883
  rowExpandedMaps
28712
28884
  } = internalData;
28713
28885
  const expandList = [];
28714
- if (expandColumn && rowExpandedFlag && rowGroupExpandedFlag && treeExpandedFlag) {
28886
+ if (tableData.length && expandColumn && rowExpandedFlag && rowGroupExpandedFlag && treeExpandedFlag) {
28715
28887
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps, (row, rowid) => {
28716
28888
  if (visibleDataRowIdData[rowid]) {
28717
28889
  expandList.push(row);
@@ -29394,11 +29566,30 @@ function renderBody(h, $xeTable) {
29394
29566
  $xeTable.$nextTick(() => {
29395
29567
  if (props.loading) {
29396
29568
  if (!VxeUILoadingComponent && !this.$scopedSlots.loading) {
29569
+ errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>']);
29397
29570
  errLog('vxe.error.reqComp', ['vxe-loading']);
29398
29571
  }
29399
29572
  }
29400
29573
  if (props.showOverflow === true || props.showOverflow === 'tooltip' || props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip' || props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip' || props.tooltipConfig || props.editRules) {
29401
29574
  if (!VxeUITooltipComponent) {
29575
+ if (props.showOverflow === true) {
29576
+ errLog('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title']);
29577
+ }
29578
+ if (props.showOverflow === 'tooltip') {
29579
+ errLog('vxe.error.errProp', ['show-overflow=tooltip', 'show-overflow=title']);
29580
+ }
29581
+ if (props.showHeaderOverflow === true) {
29582
+ errLog('vxe.error.errProp', ['show-header-overflow=true', 'show-header-overflow=title']);
29583
+ }
29584
+ if (props.showHeaderOverflow === 'tooltip') {
29585
+ errLog('vxe.error.errProp', ['show-header-overflow=tooltip', 'show-header-overflow=title']);
29586
+ }
29587
+ if (props.showFooterOverflow === true) {
29588
+ errLog('vxe.error.errProp', ['show-footer-overflow=true', 'show-footer-overflow=title']);
29589
+ }
29590
+ if (props.showFooterOverflow === 'tooltip') {
29591
+ errLog('vxe.error.errProp', ['show-footer-overflow=tooltip', 'show-footer-overflow=title']);
29592
+ }
29402
29593
  errLog('vxe.error.reqComp', ['vxe-tooltip']);
29403
29594
  }
29404
29595
  }
@@ -30869,18 +31060,17 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
30869
31060
  const {
30870
31061
  seqConfig,
30871
31062
  pagerConfig,
30872
- loading,
30873
31063
  editConfig,
30874
31064
  proxyConfig
30875
31065
  } = props;
30876
31066
  const {
30877
31067
  isZMax,
30878
- tableLoading,
30879
31068
  tablePage
30880
31069
  } = reactData;
30881
31070
  const tableExtendProps = $xeGrid.computeTableExtendProps;
30882
31071
  const proxyOpts = $xeGrid.computeProxyOpts;
30883
31072
  const pagerOpts = $xeGrid.computePagerOpts;
31073
+ const isLoading = $xeGrid.computeIsLoading;
30884
31074
  const tProps = Object.assign({}, tableExtendProps);
30885
31075
  if (isZMax) {
30886
31076
  if (tableExtendProps.maxHeight) {
@@ -30890,7 +31080,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
30890
31080
  }
30891
31081
  }
30892
31082
  if (proxyConfig && isEnableConf(proxyOpts)) {
30893
- tProps.loading = loading || tableLoading;
31083
+ tProps.loading = isLoading;
30894
31084
  if (pagerConfig && proxyOpts.seq && isEnableConf(pagerOpts)) {
30895
31085
  tProps.seqConfig = Object.assign({}, seqConfig, {
30896
31086
  startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
@@ -30950,6 +31140,23 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
30950
31140
  const $xeGrid = this;
30951
31141
  const pagerOpts = $xeGrid.computePagerOpts;
30952
31142
  return pagerOpts.total;
31143
+ },
31144
+ computeIsLoading() {
31145
+ const $xeGrid = this;
31146
+ const props = $xeGrid;
31147
+ const reactData = $xeGrid.reactData;
31148
+ const {
31149
+ loading,
31150
+ proxyConfig
31151
+ } = props;
31152
+ const {
31153
+ tableLoading
31154
+ } = reactData;
31155
+ const proxyOpts = $xeGrid.computeProxyOpts;
31156
+ const {
31157
+ showLoading
31158
+ } = proxyOpts;
31159
+ return loading || tableLoading && showLoading && proxyConfig && isEnableConf(proxyOpts);
30953
31160
  }
30954
31161
  },
30955
31162
  watch: {
@@ -31344,9 +31551,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
31344
31551
  reactData.formData = formData;
31345
31552
  }
31346
31553
  if ($xeTable) {
31347
- const {
31348
- internalData: tableInternalData
31349
- } = $xeTable;
31554
+ const tableInternalData = $xeTable;
31350
31555
  const {
31351
31556
  tableFullColumn,
31352
31557
  fullColumnFieldData
@@ -32315,6 +32520,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
32315
32520
  const reactData = $xeGrid.reactData;
32316
32521
  const vSize = $xeGrid.computeSize;
32317
32522
  const styles = $xeGrid.computeStyles;
32523
+ const isLoading = $xeGrid.computeIsLoading;
32318
32524
  return h('div', {
32319
32525
  ref: 'refElem',
32320
32526
  class: ['vxe-grid', {
@@ -32322,7 +32528,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
32322
32528
  'is--animat': !!props.animat,
32323
32529
  'is--round': props.round,
32324
32530
  'is--maximize': reactData.isZMax,
32325
- 'is--loading': props.loading || reactData.tableLoading
32531
+ 'is--loading': isLoading
32326
32532
  }],
32327
32533
  style: styles
32328
32534
  }, $xeGrid.renderLayout(h));