vxe-table 4.17.28 → 4.17.29
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.
- package/es/style.css +1 -1
- package/es/table/src/emits.js +3 -0
- package/es/table/src/table.js +201 -165
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +31 -30
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/table.js +28 -27
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/emits.ts +4 -0
- package/packages/table/src/table.ts +208 -170
- /package/es/{iconfont.1765353166500.ttf → iconfont.1765538995329.ttf} +0 -0
- /package/es/{iconfont.1765353166500.woff → iconfont.1765538995329.woff} +0 -0
- /package/es/{iconfont.1765353166500.woff2 → iconfont.1765538995329.woff2} +0 -0
- /package/lib/{iconfont.1765353166500.ttf → iconfont.1765538995329.ttf} +0 -0
- /package/lib/{iconfont.1765353166500.woff → iconfont.1765538995329.woff} +0 -0
- /package/lib/{iconfont.1765353166500.woff2 → iconfont.1765538995329.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -3614,7 +3614,8 @@ export default defineVxeComponent({
|
|
|
3614
3614
|
};
|
|
3615
3615
|
const initData = () => {
|
|
3616
3616
|
const { data } = props;
|
|
3617
|
-
|
|
3617
|
+
dispatchEvent('ready', {}, null);
|
|
3618
|
+
loadTableData(data || [], true, true).then(() => {
|
|
3618
3619
|
if (data && data.length) {
|
|
3619
3620
|
internalData.inited = true;
|
|
3620
3621
|
internalData.initStatus = true;
|
|
@@ -3632,10 +3633,10 @@ export default defineVxeComponent({
|
|
|
3632
3633
|
* 加载表格数据
|
|
3633
3634
|
* @param {Array} datas 数据
|
|
3634
3635
|
*/
|
|
3635
|
-
const loadTableData = (datas, isReset) => {
|
|
3636
|
+
const loadTableData = (datas, isReload, isReset) => {
|
|
3636
3637
|
const { keepSource, treeConfig, rowGroupConfig, aggregateConfig } = props;
|
|
3637
3638
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData;
|
|
3638
|
-
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
3639
|
+
const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
3639
3640
|
const rowOpts = computeRowOpts.value;
|
|
3640
3641
|
const treeOpts = computeTreeOpts.value;
|
|
3641
3642
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -3773,6 +3774,19 @@ export default defineVxeComponent({
|
|
|
3773
3774
|
}
|
|
3774
3775
|
handleReserveStatus();
|
|
3775
3776
|
$xeTable.checkSelectionStatus();
|
|
3777
|
+
if (initStatus) {
|
|
3778
|
+
dispatchEvent('data-rendered', {
|
|
3779
|
+
isReload,
|
|
3780
|
+
visibleColumn: internalData.visibleColumn,
|
|
3781
|
+
visibleData: internalData.afterFullData
|
|
3782
|
+
}, null);
|
|
3783
|
+
}
|
|
3784
|
+
else {
|
|
3785
|
+
dispatchEvent('init-rendered', {
|
|
3786
|
+
visibleColumn: internalData.visibleColumn,
|
|
3787
|
+
visibleData: internalData.afterFullData
|
|
3788
|
+
}, null);
|
|
3789
|
+
}
|
|
3776
3790
|
$xeTable.dispatchEvent('data-change', {
|
|
3777
3791
|
visibleColumn: internalData.visibleColumn,
|
|
3778
3792
|
visibleData: internalData.afterFullData
|
|
@@ -3844,7 +3858,9 @@ export default defineVxeComponent({
|
|
|
3844
3858
|
handleDefaultMergeCells();
|
|
3845
3859
|
handleDefaultMergeHeaderItems();
|
|
3846
3860
|
handleDefaultMergeFooterItems();
|
|
3847
|
-
nextTick(() =>
|
|
3861
|
+
nextTick(() => {
|
|
3862
|
+
setTimeout(() => $xeTable.recalculate());
|
|
3863
|
+
});
|
|
3848
3864
|
};
|
|
3849
3865
|
/**
|
|
3850
3866
|
* 处理初始化的默认行为
|
|
@@ -4821,7 +4837,7 @@ export default defineVxeComponent({
|
|
|
4821
4837
|
*/
|
|
4822
4838
|
loadData(datas) {
|
|
4823
4839
|
const { initStatus } = internalData;
|
|
4824
|
-
return loadTableData(datas, false).then(() => {
|
|
4840
|
+
return loadTableData(datas, false, false).then(() => {
|
|
4825
4841
|
internalData.inited = true;
|
|
4826
4842
|
internalData.initStatus = true;
|
|
4827
4843
|
if (!initStatus) {
|
|
@@ -4839,7 +4855,7 @@ export default defineVxeComponent({
|
|
|
4839
4855
|
.then(() => {
|
|
4840
4856
|
internalData.inited = true;
|
|
4841
4857
|
internalData.initStatus = true;
|
|
4842
|
-
return loadTableData(datas, true);
|
|
4858
|
+
return loadTableData(datas, true, true);
|
|
4843
4859
|
}).then(() => {
|
|
4844
4860
|
handleLoadDefaults();
|
|
4845
4861
|
return handleLazyRecalculate(false, true, true);
|
|
@@ -6945,7 +6961,7 @@ export default defineVxeComponent({
|
|
|
6945
6961
|
handleUpdateRowGroup(confList.map(fieldOrColumn => {
|
|
6946
6962
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field;
|
|
6947
6963
|
}));
|
|
6948
|
-
return loadTableData(internalData.tableSynchData, true);
|
|
6964
|
+
return loadTableData(internalData.tableSynchData, false, true);
|
|
6949
6965
|
}
|
|
6950
6966
|
return nextTick();
|
|
6951
6967
|
},
|
|
@@ -6974,7 +6990,7 @@ export default defineVxeComponent({
|
|
|
6974
6990
|
return nextTick();
|
|
6975
6991
|
}
|
|
6976
6992
|
handleUpdateRowGroup([]);
|
|
6977
|
-
return loadTableData(internalData.tableSynchData, true);
|
|
6993
|
+
return loadTableData(internalData.tableSynchData, false, true);
|
|
6978
6994
|
},
|
|
6979
6995
|
isRowGroupRecord(row) {
|
|
6980
6996
|
warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord']);
|
|
@@ -8344,6 +8360,16 @@ export default defineVxeComponent({
|
|
|
8344
8360
|
reactData.dragCol = null;
|
|
8345
8361
|
}
|
|
8346
8362
|
};
|
|
8363
|
+
const handleRowDragEndClearStatus = () => {
|
|
8364
|
+
clearRowDragData();
|
|
8365
|
+
clearCrossTableDragStatus();
|
|
8366
|
+
handleRecalculateStyle(false, true, true);
|
|
8367
|
+
};
|
|
8368
|
+
const handleColDragEndClearStatus = () => {
|
|
8369
|
+
clearColDragData();
|
|
8370
|
+
clearCrossTableDragStatus();
|
|
8371
|
+
handleRecalculateStyle(true, true, true);
|
|
8372
|
+
};
|
|
8347
8373
|
const clearRowDropOrigin = () => {
|
|
8348
8374
|
const el = refElem.value;
|
|
8349
8375
|
if (el) {
|
|
@@ -10392,76 +10418,47 @@ export default defineVxeComponent({
|
|
|
10392
10418
|
dragToChild: !!prevDragToChild,
|
|
10393
10419
|
offsetIndex: dragOffsetIndex
|
|
10394
10420
|
};
|
|
10395
|
-
const
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
const
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
const
|
|
10419
|
-
const
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
// 子到子
|
|
10431
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
10432
|
-
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10433
|
-
// 非同级
|
|
10434
|
-
return errRest;
|
|
10435
|
-
}
|
|
10436
|
-
}
|
|
10437
|
-
else {
|
|
10438
|
-
if (!isCrossDrag) {
|
|
10439
|
-
return errRest;
|
|
10440
|
-
}
|
|
10441
|
-
if (oldAllMaps[newRowid]) {
|
|
10442
|
-
isSelfToChildStatus = true;
|
|
10443
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10444
|
-
if (VxeUI.modal) {
|
|
10445
|
-
VxeUI.modal.message({
|
|
10446
|
-
status: 'error',
|
|
10447
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
10448
|
-
});
|
|
10449
|
-
}
|
|
10450
|
-
return errRest;
|
|
10451
|
-
}
|
|
10452
|
-
}
|
|
10453
|
-
}
|
|
10454
|
-
}
|
|
10455
|
-
else if (oldLevel) {
|
|
10456
|
-
// 子到根
|
|
10457
|
-
if (!isCrossDrag) {
|
|
10458
|
-
return errRest;
|
|
10421
|
+
const dragRowid = getRowid($xeTable, dragRow);
|
|
10422
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid] || {};
|
|
10423
|
+
const _dragRowIndex = dragRowRest._index;
|
|
10424
|
+
let dragRowHeight = 0;
|
|
10425
|
+
let dragOffsetTop = -1;
|
|
10426
|
+
if (animation) {
|
|
10427
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
10428
|
+
const oldTrEl = el.querySelector(`.vxe-body--row[rowid="${dragRowid}"]`);
|
|
10429
|
+
if (oldTrEl) {
|
|
10430
|
+
dragOffsetTop = oldTrEl.offsetTop;
|
|
10431
|
+
}
|
|
10432
|
+
}
|
|
10433
|
+
let oafIndex = -1;
|
|
10434
|
+
let nafIndex = -1;
|
|
10435
|
+
const oldRest = dragRowRest;
|
|
10436
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
10437
|
+
const newRest = fullAllDataRowIdData[newRowid];
|
|
10438
|
+
const oldAllMaps = {};
|
|
10439
|
+
let isSelfToChildStatus = false;
|
|
10440
|
+
// 如果为树结构
|
|
10441
|
+
if (treeConfig) {
|
|
10442
|
+
if (transform) {
|
|
10443
|
+
if (oldRest && newRest) {
|
|
10444
|
+
const { level: oldLevel } = oldRest;
|
|
10445
|
+
const { level: newLevel } = newRest;
|
|
10446
|
+
XEUtils.eachTree([dragRow], item => {
|
|
10447
|
+
oldAllMaps[getRowid($xeTable, item)] = item;
|
|
10448
|
+
}, { children: mapChildrenField });
|
|
10449
|
+
if (oldLevel && newLevel) {
|
|
10450
|
+
// 子到子
|
|
10451
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
10452
|
+
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10453
|
+
// 非同级
|
|
10454
|
+
handleRowDragEndClearStatus();
|
|
10455
|
+
return Promise.resolve(errRest);
|
|
10459
10456
|
}
|
|
10460
10457
|
}
|
|
10461
|
-
else
|
|
10462
|
-
// 根到子
|
|
10458
|
+
else {
|
|
10463
10459
|
if (!isCrossDrag) {
|
|
10464
|
-
|
|
10460
|
+
handleRowDragEndClearStatus();
|
|
10461
|
+
return Promise.resolve(errRest);
|
|
10465
10462
|
}
|
|
10466
10463
|
if (oldAllMaps[newRowid]) {
|
|
10467
10464
|
isSelfToChildStatus = true;
|
|
@@ -10472,13 +10469,55 @@ export default defineVxeComponent({
|
|
|
10472
10469
|
content: getI18n('vxe.error.treeDragChild')
|
|
10473
10470
|
});
|
|
10474
10471
|
}
|
|
10475
|
-
|
|
10472
|
+
handleRowDragEndClearStatus();
|
|
10473
|
+
return Promise.resolve(errRest);
|
|
10476
10474
|
}
|
|
10477
10475
|
}
|
|
10478
10476
|
}
|
|
10479
|
-
|
|
10480
|
-
|
|
10477
|
+
}
|
|
10478
|
+
else if (oldLevel) {
|
|
10479
|
+
// 子到根
|
|
10480
|
+
if (!isCrossDrag) {
|
|
10481
|
+
handleRowDragEndClearStatus();
|
|
10482
|
+
return Promise.resolve(errRest);
|
|
10481
10483
|
}
|
|
10484
|
+
}
|
|
10485
|
+
else if (newLevel) {
|
|
10486
|
+
// 根到子
|
|
10487
|
+
if (!isCrossDrag) {
|
|
10488
|
+
handleRowDragEndClearStatus();
|
|
10489
|
+
return Promise.resolve(errRest);
|
|
10490
|
+
}
|
|
10491
|
+
if (oldAllMaps[newRowid]) {
|
|
10492
|
+
isSelfToChildStatus = true;
|
|
10493
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10494
|
+
if (VxeUI.modal) {
|
|
10495
|
+
VxeUI.modal.message({
|
|
10496
|
+
status: 'error',
|
|
10497
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
10498
|
+
});
|
|
10499
|
+
}
|
|
10500
|
+
handleRowDragEndClearStatus();
|
|
10501
|
+
return Promise.resolve(errRest);
|
|
10502
|
+
}
|
|
10503
|
+
}
|
|
10504
|
+
}
|
|
10505
|
+
else {
|
|
10506
|
+
// 根到根
|
|
10507
|
+
}
|
|
10508
|
+
}
|
|
10509
|
+
}
|
|
10510
|
+
}
|
|
10511
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
10512
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10513
|
+
if (!status) {
|
|
10514
|
+
return errRest;
|
|
10515
|
+
}
|
|
10516
|
+
// 如果为树结构
|
|
10517
|
+
if (treeConfig) {
|
|
10518
|
+
if (transform) {
|
|
10519
|
+
// 移出源位置
|
|
10520
|
+
if (oldRest && newRest) {
|
|
10482
10521
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
10483
10522
|
key: rowField,
|
|
10484
10523
|
parentKey: parentField,
|
|
@@ -10521,8 +10560,6 @@ export default defineVxeComponent({
|
|
|
10521
10560
|
afterFullData.splice(nafIndex, 0, dragRow);
|
|
10522
10561
|
tableFullData.splice(ntfIndex, 0, dragRow);
|
|
10523
10562
|
}
|
|
10524
|
-
clearRowDragData();
|
|
10525
|
-
clearCrossTableDragStatus();
|
|
10526
10563
|
$xeTable.handleTableData(treeConfig && transform);
|
|
10527
10564
|
$xeTable.cacheRowMap(false);
|
|
10528
10565
|
updateScrollYStatus();
|
|
@@ -10630,18 +10667,15 @@ export default defineVxeComponent({
|
|
|
10630
10667
|
}).catch(() => {
|
|
10631
10668
|
return errRest;
|
|
10632
10669
|
}).then((rest) => {
|
|
10633
|
-
|
|
10634
|
-
clearCrossTableDragStatus();
|
|
10670
|
+
handleRowDragEndClearStatus();
|
|
10635
10671
|
return rest;
|
|
10636
10672
|
});
|
|
10637
10673
|
}
|
|
10638
|
-
|
|
10639
|
-
clearCrossTableDragStatus();
|
|
10674
|
+
handleRowDragEndClearStatus();
|
|
10640
10675
|
return Promise.resolve(errRest);
|
|
10641
10676
|
},
|
|
10642
10677
|
handleCrossTableRowDragCancelEvent() {
|
|
10643
|
-
|
|
10644
|
-
clearCrossTableDragStatus();
|
|
10678
|
+
handleRowDragEndClearStatus();
|
|
10645
10679
|
},
|
|
10646
10680
|
/**
|
|
10647
10681
|
* 处理跨表拖拽完成
|
|
@@ -10701,8 +10735,7 @@ export default defineVxeComponent({
|
|
|
10701
10735
|
dispatchEvent('row-remove-dragend', {
|
|
10702
10736
|
row: dragRow
|
|
10703
10737
|
}, evnt);
|
|
10704
|
-
|
|
10705
|
-
clearCrossTableDragStatus();
|
|
10738
|
+
handleRowDragEndClearStatus();
|
|
10706
10739
|
}
|
|
10707
10740
|
}
|
|
10708
10741
|
},
|
|
@@ -10775,8 +10808,7 @@ export default defineVxeComponent({
|
|
|
10775
10808
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt);
|
|
10776
10809
|
}
|
|
10777
10810
|
}
|
|
10778
|
-
|
|
10779
|
-
clearCrossTableDragStatus();
|
|
10811
|
+
handleRowDragEndClearStatus();
|
|
10780
10812
|
return errRest;
|
|
10781
10813
|
}
|
|
10782
10814
|
let insertRest = Promise.resolve();
|
|
@@ -11049,78 +11081,50 @@ export default defineVxeComponent({
|
|
|
11049
11081
|
dragToChild: !!prevDragToChild,
|
|
11050
11082
|
offsetIndex: dragOffsetIndex
|
|
11051
11083
|
};
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
}
|
|
11057
|
-
let dragTargetColumn = null;
|
|
11058
|
-
const dragAllTargetCols = [];
|
|
11059
|
-
let dragColWidth = 0;
|
|
11060
|
-
if (animation) {
|
|
11061
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
11062
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11063
|
-
dragTargetColumn = column;
|
|
11064
|
-
dragColWidth += column.renderWidth;
|
|
11065
|
-
}
|
|
11066
|
-
dragAllTargetCols.push(column);
|
|
11067
|
-
});
|
|
11068
|
-
}
|
|
11069
|
-
if (!dragTargetColumn) {
|
|
11070
|
-
dragTargetColumn = dragColumn;
|
|
11071
|
-
}
|
|
11072
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {};
|
|
11073
|
-
const _dragColIndex = dragColRest._index;
|
|
11074
|
-
let dragOffsetLeft = -1;
|
|
11075
|
-
if (animation) {
|
|
11076
|
-
const oldTrEl = el.querySelector(`.vxe-table--column[colid="${dragTargetColumn.id}"]`);
|
|
11077
|
-
if (oldTrEl) {
|
|
11078
|
-
dragOffsetLeft = oldTrEl.offsetLeft;
|
|
11079
|
-
}
|
|
11080
|
-
}
|
|
11081
|
-
let oafIndex = -1;
|
|
11082
|
-
let nafIndex = -1;
|
|
11083
|
-
const oldAllMaps = {};
|
|
11084
|
+
let dragTargetColumn = null;
|
|
11085
|
+
const dragAllTargetCols = [];
|
|
11086
|
+
let dragColWidth = 0;
|
|
11087
|
+
if (animation) {
|
|
11084
11088
|
XEUtils.eachTree([dragColumn], column => {
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
if (dragColumn.parentId && newColumn.parentId) {
|
|
11089
|
-
// 子到子
|
|
11090
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
11091
|
-
if (dragColumn.parentId !== newColumn.parentId) {
|
|
11092
|
-
// 非同级
|
|
11093
|
-
return errRest;
|
|
11094
|
-
}
|
|
11095
|
-
}
|
|
11096
|
-
else {
|
|
11097
|
-
if (!isCrossDrag) {
|
|
11098
|
-
return errRest;
|
|
11099
|
-
}
|
|
11100
|
-
if (oldAllMaps[newColumn.id]) {
|
|
11101
|
-
isSelfToChildStatus = true;
|
|
11102
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11103
|
-
if (VxeUI.modal) {
|
|
11104
|
-
VxeUI.modal.message({
|
|
11105
|
-
status: 'error',
|
|
11106
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
11107
|
-
});
|
|
11108
|
-
}
|
|
11109
|
-
return errRest;
|
|
11110
|
-
}
|
|
11111
|
-
}
|
|
11089
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11090
|
+
dragTargetColumn = column;
|
|
11091
|
+
dragColWidth += column.renderWidth;
|
|
11112
11092
|
}
|
|
11093
|
+
dragAllTargetCols.push(column);
|
|
11094
|
+
});
|
|
11095
|
+
}
|
|
11096
|
+
if (!dragTargetColumn) {
|
|
11097
|
+
dragTargetColumn = dragColumn;
|
|
11098
|
+
}
|
|
11099
|
+
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {};
|
|
11100
|
+
const _dragColIndex = dragColRest._index;
|
|
11101
|
+
let dragOffsetLeft = -1;
|
|
11102
|
+
if (animation) {
|
|
11103
|
+
const oldTrEl = el.querySelector(`.vxe-table--column[colid="${dragTargetColumn.id}"]`);
|
|
11104
|
+
if (oldTrEl) {
|
|
11105
|
+
dragOffsetLeft = oldTrEl.offsetLeft;
|
|
11113
11106
|
}
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11107
|
+
}
|
|
11108
|
+
let oafIndex = -1;
|
|
11109
|
+
let nafIndex = -1;
|
|
11110
|
+
const oldAllMaps = {};
|
|
11111
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11112
|
+
oldAllMaps[column.id] = column;
|
|
11113
|
+
});
|
|
11114
|
+
let isSelfToChildStatus = false;
|
|
11115
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
11116
|
+
// 子到子
|
|
11117
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
11118
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
11119
|
+
// 非同级
|
|
11120
|
+
handleColDragEndClearStatus();
|
|
11121
|
+
return Promise.resolve(errRest);
|
|
11118
11122
|
}
|
|
11119
11123
|
}
|
|
11120
|
-
else
|
|
11121
|
-
// 根到子
|
|
11124
|
+
else {
|
|
11122
11125
|
if (!isCrossDrag) {
|
|
11123
|
-
|
|
11126
|
+
handleColDragEndClearStatus();
|
|
11127
|
+
return Promise.resolve(errRest);
|
|
11124
11128
|
}
|
|
11125
11129
|
if (oldAllMaps[newColumn.id]) {
|
|
11126
11130
|
isSelfToChildStatus = true;
|
|
@@ -11131,12 +11135,46 @@ export default defineVxeComponent({
|
|
|
11131
11135
|
content: getI18n('vxe.error.treeDragChild')
|
|
11132
11136
|
});
|
|
11133
11137
|
}
|
|
11134
|
-
|
|
11138
|
+
handleColDragEndClearStatus();
|
|
11139
|
+
return Promise.resolve(errRest);
|
|
11135
11140
|
}
|
|
11136
11141
|
}
|
|
11137
11142
|
}
|
|
11138
|
-
|
|
11139
|
-
|
|
11143
|
+
}
|
|
11144
|
+
else if (dragColumn.parentId) {
|
|
11145
|
+
// 子到根
|
|
11146
|
+
if (!isCrossDrag) {
|
|
11147
|
+
handleColDragEndClearStatus();
|
|
11148
|
+
return Promise.resolve(errRest);
|
|
11149
|
+
}
|
|
11150
|
+
}
|
|
11151
|
+
else if (newColumn.parentId) {
|
|
11152
|
+
// 根到子
|
|
11153
|
+
if (!isCrossDrag) {
|
|
11154
|
+
handleColDragEndClearStatus();
|
|
11155
|
+
return Promise.resolve(errRest);
|
|
11156
|
+
}
|
|
11157
|
+
if (oldAllMaps[newColumn.id]) {
|
|
11158
|
+
isSelfToChildStatus = true;
|
|
11159
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11160
|
+
if (VxeUI.modal) {
|
|
11161
|
+
VxeUI.modal.message({
|
|
11162
|
+
status: 'error',
|
|
11163
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
11164
|
+
});
|
|
11165
|
+
}
|
|
11166
|
+
handleColDragEndClearStatus();
|
|
11167
|
+
return Promise.resolve(errRest);
|
|
11168
|
+
}
|
|
11169
|
+
}
|
|
11170
|
+
}
|
|
11171
|
+
else {
|
|
11172
|
+
// 根到根
|
|
11173
|
+
}
|
|
11174
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
11175
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11176
|
+
if (!status) {
|
|
11177
|
+
return errRest;
|
|
11140
11178
|
}
|
|
11141
11179
|
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
|
|
11142
11180
|
// 改变层级
|
|
@@ -11296,13 +11334,11 @@ export default defineVxeComponent({
|
|
|
11296
11334
|
}).catch(() => {
|
|
11297
11335
|
return errRest;
|
|
11298
11336
|
}).then((rest) => {
|
|
11299
|
-
|
|
11300
|
-
clearCrossTableDragStatus();
|
|
11337
|
+
handleColDragEndClearStatus();
|
|
11301
11338
|
return rest;
|
|
11302
11339
|
});
|
|
11303
11340
|
}
|
|
11304
|
-
|
|
11305
|
-
clearCrossTableDragStatus();
|
|
11341
|
+
handleColDragEndClearStatus();
|
|
11306
11342
|
return Promise.resolve(errRest);
|
|
11307
11343
|
},
|
|
11308
11344
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
@@ -12211,7 +12247,7 @@ export default defineVxeComponent({
|
|
|
12211
12247
|
}
|
|
12212
12248
|
},
|
|
12213
12249
|
handleUpdateAggData() {
|
|
12214
|
-
return loadTableData(internalData.tableSynchData, true);
|
|
12250
|
+
return loadTableData(internalData.tableSynchData, false, true);
|
|
12215
12251
|
},
|
|
12216
12252
|
updateZindex() {
|
|
12217
12253
|
if (props.zIndex) {
|
|
@@ -13020,7 +13056,7 @@ export default defineVxeComponent({
|
|
|
13020
13056
|
if (value && value.length >= 20000) {
|
|
13021
13057
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
13022
13058
|
}
|
|
13023
|
-
loadTableData(value, true).then(() => {
|
|
13059
|
+
loadTableData(value, false, true).then(() => {
|
|
13024
13060
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
13025
13061
|
const expandOpts = computeExpandOpts.value;
|
|
13026
13062
|
internalData.inited = true;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED