vxe-table 4.17.27 → 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/locale/lang/ar-EG.js +16 -11
- package/es/locale/lang/de-DE.js +16 -11
- package/es/locale/lang/en-US.js +19 -14
- package/es/locale/lang/es-ES.js +16 -11
- package/es/locale/lang/fr-FR.js +16 -11
- package/es/locale/lang/hu-HU.js +16 -11
- package/es/locale/lang/hy-AM.js +16 -11
- package/es/locale/lang/id-ID.js +16 -11
- package/es/locale/lang/it-IT.js +16 -11
- package/es/locale/lang/ja-JP.js +16 -11
- package/es/locale/lang/ko-KR.js +16 -11
- package/es/locale/lang/ms-MY.js +16 -11
- package/es/locale/lang/nb-NO.js +16 -11
- package/es/locale/lang/pt-BR.js +16 -11
- package/es/locale/lang/ru-RU.js +16 -11
- package/es/locale/lang/th-TH.js +16 -11
- package/es/locale/lang/ug-CN.js +16 -11
- package/es/locale/lang/uk-UA.js +16 -11
- package/es/locale/lang/uz-UZ.js +16 -11
- package/es/locale/lang/vi-VN.js +16 -11
- package/es/locale/lang/zh-CHT.js +16 -11
- package/es/locale/lang/zh-CN.js +15 -12
- package/es/style.css +1 -1
- package/es/table/src/emits.js +3 -0
- package/es/table/src/table.js +221 -181
- package/es/ui/index.js +1 -1
- package/es/{table → ui}/src/anime.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +54 -50
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +16 -11
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +16 -11
- package/lib/locale/lang/de-DE.js +16 -11
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +16 -11
- package/lib/locale/lang/en-US.js +19 -14
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +19 -14
- package/lib/locale/lang/es-ES.js +16 -11
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +16 -11
- package/lib/locale/lang/fr-FR.js +16 -11
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +16 -11
- package/lib/locale/lang/hu-HU.js +16 -11
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +16 -11
- package/lib/locale/lang/hy-AM.js +16 -11
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +16 -11
- package/lib/locale/lang/id-ID.js +16 -11
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +16 -11
- package/lib/locale/lang/it-IT.js +16 -11
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +16 -11
- package/lib/locale/lang/ja-JP.js +16 -11
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +16 -11
- package/lib/locale/lang/ko-KR.js +16 -11
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +16 -11
- package/lib/locale/lang/ms-MY.js +16 -11
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +16 -11
- package/lib/locale/lang/nb-NO.js +16 -11
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +16 -11
- package/lib/locale/lang/pt-BR.js +16 -11
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +16 -11
- package/lib/locale/lang/ru-RU.js +16 -11
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +16 -11
- package/lib/locale/lang/th-TH.js +16 -11
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +16 -11
- package/lib/locale/lang/ug-CN.js +16 -11
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +16 -11
- package/lib/locale/lang/uk-UA.js +16 -11
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +16 -11
- package/lib/locale/lang/uz-UZ.js +16 -11
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +16 -11
- package/lib/locale/lang/vi-VN.js +16 -11
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +16 -11
- package/lib/locale/lang/zh-CHT.js +16 -11
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +16 -11
- package/lib/locale/lang/zh-CN.js +15 -12
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +15 -12
- 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 +36 -35
- 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/{table → ui}/src/anime.js +1 -1
- package/lib/ui/src/anime.min.js +1 -0
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/locale/lang/ar-EG.ts +16 -11
- package/packages/locale/lang/de-DE.ts +16 -11
- package/packages/locale/lang/en-US.ts +19 -14
- package/packages/locale/lang/es-ES.ts +16 -11
- package/packages/locale/lang/fr-FR.ts +16 -11
- package/packages/locale/lang/hu-HU.ts +16 -11
- package/packages/locale/lang/hy-AM.ts +16 -11
- package/packages/locale/lang/id-ID.ts +16 -11
- package/packages/locale/lang/it-IT.ts +16 -11
- package/packages/locale/lang/ja-JP.ts +16 -11
- package/packages/locale/lang/ko-KR.ts +16 -11
- package/packages/locale/lang/ms-MY.ts +16 -11
- package/packages/locale/lang/nb-NO.ts +16 -11
- package/packages/locale/lang/pt-BR.ts +16 -11
- package/packages/locale/lang/ru-RU.ts +16 -11
- package/packages/locale/lang/th-TH.ts +16 -11
- package/packages/locale/lang/ug-CN.ts +16 -11
- package/packages/locale/lang/uk-UA.ts +16 -11
- package/packages/locale/lang/uz-UZ.ts +16 -11
- package/packages/locale/lang/vi-VN.ts +16 -11
- package/packages/locale/lang/zh-CHT.ts +16 -11
- package/packages/locale/lang/zh-CN.ts +15 -12
- package/packages/table/src/emits.ts +4 -0
- package/packages/table/src/table.ts +228 -187
- package/packages/{table → ui}/src/anime.ts +1 -1
- package/lib/table/src/anime.min.js +0 -1
- /package/es/{iconfont.1765156968806.ttf → iconfont.1765538995329.ttf} +0 -0
- /package/es/{iconfont.1765156968806.woff → iconfont.1765538995329.woff} +0 -0
- /package/es/{iconfont.1765156968806.woff2 → iconfont.1765538995329.woff2} +0 -0
- /package/lib/{iconfont.1765156968806.ttf → iconfont.1765538995329.ttf} +0 -0
- /package/lib/{iconfont.1765156968806.woff → iconfont.1765538995329.woff} +0 -0
- /package/lib/{iconfont.1765156968806.woff2 → iconfont.1765538995329.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf,
|
|
|
6
6
|
import { VxeUI } from '../../ui';
|
|
7
7
|
import { createInternalData, getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn } from './util';
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
9
|
-
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '
|
|
9
|
+
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
10
10
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
11
11
|
import { getCrossTableDragRowInfo } from './store';
|
|
12
12
|
import Cell from './cell';
|
|
@@ -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);
|
|
@@ -5272,7 +5288,7 @@ export default defineVxeComponent({
|
|
|
5272
5288
|
}
|
|
5273
5289
|
}
|
|
5274
5290
|
else if (renderOpts && tcFormatter) {
|
|
5275
|
-
cellLabel =
|
|
5291
|
+
cellLabel = tcFormatter(renderOpts, formatParams);
|
|
5276
5292
|
}
|
|
5277
5293
|
if (formatData) {
|
|
5278
5294
|
formatData[colid] = { value: cellValue, label: cellLabel };
|
|
@@ -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,78 +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
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
if (
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
let isSelfToChildStatus = false;
|
|
10431
|
-
if (oldLevel && newLevel) {
|
|
10432
|
-
// 子到子
|
|
10433
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
10434
|
-
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10435
|
-
// 非同级
|
|
10436
|
-
return errRest;
|
|
10437
|
-
}
|
|
10438
|
-
}
|
|
10439
|
-
else {
|
|
10440
|
-
if (!isCrossDrag) {
|
|
10441
|
-
return errRest;
|
|
10442
|
-
}
|
|
10443
|
-
if (oldAllMaps[newRowid]) {
|
|
10444
|
-
isSelfToChildStatus = true;
|
|
10445
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10446
|
-
if (VxeUI.modal) {
|
|
10447
|
-
VxeUI.modal.message({
|
|
10448
|
-
status: 'error',
|
|
10449
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
10450
|
-
});
|
|
10451
|
-
}
|
|
10452
|
-
return errRest;
|
|
10453
|
-
}
|
|
10454
|
-
}
|
|
10455
|
-
}
|
|
10456
|
-
}
|
|
10457
|
-
else if (oldLevel) {
|
|
10458
|
-
// 子到根
|
|
10459
|
-
if (!isCrossDrag) {
|
|
10460
|
-
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);
|
|
10461
10456
|
}
|
|
10462
10457
|
}
|
|
10463
|
-
else
|
|
10464
|
-
// 根到子
|
|
10458
|
+
else {
|
|
10465
10459
|
if (!isCrossDrag) {
|
|
10466
|
-
|
|
10460
|
+
handleRowDragEndClearStatus();
|
|
10461
|
+
return Promise.resolve(errRest);
|
|
10467
10462
|
}
|
|
10468
10463
|
if (oldAllMaps[newRowid]) {
|
|
10469
10464
|
isSelfToChildStatus = true;
|
|
@@ -10474,13 +10469,55 @@ export default defineVxeComponent({
|
|
|
10474
10469
|
content: getI18n('vxe.error.treeDragChild')
|
|
10475
10470
|
});
|
|
10476
10471
|
}
|
|
10477
|
-
|
|
10472
|
+
handleRowDragEndClearStatus();
|
|
10473
|
+
return Promise.resolve(errRest);
|
|
10478
10474
|
}
|
|
10479
10475
|
}
|
|
10480
10476
|
}
|
|
10481
|
-
|
|
10482
|
-
|
|
10477
|
+
}
|
|
10478
|
+
else if (oldLevel) {
|
|
10479
|
+
// 子到根
|
|
10480
|
+
if (!isCrossDrag) {
|
|
10481
|
+
handleRowDragEndClearStatus();
|
|
10482
|
+
return Promise.resolve(errRest);
|
|
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
|
+
}
|
|
10483
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) {
|
|
10484
10521
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
10485
10522
|
key: rowField,
|
|
10486
10523
|
parentKey: parentField,
|
|
@@ -10523,8 +10560,6 @@ export default defineVxeComponent({
|
|
|
10523
10560
|
afterFullData.splice(nafIndex, 0, dragRow);
|
|
10524
10561
|
tableFullData.splice(ntfIndex, 0, dragRow);
|
|
10525
10562
|
}
|
|
10526
|
-
clearRowDragData();
|
|
10527
|
-
clearCrossTableDragStatus();
|
|
10528
10563
|
$xeTable.handleTableData(treeConfig && transform);
|
|
10529
10564
|
$xeTable.cacheRowMap(false);
|
|
10530
10565
|
updateScrollYStatus();
|
|
@@ -10552,6 +10587,7 @@ export default defineVxeComponent({
|
|
|
10552
10587
|
return nextTick().then(() => {
|
|
10553
10588
|
if (animation) {
|
|
10554
10589
|
const { tableData } = reactData;
|
|
10590
|
+
const { fullAllDataRowIdData } = internalData;
|
|
10555
10591
|
const dragRowRest = fullAllDataRowIdData[dragRowid];
|
|
10556
10592
|
const _newRowIndex = dragRowRest._index;
|
|
10557
10593
|
const firstRow = tableData[0];
|
|
@@ -10630,15 +10666,16 @@ export default defineVxeComponent({
|
|
|
10630
10666
|
});
|
|
10631
10667
|
}).catch(() => {
|
|
10632
10668
|
return errRest;
|
|
10669
|
+
}).then((rest) => {
|
|
10670
|
+
handleRowDragEndClearStatus();
|
|
10671
|
+
return rest;
|
|
10633
10672
|
});
|
|
10634
10673
|
}
|
|
10635
|
-
|
|
10636
|
-
clearCrossTableDragStatus();
|
|
10674
|
+
handleRowDragEndClearStatus();
|
|
10637
10675
|
return Promise.resolve(errRest);
|
|
10638
10676
|
},
|
|
10639
10677
|
handleCrossTableRowDragCancelEvent() {
|
|
10640
|
-
|
|
10641
|
-
clearCrossTableDragStatus();
|
|
10678
|
+
handleRowDragEndClearStatus();
|
|
10642
10679
|
},
|
|
10643
10680
|
/**
|
|
10644
10681
|
* 处理跨表拖拽完成
|
|
@@ -10698,8 +10735,7 @@ export default defineVxeComponent({
|
|
|
10698
10735
|
dispatchEvent('row-remove-dragend', {
|
|
10699
10736
|
row: dragRow
|
|
10700
10737
|
}, evnt);
|
|
10701
|
-
|
|
10702
|
-
clearCrossTableDragStatus();
|
|
10738
|
+
handleRowDragEndClearStatus();
|
|
10703
10739
|
}
|
|
10704
10740
|
}
|
|
10705
10741
|
},
|
|
@@ -10772,8 +10808,7 @@ export default defineVxeComponent({
|
|
|
10772
10808
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt);
|
|
10773
10809
|
}
|
|
10774
10810
|
}
|
|
10775
|
-
|
|
10776
|
-
clearCrossTableDragStatus();
|
|
10811
|
+
handleRowDragEndClearStatus();
|
|
10777
10812
|
return errRest;
|
|
10778
10813
|
}
|
|
10779
10814
|
let insertRest = Promise.resolve();
|
|
@@ -10922,12 +10957,10 @@ export default defineVxeComponent({
|
|
|
10922
10957
|
const isControlKey = hasControlKey(evnt);
|
|
10923
10958
|
const trEl = evnt.currentTarget;
|
|
10924
10959
|
const rowid = trEl.getAttribute('rowid') || '';
|
|
10925
|
-
const
|
|
10926
|
-
if (
|
|
10960
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
10961
|
+
if (rowRest) {
|
|
10927
10962
|
evnt.preventDefault();
|
|
10928
|
-
const row =
|
|
10929
|
-
const rowid = getRowid($xeTable, row);
|
|
10930
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
10963
|
+
const row = rowRest.row;
|
|
10931
10964
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
10932
10965
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
10933
10966
|
internalData.prevDragToChild = !!(treeConfig && transform && (isCrossDrag && isToChildDrag) && isControlKey);
|
|
@@ -10961,7 +10994,7 @@ export default defineVxeComponent({
|
|
|
10961
10994
|
}
|
|
10962
10995
|
if ($xeTable.eqRow(dragRow, row) ||
|
|
10963
10996
|
(isControlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
|
|
10964
|
-
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] :
|
|
10997
|
+
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rowRest.level))) {
|
|
10965
10998
|
showDropTip(evnt, trEl, null, false, dragPos);
|
|
10966
10999
|
return;
|
|
10967
11000
|
}
|
|
@@ -11048,80 +11081,50 @@ export default defineVxeComponent({
|
|
|
11048
11081
|
dragToChild: !!prevDragToChild,
|
|
11049
11082
|
offsetIndex: dragOffsetIndex
|
|
11050
11083
|
};
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
clearCrossTableDragStatus();
|
|
11056
|
-
return errRest;
|
|
11057
|
-
}
|
|
11058
|
-
let dragTargetColumn = null;
|
|
11059
|
-
const dragAllTargetCols = [];
|
|
11060
|
-
let dragColWidth = 0;
|
|
11061
|
-
if (animation) {
|
|
11062
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
11063
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11064
|
-
dragTargetColumn = column;
|
|
11065
|
-
dragColWidth += column.renderWidth;
|
|
11066
|
-
}
|
|
11067
|
-
dragAllTargetCols.push(column);
|
|
11068
|
-
});
|
|
11069
|
-
}
|
|
11070
|
-
if (!dragTargetColumn) {
|
|
11071
|
-
dragTargetColumn = dragColumn;
|
|
11072
|
-
}
|
|
11073
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {};
|
|
11074
|
-
const _dragColIndex = dragColRest._index;
|
|
11075
|
-
let dragOffsetLeft = -1;
|
|
11076
|
-
if (animation) {
|
|
11077
|
-
const oldTrEl = el.querySelector(`.vxe-table--column[colid="${dragTargetColumn.id}"]`);
|
|
11078
|
-
if (oldTrEl) {
|
|
11079
|
-
dragOffsetLeft = oldTrEl.offsetLeft;
|
|
11080
|
-
}
|
|
11081
|
-
}
|
|
11082
|
-
let oafIndex = -1;
|
|
11083
|
-
let nafIndex = -1;
|
|
11084
|
-
const oldAllMaps = {};
|
|
11084
|
+
let dragTargetColumn = null;
|
|
11085
|
+
const dragAllTargetCols = [];
|
|
11086
|
+
let dragColWidth = 0;
|
|
11087
|
+
if (animation) {
|
|
11085
11088
|
XEUtils.eachTree([dragColumn], column => {
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
if (dragColumn.parentId && newColumn.parentId) {
|
|
11090
|
-
// 子到子
|
|
11091
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
11092
|
-
if (dragColumn.parentId !== newColumn.parentId) {
|
|
11093
|
-
// 非同级
|
|
11094
|
-
return errRest;
|
|
11095
|
-
}
|
|
11096
|
-
}
|
|
11097
|
-
else {
|
|
11098
|
-
if (!isCrossDrag) {
|
|
11099
|
-
return errRest;
|
|
11100
|
-
}
|
|
11101
|
-
if (oldAllMaps[newColumn.id]) {
|
|
11102
|
-
isSelfToChildStatus = true;
|
|
11103
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11104
|
-
if (VxeUI.modal) {
|
|
11105
|
-
VxeUI.modal.message({
|
|
11106
|
-
status: 'error',
|
|
11107
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
11108
|
-
});
|
|
11109
|
-
}
|
|
11110
|
-
return errRest;
|
|
11111
|
-
}
|
|
11112
|
-
}
|
|
11089
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11090
|
+
dragTargetColumn = column;
|
|
11091
|
+
dragColWidth += column.renderWidth;
|
|
11113
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;
|
|
11114
11106
|
}
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
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);
|
|
11119
11122
|
}
|
|
11120
11123
|
}
|
|
11121
|
-
else
|
|
11122
|
-
// 根到子
|
|
11124
|
+
else {
|
|
11123
11125
|
if (!isCrossDrag) {
|
|
11124
|
-
|
|
11126
|
+
handleColDragEndClearStatus();
|
|
11127
|
+
return Promise.resolve(errRest);
|
|
11125
11128
|
}
|
|
11126
11129
|
if (oldAllMaps[newColumn.id]) {
|
|
11127
11130
|
isSelfToChildStatus = true;
|
|
@@ -11132,12 +11135,46 @@ export default defineVxeComponent({
|
|
|
11132
11135
|
content: getI18n('vxe.error.treeDragChild')
|
|
11133
11136
|
});
|
|
11134
11137
|
}
|
|
11135
|
-
|
|
11138
|
+
handleColDragEndClearStatus();
|
|
11139
|
+
return Promise.resolve(errRest);
|
|
11136
11140
|
}
|
|
11137
11141
|
}
|
|
11138
11142
|
}
|
|
11139
|
-
|
|
11140
|
-
|
|
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;
|
|
11141
11178
|
}
|
|
11142
11179
|
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id);
|
|
11143
11180
|
// 改变层级
|
|
@@ -11192,8 +11229,6 @@ export default defineVxeComponent({
|
|
|
11192
11229
|
$xeTable.clearCopyCellArea();
|
|
11193
11230
|
}
|
|
11194
11231
|
}
|
|
11195
|
-
clearColDragData();
|
|
11196
|
-
clearCrossTableDragStatus();
|
|
11197
11232
|
if (evnt) {
|
|
11198
11233
|
dispatchEvent('column-dragend', {
|
|
11199
11234
|
oldColumn: dragColumn,
|
|
@@ -11298,10 +11333,12 @@ export default defineVxeComponent({
|
|
|
11298
11333
|
});
|
|
11299
11334
|
}).catch(() => {
|
|
11300
11335
|
return errRest;
|
|
11336
|
+
}).then((rest) => {
|
|
11337
|
+
handleColDragEndClearStatus();
|
|
11338
|
+
return rest;
|
|
11301
11339
|
});
|
|
11302
11340
|
}
|
|
11303
|
-
|
|
11304
|
-
clearCrossTableDragStatus();
|
|
11341
|
+
handleColDragEndClearStatus();
|
|
11305
11342
|
return Promise.resolve(errRest);
|
|
11306
11343
|
},
|
|
11307
11344
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
@@ -12062,12 +12099,15 @@ export default defineVxeComponent({
|
|
|
12062
12099
|
const lastRow = afterFullData[afterFullData.length - 1];
|
|
12063
12100
|
rowid = getRowid($xeTable, lastRow);
|
|
12064
12101
|
rowRest = fullAllDataRowIdData[rowid] || {};
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12102
|
+
if (rowRest) {
|
|
12103
|
+
const rHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
12104
|
+
// 如果为空时还没计算完数据,保持原高度不变
|
|
12105
|
+
if (rHeight) {
|
|
12106
|
+
sYHeight = (rowRest.oTop || 0) + rHeight;
|
|
12107
|
+
// 是否展开行
|
|
12108
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
12109
|
+
sYHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
12110
|
+
}
|
|
12071
12111
|
}
|
|
12072
12112
|
}
|
|
12073
12113
|
if (sYHeight > maxYHeight) {
|
|
@@ -12207,7 +12247,7 @@ export default defineVxeComponent({
|
|
|
12207
12247
|
}
|
|
12208
12248
|
},
|
|
12209
12249
|
handleUpdateAggData() {
|
|
12210
|
-
return loadTableData(internalData.tableSynchData, true);
|
|
12250
|
+
return loadTableData(internalData.tableSynchData, false, true);
|
|
12211
12251
|
},
|
|
12212
12252
|
updateZindex() {
|
|
12213
12253
|
if (props.zIndex) {
|
|
@@ -13016,7 +13056,7 @@ export default defineVxeComponent({
|
|
|
13016
13056
|
if (value && value.length >= 20000) {
|
|
13017
13057
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
13018
13058
|
}
|
|
13019
|
-
loadTableData(value, true).then(() => {
|
|
13059
|
+
loadTableData(value, false, true).then(() => {
|
|
13020
13060
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
13021
13061
|
const expandOpts = computeExpandOpts.value;
|
|
13022
13062
|
internalData.inited = true;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED