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
|
@@ -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'
|
|
@@ -3787,7 +3787,8 @@ export default defineVxeComponent({
|
|
|
3787
3787
|
|
|
3788
3788
|
const initData = () => {
|
|
3789
3789
|
const { data } = props
|
|
3790
|
-
|
|
3790
|
+
dispatchEvent('ready', {}, null)
|
|
3791
|
+
loadTableData(data || [], true, true).then(() => {
|
|
3791
3792
|
if (data && data.length) {
|
|
3792
3793
|
internalData.inited = true
|
|
3793
3794
|
internalData.initStatus = true
|
|
@@ -3806,10 +3807,10 @@ export default defineVxeComponent({
|
|
|
3806
3807
|
* 加载表格数据
|
|
3807
3808
|
* @param {Array} datas 数据
|
|
3808
3809
|
*/
|
|
3809
|
-
const loadTableData = (datas: any[], isReset: boolean) => {
|
|
3810
|
+
const loadTableData = (datas: any[], isReload: boolean, isReset: boolean) => {
|
|
3810
3811
|
const { keepSource, treeConfig, rowGroupConfig, aggregateConfig } = props
|
|
3811
3812
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData
|
|
3812
|
-
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3813
|
+
const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3813
3814
|
const rowOpts = computeRowOpts.value
|
|
3814
3815
|
const treeOpts = computeTreeOpts.value
|
|
3815
3816
|
const expandOpts = computeExpandOpts.value
|
|
@@ -3948,6 +3949,18 @@ export default defineVxeComponent({
|
|
|
3948
3949
|
|
|
3949
3950
|
handleReserveStatus()
|
|
3950
3951
|
$xeTable.checkSelectionStatus()
|
|
3952
|
+
if (initStatus) {
|
|
3953
|
+
dispatchEvent('data-rendered', {
|
|
3954
|
+
isReload,
|
|
3955
|
+
visibleColumn: internalData.visibleColumn,
|
|
3956
|
+
visibleData: internalData.afterFullData
|
|
3957
|
+
}, null)
|
|
3958
|
+
} else {
|
|
3959
|
+
dispatchEvent('init-rendered', {
|
|
3960
|
+
visibleColumn: internalData.visibleColumn,
|
|
3961
|
+
visibleData: internalData.afterFullData
|
|
3962
|
+
}, null)
|
|
3963
|
+
}
|
|
3951
3964
|
$xeTable.dispatchEvent('data-change', {
|
|
3952
3965
|
visibleColumn: internalData.visibleColumn,
|
|
3953
3966
|
visibleData: internalData.afterFullData
|
|
@@ -4019,7 +4032,9 @@ export default defineVxeComponent({
|
|
|
4019
4032
|
handleDefaultMergeCells()
|
|
4020
4033
|
handleDefaultMergeHeaderItems()
|
|
4021
4034
|
handleDefaultMergeFooterItems()
|
|
4022
|
-
nextTick(() =>
|
|
4035
|
+
nextTick(() => {
|
|
4036
|
+
setTimeout(() => $xeTable.recalculate())
|
|
4037
|
+
})
|
|
4023
4038
|
}
|
|
4024
4039
|
|
|
4025
4040
|
/**
|
|
@@ -5022,7 +5037,7 @@ export default defineVxeComponent({
|
|
|
5022
5037
|
*/
|
|
5023
5038
|
loadData (datas) {
|
|
5024
5039
|
const { initStatus } = internalData
|
|
5025
|
-
return loadTableData(datas, false).then(() => {
|
|
5040
|
+
return loadTableData(datas, false, false).then(() => {
|
|
5026
5041
|
internalData.inited = true
|
|
5027
5042
|
internalData.initStatus = true
|
|
5028
5043
|
if (!initStatus) {
|
|
@@ -5040,7 +5055,7 @@ export default defineVxeComponent({
|
|
|
5040
5055
|
.then(() => {
|
|
5041
5056
|
internalData.inited = true
|
|
5042
5057
|
internalData.initStatus = true
|
|
5043
|
-
return loadTableData(datas, true)
|
|
5058
|
+
return loadTableData(datas, true, true)
|
|
5044
5059
|
}).then(() => {
|
|
5045
5060
|
handleLoadDefaults()
|
|
5046
5061
|
return handleLazyRecalculate(false, true, true)
|
|
@@ -5463,7 +5478,7 @@ export default defineVxeComponent({
|
|
|
5463
5478
|
cellLabel = `${formatter(formatParams)}`
|
|
5464
5479
|
}
|
|
5465
5480
|
} else if (renderOpts && tcFormatter) {
|
|
5466
|
-
cellLabel =
|
|
5481
|
+
cellLabel = tcFormatter(renderOpts, formatParams)
|
|
5467
5482
|
}
|
|
5468
5483
|
if (formatData) {
|
|
5469
5484
|
formatData[colid] = { value: cellValue, label: cellLabel }
|
|
@@ -7123,7 +7138,7 @@ export default defineVxeComponent({
|
|
|
7123
7138
|
handleUpdateRowGroup(confList.map(fieldOrColumn => {
|
|
7124
7139
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field
|
|
7125
7140
|
}))
|
|
7126
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
7141
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
7127
7142
|
}
|
|
7128
7143
|
return nextTick()
|
|
7129
7144
|
},
|
|
@@ -7152,7 +7167,7 @@ export default defineVxeComponent({
|
|
|
7152
7167
|
return nextTick()
|
|
7153
7168
|
}
|
|
7154
7169
|
handleUpdateRowGroup([])
|
|
7155
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
7170
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
7156
7171
|
},
|
|
7157
7172
|
isRowGroupRecord (row) {
|
|
7158
7173
|
warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord'])
|
|
@@ -8506,6 +8521,18 @@ export default defineVxeComponent({
|
|
|
8506
8521
|
}
|
|
8507
8522
|
}
|
|
8508
8523
|
|
|
8524
|
+
const handleRowDragEndClearStatus = () => {
|
|
8525
|
+
clearRowDragData()
|
|
8526
|
+
clearCrossTableDragStatus()
|
|
8527
|
+
handleRecalculateStyle(false, true, true)
|
|
8528
|
+
}
|
|
8529
|
+
|
|
8530
|
+
const handleColDragEndClearStatus = () => {
|
|
8531
|
+
clearColDragData()
|
|
8532
|
+
clearCrossTableDragStatus()
|
|
8533
|
+
handleRecalculateStyle(true, true, true)
|
|
8534
|
+
}
|
|
8535
|
+
|
|
8509
8536
|
const clearRowDropOrigin = () => {
|
|
8510
8537
|
const el = refElem.value
|
|
8511
8538
|
if (el) {
|
|
@@ -10539,84 +10566,52 @@ export default defineVxeComponent({
|
|
|
10539
10566
|
dragToChild: !!prevDragToChild,
|
|
10540
10567
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
10541
10568
|
}
|
|
10542
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
10543
|
-
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10544
|
-
if (!status) {
|
|
10545
|
-
clearRowDragData()
|
|
10546
|
-
clearCrossTableDragStatus()
|
|
10547
|
-
return errRest
|
|
10548
|
-
}
|
|
10549
10569
|
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
}
|
|
10570
|
+
const dragRowid = getRowid($xeTable, dragRow)
|
|
10571
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid] || {}
|
|
10572
|
+
const _dragRowIndex = dragRowRest._index
|
|
10573
|
+
let dragRowHeight = 0
|
|
10574
|
+
let dragOffsetTop = -1
|
|
10575
|
+
if (animation) {
|
|
10576
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
10577
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-body--row[rowid="${dragRowid}"]`)
|
|
10578
|
+
if (oldTrEl) {
|
|
10579
|
+
dragOffsetTop = oldTrEl.offsetTop
|
|
10561
10580
|
}
|
|
10581
|
+
}
|
|
10562
10582
|
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
const newRowid = getRowid($xeTable, prevDragRow)
|
|
10571
|
-
const newRest = fullAllDataRowIdData[newRowid]
|
|
10572
|
-
|
|
10573
|
-
if (oldRest && newRest) {
|
|
10574
|
-
const { level: oldLevel } = oldRest
|
|
10575
|
-
const { level: newLevel } = newRest
|
|
10576
|
-
|
|
10577
|
-
const oldAllMaps: Record<string, any> = {}
|
|
10578
|
-
XEUtils.eachTree([dragRow], item => {
|
|
10579
|
-
oldAllMaps[getRowid($xeTable, item)] = item
|
|
10580
|
-
}, { children: mapChildrenField })
|
|
10581
|
-
|
|
10582
|
-
let isSelfToChildStatus = false
|
|
10583
|
-
|
|
10584
|
-
if (oldLevel && newLevel) {
|
|
10585
|
-
// 子到子
|
|
10586
|
-
|
|
10587
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
10588
|
-
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10589
|
-
// 非同级
|
|
10590
|
-
return errRest
|
|
10591
|
-
}
|
|
10592
|
-
} else {
|
|
10593
|
-
if (!isCrossDrag) {
|
|
10594
|
-
return errRest
|
|
10595
|
-
}
|
|
10596
|
-
if (oldAllMaps[newRowid]) {
|
|
10597
|
-
isSelfToChildStatus = true
|
|
10598
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10599
|
-
if (VxeUI.modal) {
|
|
10600
|
-
VxeUI.modal.message({
|
|
10601
|
-
status: 'error',
|
|
10602
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
10603
|
-
})
|
|
10604
|
-
}
|
|
10605
|
-
return errRest
|
|
10606
|
-
}
|
|
10607
|
-
}
|
|
10608
|
-
}
|
|
10609
|
-
} else if (oldLevel) {
|
|
10610
|
-
// 子到根
|
|
10583
|
+
let oafIndex = -1
|
|
10584
|
+
let nafIndex = -1
|
|
10585
|
+
const oldRest = dragRowRest
|
|
10586
|
+
const newRowid = getRowid($xeTable, prevDragRow)
|
|
10587
|
+
const newRest = fullAllDataRowIdData[newRowid]
|
|
10588
|
+
const oldAllMaps: Record<string, any> = {}
|
|
10589
|
+
let isSelfToChildStatus = false
|
|
10611
10590
|
|
|
10612
|
-
|
|
10613
|
-
|
|
10591
|
+
// 如果为树结构
|
|
10592
|
+
if (treeConfig) {
|
|
10593
|
+
if (transform) {
|
|
10594
|
+
if (oldRest && newRest) {
|
|
10595
|
+
const { level: oldLevel } = oldRest
|
|
10596
|
+
const { level: newLevel } = newRest
|
|
10597
|
+
|
|
10598
|
+
XEUtils.eachTree([dragRow], item => {
|
|
10599
|
+
oldAllMaps[getRowid($xeTable, item)] = item
|
|
10600
|
+
}, { children: mapChildrenField })
|
|
10601
|
+
|
|
10602
|
+
if (oldLevel && newLevel) {
|
|
10603
|
+
// 子到子
|
|
10604
|
+
|
|
10605
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
10606
|
+
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10607
|
+
// 非同级
|
|
10608
|
+
handleRowDragEndClearStatus()
|
|
10609
|
+
return Promise.resolve(errRest)
|
|
10614
10610
|
}
|
|
10615
|
-
} else
|
|
10616
|
-
// 根到子
|
|
10617
|
-
|
|
10611
|
+
} else {
|
|
10618
10612
|
if (!isCrossDrag) {
|
|
10619
|
-
|
|
10613
|
+
handleRowDragEndClearStatus()
|
|
10614
|
+
return Promise.resolve(errRest)
|
|
10620
10615
|
}
|
|
10621
10616
|
if (oldAllMaps[newRowid]) {
|
|
10622
10617
|
isSelfToChildStatus = true
|
|
@@ -10627,13 +10622,56 @@ export default defineVxeComponent({
|
|
|
10627
10622
|
content: getI18n('vxe.error.treeDragChild')
|
|
10628
10623
|
})
|
|
10629
10624
|
}
|
|
10630
|
-
|
|
10625
|
+
handleRowDragEndClearStatus()
|
|
10626
|
+
return Promise.resolve(errRest)
|
|
10631
10627
|
}
|
|
10632
10628
|
}
|
|
10633
|
-
} else {
|
|
10634
|
-
// 根到根
|
|
10635
10629
|
}
|
|
10630
|
+
} else if (oldLevel) {
|
|
10631
|
+
// 子到根
|
|
10632
|
+
|
|
10633
|
+
if (!isCrossDrag) {
|
|
10634
|
+
handleRowDragEndClearStatus()
|
|
10635
|
+
return Promise.resolve(errRest)
|
|
10636
|
+
}
|
|
10637
|
+
} else if (newLevel) {
|
|
10638
|
+
// 根到子
|
|
10639
|
+
|
|
10640
|
+
if (!isCrossDrag) {
|
|
10641
|
+
handleRowDragEndClearStatus()
|
|
10642
|
+
return Promise.resolve(errRest)
|
|
10643
|
+
}
|
|
10644
|
+
if (oldAllMaps[newRowid]) {
|
|
10645
|
+
isSelfToChildStatus = true
|
|
10646
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10647
|
+
if (VxeUI.modal) {
|
|
10648
|
+
VxeUI.modal.message({
|
|
10649
|
+
status: 'error',
|
|
10650
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
10651
|
+
})
|
|
10652
|
+
}
|
|
10653
|
+
handleRowDragEndClearStatus()
|
|
10654
|
+
return Promise.resolve(errRest)
|
|
10655
|
+
}
|
|
10656
|
+
}
|
|
10657
|
+
} else {
|
|
10658
|
+
// 根到根
|
|
10659
|
+
}
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10662
|
+
}
|
|
10663
|
+
|
|
10664
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
10665
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10666
|
+
if (!status) {
|
|
10667
|
+
return errRest
|
|
10668
|
+
}
|
|
10636
10669
|
|
|
10670
|
+
// 如果为树结构
|
|
10671
|
+
if (treeConfig) {
|
|
10672
|
+
if (transform) {
|
|
10673
|
+
// 移出源位置
|
|
10674
|
+
if (oldRest && newRest) {
|
|
10637
10675
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
10638
10676
|
key: rowField,
|
|
10639
10677
|
parentKey: parentField,
|
|
@@ -10679,8 +10717,6 @@ export default defineVxeComponent({
|
|
|
10679
10717
|
afterFullData.splice(nafIndex, 0, dragRow)
|
|
10680
10718
|
tableFullData.splice(ntfIndex, 0, dragRow)
|
|
10681
10719
|
}
|
|
10682
|
-
clearRowDragData()
|
|
10683
|
-
clearCrossTableDragStatus()
|
|
10684
10720
|
|
|
10685
10721
|
$xeTable.handleTableData(treeConfig && transform)
|
|
10686
10722
|
$xeTable.cacheRowMap(false)
|
|
@@ -10711,6 +10747,7 @@ export default defineVxeComponent({
|
|
|
10711
10747
|
return nextTick().then(() => {
|
|
10712
10748
|
if (animation) {
|
|
10713
10749
|
const { tableData } = reactData
|
|
10750
|
+
const { fullAllDataRowIdData } = internalData
|
|
10714
10751
|
const dragRowRest = fullAllDataRowIdData[dragRowid]
|
|
10715
10752
|
const _newRowIndex = dragRowRest._index
|
|
10716
10753
|
const firstRow = tableData[0]
|
|
@@ -10791,15 +10828,16 @@ export default defineVxeComponent({
|
|
|
10791
10828
|
})
|
|
10792
10829
|
}).catch(() => {
|
|
10793
10830
|
return errRest
|
|
10831
|
+
}).then((rest) => {
|
|
10832
|
+
handleRowDragEndClearStatus()
|
|
10833
|
+
return rest
|
|
10794
10834
|
})
|
|
10795
10835
|
}
|
|
10796
|
-
|
|
10797
|
-
clearCrossTableDragStatus()
|
|
10836
|
+
handleRowDragEndClearStatus()
|
|
10798
10837
|
return Promise.resolve(errRest)
|
|
10799
10838
|
},
|
|
10800
10839
|
handleCrossTableRowDragCancelEvent () {
|
|
10801
|
-
|
|
10802
|
-
clearCrossTableDragStatus()
|
|
10840
|
+
handleRowDragEndClearStatus()
|
|
10803
10841
|
},
|
|
10804
10842
|
/**
|
|
10805
10843
|
* 处理跨表拖拽完成
|
|
@@ -10860,8 +10898,7 @@ export default defineVxeComponent({
|
|
|
10860
10898
|
dispatchEvent('row-remove-dragend', {
|
|
10861
10899
|
row: dragRow
|
|
10862
10900
|
}, evnt)
|
|
10863
|
-
|
|
10864
|
-
clearCrossTableDragStatus()
|
|
10901
|
+
handleRowDragEndClearStatus()
|
|
10865
10902
|
}
|
|
10866
10903
|
}
|
|
10867
10904
|
},
|
|
@@ -10934,8 +10971,7 @@ export default defineVxeComponent({
|
|
|
10934
10971
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt)
|
|
10935
10972
|
}
|
|
10936
10973
|
}
|
|
10937
|
-
|
|
10938
|
-
clearCrossTableDragStatus()
|
|
10974
|
+
handleRowDragEndClearStatus()
|
|
10939
10975
|
return errRest
|
|
10940
10976
|
}
|
|
10941
10977
|
let insertRest: Promise<any> = Promise.resolve()
|
|
@@ -11078,12 +11114,10 @@ export default defineVxeComponent({
|
|
|
11078
11114
|
const isControlKey = hasControlKey(evnt)
|
|
11079
11115
|
const trEl = evnt.currentTarget as HTMLElement
|
|
11080
11116
|
const rowid = trEl.getAttribute('rowid') || ''
|
|
11081
|
-
const
|
|
11082
|
-
if (
|
|
11117
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
11118
|
+
if (rowRest) {
|
|
11083
11119
|
evnt.preventDefault()
|
|
11084
|
-
const row =
|
|
11085
|
-
const rowid = getRowid($xeTable, row)
|
|
11086
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
11120
|
+
const row = rowRest.row
|
|
11087
11121
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y
|
|
11088
11122
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom'
|
|
11089
11123
|
internalData.prevDragToChild = !!(treeConfig && transform && (isCrossDrag && isToChildDrag) && isControlKey)
|
|
@@ -11116,7 +11150,7 @@ export default defineVxeComponent({
|
|
|
11116
11150
|
}
|
|
11117
11151
|
if ($xeTable.eqRow(dragRow, row) ||
|
|
11118
11152
|
(isControlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
|
|
11119
|
-
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] :
|
|
11153
|
+
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rowRest.level))
|
|
11120
11154
|
) {
|
|
11121
11155
|
showDropTip(evnt, trEl, null, false, dragPos)
|
|
11122
11156
|
return
|
|
@@ -11203,88 +11237,58 @@ export default defineVxeComponent({
|
|
|
11203
11237
|
dragToChild: !!prevDragToChild,
|
|
11204
11238
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
11205
11239
|
}
|
|
11206
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
11207
|
-
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11208
|
-
if (!status) {
|
|
11209
|
-
clearColDragData()
|
|
11210
|
-
clearCrossTableDragStatus()
|
|
11211
|
-
return errRest
|
|
11212
|
-
}
|
|
11213
|
-
|
|
11214
|
-
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
11215
|
-
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
11216
|
-
let dragColWidth = 0
|
|
11217
|
-
if (animation) {
|
|
11218
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
11219
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11220
|
-
dragTargetColumn = column
|
|
11221
|
-
dragColWidth += column.renderWidth
|
|
11222
|
-
}
|
|
11223
|
-
dragAllTargetCols.push(column)
|
|
11224
|
-
})
|
|
11225
|
-
}
|
|
11226
|
-
if (!dragTargetColumn) {
|
|
11227
|
-
dragTargetColumn = dragColumn
|
|
11228
|
-
}
|
|
11229
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
11230
|
-
const _dragColIndex = dragColRest._index
|
|
11231
11240
|
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11241
|
+
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
11242
|
+
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
11243
|
+
let dragColWidth = 0
|
|
11244
|
+
if (animation) {
|
|
11245
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11246
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11247
|
+
dragTargetColumn = column
|
|
11248
|
+
dragColWidth += column.renderWidth
|
|
11237
11249
|
}
|
|
11238
|
-
|
|
11250
|
+
dragAllTargetCols.push(column)
|
|
11251
|
+
})
|
|
11252
|
+
}
|
|
11253
|
+
if (!dragTargetColumn) {
|
|
11254
|
+
dragTargetColumn = dragColumn
|
|
11255
|
+
}
|
|
11256
|
+
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
11257
|
+
const _dragColIndex = dragColRest._index
|
|
11239
11258
|
|
|
11240
|
-
|
|
11241
|
-
|
|
11259
|
+
let dragOffsetLeft = -1
|
|
11260
|
+
if (animation) {
|
|
11261
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-table--column[colid="${dragTargetColumn.id}"]`)
|
|
11262
|
+
if (oldTrEl) {
|
|
11263
|
+
dragOffsetLeft = oldTrEl.offsetLeft
|
|
11264
|
+
}
|
|
11265
|
+
}
|
|
11242
11266
|
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
oldAllMaps[column.id] = column
|
|
11246
|
-
})
|
|
11267
|
+
let oafIndex = -1
|
|
11268
|
+
let nafIndex = -1
|
|
11247
11269
|
|
|
11248
|
-
|
|
11270
|
+
const oldAllMaps: Record<string, any> = {}
|
|
11271
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11272
|
+
oldAllMaps[column.id] = column
|
|
11273
|
+
})
|
|
11249
11274
|
|
|
11250
|
-
|
|
11251
|
-
// 子到子
|
|
11275
|
+
let isSelfToChildStatus = false
|
|
11252
11276
|
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
// 非同级
|
|
11256
|
-
return errRest
|
|
11257
|
-
}
|
|
11258
|
-
} else {
|
|
11259
|
-
if (!isCrossDrag) {
|
|
11260
|
-
return errRest
|
|
11261
|
-
}
|
|
11277
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
11278
|
+
// 子到子
|
|
11262
11279
|
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
status: 'error',
|
|
11269
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
11270
|
-
})
|
|
11271
|
-
}
|
|
11272
|
-
return errRest
|
|
11273
|
-
}
|
|
11274
|
-
}
|
|
11280
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
11281
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
11282
|
+
// 非同级
|
|
11283
|
+
handleColDragEndClearStatus()
|
|
11284
|
+
return Promise.resolve(errRest)
|
|
11275
11285
|
}
|
|
11276
|
-
} else
|
|
11277
|
-
// 子到根
|
|
11278
|
-
|
|
11286
|
+
} else {
|
|
11279
11287
|
if (!isCrossDrag) {
|
|
11280
|
-
|
|
11288
|
+
handleColDragEndClearStatus()
|
|
11289
|
+
return Promise.resolve(errRest)
|
|
11281
11290
|
}
|
|
11282
|
-
} else if (newColumn.parentId) {
|
|
11283
|
-
// 根到子
|
|
11284
11291
|
|
|
11285
|
-
if (!isCrossDrag) {
|
|
11286
|
-
return errRest
|
|
11287
|
-
}
|
|
11288
11292
|
if (oldAllMaps[newColumn.id]) {
|
|
11289
11293
|
isSelfToChildStatus = true
|
|
11290
11294
|
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
@@ -11294,11 +11298,46 @@ export default defineVxeComponent({
|
|
|
11294
11298
|
content: getI18n('vxe.error.treeDragChild')
|
|
11295
11299
|
})
|
|
11296
11300
|
}
|
|
11297
|
-
|
|
11301
|
+
handleColDragEndClearStatus()
|
|
11302
|
+
return Promise.resolve(errRest)
|
|
11298
11303
|
}
|
|
11299
11304
|
}
|
|
11300
|
-
}
|
|
11301
|
-
|
|
11305
|
+
}
|
|
11306
|
+
} else if (dragColumn.parentId) {
|
|
11307
|
+
// 子到根
|
|
11308
|
+
|
|
11309
|
+
if (!isCrossDrag) {
|
|
11310
|
+
handleColDragEndClearStatus()
|
|
11311
|
+
return Promise.resolve(errRest)
|
|
11312
|
+
}
|
|
11313
|
+
} else if (newColumn.parentId) {
|
|
11314
|
+
// 根到子
|
|
11315
|
+
|
|
11316
|
+
if (!isCrossDrag) {
|
|
11317
|
+
handleColDragEndClearStatus()
|
|
11318
|
+
return Promise.resolve(errRest)
|
|
11319
|
+
}
|
|
11320
|
+
if (oldAllMaps[newColumn.id]) {
|
|
11321
|
+
isSelfToChildStatus = true
|
|
11322
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11323
|
+
if (VxeUI.modal) {
|
|
11324
|
+
VxeUI.modal.message({
|
|
11325
|
+
status: 'error',
|
|
11326
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
11327
|
+
})
|
|
11328
|
+
}
|
|
11329
|
+
handleColDragEndClearStatus()
|
|
11330
|
+
return Promise.resolve(errRest)
|
|
11331
|
+
}
|
|
11332
|
+
}
|
|
11333
|
+
} else {
|
|
11334
|
+
// 根到根
|
|
11335
|
+
}
|
|
11336
|
+
|
|
11337
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
11338
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11339
|
+
if (!status) {
|
|
11340
|
+
return errRest
|
|
11302
11341
|
}
|
|
11303
11342
|
|
|
11304
11343
|
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id)
|
|
@@ -11357,9 +11396,6 @@ export default defineVxeComponent({
|
|
|
11357
11396
|
}
|
|
11358
11397
|
}
|
|
11359
11398
|
|
|
11360
|
-
clearColDragData()
|
|
11361
|
-
clearCrossTableDragStatus()
|
|
11362
|
-
|
|
11363
11399
|
if (evnt) {
|
|
11364
11400
|
dispatchEvent('column-dragend', {
|
|
11365
11401
|
oldColumn: dragColumn,
|
|
@@ -11468,10 +11504,12 @@ export default defineVxeComponent({
|
|
|
11468
11504
|
})
|
|
11469
11505
|
}).catch(() => {
|
|
11470
11506
|
return errRest
|
|
11507
|
+
}).then((rest) => {
|
|
11508
|
+
handleColDragEndClearStatus()
|
|
11509
|
+
return rest
|
|
11471
11510
|
})
|
|
11472
11511
|
}
|
|
11473
|
-
|
|
11474
|
-
clearCrossTableDragStatus()
|
|
11512
|
+
handleColDragEndClearStatus()
|
|
11475
11513
|
return Promise.resolve(errRest)
|
|
11476
11514
|
},
|
|
11477
11515
|
handleHeaderCellDragDragendEvent (evnt) {
|
|
@@ -12247,12 +12285,15 @@ export default defineVxeComponent({
|
|
|
12247
12285
|
const lastRow = afterFullData[afterFullData.length - 1]
|
|
12248
12286
|
rowid = getRowid($xeTable, lastRow)
|
|
12249
12287
|
rowRest = fullAllDataRowIdData[rowid] || {}
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12288
|
+
if (rowRest) {
|
|
12289
|
+
const rHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
12290
|
+
// 如果为空时还没计算完数据,保持原高度不变
|
|
12291
|
+
if (rHeight) {
|
|
12292
|
+
sYHeight = (rowRest.oTop || 0) + rHeight
|
|
12293
|
+
// 是否展开行
|
|
12294
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
12295
|
+
sYHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
12296
|
+
}
|
|
12256
12297
|
}
|
|
12257
12298
|
}
|
|
12258
12299
|
if (sYHeight > maxYHeight) {
|
|
@@ -12390,7 +12431,7 @@ export default defineVxeComponent({
|
|
|
12390
12431
|
}
|
|
12391
12432
|
},
|
|
12392
12433
|
handleUpdateAggData () {
|
|
12393
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
12434
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
12394
12435
|
},
|
|
12395
12436
|
updateZindex () {
|
|
12396
12437
|
if (props.zIndex) {
|
|
@@ -13223,7 +13264,7 @@ export default defineVxeComponent({
|
|
|
13223
13264
|
if (value && value.length >= 20000) {
|
|
13224
13265
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
|
|
13225
13266
|
}
|
|
13226
|
-
loadTableData(value, true).then(() => {
|
|
13267
|
+
loadTableData(value, false, true).then(() => {
|
|
13227
13268
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
13228
13269
|
const expandOpts = computeExpandOpts.value
|
|
13229
13270
|
internalData.inited = true
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.clearColAnimate=clearColAnimate,exports.clearRowAnimate=clearRowAnimate,exports.moveColAnimateToLr=moveColAnimateToLr,exports.moveRowAnimateToTb=moveRowAnimateToTb;var _xeUtils=_interopRequireDefault(require("xe-utils")),_dom=require("../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let rowMoveCls="row--drag-move",colMoveClass="col--drag-move";function moveRowAnimateToTb(e,o){_xeUtils.default.arrayEach(e,e=>{e.style.transform=`translateY(${o}px)`}),requestAnimationFrame(()=>{_xeUtils.default.arrayEach(e,e=>{(0,_dom.addClass)(e,rowMoveCls),e.style.transform=""})})}function clearRowAnimate(e,o){setTimeout(()=>{e&&_xeUtils.default.arrayEach(e.querySelectorAll(o.map(e=>e+"."+rowMoveCls).join(",")),e=>(0,_dom.removeClass)(e,rowMoveCls))},500)}function moveColAnimateToLr(e,o){_xeUtils.default.arrayEach(e,e=>{e.style.transform=`translateX(${o}px)`}),requestAnimationFrame(()=>{_xeUtils.default.arrayEach(e,e=>{(0,_dom.addClass)(e,colMoveClass),e.style.transform=""})})}function clearColAnimate(e,o){setTimeout(()=>{e&&_xeUtils.default.arrayEach(e.querySelectorAll(o.map(e=>e+"."+rowMoveCls).join(",")),e=>(0,_dom.removeClass)(e,colMoveClass))},500)}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|