vxe-table 4.10.1 → 4.10.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.
@@ -1028,6 +1028,8 @@ export default defineComponent({
1028
1028
  const columnOpts = computeColumnOpts.value;
1029
1029
  const columnDragOpts = computeColumnDragOpts.value;
1030
1030
  const { isCrossDrag, isSelfToChildDrag } = columnDragOpts;
1031
+ const customOpts = computeCustomOpts.value;
1032
+ const { storage } = customOpts;
1031
1033
  const rowOpts = computeRowOpts.value;
1032
1034
  const isGroup = collectColumn.some(hasChildrenList);
1033
1035
  let isAllOverflow = !!props.showOverflow;
@@ -1047,8 +1049,8 @@ export default defineComponent({
1047
1049
  fullColumnFieldData[field] = rest;
1048
1050
  }
1049
1051
  else {
1050
- if (isCrossDrag || isSelfToChildDrag) {
1051
- errLog('vxe.error.emptyProp', ['column.field']);
1052
+ if (storage || isCrossDrag || isSelfToChildDrag) {
1053
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
1052
1054
  }
1053
1055
  }
1054
1056
  if (!hasFixed && fixed) {
@@ -2332,25 +2334,28 @@ export default defineComponent({
2332
2334
  const { loadMethod } = expandOpts;
2333
2335
  if (loadMethod) {
2334
2336
  const { fullAllDataRowIdData } = internalData;
2335
- const { rowExpandLazyLoadedMaps } = reactData;
2337
+ const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
2336
2338
  const rowid = getRowid($xeTable, row);
2337
2339
  const rowRest = fullAllDataRowIdData[rowid];
2338
- rowExpandLazyLoadedMaps[rowid] = row;
2340
+ rExpandLazyLoadedMaps[rowid] = row;
2341
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
2339
2342
  loadMethod({ $table: $xeTable, row, rowIndex: tableMethods.getRowIndex(row), $rowIndex: tableMethods.getVMRowIndex(row) }).then(() => {
2340
- const { rowExpandedMaps } = reactData;
2343
+ const rExpandedMaps = Object.assign({}, reactData.rowExpandedMaps);
2341
2344
  if (rowRest) {
2342
2345
  rowRest.expandLoaded = true;
2343
2346
  }
2344
- rowExpandedMaps[rowid] = row;
2347
+ rExpandedMaps[rowid] = row;
2348
+ reactData.rowExpandedMaps = rExpandedMaps;
2345
2349
  }).catch(() => {
2346
2350
  if (rowRest) {
2347
2351
  rowRest.expandLoaded = false;
2348
2352
  }
2349
2353
  }).finally(() => {
2350
- const { rowExpandLazyLoadedMaps } = reactData;
2351
- if (rowExpandLazyLoadedMaps[rowid]) {
2352
- delete rowExpandLazyLoadedMaps[rowid];
2354
+ const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
2355
+ if (rExpandLazyLoadedMaps[rowid]) {
2356
+ delete rExpandLazyLoadedMaps[rowid];
2353
2357
  }
2358
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
2354
2359
  nextTick().then(() => tableMethods.recalculate()).then(() => resolve());
2355
2360
  });
2356
2361
  }
@@ -4687,7 +4692,7 @@ export default defineComponent({
4687
4692
  return rowRest && !!rowRest.expandLoaded;
4688
4693
  },
4689
4694
  clearRowExpandLoaded(row) {
4690
- const { rowExpandLazyLoadedMaps } = reactData;
4695
+ const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
4691
4696
  const { fullAllDataRowIdData } = internalData;
4692
4697
  const expandOpts = computeExpandOpts.value;
4693
4698
  const { lazy } = expandOpts;
@@ -4695,8 +4700,9 @@ export default defineComponent({
4695
4700
  const rowRest = fullAllDataRowIdData[rowid];
4696
4701
  if (lazy && rowRest) {
4697
4702
  rowRest.expandLoaded = false;
4698
- delete rowExpandLazyLoadedMaps[rowid];
4703
+ delete rExpandLazyLoadedMaps[rowid];
4699
4704
  }
4705
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
4700
4706
  return nextTick();
4701
4707
  },
4702
4708
  /**
@@ -4868,7 +4874,7 @@ export default defineComponent({
4868
4874
  return rowRest && !!rowRest.treeLoaded;
4869
4875
  },
4870
4876
  clearTreeExpandLoaded(rows) {
4871
- const { treeExpandedMaps } = reactData;
4877
+ const tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
4872
4878
  const { fullAllDataRowIdData } = internalData;
4873
4879
  const treeOpts = computeTreeOpts.value;
4874
4880
  const { transform } = treeOpts;
@@ -4881,12 +4887,13 @@ export default defineComponent({
4881
4887
  const rowRest = fullAllDataRowIdData[rowid];
4882
4888
  if (rowRest) {
4883
4889
  rowRest.treeLoaded = false;
4884
- if (treeExpandedMaps[rowid]) {
4885
- delete treeExpandedMaps[rowid];
4890
+ if (tExpandedMaps[rowid]) {
4891
+ delete tExpandedMaps[rowid];
4886
4892
  }
4887
4893
  }
4888
4894
  });
4889
4895
  }
4896
+ reactData.treeExpandedMaps = tExpandedMaps;
4890
4897
  if (transform) {
4891
4898
  handleVirtualTreeToList();
4892
4899
  return tablePrivateMethods.handleTableData();
@@ -5319,7 +5326,7 @@ export default defineComponent({
5319
5326
  }
5320
5327
  let hasResizable = 0;
5321
5328
  let hasSort = 0;
5322
- let hasFixedt = 0;
5329
+ let hasFixed = 0;
5323
5330
  let hasVisible = 0;
5324
5331
  XEUtils.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
5325
5332
  // 只支持一级
@@ -5334,7 +5341,7 @@ export default defineComponent({
5334
5341
  if (column.fixed !== column.defaultFixed) {
5335
5342
  const colKey = column.getKey();
5336
5343
  if (colKey) {
5337
- hasFixedt = 1;
5344
+ hasFixed = 1;
5338
5345
  fixedData[colKey] = column.fixed;
5339
5346
  }
5340
5347
  }
@@ -5369,7 +5376,7 @@ export default defineComponent({
5369
5376
  if (hasSort) {
5370
5377
  storeData.sortData = sortData;
5371
5378
  }
5372
- if (hasFixedt) {
5379
+ if (hasFixed) {
5373
5380
  storeData.fixedData = fixedData;
5374
5381
  }
5375
5382
  if (hasVisible) {
@@ -7315,22 +7322,21 @@ export default defineComponent({
7315
7322
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
7316
7323
  }
7317
7324
  },
7318
- handleRowDragDragendEvent(evnt) {
7325
+ handleRowDragSwapEvent(evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
7319
7326
  const { treeConfig, dragConfig } = props;
7320
7327
  const rowDragOpts = computeRowDragOpts.value;
7321
- const { fullAllDataRowIdData, prevDragToChild } = internalData;
7328
+ const { fullAllDataRowIdData } = internalData;
7322
7329
  const { isPeerDrag, isCrossDrag, isSelfToChildDrag, dragEndMethod } = rowDragOpts;
7323
7330
  const treeOpts = computeTreeOpts.value;
7324
7331
  const { transform, rowField, mapChildrenField, parentField } = treeOpts;
7325
7332
  const childrenField = treeOpts.children || treeOpts.childrenField;
7326
- const { dragRow } = reactData;
7327
- const { afterFullData, tableFullData, prevDragRow, prevDragPos } = internalData;
7333
+ const { afterFullData, tableFullData } = internalData;
7328
7334
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
7329
7335
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
7330
7336
  if (prevDragRow && dragRow) {
7331
7337
  // 判断是否有拖动
7332
7338
  if (prevDragRow !== dragRow) {
7333
- Promise.resolve(dEndMethod
7339
+ return Promise.resolve(dEndMethod
7334
7340
  ? dEndMethod({
7335
7341
  oldRow: dragRow,
7336
7342
  newRow: prevDragRow,
@@ -7481,6 +7487,34 @@ export default defineComponent({
7481
7487
  });
7482
7488
  }
7483
7489
  }
7490
+ return Promise.resolve();
7491
+ },
7492
+ handleRowDragDragendEvent(evnt) {
7493
+ const { treeConfig } = props;
7494
+ const { fullAllDataRowIdData, prevDragToChild } = internalData;
7495
+ const { dragRow } = reactData;
7496
+ const treeOpts = computeTreeOpts.value;
7497
+ const { lazy } = treeOpts;
7498
+ const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
7499
+ const { prevDragRow, prevDragPos } = internalData;
7500
+ if (treeConfig && prevDragToChild) {
7501
+ // 懒加载
7502
+ if (lazy) {
7503
+ const newRowid = getRowid($xeTable, prevDragRow);
7504
+ const rowRest = fullAllDataRowIdData[newRowid];
7505
+ if (prevDragRow[hasChildField]) {
7506
+ if (rowRest && rowRest.treeLoaded) {
7507
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
7508
+ }
7509
+ }
7510
+ else {
7511
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
7512
+ }
7513
+ }
7514
+ }
7515
+ else {
7516
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
7517
+ }
7484
7518
  hideDropTip();
7485
7519
  clearRowDropOrigin();
7486
7520
  internalData.prevDragToChild = false;
@@ -7495,7 +7529,8 @@ export default defineComponent({
7495
7529
  const { fullAllDataRowIdData } = internalData;
7496
7530
  const { dragRow } = reactData;
7497
7531
  const treeOpts = computeTreeOpts.value;
7498
- const { transform, parentField } = treeOpts;
7532
+ const { lazy, transform, parentField } = treeOpts;
7533
+ const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
7499
7534
  const rowDragOpts = computeRowDragOpts.value;
7500
7535
  const { isPeerDrag, isCrossDrag, isToChildDrag } = rowDragOpts;
7501
7536
  if (!dragRow) {
@@ -7508,18 +7543,21 @@ export default defineComponent({
7508
7543
  const rest = fullAllDataRowIdData[rowid];
7509
7544
  if (rest) {
7510
7545
  const row = rest.row;
7546
+ const rowid = getRowid($xeTable, row);
7547
+ const rowRest = fullAllDataRowIdData[rowid];
7511
7548
  evnt.preventDefault();
7512
7549
  const { dragRow } = reactData;
7513
7550
  const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
7514
7551
  const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
7552
+ internalData.prevDragToChild = !!(treeConfig && transform && (isCrossDrag && isToChildDrag) && hasCtrlKey);
7553
+ internalData.prevDragRow = row;
7554
+ internalData.prevDragPos = dragPos;
7515
7555
  if ($xeTable.eqRow(dragRow, row) ||
7556
+ (hasCtrlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
7516
7557
  (!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level))) {
7517
7558
  showDropTip(evnt, trEl, null, false, dragPos);
7518
7559
  return;
7519
7560
  }
7520
- internalData.prevDragToChild = !!(treeConfig && transform && (isCrossDrag && isToChildDrag) && hasCtrlKey);
7521
- internalData.prevDragRow = row;
7522
- internalData.prevDragPos = dragPos;
7523
7561
  showDropTip(evnt, trEl, null, true, dragPos);
7524
7562
  dispatchEvent('row-dragover', {
7525
7563
  oldRow: dragRow,
@@ -7762,15 +7800,15 @@ export default defineComponent({
7762
7800
  const { clientX } = evnt;
7763
7801
  const offsetX = clientX - thEl.getBoundingClientRect().x;
7764
7802
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
7803
+ internalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && hasCtrlKey);
7804
+ internalData.prevDragCol = column;
7805
+ internalData.prevDragPos = dragPos;
7765
7806
  if (column.fixed ||
7766
7807
  (dragCol && dragCol.id === column.id) ||
7767
7808
  (!isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.parentId))) {
7768
7809
  showDropTip(evnt, null, thEl, false, dragPos);
7769
7810
  return;
7770
7811
  }
7771
- internalData.prevDragToChild = !!((isCrossDrag && isToChildDrag) && hasCtrlKey);
7772
- internalData.prevDragCol = column;
7773
- internalData.prevDragPos = dragPos;
7774
7812
  showDropTip(evnt, null, thEl, true, dragPos);
7775
7813
  dispatchEvent('column-dragover', {
7776
7814
  oldColumn: dragCol,
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.10.1";
3
+ export const version = "4.10.2";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.10.1"}`;
3
+ const version = `table v${"4.10.2"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.10.1";
3141
+ const version = "4.10.2";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3558,7 +3558,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3558
3558
  const {
3559
3559
  log: log_log
3560
3560
  } = core_.VxeUI;
3561
- const log_version = `table v${"4.10.1"}`;
3561
+ const log_version = `table v${"4.10.2"}`;
3562
3562
  const warnLog = log_log.create('warn', log_version);
3563
3563
  const errLog = log_log.create('error', log_version);
3564
3564
  ;// ./packages/table/src/columnInfo.ts
@@ -5062,6 +5062,7 @@ const Cell = {
5062
5062
  $table.triggerTreeExpandEvent(evnt, params);
5063
5063
  };
5064
5064
  }
5065
+ console.log(row.name, hasChild);
5065
5066
  return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
5066
5067
  class: ['vxe-cell--tree-node', {
5067
5068
  'is--active': isActive
@@ -5069,7 +5070,7 @@ const Cell = {
5069
5070
  style: {
5070
5071
  paddingLeft: `${level * indent}px`
5071
5072
  }
5072
- }, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasLazyChilds : hasChild) ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
5073
+ }, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
5073
5074
  class: 'vxe-tree--btn-wrapper',
5074
5075
  ...ons
5075
5076
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
@@ -11599,6 +11600,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11599
11600
  isCrossDrag,
11600
11601
  isSelfToChildDrag
11601
11602
  } = columnDragOpts;
11603
+ const customOpts = computeCustomOpts.value;
11604
+ const {
11605
+ storage
11606
+ } = customOpts;
11602
11607
  const rowOpts = computeRowOpts.value;
11603
11608
  const isGroup = collectColumn.some(hasChildrenList);
11604
11609
  let isAllOverflow = !!props.showOverflow;
@@ -11632,8 +11637,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11632
11637
  }
11633
11638
  fullColumnFieldData[field] = rest;
11634
11639
  } else {
11635
- if (isCrossDrag || isSelfToChildDrag) {
11636
- errLog('vxe.error.emptyProp', ['column.field']);
11640
+ if (storage || isCrossDrag || isSelfToChildDrag) {
11641
+ errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
11637
11642
  }
11638
11643
  }
11639
11644
  if (!hasFixed && fixed) {
@@ -13181,36 +13186,39 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13181
13186
  const {
13182
13187
  fullAllDataRowIdData
13183
13188
  } = internalData;
13184
- const {
13185
- rowExpandLazyLoadedMaps
13186
- } = reactData;
13189
+ const rExpandLazyLoadedMaps = {
13190
+ ...reactData.rowExpandLazyLoadedMaps
13191
+ };
13187
13192
  const rowid = getRowid($xeTable, row);
13188
13193
  const rowRest = fullAllDataRowIdData[rowid];
13189
- rowExpandLazyLoadedMaps[rowid] = row;
13194
+ rExpandLazyLoadedMaps[rowid] = row;
13195
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
13190
13196
  loadMethod({
13191
13197
  $table: $xeTable,
13192
13198
  row,
13193
13199
  rowIndex: tableMethods.getRowIndex(row),
13194
13200
  $rowIndex: tableMethods.getVMRowIndex(row)
13195
13201
  }).then(() => {
13196
- const {
13197
- rowExpandedMaps
13198
- } = reactData;
13202
+ const rExpandedMaps = {
13203
+ ...reactData.rowExpandedMaps
13204
+ };
13199
13205
  if (rowRest) {
13200
13206
  rowRest.expandLoaded = true;
13201
13207
  }
13202
- rowExpandedMaps[rowid] = row;
13208
+ rExpandedMaps[rowid] = row;
13209
+ reactData.rowExpandedMaps = rExpandedMaps;
13203
13210
  }).catch(() => {
13204
13211
  if (rowRest) {
13205
13212
  rowRest.expandLoaded = false;
13206
13213
  }
13207
13214
  }).finally(() => {
13208
- const {
13209
- rowExpandLazyLoadedMaps
13210
- } = reactData;
13211
- if (rowExpandLazyLoadedMaps[rowid]) {
13212
- delete rowExpandLazyLoadedMaps[rowid];
13215
+ const rExpandLazyLoadedMaps = {
13216
+ ...reactData.rowExpandLazyLoadedMaps
13217
+ };
13218
+ if (rExpandLazyLoadedMaps[rowid]) {
13219
+ delete rExpandLazyLoadedMaps[rowid];
13213
13220
  }
13221
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
13214
13222
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => tableMethods.recalculate()).then(() => resolve());
13215
13223
  });
13216
13224
  } else {
@@ -15893,9 +15901,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15893
15901
  return rowRest && !!rowRest.expandLoaded;
15894
15902
  },
15895
15903
  clearRowExpandLoaded(row) {
15896
- const {
15897
- rowExpandLazyLoadedMaps
15898
- } = reactData;
15904
+ const rExpandLazyLoadedMaps = {
15905
+ ...reactData.rowExpandLazyLoadedMaps
15906
+ };
15899
15907
  const {
15900
15908
  fullAllDataRowIdData
15901
15909
  } = internalData;
@@ -15907,8 +15915,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
15907
15915
  const rowRest = fullAllDataRowIdData[rowid];
15908
15916
  if (lazy && rowRest) {
15909
15917
  rowRest.expandLoaded = false;
15910
- delete rowExpandLazyLoadedMaps[rowid];
15918
+ delete rExpandLazyLoadedMaps[rowid];
15911
15919
  }
15920
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
15912
15921
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
15913
15922
  },
15914
15923
  /**
@@ -16115,9 +16124,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16115
16124
  return rowRest && !!rowRest.treeLoaded;
16116
16125
  },
16117
16126
  clearTreeExpandLoaded(rows) {
16118
- const {
16119
- treeExpandedMaps
16120
- } = reactData;
16127
+ const tExpandedMaps = {
16128
+ ...reactData.treeExpandedMaps
16129
+ };
16121
16130
  const {
16122
16131
  fullAllDataRowIdData
16123
16132
  } = internalData;
@@ -16134,12 +16143,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16134
16143
  const rowRest = fullAllDataRowIdData[rowid];
16135
16144
  if (rowRest) {
16136
16145
  rowRest.treeLoaded = false;
16137
- if (treeExpandedMaps[rowid]) {
16138
- delete treeExpandedMaps[rowid];
16146
+ if (tExpandedMaps[rowid]) {
16147
+ delete tExpandedMaps[rowid];
16139
16148
  }
16140
16149
  }
16141
16150
  });
16142
16151
  }
16152
+ reactData.treeExpandedMaps = tExpandedMaps;
16143
16153
  if (transform) {
16144
16154
  handleVirtualTreeToList();
16145
16155
  return tablePrivateMethods.handleTableData();
@@ -16628,7 +16638,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16628
16638
  }
16629
16639
  let hasResizable = 0;
16630
16640
  let hasSort = 0;
16631
- let hasFixedt = 0;
16641
+ let hasFixed = 0;
16632
16642
  let hasVisible = 0;
16633
16643
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
16634
16644
  // 只支持一级
@@ -16643,7 +16653,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16643
16653
  if (column.fixed !== column.defaultFixed) {
16644
16654
  const colKey = column.getKey();
16645
16655
  if (colKey) {
16646
- hasFixedt = 1;
16656
+ hasFixed = 1;
16647
16657
  fixedData[colKey] = column.fixed;
16648
16658
  }
16649
16659
  }
@@ -16679,7 +16689,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
16679
16689
  if (hasSort) {
16680
16690
  storeData.sortData = sortData;
16681
16691
  }
16682
- if (hasFixedt) {
16692
+ if (hasFixed) {
16683
16693
  storeData.fixedData = fixedData;
16684
16694
  }
16685
16695
  if (hasVisible) {
@@ -18963,15 +18973,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
18963
18973
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
18964
18974
  }
18965
18975
  },
18966
- handleRowDragDragendEvent(evnt) {
18976
+ handleRowDragSwapEvent(evnt, isSyncRow, dragRow, prevDragRow, prevDragPos, prevDragToChild) {
18967
18977
  const {
18968
18978
  treeConfig,
18969
18979
  dragConfig
18970
18980
  } = props;
18971
18981
  const rowDragOpts = computeRowDragOpts.value;
18972
18982
  const {
18973
- fullAllDataRowIdData,
18974
- prevDragToChild
18983
+ fullAllDataRowIdData
18975
18984
  } = internalData;
18976
18985
  const {
18977
18986
  isPeerDrag,
@@ -18987,21 +18996,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
18987
18996
  parentField
18988
18997
  } = treeOpts;
18989
18998
  const childrenField = treeOpts.children || treeOpts.childrenField;
18990
- const {
18991
- dragRow
18992
- } = reactData;
18993
18999
  const {
18994
19000
  afterFullData,
18995
- tableFullData,
18996
- prevDragRow,
18997
- prevDragPos
19001
+ tableFullData
18998
19002
  } = internalData;
18999
19003
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
19000
19004
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
19001
19005
  if (prevDragRow && dragRow) {
19002
19006
  // 判断是否有拖动
19003
19007
  if (prevDragRow !== dragRow) {
19004
- Promise.resolve(dEndMethod ? dEndMethod({
19008
+ return Promise.resolve(dEndMethod ? dEndMethod({
19005
19009
  oldRow: dragRow,
19006
19010
  newRow: prevDragRow,
19007
19011
  dragPos: prevDragPos,
@@ -19152,6 +19156,44 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
19152
19156
  }).catch(() => {});
19153
19157
  }
19154
19158
  }
19159
+ return Promise.resolve();
19160
+ },
19161
+ handleRowDragDragendEvent(evnt) {
19162
+ const {
19163
+ treeConfig
19164
+ } = props;
19165
+ const {
19166
+ fullAllDataRowIdData,
19167
+ prevDragToChild
19168
+ } = internalData;
19169
+ const {
19170
+ dragRow
19171
+ } = reactData;
19172
+ const treeOpts = computeTreeOpts.value;
19173
+ const {
19174
+ lazy
19175
+ } = treeOpts;
19176
+ const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
19177
+ const {
19178
+ prevDragRow,
19179
+ prevDragPos
19180
+ } = internalData;
19181
+ if (treeConfig && prevDragToChild) {
19182
+ // 懒加载
19183
+ if (lazy) {
19184
+ const newRowid = getRowid($xeTable, prevDragRow);
19185
+ const rowRest = fullAllDataRowIdData[newRowid];
19186
+ if (prevDragRow[hasChildField]) {
19187
+ if (rowRest && rowRest.treeLoaded) {
19188
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
19189
+ }
19190
+ } else {
19191
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
19192
+ }
19193
+ }
19194
+ } else {
19195
+ $xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
19196
+ }
19155
19197
  hideDropTip();
19156
19198
  clearRowDropOrigin();
19157
19199
  internalData.prevDragToChild = false;
@@ -19173,9 +19215,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
19173
19215
  } = reactData;
19174
19216
  const treeOpts = computeTreeOpts.value;
19175
19217
  const {
19218
+ lazy,
19176
19219
  transform,
19177
19220
  parentField
19178
19221
  } = treeOpts;
19222
+ const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
19179
19223
  const rowDragOpts = computeRowDragOpts.value;
19180
19224
  const {
19181
19225
  isPeerDrag,
@@ -19192,19 +19236,21 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
19192
19236
  const rest = fullAllDataRowIdData[rowid];
19193
19237
  if (rest) {
19194
19238
  const row = rest.row;
19239
+ const rowid = getRowid($xeTable, row);
19240
+ const rowRest = fullAllDataRowIdData[rowid];
19195
19241
  evnt.preventDefault();
19196
19242
  const {
19197
19243
  dragRow
19198
19244
  } = reactData;
19199
19245
  const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
19200
19246
  const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
19201
- if ($xeTable.eqRow(dragRow, row) || !isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level)) {
19202
- showDropTip(evnt, trEl, null, false, dragPos);
19203
- return;
19204
- }
19205
19247
  internalData.prevDragToChild = !!(treeConfig && transform && isCrossDrag && isToChildDrag && hasCtrlKey);
19206
19248
  internalData.prevDragRow = row;
19207
19249
  internalData.prevDragPos = dragPos;
19250
+ if ($xeTable.eqRow(dragRow, row) || hasCtrlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded || !isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level)) {
19251
+ showDropTip(evnt, trEl, null, false, dragPos);
19252
+ return;
19253
+ }
19208
19254
  showDropTip(evnt, trEl, null, true, dragPos);
19209
19255
  dispatchEvent('row-dragover', {
19210
19256
  oldRow: dragRow,
@@ -19479,13 +19525,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
19479
19525
  } = evnt;
19480
19526
  const offsetX = clientX - thEl.getBoundingClientRect().x;
19481
19527
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
19528
+ internalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && hasCtrlKey);
19529
+ internalData.prevDragCol = column;
19530
+ internalData.prevDragPos = dragPos;
19482
19531
  if (column.fixed || dragCol && dragCol.id === column.id || !isCrossDrag && (isPeerDrag ? dragCol.parentId !== column.parentId : column.parentId)) {
19483
19532
  showDropTip(evnt, null, thEl, false, dragPos);
19484
19533
  return;
19485
19534
  }
19486
- internalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && hasCtrlKey);
19487
- internalData.prevDragCol = column;
19488
- internalData.prevDragPos = dragPos;
19489
19535
  showDropTip(evnt, null, thEl, true, dragPos);
19490
19536
  dispatchEvent('column-dragover', {
19491
19537
  oldColumn: dragCol,
@@ -25785,10 +25831,10 @@ core_.VxeUI.hooks.add('tableCustomModule', {
25785
25831
  allowFixed,
25786
25832
  allowResizable
25787
25833
  } = customOpts;
25788
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parent) => {
25789
- if (parent) {
25834
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parentColumn) => {
25835
+ if (parentColumn) {
25790
25836
  // 更新子列信息
25791
- column.fixed = parent.fixed;
25837
+ column.fixed = parentColumn.fixed;
25792
25838
  } else {
25793
25839
  if (allowSort) {
25794
25840
  const sortIndex = index + 1;