vxe-table 3.19.28 → 3.19.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/methods.js +210 -170
- package/es/table/src/table.js +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +29 -28
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +212 -172
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +1 -1
- 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/methods.ts +215 -172
- package/packages/table/src/table.ts +1 -1
- /package/es/{iconfont.1765353143587.ttf → iconfont.1765538900604.ttf} +0 -0
- /package/es/{iconfont.1765353143587.woff → iconfont.1765538900604.woff} +0 -0
- /package/es/{iconfont.1765353143587.woff2 → iconfont.1765538900604.woff2} +0 -0
- /package/lib/{iconfont.1765353143587.ttf → iconfont.1765538900604.ttf} +0 -0
- /package/lib/{iconfont.1765353143587.woff → iconfont.1765538900604.woff} +0 -0
- /package/lib/{iconfont.1765353143587.woff2 → iconfont.1765538900604.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -2540,6 +2540,16 @@ function clearDragStatus($xeTable) {
|
|
|
2540
2540
|
reactData.dragCol = null;
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
|
+
function handleRowDragEndClearStatus($xeTable) {
|
|
2544
|
+
clearRowDragData($xeTable);
|
|
2545
|
+
clearCrossTableDragStatus($xeTable);
|
|
2546
|
+
handleRecalculateStyle($xeTable, false, true, true);
|
|
2547
|
+
}
|
|
2548
|
+
function handleColDragEndClearStatus($xeTable) {
|
|
2549
|
+
clearColDragData($xeTable);
|
|
2550
|
+
clearCrossTableDragStatus($xeTable);
|
|
2551
|
+
handleRecalculateStyle($xeTable, true, true, true);
|
|
2552
|
+
}
|
|
2543
2553
|
function clearRowDropOrigin($xeTable) {
|
|
2544
2554
|
const el = $xeTable.$el;
|
|
2545
2555
|
if (el) {
|
|
@@ -3215,13 +3225,13 @@ function handleGroupData($xeTable, list, rowGroups) {
|
|
|
3215
3225
|
* 加载表格数据
|
|
3216
3226
|
* @param {Array} datas 数据
|
|
3217
3227
|
*/
|
|
3218
|
-
function loadTableData($xeTable, datas, isReset) {
|
|
3228
|
+
function loadTableData($xeTable, datas, isReload, isReset) {
|
|
3219
3229
|
const props = $xeTable;
|
|
3220
3230
|
const reactData = $xeTable;
|
|
3221
3231
|
const internalData = $xeTable;
|
|
3222
3232
|
const { keepSource, treeConfig, aggregateConfig, rowGroupConfig } = props;
|
|
3223
3233
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData;
|
|
3224
|
-
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
3234
|
+
const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData;
|
|
3225
3235
|
const rowOpts = $xeTable.computeRowOpts;
|
|
3226
3236
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3227
3237
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
@@ -3359,6 +3369,19 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
3359
3369
|
}
|
|
3360
3370
|
handleReserveStatus($xeTable);
|
|
3361
3371
|
$xeTable.checkSelectionStatus();
|
|
3372
|
+
if (initStatus) {
|
|
3373
|
+
$xeTable.dispatchEvent('data-rendered', {
|
|
3374
|
+
isReload,
|
|
3375
|
+
visibleColumn: internalData.visibleColumn,
|
|
3376
|
+
visibleData: internalData.afterFullData
|
|
3377
|
+
}, null);
|
|
3378
|
+
}
|
|
3379
|
+
else {
|
|
3380
|
+
$xeTable.dispatchEvent('init-rendered', {
|
|
3381
|
+
visibleColumn: internalData.visibleColumn,
|
|
3382
|
+
visibleData: internalData.afterFullData
|
|
3383
|
+
}, null);
|
|
3384
|
+
}
|
|
3362
3385
|
$xeTable.dispatchEvent('data-change', {
|
|
3363
3386
|
visibleColumn: internalData.visibleColumn,
|
|
3364
3387
|
visibleData: internalData.afterFullData
|
|
@@ -3430,7 +3453,14 @@ function handleLoadDefaults($xeTable) {
|
|
|
3430
3453
|
handleDefaultMergeCells($xeTable);
|
|
3431
3454
|
handleDefaultMergeHeaderItems($xeTable);
|
|
3432
3455
|
handleDefaultMergeFooterItems($xeTable);
|
|
3433
|
-
$xeTable.$nextTick(() =>
|
|
3456
|
+
$xeTable.$nextTick(() => {
|
|
3457
|
+
const internalData = $xeTable;
|
|
3458
|
+
$xeTable.dispatchEvent('init-rendered', {
|
|
3459
|
+
visibleColumn: internalData.visibleColumn,
|
|
3460
|
+
visibleData: internalData.afterFullData
|
|
3461
|
+
}, null);
|
|
3462
|
+
setTimeout(() => $xeTable.recalculate());
|
|
3463
|
+
});
|
|
3434
3464
|
}
|
|
3435
3465
|
/**
|
|
3436
3466
|
* 处理初始化的默认行为
|
|
@@ -4316,7 +4346,7 @@ const tableMethods = {
|
|
|
4316
4346
|
errLog('vxe.error.delFunc', ['syncData', 'getData']);
|
|
4317
4347
|
return $xeTable.$nextTick().then(() => {
|
|
4318
4348
|
reactData.tableData = [];
|
|
4319
|
-
return $xeTable.$nextTick().then(() => loadTableData($xeTable, internalData.tableFullData, true));
|
|
4349
|
+
return $xeTable.$nextTick().then(() => loadTableData($xeTable, internalData.tableFullData, true, true));
|
|
4320
4350
|
});
|
|
4321
4351
|
},
|
|
4322
4352
|
/**
|
|
@@ -4384,7 +4414,8 @@ const tableMethods = {
|
|
|
4384
4414
|
const reactData = $xeTable;
|
|
4385
4415
|
const internalData = $xeTable;
|
|
4386
4416
|
const { data } = props;
|
|
4387
|
-
|
|
4417
|
+
$xeTable.dispatchEvent('ready', {}, null);
|
|
4418
|
+
loadTableData($xeTable, data || [], true, true).then(() => {
|
|
4388
4419
|
if (data && data.length) {
|
|
4389
4420
|
internalData.inited = true;
|
|
4390
4421
|
internalData.initStatus = true;
|
|
@@ -4402,9 +4433,9 @@ const tableMethods = {
|
|
|
4402
4433
|
* 加载表格数据
|
|
4403
4434
|
* @param {Array} datas 数据
|
|
4404
4435
|
*/
|
|
4405
|
-
loadTableData(datas, isReset) {
|
|
4436
|
+
loadTableData(datas, isReload, isReset) {
|
|
4406
4437
|
const $xeTable = this;
|
|
4407
|
-
return loadTableData($xeTable, datas, isReset);
|
|
4438
|
+
return loadTableData($xeTable, datas, isReload, isReset);
|
|
4408
4439
|
},
|
|
4409
4440
|
/**
|
|
4410
4441
|
* 重新加载数据,不会清空表格状态
|
|
@@ -4412,11 +4443,12 @@ const tableMethods = {
|
|
|
4412
4443
|
*/
|
|
4413
4444
|
loadData(datas) {
|
|
4414
4445
|
const $xeTable = this;
|
|
4415
|
-
const
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4446
|
+
const internalData = $xeTable;
|
|
4447
|
+
const { initStatus } = internalData;
|
|
4448
|
+
return loadTableData($xeTable, datas, false, false).then(() => {
|
|
4449
|
+
internalData.inited = true;
|
|
4450
|
+
internalData.initStatus = true;
|
|
4451
|
+
if (initStatus) {
|
|
4420
4452
|
handleLoadDefaults($xeTable);
|
|
4421
4453
|
}
|
|
4422
4454
|
return handleLazyRecalculate($xeTable, false, true, true);
|
|
@@ -4428,11 +4460,12 @@ const tableMethods = {
|
|
|
4428
4460
|
*/
|
|
4429
4461
|
reloadData(datas) {
|
|
4430
4462
|
const $xeTable = this;
|
|
4431
|
-
|
|
4463
|
+
const internalData = $xeTable;
|
|
4464
|
+
return $xeTable.clearAll()
|
|
4432
4465
|
.then(() => {
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
return loadTableData($xeTable, datas, true);
|
|
4466
|
+
internalData.inited = true;
|
|
4467
|
+
internalData.initStatus = true;
|
|
4468
|
+
return loadTableData($xeTable, datas, true, true);
|
|
4436
4469
|
})
|
|
4437
4470
|
.then(() => {
|
|
4438
4471
|
handleLoadDefaults($xeTable);
|
|
@@ -4443,6 +4476,7 @@ const tableMethods = {
|
|
|
4443
4476
|
* 修改行数据
|
|
4444
4477
|
*/
|
|
4445
4478
|
setRow(rows, record) {
|
|
4479
|
+
const $xeTable = this;
|
|
4446
4480
|
if (record) {
|
|
4447
4481
|
let rest = rows;
|
|
4448
4482
|
if (!XEUtils.isArray(rows)) {
|
|
@@ -4450,7 +4484,7 @@ const tableMethods = {
|
|
|
4450
4484
|
}
|
|
4451
4485
|
rest.forEach((item) => Object.assign(item, record));
|
|
4452
4486
|
}
|
|
4453
|
-
return
|
|
4487
|
+
return $xeTable.$nextTick();
|
|
4454
4488
|
},
|
|
4455
4489
|
/**
|
|
4456
4490
|
* 局部加载行数据并恢复到初始状态
|
|
@@ -8757,74 +8791,43 @@ const tableMethods = {
|
|
|
8757
8791
|
dragToChild: !!prevDragToChild,
|
|
8758
8792
|
offsetIndex: dragOffsetIndex
|
|
8759
8793
|
};
|
|
8760
|
-
const
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
const
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
const
|
|
8784
|
-
const
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
let isSelfToChildStatus = false;
|
|
8794
|
-
if (oldLevel && newLevel) {
|
|
8795
|
-
// 子到子
|
|
8796
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
8797
|
-
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
8798
|
-
// 非同级
|
|
8799
|
-
return errRest;
|
|
8800
|
-
}
|
|
8801
|
-
}
|
|
8802
|
-
else {
|
|
8803
|
-
if (!isCrossDrag) {
|
|
8804
|
-
return errRest;
|
|
8805
|
-
}
|
|
8806
|
-
if (oldAllMaps[newRowid]) {
|
|
8807
|
-
isSelfToChildStatus = true;
|
|
8808
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
8809
|
-
if (VxeUI.modal) {
|
|
8810
|
-
VxeUI.modal.message({
|
|
8811
|
-
status: 'error',
|
|
8812
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
8813
|
-
});
|
|
8814
|
-
}
|
|
8815
|
-
return errRest;
|
|
8816
|
-
}
|
|
8817
|
-
}
|
|
8818
|
-
}
|
|
8819
|
-
}
|
|
8820
|
-
else if (oldLevel) {
|
|
8821
|
-
// 子到根
|
|
8822
|
-
if (!isCrossDrag) {
|
|
8794
|
+
const dragRowid = getRowid($xeTable, dragRow);
|
|
8795
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid] || {};
|
|
8796
|
+
const _dragRowIndex = dragRowRest._index;
|
|
8797
|
+
let dragRowHeight = 0;
|
|
8798
|
+
let dragOffsetTop = -1;
|
|
8799
|
+
if (animation) {
|
|
8800
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
8801
|
+
const oldTrEl = el.querySelector(`.vxe-body--row[rowid="${dragRowid}"]`);
|
|
8802
|
+
if (oldTrEl) {
|
|
8803
|
+
dragOffsetTop = oldTrEl.offsetTop;
|
|
8804
|
+
}
|
|
8805
|
+
}
|
|
8806
|
+
let oafIndex = -1;
|
|
8807
|
+
let nafIndex = -1;
|
|
8808
|
+
const oldRest = dragRowRest;
|
|
8809
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
8810
|
+
const newRest = fullAllDataRowIdData[newRowid];
|
|
8811
|
+
const oldAllMaps = {};
|
|
8812
|
+
let isSelfToChildStatus = false;
|
|
8813
|
+
// 如果为树结构
|
|
8814
|
+
if (treeConfig) {
|
|
8815
|
+
if (transform) {
|
|
8816
|
+
if (oldRest && newRest) {
|
|
8817
|
+
const { level: oldLevel } = oldRest;
|
|
8818
|
+
const { level: newLevel } = newRest;
|
|
8819
|
+
XEUtils.eachTree([dragRow], item => {
|
|
8820
|
+
oldAllMaps[getRowid($xeTable, item)] = item;
|
|
8821
|
+
}, { children: mapChildrenField });
|
|
8822
|
+
if (oldLevel && newLevel) {
|
|
8823
|
+
// 子到子
|
|
8824
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
8825
|
+
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
8826
|
+
// 非同级
|
|
8823
8827
|
return errRest;
|
|
8824
8828
|
}
|
|
8825
8829
|
}
|
|
8826
|
-
else
|
|
8827
|
-
// 根到子
|
|
8830
|
+
else {
|
|
8828
8831
|
if (!isCrossDrag) {
|
|
8829
8832
|
return errRest;
|
|
8830
8833
|
}
|
|
@@ -8841,9 +8844,47 @@ const tableMethods = {
|
|
|
8841
8844
|
}
|
|
8842
8845
|
}
|
|
8843
8846
|
}
|
|
8844
|
-
|
|
8845
|
-
|
|
8847
|
+
}
|
|
8848
|
+
else if (oldLevel) {
|
|
8849
|
+
// 子到根
|
|
8850
|
+
if (!isCrossDrag) {
|
|
8851
|
+
return errRest;
|
|
8846
8852
|
}
|
|
8853
|
+
}
|
|
8854
|
+
else if (newLevel) {
|
|
8855
|
+
// 根到子
|
|
8856
|
+
if (!isCrossDrag) {
|
|
8857
|
+
return errRest;
|
|
8858
|
+
}
|
|
8859
|
+
if (oldAllMaps[newRowid]) {
|
|
8860
|
+
isSelfToChildStatus = true;
|
|
8861
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
8862
|
+
if (VxeUI.modal) {
|
|
8863
|
+
VxeUI.modal.message({
|
|
8864
|
+
status: 'error',
|
|
8865
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
8866
|
+
});
|
|
8867
|
+
}
|
|
8868
|
+
return errRest;
|
|
8869
|
+
}
|
|
8870
|
+
}
|
|
8871
|
+
}
|
|
8872
|
+
else {
|
|
8873
|
+
// 根到根
|
|
8874
|
+
}
|
|
8875
|
+
}
|
|
8876
|
+
}
|
|
8877
|
+
}
|
|
8878
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8879
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
8880
|
+
if (!status) {
|
|
8881
|
+
return errRest;
|
|
8882
|
+
}
|
|
8883
|
+
// 如果为树结构
|
|
8884
|
+
if (treeConfig) {
|
|
8885
|
+
if (transform) {
|
|
8886
|
+
// 移出源位置
|
|
8887
|
+
if (oldRest && newRest) {
|
|
8847
8888
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
8848
8889
|
key: rowField,
|
|
8849
8890
|
parentKey: parentField,
|
|
@@ -8992,19 +9033,16 @@ const tableMethods = {
|
|
|
8992
9033
|
}).catch(() => {
|
|
8993
9034
|
return errRest;
|
|
8994
9035
|
}).then((rest) => {
|
|
8995
|
-
|
|
8996
|
-
clearCrossTableDragStatus($xeTable);
|
|
9036
|
+
handleRowDragEndClearStatus($xeTable);
|
|
8997
9037
|
return rest;
|
|
8998
9038
|
});
|
|
8999
9039
|
}
|
|
9000
|
-
|
|
9001
|
-
clearCrossTableDragStatus($xeTable);
|
|
9040
|
+
handleRowDragEndClearStatus($xeTable);
|
|
9002
9041
|
return Promise.resolve(errRest);
|
|
9003
9042
|
},
|
|
9004
9043
|
handleCrossTableRowDragCancelEvent() {
|
|
9005
9044
|
const $xeTable = this;
|
|
9006
|
-
|
|
9007
|
-
clearCrossTableDragStatus($xeTable);
|
|
9045
|
+
handleRowDragEndClearStatus($xeTable);
|
|
9008
9046
|
},
|
|
9009
9047
|
/**
|
|
9010
9048
|
* 处理跨表拖拽完成
|
|
@@ -9068,8 +9106,7 @@ const tableMethods = {
|
|
|
9068
9106
|
$xeTable.dispatchEvent('row-remove-dragend', {
|
|
9069
9107
|
row: dragRow
|
|
9070
9108
|
}, evnt);
|
|
9071
|
-
|
|
9072
|
-
clearCrossTableDragStatus($xeTable);
|
|
9109
|
+
handleRowDragEndClearStatus($xeTable);
|
|
9073
9110
|
}
|
|
9074
9111
|
}
|
|
9075
9112
|
},
|
|
@@ -9151,8 +9188,7 @@ const tableMethods = {
|
|
|
9151
9188
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt);
|
|
9152
9189
|
}
|
|
9153
9190
|
}
|
|
9154
|
-
|
|
9155
|
-
clearCrossTableDragStatus($xeTable);
|
|
9191
|
+
handleRowDragEndClearStatus($xeTable);
|
|
9156
9192
|
return errRest;
|
|
9157
9193
|
}
|
|
9158
9194
|
let insertRest = Promise.resolve();
|
|
@@ -9445,78 +9481,50 @@ const tableMethods = {
|
|
|
9445
9481
|
dragToChild: !!prevDragToChild,
|
|
9446
9482
|
offsetIndex: dragOffsetIndex
|
|
9447
9483
|
};
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
}
|
|
9453
|
-
let dragTargetColumn = null;
|
|
9454
|
-
const dragAllTargetCols = [];
|
|
9455
|
-
let dragColWidth = 0;
|
|
9456
|
-
if (animation) {
|
|
9457
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
9458
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
9459
|
-
dragTargetColumn = column;
|
|
9460
|
-
dragColWidth += column.renderWidth;
|
|
9461
|
-
}
|
|
9462
|
-
dragAllTargetCols.push(column);
|
|
9463
|
-
});
|
|
9464
|
-
}
|
|
9465
|
-
if (!dragTargetColumn) {
|
|
9466
|
-
dragTargetColumn = dragColumn;
|
|
9467
|
-
}
|
|
9468
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {};
|
|
9469
|
-
const _dragColIndex = dragColRest._index;
|
|
9470
|
-
let dragOffsetLeft = -1;
|
|
9471
|
-
if (animation) {
|
|
9472
|
-
const oldTrEl = el.querySelector(`.vxe-table--column[colid="${dragTargetColumn.id}"]`);
|
|
9473
|
-
if (oldTrEl) {
|
|
9474
|
-
dragOffsetLeft = oldTrEl.offsetLeft;
|
|
9475
|
-
}
|
|
9476
|
-
}
|
|
9477
|
-
let oafIndex = -1;
|
|
9478
|
-
let nafIndex = -1;
|
|
9479
|
-
const oldAllMaps = {};
|
|
9484
|
+
let dragTargetColumn = null;
|
|
9485
|
+
const dragAllTargetCols = [];
|
|
9486
|
+
let dragColWidth = 0;
|
|
9487
|
+
if (animation) {
|
|
9480
9488
|
XEUtils.eachTree([dragColumn], column => {
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
if (dragColumn.parentId && newColumn.parentId) {
|
|
9485
|
-
// 子到子
|
|
9486
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
9487
|
-
if (dragColumn.parentId !== newColumn.parentId) {
|
|
9488
|
-
// 非同级
|
|
9489
|
-
return errRest;
|
|
9490
|
-
}
|
|
9491
|
-
}
|
|
9492
|
-
else {
|
|
9493
|
-
if (!isCrossDrag) {
|
|
9494
|
-
return errRest;
|
|
9495
|
-
}
|
|
9496
|
-
if (oldAllMaps[newColumn.id]) {
|
|
9497
|
-
isSelfToChildStatus = true;
|
|
9498
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
9499
|
-
if (VxeUI.modal) {
|
|
9500
|
-
VxeUI.modal.message({
|
|
9501
|
-
status: 'error',
|
|
9502
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
9503
|
-
});
|
|
9504
|
-
}
|
|
9505
|
-
return errRest;
|
|
9506
|
-
}
|
|
9507
|
-
}
|
|
9489
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
9490
|
+
dragTargetColumn = column;
|
|
9491
|
+
dragColWidth += column.renderWidth;
|
|
9508
9492
|
}
|
|
9493
|
+
dragAllTargetCols.push(column);
|
|
9494
|
+
});
|
|
9495
|
+
}
|
|
9496
|
+
if (!dragTargetColumn) {
|
|
9497
|
+
dragTargetColumn = dragColumn;
|
|
9498
|
+
}
|
|
9499
|
+
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {};
|
|
9500
|
+
const _dragColIndex = dragColRest._index;
|
|
9501
|
+
let dragOffsetLeft = -1;
|
|
9502
|
+
if (animation) {
|
|
9503
|
+
const oldTrEl = el.querySelector(`.vxe-table--column[colid="${dragTargetColumn.id}"]`);
|
|
9504
|
+
if (oldTrEl) {
|
|
9505
|
+
dragOffsetLeft = oldTrEl.offsetLeft;
|
|
9509
9506
|
}
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9507
|
+
}
|
|
9508
|
+
let oafIndex = -1;
|
|
9509
|
+
let nafIndex = -1;
|
|
9510
|
+
const oldAllMaps = {};
|
|
9511
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
9512
|
+
oldAllMaps[column.id] = column;
|
|
9513
|
+
});
|
|
9514
|
+
let isSelfToChildStatus = false;
|
|
9515
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
9516
|
+
// 子到子
|
|
9517
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
9518
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
9519
|
+
// 非同级
|
|
9520
|
+
handleColDragEndClearStatus($xeTable);
|
|
9521
|
+
return Promise.resolve(errRest);
|
|
9514
9522
|
}
|
|
9515
9523
|
}
|
|
9516
|
-
else
|
|
9517
|
-
// 根到子
|
|
9524
|
+
else {
|
|
9518
9525
|
if (!isCrossDrag) {
|
|
9519
|
-
|
|
9526
|
+
handleColDragEndClearStatus($xeTable);
|
|
9527
|
+
return Promise.resolve(errRest);
|
|
9520
9528
|
}
|
|
9521
9529
|
if (oldAllMaps[newColumn.id]) {
|
|
9522
9530
|
isSelfToChildStatus = true;
|
|
@@ -9527,12 +9535,46 @@ const tableMethods = {
|
|
|
9527
9535
|
content: getI18n('vxe.error.treeDragChild')
|
|
9528
9536
|
});
|
|
9529
9537
|
}
|
|
9530
|
-
|
|
9538
|
+
handleColDragEndClearStatus($xeTable);
|
|
9539
|
+
return Promise.resolve(errRest);
|
|
9531
9540
|
}
|
|
9532
9541
|
}
|
|
9533
9542
|
}
|
|
9534
|
-
|
|
9535
|
-
|
|
9543
|
+
}
|
|
9544
|
+
else if (dragColumn.parentId) {
|
|
9545
|
+
// 子到根
|
|
9546
|
+
if (!isCrossDrag) {
|
|
9547
|
+
handleColDragEndClearStatus($xeTable);
|
|
9548
|
+
return Promise.resolve(errRest);
|
|
9549
|
+
}
|
|
9550
|
+
}
|
|
9551
|
+
else if (newColumn.parentId) {
|
|
9552
|
+
// 根到子
|
|
9553
|
+
if (!isCrossDrag) {
|
|
9554
|
+
handleColDragEndClearStatus($xeTable);
|
|
9555
|
+
return Promise.resolve(errRest);
|
|
9556
|
+
}
|
|
9557
|
+
if (oldAllMaps[newColumn.id]) {
|
|
9558
|
+
isSelfToChildStatus = true;
|
|
9559
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
9560
|
+
if (VxeUI.modal) {
|
|
9561
|
+
VxeUI.modal.message({
|
|
9562
|
+
status: 'error',
|
|
9563
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
9564
|
+
});
|
|
9565
|
+
}
|
|
9566
|
+
handleColDragEndClearStatus($xeTable);
|
|
9567
|
+
return Promise.resolve(errRest);
|
|
9568
|
+
}
|
|
9569
|
+
}
|
|
9570
|
+
}
|
|
9571
|
+
else {
|
|
9572
|
+
// 根到根
|
|
9573
|
+
}
|
|
9574
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
9575
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
9576
|
+
if (!status) {
|
|
9577
|
+
return errRest;
|
|
9536
9578
|
}
|
|
9537
9579
|
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
|
|
9538
9580
|
// 改变层级
|
|
@@ -9692,13 +9734,11 @@ const tableMethods = {
|
|
|
9692
9734
|
}).catch(() => {
|
|
9693
9735
|
return errRest;
|
|
9694
9736
|
}).then((rest) => {
|
|
9695
|
-
|
|
9696
|
-
clearCrossTableDragStatus($xeTable);
|
|
9737
|
+
handleColDragEndClearStatus($xeTable);
|
|
9697
9738
|
return rest;
|
|
9698
9739
|
});
|
|
9699
9740
|
}
|
|
9700
|
-
|
|
9701
|
-
clearCrossTableDragStatus($xeTable);
|
|
9741
|
+
handleColDragEndClearStatus($xeTable);
|
|
9702
9742
|
return Promise.resolve(errRest);
|
|
9703
9743
|
},
|
|
9704
9744
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
@@ -10424,7 +10464,7 @@ const tableMethods = {
|
|
|
10424
10464
|
handleUpdateRowGroup($xeTable, confList.map(fieldOrColumn => {
|
|
10425
10465
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field;
|
|
10426
10466
|
}));
|
|
10427
|
-
return loadTableData($xeTable, internalData.tableSynchData, true);
|
|
10467
|
+
return loadTableData($xeTable, internalData.tableSynchData, false, true);
|
|
10428
10468
|
}
|
|
10429
10469
|
return $xeTable.$nextTick();
|
|
10430
10470
|
},
|
|
@@ -10461,7 +10501,7 @@ const tableMethods = {
|
|
|
10461
10501
|
return $xeTable.$nextTick();
|
|
10462
10502
|
}
|
|
10463
10503
|
handleUpdateRowGroup($xeTable, []);
|
|
10464
|
-
return loadTableData($xeTable, internalData.tableSynchData, true);
|
|
10504
|
+
return loadTableData($xeTable, internalData.tableSynchData, false, true);
|
|
10465
10505
|
},
|
|
10466
10506
|
isRowGroupRecord(row) {
|
|
10467
10507
|
const $xeTable = this;
|
|
@@ -12046,7 +12086,7 @@ const tableMethods = {
|
|
|
12046
12086
|
handleUpdateAggData() {
|
|
12047
12087
|
const $xeTable = this;
|
|
12048
12088
|
const internalData = $xeTable;
|
|
12049
|
-
return loadTableData($xeTable, internalData.tableSynchData, true);
|
|
12089
|
+
return loadTableData($xeTable, internalData.tableSynchData, false, true);
|
|
12050
12090
|
},
|
|
12051
12091
|
updateZindex() {
|
|
12052
12092
|
if (this.zIndex) {
|
package/es/table/src/table.js
CHANGED
|
@@ -1485,7 +1485,7 @@ export default {
|
|
|
1485
1485
|
if (value && value.length >= 20000) {
|
|
1486
1486
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
1487
1487
|
}
|
|
1488
|
-
this.loadTableData(value || [], true).then(() => {
|
|
1488
|
+
this.loadTableData(value || [], true, true).then(() => {
|
|
1489
1489
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
1490
1490
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
1491
1491
|
this.inited = true;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED