vxe-table 3.11.26 → 3.11.27-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +3 -3
  4. package/es/locale/lang/de-DE.js +3 -3
  5. package/es/locale/lang/en-US.js +3 -3
  6. package/es/locale/lang/es-ES.js +3 -3
  7. package/es/locale/lang/fr-FR.js +3 -3
  8. package/es/locale/lang/hu-HU.js +3 -3
  9. package/es/locale/lang/hy-AM.js +3 -3
  10. package/es/locale/lang/ja-JP.js +3 -3
  11. package/es/locale/lang/ko-KR.js +3 -3
  12. package/es/locale/lang/nb-NO.js +3 -3
  13. package/es/locale/lang/pt-BR.js +3 -3
  14. package/es/locale/lang/ru-RU.js +3 -3
  15. package/es/locale/lang/ug-CN.js +3 -3
  16. package/es/locale/lang/uk-UA.js +3 -3
  17. package/es/locale/lang/vi-VN.js +3 -3
  18. package/es/locale/lang/zh-CHT.js +3 -3
  19. package/es/locale/lang/zh-CN.js +3 -3
  20. package/es/style.css +1 -1
  21. package/es/style.min.css +1 -1
  22. package/es/table/module/custom/mixin.js +2 -0
  23. package/es/table/module/custom/panel.js +433 -231
  24. package/es/table/src/body.js +2 -2
  25. package/es/table/src/cell.js +2 -2
  26. package/es/table/src/column.js +10 -8
  27. package/es/table/src/group.js +37 -6
  28. package/es/table/src/methods.js +167 -73
  29. package/es/table/src/table.js +1 -1
  30. package/es/table/src/util.js +0 -1
  31. package/es/table/style.css +106 -37
  32. package/es/table/style.min.css +1 -1
  33. package/es/ui/index.js +1 -1
  34. package/es/ui/src/dom.js +1 -0
  35. package/es/ui/src/log.js +1 -1
  36. package/es/vxe-table/style.css +106 -37
  37. package/es/vxe-table/style.min.css +1 -1
  38. package/lib/index.css +1 -1
  39. package/lib/index.min.css +1 -1
  40. package/lib/index.umd.js +618 -260
  41. package/lib/index.umd.min.js +1 -1
  42. package/lib/locale/lang/ar-EG.js +3 -3
  43. package/lib/locale/lang/ar-EG.min.js +1 -1
  44. package/lib/locale/lang/de-DE.js +3 -3
  45. package/lib/locale/lang/de-DE.min.js +1 -1
  46. package/lib/locale/lang/en-US.js +3 -3
  47. package/lib/locale/lang/en-US.min.js +1 -1
  48. package/lib/locale/lang/en-US.umd.js +3 -3
  49. package/lib/locale/lang/es-ES.js +3 -3
  50. package/lib/locale/lang/es-ES.min.js +1 -1
  51. package/lib/locale/lang/es-ES.umd.js +3 -3
  52. package/lib/locale/lang/fr-FR.js +3 -3
  53. package/lib/locale/lang/fr-FR.min.js +1 -1
  54. package/lib/locale/lang/hu-HU.js +3 -3
  55. package/lib/locale/lang/hu-HU.min.js +1 -1
  56. package/lib/locale/lang/hu-HU.umd.js +3 -3
  57. package/lib/locale/lang/hy-AM.js +3 -3
  58. package/lib/locale/lang/hy-AM.min.js +1 -1
  59. package/lib/locale/lang/ja-JP.js +3 -3
  60. package/lib/locale/lang/ja-JP.min.js +1 -1
  61. package/lib/locale/lang/ja-JP.umd.js +3 -3
  62. package/lib/locale/lang/ko-KR.js +3 -3
  63. package/lib/locale/lang/ko-KR.min.js +1 -1
  64. package/lib/locale/lang/ko-KR.umd.js +3 -3
  65. package/lib/locale/lang/nb-NO.js +3 -3
  66. package/lib/locale/lang/nb-NO.min.js +1 -1
  67. package/lib/locale/lang/pt-BR.js +3 -3
  68. package/lib/locale/lang/pt-BR.min.js +1 -1
  69. package/lib/locale/lang/pt-BR.umd.js +3 -3
  70. package/lib/locale/lang/ru-RU.js +3 -3
  71. package/lib/locale/lang/ru-RU.min.js +1 -1
  72. package/lib/locale/lang/ru-RU.umd.js +3 -3
  73. package/lib/locale/lang/ug-CN.js +3 -3
  74. package/lib/locale/lang/ug-CN.min.js +1 -1
  75. package/lib/locale/lang/uk-UA.js +3 -3
  76. package/lib/locale/lang/uk-UA.min.js +1 -1
  77. package/lib/locale/lang/uk-UA.umd.js +3 -3
  78. package/lib/locale/lang/vi-VN.js +3 -3
  79. package/lib/locale/lang/vi-VN.min.js +1 -1
  80. package/lib/locale/lang/zh-CHT.js +3 -3
  81. package/lib/locale/lang/zh-CHT.min.js +1 -1
  82. package/lib/locale/lang/zh-CHT.umd.js +3 -3
  83. package/lib/locale/lang/zh-CN.js +3 -3
  84. package/lib/locale/lang/zh-CN.min.js +1 -1
  85. package/lib/locale/lang/zh-CN.umd.js +3 -3
  86. package/lib/style.css +1 -1
  87. package/lib/style.min.css +1 -1
  88. package/lib/table/module/custom/mixin.js +2 -0
  89. package/lib/table/module/custom/mixin.min.js +1 -1
  90. package/lib/table/module/custom/panel.js +369 -156
  91. package/lib/table/module/custom/panel.min.js +1 -1
  92. package/lib/table/src/body.js +2 -2
  93. package/lib/table/src/body.min.js +1 -1
  94. package/lib/table/src/cell.js +2 -1
  95. package/lib/table/src/cell.min.js +1 -1
  96. package/lib/table/src/column.js +11 -9
  97. package/lib/table/src/column.min.js +1 -1
  98. package/lib/table/src/group.js +39 -6
  99. package/lib/table/src/group.min.js +1 -1
  100. package/lib/table/src/methods.js +181 -74
  101. package/lib/table/src/methods.min.js +1 -1
  102. package/lib/table/src/table.js +1 -1
  103. package/lib/table/src/table.min.js +1 -1
  104. package/lib/table/src/util.js +0 -1
  105. package/lib/table/src/util.min.js +1 -1
  106. package/lib/table/style/style.css +106 -37
  107. package/lib/table/style/style.min.css +1 -1
  108. package/lib/ui/index.js +1 -1
  109. package/lib/ui/index.min.js +1 -1
  110. package/lib/ui/src/dom.js +2 -0
  111. package/lib/ui/src/dom.min.js +1 -1
  112. package/lib/ui/src/log.js +1 -1
  113. package/lib/ui/src/log.min.js +1 -1
  114. package/lib/vxe-table/style/style.css +106 -37
  115. package/lib/vxe-table/style/style.min.css +1 -1
  116. package/package.json +2 -2
  117. package/packages/locale/lang/ar-EG.ts +3 -3
  118. package/packages/locale/lang/de-DE.ts +3 -3
  119. package/packages/locale/lang/en-US.ts +3 -3
  120. package/packages/locale/lang/es-ES.ts +3 -3
  121. package/packages/locale/lang/fr-FR.ts +3 -3
  122. package/packages/locale/lang/hu-HU.ts +3 -3
  123. package/packages/locale/lang/hy-AM.ts +3 -3
  124. package/packages/locale/lang/ja-JP.ts +3 -3
  125. package/packages/locale/lang/ko-KR.ts +3 -3
  126. package/packages/locale/lang/nb-NO.ts +3 -3
  127. package/packages/locale/lang/pt-BR.ts +3 -3
  128. package/packages/locale/lang/ru-RU.ts +3 -3
  129. package/packages/locale/lang/ug-CN.ts +3 -3
  130. package/packages/locale/lang/uk-UA.ts +3 -3
  131. package/packages/locale/lang/vi-VN.ts +3 -3
  132. package/packages/locale/lang/zh-CHT.ts +3 -3
  133. package/packages/locale/lang/zh-CN.ts +3 -3
  134. package/packages/table/module/custom/mixin.ts +2 -0
  135. package/packages/table/module/custom/panel.ts +458 -234
  136. package/packages/table/src/body.ts +2 -2
  137. package/packages/table/src/cell.ts +2 -2
  138. package/packages/table/src/column.ts +10 -8
  139. package/packages/table/src/group.ts +40 -6
  140. package/packages/table/src/methods.ts +182 -86
  141. package/packages/table/src/table.ts +1 -1
  142. package/packages/table/src/util.ts +0 -1
  143. package/packages/ui/src/dom.ts +2 -0
  144. package/styles/components/table-module/custom.scss +92 -12
  145. package/styles/components/table.scss +5 -0
  146. /package/es/{iconfont.1733885890565.ttf → iconfont.1734000397391.ttf} +0 -0
  147. /package/es/{iconfont.1733885890565.woff → iconfont.1734000397391.woff} +0 -0
  148. /package/es/{iconfont.1733885890565.woff2 → iconfont.1734000397391.woff2} +0 -0
  149. /package/lib/{iconfont.1733885890565.ttf → iconfont.1734000397391.ttf} +0 -0
  150. /package/lib/{iconfont.1733885890565.woff → iconfont.1734000397391.woff} +0 -0
  151. /package/lib/{iconfont.1733885890565.woff2 → iconfont.1734000397391.woff2} +0 -0
@@ -536,11 +536,18 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
536
536
  if (cdLineEl) {
537
537
  if (showLine) {
538
538
  const thRect = thEl.getBoundingClientRect();
539
+ const offsetTop = Math.max(0, thRect.y - wrapperRect.y);
539
540
  cdLineEl.style.display = 'block';
541
+ cdLineEl.style.top = `${offsetTop}px`;
540
542
  cdLineEl.style.left = `${Math.max(1, thRect.x - wrapperRect.x)}px`;
541
543
  cdLineEl.style.width = `${thRect.width}px`;
542
- cdLineEl.style.height = `${wrapperRect.height - scrollbarHeight}px`;
544
+ if (prevDragToChild) {
545
+ cdLineEl.style.height = `${thRect.height}px`;
546
+ } else {
547
+ cdLineEl.style.height = `${wrapperRect.height - offsetTop - scrollbarHeight}px`;
548
+ }
543
549
  cdLineEl.setAttribute('drag-pos', dragPos);
550
+ cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
544
551
  } else {
545
552
  cdLineEl.style.display = '';
546
553
  }
@@ -1100,12 +1107,12 @@ const Methods = {
1100
1107
  height: 0
1101
1108
  };
1102
1109
  }
1110
+ cacheItem.row = row;
1111
+ cacheItem.items = items;
1112
+ cacheItem.parent = parent;
1113
+ cacheItem.level = level;
1114
+ cacheItem.index = treeConfig && parent ? -1 : index;
1103
1115
  if (isSource) {
1104
- cacheItem.row = row;
1105
- cacheItem.items = items;
1106
- cacheItem.parent = parent;
1107
- cacheItem.level = level;
1108
- cacheItem.index = treeConfig && parent ? -1 : index;
1109
1116
  fullDataRowIdMaps[rowid] = cacheItem;
1110
1117
  }
1111
1118
  fullAllDataRowIdMaps[rowid] = cacheItem;
@@ -1220,18 +1227,26 @@ const Methods = {
1220
1227
  * 牺牲数据组装的耗时,用来换取使用过程中的流畅
1221
1228
  */
1222
1229
  cacheColumnMap() {
1230
+ const $xeTable = this;
1231
+ const props = $xeTable;
1232
+ const reactData = $xeTable;
1233
+ const internalData = $xeTable;
1223
1234
  const {
1224
1235
  tableFullColumn,
1225
- collectColumn,
1226
- fullColumnMap,
1227
- showOverflow,
1228
- columnOpts,
1229
- rowOpts
1230
- } = this;
1231
- const fullColumnIdData = this.fullColumnIdData = {};
1232
- const fullColumnFieldData = this.fullColumnFieldData = {};
1236
+ collectColumn
1237
+ } = internalData;
1238
+ const fullColumnIdData = internalData.fullColumnIdData = {};
1239
+ const fullColumnFieldData = internalData.fullColumnFieldData = {};
1240
+ const mouseOpts = $xeTable.computeMouseOpts;
1241
+ const columnOpts = $xeTable.computeColumnOpts;
1242
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
1243
+ const {
1244
+ isCrossDrag,
1245
+ isSelfToChildDrag
1246
+ } = columnDragOpts;
1247
+ const rowOpts = $xeTable.computeRowOpts;
1233
1248
  const isGroup = collectColumn.some(_utils.hasChildrenList);
1234
- let isAllOverflow = !!showOverflow;
1249
+ let isAllOverflow = !!props.showOverflow;
1235
1250
  let expandColumn;
1236
1251
  let treeNodeColumn;
1237
1252
  let checkboxColumn;
@@ -1247,6 +1262,8 @@ const Methods = {
1247
1262
  treeNode
1248
1263
  } = column;
1249
1264
  const rest = {
1265
+ $index: -1,
1266
+ _index: -1,
1250
1267
  column,
1251
1268
  colid,
1252
1269
  index,
@@ -1255,12 +1272,14 @@ const Methods = {
1255
1272
  width: 0
1256
1273
  };
1257
1274
  if (field) {
1258
- if (process.env.NODE_ENV === 'development') {
1259
- if (fullColumnFieldData[field]) {
1260
- (0, _log.warnLog)('vxe.error.colRepet', ['field', field]);
1261
- }
1275
+ if (fullColumnFieldData[field]) {
1276
+ (0, _log.errLog)('vxe.error.colRepet', ['field', field]);
1262
1277
  }
1263
1278
  fullColumnFieldData[field] = rest;
1279
+ } else {
1280
+ if (isCrossDrag || isSelfToChildDrag) {
1281
+ (0, _log.errLog)('vxe.error.emptyProp', ['column.field']);
1282
+ }
1264
1283
  }
1265
1284
  if (!hasFixed && fixed) {
1266
1285
  hasFixed = fixed;
@@ -1304,27 +1323,6 @@ const Methods = {
1304
1323
  }
1305
1324
  }
1306
1325
  }
1307
- if (process.env.NODE_ENV === 'development') {
1308
- if (this.showOverflow && column.showOverflow === false) {
1309
- (0, _log.warnLog)('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`]);
1310
- }
1311
- if (this.showHeaderOverflow && column.showHeaderOverflow === false) {
1312
- (0, _log.warnLog)('vxe.error.errConflicts', [`table.show-header-overflow=${this.showHeaderOverflow}`, `column.show-header-overflow=${column.showHeaderOverflow}`]);
1313
- }
1314
- if (this.showFooterOverflow && column.showFooterOverflow === false) {
1315
- (0, _log.warnLog)('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`]);
1316
- }
1317
- }
1318
- if (process.env.NODE_ENV === 'development') {
1319
- if (htmlColumn) {
1320
- if (!columnOpts.useKey) {
1321
- (0, _log.errLog)('vxe.error.reqProp', ['column-config.useKey', 'column.type=html']);
1322
- }
1323
- if (!rowOpts.useKey) {
1324
- (0, _log.errLog)('vxe.error.reqProp', ['row-config.useKey', 'column.type=html']);
1325
- }
1326
- }
1327
- }
1328
1326
  if (isAllOverflow && column.showOverflow === false) {
1329
1327
  isAllOverflow = false;
1330
1328
  }
@@ -1332,9 +1330,7 @@ const Methods = {
1332
1330
  (0, _log.errLog)('vxe.error.colRepet', ['colId', colid]);
1333
1331
  }
1334
1332
  fullColumnIdData[colid] = rest;
1335
- fullColumnMap.set(column, rest);
1336
1333
  };
1337
- fullColumnMap.clear();
1338
1334
  if (isGroup) {
1339
1335
  _xeUtils.default.eachTree(collectColumn, (column, index, items, path, parent, nodes) => {
1340
1336
  column.level = nodes.length;
@@ -1344,14 +1340,24 @@ const Methods = {
1344
1340
  tableFullColumn.forEach(handleFunc);
1345
1341
  }
1346
1342
  if (process.env.NODE_ENV === 'development') {
1347
- if (expandColumn && this.mouseOpts.area) {
1343
+ if (expandColumn && mouseOpts.area) {
1348
1344
  (0, _log.errLog)('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
1349
1345
  }
1350
1346
  }
1351
- this.isGroup = isGroup;
1352
- this.treeNodeColumn = treeNodeColumn;
1353
- this.expandColumn = expandColumn;
1354
- this.isAllOverflow = isAllOverflow;
1347
+ if (process.env.NODE_ENV === 'development') {
1348
+ if (htmlColumn) {
1349
+ if (!columnOpts.useKey) {
1350
+ (0, _log.errLog)('vxe.error.reqProp', ['column-config.useKey & column.type=html']);
1351
+ }
1352
+ if (!rowOpts.useKey) {
1353
+ (0, _log.errLog)('vxe.error.reqProp', ['row-config.useKey & column.type=html']);
1354
+ }
1355
+ }
1356
+ }
1357
+ reactData.isGroup = isGroup;
1358
+ reactData.treeNodeColumn = treeNodeColumn;
1359
+ reactData.expandColumn = expandColumn;
1360
+ reactData.isAllOverflow = isAllOverflow;
1355
1361
  },
1356
1362
  /**
1357
1363
  * 根据 tr 元素获取对应的 row 信息
@@ -3160,6 +3166,10 @@ const Methods = {
3160
3166
  const {
3161
3167
  rceTimeout
3162
3168
  } = internalData;
3169
+ const el = $xeTable.$refs.refElem;
3170
+ if (!el || !el.clientWidth) {
3171
+ $xeTable.autoCellWidth();
3172
+ }
3163
3173
  if (rceTimeout) {
3164
3174
  clearTimeout(rceTimeout);
3165
3175
  $xeTable.$nextTick(() => {
@@ -6014,8 +6024,9 @@ const Methods = {
6014
6024
  * 行拖拽
6015
6025
  */
6016
6026
  handleRowDragDragstartEvent(evnt) {
6017
- const img = new Image();
6018
6027
  if (evnt.dataTransfer) {
6028
+ const img = new Image();
6029
+ img.src = _dom.tpImg;
6019
6030
  evnt.dataTransfer.setDragImage(img, 0, 0);
6020
6031
  }
6021
6032
  },
@@ -6099,8 +6110,8 @@ const Methods = {
6099
6110
  return;
6100
6111
  }
6101
6112
  if (oldAllMaps[newRowid]) {
6113
+ isSelfToChildStatus = true;
6102
6114
  if (!isSelfToChildDrag) {
6103
- isSelfToChildStatus = true;
6104
6115
  if (_ui.VxeUI.modal) {
6105
6116
  _ui.VxeUI.modal.message({
6106
6117
  status: 'error',
@@ -6176,7 +6187,7 @@ const Methods = {
6176
6187
  }
6177
6188
  reactData.isDragRowMove = true;
6178
6189
  $xeTable.handleTableData(treeConfig && transform);
6179
- $xeTable.cacheRowMap(true);
6190
+ $xeTable.cacheRowMap();
6180
6191
  $xeTable.updateScrollYStatus();
6181
6192
  if (!(treeConfig && transform)) {
6182
6193
  $xeTable.updateAfterDataIndex();
@@ -6204,6 +6215,7 @@ const Methods = {
6204
6215
  }
6205
6216
  hideDropTip($xeTable);
6206
6217
  clearRowDropOrigin($xeTable);
6218
+ internalData.prevDragToChild = false;
6207
6219
  reactData.dragRow = null;
6208
6220
  reactData.dragCol = null;
6209
6221
  setTimeout(() => {
@@ -6269,7 +6281,6 @@ const Methods = {
6269
6281
  const $xeTable = this;
6270
6282
  const props = $xeTable;
6271
6283
  const reactData = $xeTable;
6272
- evnt.stopPropagation();
6273
6284
  const {
6274
6285
  dragConfig
6275
6286
  } = props;
@@ -6313,8 +6324,9 @@ const Methods = {
6313
6324
  * 列拖拽
6314
6325
  */
6315
6326
  handleHeaderCellDragDragstartEvent(evnt) {
6316
- const img = new Image();
6317
6327
  if (evnt.dataTransfer) {
6328
+ const img = new Image();
6329
+ img.src = _dom.tpImg;
6318
6330
  evnt.dataTransfer.setDragImage(img, 0, 0);
6319
6331
  }
6320
6332
  },
@@ -6328,6 +6340,9 @@ const Methods = {
6328
6340
  } = props;
6329
6341
  const columnDragOpts = $xeTable.computeColumnDragOpts;
6330
6342
  const {
6343
+ isCrossDrag,
6344
+ isSelfToChildDrag,
6345
+ isToChildDrag,
6331
6346
  dragEndMethod
6332
6347
  } = columnDragOpts;
6333
6348
  const {
@@ -6336,38 +6351,126 @@ const Methods = {
6336
6351
  const {
6337
6352
  collectColumn,
6338
6353
  prevDragCol,
6339
- prevDragPos
6354
+ prevDragPos,
6355
+ prevDragToChild
6340
6356
  } = internalData;
6341
6357
  const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
6342
6358
  if (prevDragCol && dragCol) {
6343
6359
  // 判断是否有拖动
6344
6360
  if (prevDragCol !== dragCol) {
6361
+ const oldColumn = dragCol;
6362
+ const newColumn = prevDragCol;
6345
6363
  Promise.resolve(dragEndMethod ? dragEndMethod({
6346
- oldColumn: dragCol,
6347
- newColumn: prevDragCol,
6364
+ oldColumn,
6365
+ newColumn,
6348
6366
  dragPos: prevDragPos,
6349
6367
  offsetIndex: dragOffsetIndex
6350
6368
  }) : true).then(status => {
6351
6369
  if (!status) {
6352
6370
  return;
6353
6371
  }
6372
+ let oafIndex = -1;
6373
+ let nafIndex = -1;
6374
+ const oldAllMaps = {};
6375
+ _xeUtils.default.eachTree([oldColumn], column => {
6376
+ oldAllMaps[column.id] = column;
6377
+ });
6378
+ let isSelfToChildStatus = false;
6379
+ if (oldColumn.parentId && newColumn.parentId) {
6380
+ // 子到子
6381
+ if (!isCrossDrag) {
6382
+ return;
6383
+ }
6384
+ if (oldAllMaps[newColumn.id]) {
6385
+ isSelfToChildStatus = true;
6386
+ if (!isSelfToChildDrag) {
6387
+ if (_ui.VxeUI.modal) {
6388
+ _ui.VxeUI.modal.message({
6389
+ status: 'error',
6390
+ content: getI18n('vxe.error.treeDragChild')
6391
+ });
6392
+ }
6393
+ return;
6394
+ }
6395
+ }
6396
+ } else if (oldColumn.parentId) {
6397
+ // 子到根
6398
+ if (!isCrossDrag) {
6399
+ return;
6400
+ }
6401
+ } else if (newColumn.parentId) {
6402
+ // 根到子
6403
+ if (!isCrossDrag) {
6404
+ return;
6405
+ }
6406
+ if (oldAllMaps[newColumn.id]) {
6407
+ isSelfToChildStatus = true;
6408
+ if (!isSelfToChildDrag) {
6409
+ if (_ui.VxeUI.modal) {
6410
+ _ui.VxeUI.modal.message({
6411
+ status: 'error',
6412
+ content: getI18n('vxe.error.treeDragChild')
6413
+ });
6414
+ }
6415
+ return;
6416
+ }
6417
+ }
6418
+ } else {
6419
+ // 根到根
6420
+ }
6421
+ const oldewMatchRest = _xeUtils.default.findTree(collectColumn, item => item.id === oldColumn.id);
6422
+ // 改变层级
6423
+ if (isSelfToChildStatus && isSelfToChildDrag) {
6424
+ if (oldewMatchRest) {
6425
+ const {
6426
+ items: oCols,
6427
+ index: oIndex
6428
+ } = oldewMatchRest;
6429
+ const childList = oldColumn.children || [];
6430
+ childList.forEach(column => {
6431
+ column.parentId = oldColumn.parentId;
6432
+ });
6433
+ oCols.splice(oIndex, 1, ...childList);
6434
+ oldColumn.children = [];
6435
+ }
6436
+ } else {
6437
+ if (oldewMatchRest) {
6438
+ const {
6439
+ items: oCols,
6440
+ index: oIndex,
6441
+ parent: oParent
6442
+ } = oldewMatchRest;
6443
+ oCols.splice(oIndex, 1);
6444
+ if (!oParent) {
6445
+ oafIndex = oIndex;
6446
+ }
6447
+ }
6448
+ }
6449
+ const newMatchRest = _xeUtils.default.findTree(collectColumn, item => item.id === newColumn.id);
6450
+ if (newMatchRest) {
6451
+ const {
6452
+ items: nCols,
6453
+ index: nIndex,
6454
+ parent: nParent
6455
+ } = newMatchRest;
6456
+ // 转子级
6457
+ if (isToChildDrag && prevDragToChild) {
6458
+ oldColumn.parentId = newColumn.id;
6459
+ newColumn.children = (newColumn.children || []).concat([oldColumn]);
6460
+ } else {
6461
+ oldColumn.parentId = newColumn.parentId;
6462
+ nCols.splice(nIndex + dragOffsetIndex, 0, oldColumn);
6463
+ }
6464
+ if (!nParent) {
6465
+ nafIndex = nIndex;
6466
+ }
6467
+ }
6354
6468
  _xeUtils.default.eachTree(collectColumn, (column, index, items, path, parent) => {
6355
6469
  if (!parent) {
6356
6470
  const sortIndex = index + 1;
6357
6471
  column.renderSortNumber = sortIndex;
6358
6472
  }
6359
6473
  });
6360
- const oafIndex = _xeUtils.default.findIndexOf(collectColumn, item => item.id === dragCol.id);
6361
- const nafIndex = _xeUtils.default.findIndexOf(collectColumn, item => item.id === prevDragCol.id) + dragOffsetIndex;
6362
- const newTargetCol = collectColumn[nafIndex];
6363
- if (newTargetCol) {
6364
- // 插入最后位置
6365
- dragCol.renderSortNumber = newTargetCol.renderSortNumber;
6366
- newTargetCol.renderSortNumber = dragCol.renderSortNumber + 0.5;
6367
- } else {
6368
- // 插入新位置
6369
- dragCol.renderSortNumber = collectColumn.length + 1.5;
6370
- }
6371
6474
  reactData.isDragColMove = true;
6372
6475
  if (mouseConfig) {
6373
6476
  if ($xeTable.clearSelected) {
@@ -6378,14 +6481,12 @@ const Methods = {
6378
6481
  $xeTable.clearCopyCellArea();
6379
6482
  }
6380
6483
  }
6381
- $xeTable.analyColumnWidth();
6382
- $xeTable.$nextTick().then(() => {
6484
+ $xeTable.refreshColumn(true).then(() => {
6383
6485
  $xeTable.updateCellAreas();
6384
- $xeTable.refreshColumn(true);
6385
6486
  });
6386
6487
  $xeTable.dispatchEvent('column-dragend', {
6387
- oldColumn: dragCol,
6388
- newColumn: prevDragCol,
6488
+ oldColumn,
6489
+ newColumn,
6389
6490
  dragPos: prevDragPos,
6390
6491
  offsetIndex: dragOffsetIndex,
6391
6492
  _index: {
@@ -6399,6 +6500,7 @@ const Methods = {
6399
6500
  }
6400
6501
  hideDropTip($xeTable);
6401
6502
  clearColDropOrigin($xeTable);
6503
+ internalData.prevDragToChild = false;
6402
6504
  reactData.dragRow = null;
6403
6505
  reactData.dragCol = null;
6404
6506
  setTimeout(() => {
@@ -6412,10 +6514,16 @@ const Methods = {
6412
6514
  const {
6413
6515
  dragCol
6414
6516
  } = reactData;
6517
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
6518
+ const {
6519
+ isToChildDrag,
6520
+ isCrossDrag
6521
+ } = columnDragOpts;
6415
6522
  if (!dragCol) {
6416
6523
  evnt.preventDefault();
6417
6524
  return;
6418
6525
  }
6526
+ const hasCtrlKey = evnt.ctrlKey;
6419
6527
  const thEl = evnt.currentTarget;
6420
6528
  const colid = thEl.getAttribute('colid');
6421
6529
  const column = $xeTable.getColumnById(colid);
@@ -6426,11 +6534,11 @@ const Methods = {
6426
6534
  } = reactData;
6427
6535
  const offsetX = evnt.clientX - thEl.getBoundingClientRect().x;
6428
6536
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
6429
- if (dragCol.id === column.id || column.parentId) {
6537
+ if (dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
6430
6538
  showDropTip($xeTable, evnt, null, thEl, false, dragPos);
6431
6539
  return;
6432
6540
  }
6433
- internalData.prevDragToChild = false;
6541
+ internalData.prevDragToChild = !!(isToChildDrag && hasCtrlKey);
6434
6542
  internalData.prevDragCol = column;
6435
6543
  internalData.prevDragPos = dragPos;
6436
6544
  showDropTip($xeTable, evnt, null, thEl, true, dragPos);
@@ -6445,7 +6553,6 @@ const Methods = {
6445
6553
  var _a;
6446
6554
  const $xeTable = this;
6447
6555
  const reactData = $xeTable;
6448
- evnt.stopPropagation();
6449
6556
  const columnDragOpts = $xeTable.computeColumnDragOpts;
6450
6557
  const {
6451
6558
  dragStartMethod