vxe-table 4.17.28 → 4.17.30
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/emits.js +3 -0
- package/es/table/src/table.js +205 -165
- package/es/table/style.css +212 -47
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +212 -47
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +32 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.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 +29 -28
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +212 -47
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +212 -47
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/src/emits.ts +4 -0
- package/packages/table/src/table.ts +213 -172
- package/styles/components/table.scss +326 -129
- /package/es/{iconfont.1765353166500.ttf → iconfont.1765844165606.ttf} +0 -0
- /package/es/{iconfont.1765353166500.woff → iconfont.1765844165606.woff} +0 -0
- /package/es/{iconfont.1765353166500.woff2 → iconfont.1765844165606.woff2} +0 -0
- /package/lib/{iconfont.1765353166500.ttf → iconfont.1765844165606.ttf} +0 -0
- /package/lib/{iconfont.1765353166500.woff → iconfont.1765844165606.woff} +0 -0
- /package/lib/{iconfont.1765353166500.woff2 → iconfont.1765844165606.woff2} +0 -0
|
@@ -31,7 +31,6 @@ import '../module/custom/hook'
|
|
|
31
31
|
import '../render'
|
|
32
32
|
|
|
33
33
|
import type { VxeTooltipInstance, VxeTabsConstructor, VxeTabsPrivateMethods, ValueOf, VxeComponentSlotType } from 'vxe-pc-ui'
|
|
34
|
-
import type { VxeGanttConstructor, VxeGanttPrivateMethods } from 'vxe-pc-ui/types/components/gantt'
|
|
35
34
|
import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes, VxeTableCustomPanelConstructor } from '../../../types'
|
|
36
35
|
|
|
37
36
|
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
|
|
@@ -66,7 +65,7 @@ export default defineVxeComponent({
|
|
|
66
65
|
const $xeTabs = inject<(VxeTabsConstructor & VxeTabsPrivateMethods) | null>('$xeTabs', null)
|
|
67
66
|
const $xeParentTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
68
67
|
const $xeGrid = inject<(VxeGridConstructor & VxeGridPrivateMethods) | null>('$xeGrid', null)
|
|
69
|
-
const $xeGantt = inject<
|
|
68
|
+
const $xeGantt = inject<VxeTableDefines.InjectGanttType | null>('$xeGantt', null)
|
|
70
69
|
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
71
70
|
|
|
72
71
|
const { computeSize } = useFns.useSize(props)
|
|
@@ -3787,7 +3786,8 @@ export default defineVxeComponent({
|
|
|
3787
3786
|
|
|
3788
3787
|
const initData = () => {
|
|
3789
3788
|
const { data } = props
|
|
3790
|
-
|
|
3789
|
+
dispatchEvent('ready', {}, null)
|
|
3790
|
+
loadTableData(data || [], true, true).then(() => {
|
|
3791
3791
|
if (data && data.length) {
|
|
3792
3792
|
internalData.inited = true
|
|
3793
3793
|
internalData.initStatus = true
|
|
@@ -3806,10 +3806,10 @@ export default defineVxeComponent({
|
|
|
3806
3806
|
* 加载表格数据
|
|
3807
3807
|
* @param {Array} datas 数据
|
|
3808
3808
|
*/
|
|
3809
|
-
const loadTableData = (datas: any[], isReset: boolean) => {
|
|
3809
|
+
const loadTableData = (datas: any[], isReload: boolean, isReset: boolean) => {
|
|
3810
3810
|
const { keepSource, treeConfig, rowGroupConfig, aggregateConfig } = props
|
|
3811
3811
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData
|
|
3812
|
-
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3812
|
+
const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3813
3813
|
const rowOpts = computeRowOpts.value
|
|
3814
3814
|
const treeOpts = computeTreeOpts.value
|
|
3815
3815
|
const expandOpts = computeExpandOpts.value
|
|
@@ -3948,6 +3948,18 @@ export default defineVxeComponent({
|
|
|
3948
3948
|
|
|
3949
3949
|
handleReserveStatus()
|
|
3950
3950
|
$xeTable.checkSelectionStatus()
|
|
3951
|
+
if (initStatus) {
|
|
3952
|
+
dispatchEvent('data-rendered', {
|
|
3953
|
+
isReload,
|
|
3954
|
+
visibleColumn: internalData.visibleColumn,
|
|
3955
|
+
visibleData: internalData.afterFullData
|
|
3956
|
+
}, null)
|
|
3957
|
+
} else {
|
|
3958
|
+
dispatchEvent('init-rendered', {
|
|
3959
|
+
visibleColumn: internalData.visibleColumn,
|
|
3960
|
+
visibleData: internalData.afterFullData
|
|
3961
|
+
}, null)
|
|
3962
|
+
}
|
|
3951
3963
|
$xeTable.dispatchEvent('data-change', {
|
|
3952
3964
|
visibleColumn: internalData.visibleColumn,
|
|
3953
3965
|
visibleData: internalData.afterFullData
|
|
@@ -4019,7 +4031,9 @@ export default defineVxeComponent({
|
|
|
4019
4031
|
handleDefaultMergeCells()
|
|
4020
4032
|
handleDefaultMergeHeaderItems()
|
|
4021
4033
|
handleDefaultMergeFooterItems()
|
|
4022
|
-
nextTick(() =>
|
|
4034
|
+
nextTick(() => {
|
|
4035
|
+
setTimeout(() => $xeTable.recalculate())
|
|
4036
|
+
})
|
|
4023
4037
|
}
|
|
4024
4038
|
|
|
4025
4039
|
/**
|
|
@@ -5022,7 +5036,7 @@ export default defineVxeComponent({
|
|
|
5022
5036
|
*/
|
|
5023
5037
|
loadData (datas) {
|
|
5024
5038
|
const { initStatus } = internalData
|
|
5025
|
-
return loadTableData(datas, false).then(() => {
|
|
5039
|
+
return loadTableData(datas, false, false).then(() => {
|
|
5026
5040
|
internalData.inited = true
|
|
5027
5041
|
internalData.initStatus = true
|
|
5028
5042
|
if (!initStatus) {
|
|
@@ -5040,7 +5054,7 @@ export default defineVxeComponent({
|
|
|
5040
5054
|
.then(() => {
|
|
5041
5055
|
internalData.inited = true
|
|
5042
5056
|
internalData.initStatus = true
|
|
5043
|
-
return loadTableData(datas, true)
|
|
5057
|
+
return loadTableData(datas, true, true)
|
|
5044
5058
|
}).then(() => {
|
|
5045
5059
|
handleLoadDefaults()
|
|
5046
5060
|
return handleLazyRecalculate(false, true, true)
|
|
@@ -7123,7 +7137,7 @@ export default defineVxeComponent({
|
|
|
7123
7137
|
handleUpdateRowGroup(confList.map(fieldOrColumn => {
|
|
7124
7138
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field
|
|
7125
7139
|
}))
|
|
7126
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
7140
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
7127
7141
|
}
|
|
7128
7142
|
return nextTick()
|
|
7129
7143
|
},
|
|
@@ -7152,7 +7166,7 @@ export default defineVxeComponent({
|
|
|
7152
7166
|
return nextTick()
|
|
7153
7167
|
}
|
|
7154
7168
|
handleUpdateRowGroup([])
|
|
7155
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
7169
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
7156
7170
|
},
|
|
7157
7171
|
isRowGroupRecord (row) {
|
|
7158
7172
|
warnLog('vxe.error.delFunc', ['isRowGroupRecord', 'isAggregateRecord'])
|
|
@@ -8506,6 +8520,18 @@ export default defineVxeComponent({
|
|
|
8506
8520
|
}
|
|
8507
8521
|
}
|
|
8508
8522
|
|
|
8523
|
+
const handleRowDragEndClearStatus = () => {
|
|
8524
|
+
clearRowDragData()
|
|
8525
|
+
clearCrossTableDragStatus()
|
|
8526
|
+
handleRecalculateStyle(false, true, true)
|
|
8527
|
+
}
|
|
8528
|
+
|
|
8529
|
+
const handleColDragEndClearStatus = () => {
|
|
8530
|
+
clearColDragData()
|
|
8531
|
+
clearCrossTableDragStatus()
|
|
8532
|
+
handleRecalculateStyle(true, true, true)
|
|
8533
|
+
}
|
|
8534
|
+
|
|
8509
8535
|
const clearRowDropOrigin = () => {
|
|
8510
8536
|
const el = refElem.value
|
|
8511
8537
|
if (el) {
|
|
@@ -10539,82 +10565,52 @@ export default defineVxeComponent({
|
|
|
10539
10565
|
dragToChild: !!prevDragToChild,
|
|
10540
10566
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
10541
10567
|
}
|
|
10542
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
10543
|
-
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10544
|
-
if (!status) {
|
|
10545
|
-
return errRest
|
|
10546
|
-
}
|
|
10547
10568
|
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
}
|
|
10569
|
+
const dragRowid = getRowid($xeTable, dragRow)
|
|
10570
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid] || {}
|
|
10571
|
+
const _dragRowIndex = dragRowRest._index
|
|
10572
|
+
let dragRowHeight = 0
|
|
10573
|
+
let dragOffsetTop = -1
|
|
10574
|
+
if (animation) {
|
|
10575
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
10576
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-body--row[rowid="${dragRowid}"]`)
|
|
10577
|
+
if (oldTrEl) {
|
|
10578
|
+
dragOffsetTop = oldTrEl.offsetTop
|
|
10559
10579
|
}
|
|
10580
|
+
}
|
|
10560
10581
|
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
const newRowid = getRowid($xeTable, prevDragRow)
|
|
10569
|
-
const newRest = fullAllDataRowIdData[newRowid]
|
|
10570
|
-
|
|
10571
|
-
if (oldRest && newRest) {
|
|
10572
|
-
const { level: oldLevel } = oldRest
|
|
10573
|
-
const { level: newLevel } = newRest
|
|
10574
|
-
|
|
10575
|
-
const oldAllMaps: Record<string, any> = {}
|
|
10576
|
-
XEUtils.eachTree([dragRow], item => {
|
|
10577
|
-
oldAllMaps[getRowid($xeTable, item)] = item
|
|
10578
|
-
}, { children: mapChildrenField })
|
|
10579
|
-
|
|
10580
|
-
let isSelfToChildStatus = false
|
|
10581
|
-
|
|
10582
|
-
if (oldLevel && newLevel) {
|
|
10583
|
-
// 子到子
|
|
10584
|
-
|
|
10585
|
-
if (isPeerDrag && !isCrossDrag) {
|
|
10586
|
-
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10587
|
-
// 非同级
|
|
10588
|
-
return errRest
|
|
10589
|
-
}
|
|
10590
|
-
} else {
|
|
10591
|
-
if (!isCrossDrag) {
|
|
10592
|
-
return errRest
|
|
10593
|
-
}
|
|
10594
|
-
if (oldAllMaps[newRowid]) {
|
|
10595
|
-
isSelfToChildStatus = true
|
|
10596
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10597
|
-
if (VxeUI.modal) {
|
|
10598
|
-
VxeUI.modal.message({
|
|
10599
|
-
status: 'error',
|
|
10600
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
10601
|
-
})
|
|
10602
|
-
}
|
|
10603
|
-
return errRest
|
|
10604
|
-
}
|
|
10605
|
-
}
|
|
10606
|
-
}
|
|
10607
|
-
} else if (oldLevel) {
|
|
10608
|
-
// 子到根
|
|
10582
|
+
let oafIndex = -1
|
|
10583
|
+
let nafIndex = -1
|
|
10584
|
+
const oldRest = dragRowRest
|
|
10585
|
+
const newRowid = getRowid($xeTable, prevDragRow)
|
|
10586
|
+
const newRest = fullAllDataRowIdData[newRowid]
|
|
10587
|
+
const oldAllMaps: Record<string, any> = {}
|
|
10588
|
+
let isSelfToChildStatus = false
|
|
10609
10589
|
|
|
10610
|
-
|
|
10611
|
-
|
|
10590
|
+
// 如果为树结构
|
|
10591
|
+
if (treeConfig) {
|
|
10592
|
+
if (transform) {
|
|
10593
|
+
if (oldRest && newRest) {
|
|
10594
|
+
const { level: oldLevel } = oldRest
|
|
10595
|
+
const { level: newLevel } = newRest
|
|
10596
|
+
|
|
10597
|
+
XEUtils.eachTree([dragRow], item => {
|
|
10598
|
+
oldAllMaps[getRowid($xeTable, item)] = item
|
|
10599
|
+
}, { children: mapChildrenField })
|
|
10600
|
+
|
|
10601
|
+
if (oldLevel && newLevel) {
|
|
10602
|
+
// 子到子
|
|
10603
|
+
|
|
10604
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
10605
|
+
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
10606
|
+
// 非同级
|
|
10607
|
+
handleRowDragEndClearStatus()
|
|
10608
|
+
return Promise.resolve(errRest)
|
|
10612
10609
|
}
|
|
10613
|
-
} else
|
|
10614
|
-
// 根到子
|
|
10615
|
-
|
|
10610
|
+
} else {
|
|
10616
10611
|
if (!isCrossDrag) {
|
|
10617
|
-
|
|
10612
|
+
handleRowDragEndClearStatus()
|
|
10613
|
+
return Promise.resolve(errRest)
|
|
10618
10614
|
}
|
|
10619
10615
|
if (oldAllMaps[newRowid]) {
|
|
10620
10616
|
isSelfToChildStatus = true
|
|
@@ -10625,13 +10621,56 @@ export default defineVxeComponent({
|
|
|
10625
10621
|
content: getI18n('vxe.error.treeDragChild')
|
|
10626
10622
|
})
|
|
10627
10623
|
}
|
|
10628
|
-
|
|
10624
|
+
handleRowDragEndClearStatus()
|
|
10625
|
+
return Promise.resolve(errRest)
|
|
10629
10626
|
}
|
|
10630
10627
|
}
|
|
10631
|
-
} else {
|
|
10632
|
-
// 根到根
|
|
10633
10628
|
}
|
|
10629
|
+
} else if (oldLevel) {
|
|
10630
|
+
// 子到根
|
|
10631
|
+
|
|
10632
|
+
if (!isCrossDrag) {
|
|
10633
|
+
handleRowDragEndClearStatus()
|
|
10634
|
+
return Promise.resolve(errRest)
|
|
10635
|
+
}
|
|
10636
|
+
} else if (newLevel) {
|
|
10637
|
+
// 根到子
|
|
10638
|
+
|
|
10639
|
+
if (!isCrossDrag) {
|
|
10640
|
+
handleRowDragEndClearStatus()
|
|
10641
|
+
return Promise.resolve(errRest)
|
|
10642
|
+
}
|
|
10643
|
+
if (oldAllMaps[newRowid]) {
|
|
10644
|
+
isSelfToChildStatus = true
|
|
10645
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
10646
|
+
if (VxeUI.modal) {
|
|
10647
|
+
VxeUI.modal.message({
|
|
10648
|
+
status: 'error',
|
|
10649
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
10650
|
+
})
|
|
10651
|
+
}
|
|
10652
|
+
handleRowDragEndClearStatus()
|
|
10653
|
+
return Promise.resolve(errRest)
|
|
10654
|
+
}
|
|
10655
|
+
}
|
|
10656
|
+
} else {
|
|
10657
|
+
// 根到根
|
|
10658
|
+
}
|
|
10659
|
+
}
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10662
|
+
|
|
10663
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
10664
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
10665
|
+
if (!status) {
|
|
10666
|
+
return errRest
|
|
10667
|
+
}
|
|
10634
10668
|
|
|
10669
|
+
// 如果为树结构
|
|
10670
|
+
if (treeConfig) {
|
|
10671
|
+
if (transform) {
|
|
10672
|
+
// 移出源位置
|
|
10673
|
+
if (oldRest && newRest) {
|
|
10635
10674
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
10636
10675
|
key: rowField,
|
|
10637
10676
|
parentKey: parentField,
|
|
@@ -10677,8 +10716,6 @@ export default defineVxeComponent({
|
|
|
10677
10716
|
afterFullData.splice(nafIndex, 0, dragRow)
|
|
10678
10717
|
tableFullData.splice(ntfIndex, 0, dragRow)
|
|
10679
10718
|
}
|
|
10680
|
-
clearRowDragData()
|
|
10681
|
-
clearCrossTableDragStatus()
|
|
10682
10719
|
|
|
10683
10720
|
$xeTable.handleTableData(treeConfig && transform)
|
|
10684
10721
|
$xeTable.cacheRowMap(false)
|
|
@@ -10791,18 +10828,15 @@ export default defineVxeComponent({
|
|
|
10791
10828
|
}).catch(() => {
|
|
10792
10829
|
return errRest
|
|
10793
10830
|
}).then((rest) => {
|
|
10794
|
-
|
|
10795
|
-
clearCrossTableDragStatus()
|
|
10831
|
+
handleRowDragEndClearStatus()
|
|
10796
10832
|
return rest
|
|
10797
10833
|
})
|
|
10798
10834
|
}
|
|
10799
|
-
|
|
10800
|
-
clearCrossTableDragStatus()
|
|
10835
|
+
handleRowDragEndClearStatus()
|
|
10801
10836
|
return Promise.resolve(errRest)
|
|
10802
10837
|
},
|
|
10803
10838
|
handleCrossTableRowDragCancelEvent () {
|
|
10804
|
-
|
|
10805
|
-
clearCrossTableDragStatus()
|
|
10839
|
+
handleRowDragEndClearStatus()
|
|
10806
10840
|
},
|
|
10807
10841
|
/**
|
|
10808
10842
|
* 处理跨表拖拽完成
|
|
@@ -10863,8 +10897,7 @@ export default defineVxeComponent({
|
|
|
10863
10897
|
dispatchEvent('row-remove-dragend', {
|
|
10864
10898
|
row: dragRow
|
|
10865
10899
|
}, evnt)
|
|
10866
|
-
|
|
10867
|
-
clearCrossTableDragStatus()
|
|
10900
|
+
handleRowDragEndClearStatus()
|
|
10868
10901
|
}
|
|
10869
10902
|
}
|
|
10870
10903
|
},
|
|
@@ -10937,8 +10970,7 @@ export default defineVxeComponent({
|
|
|
10937
10970
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt)
|
|
10938
10971
|
}
|
|
10939
10972
|
}
|
|
10940
|
-
|
|
10941
|
-
clearCrossTableDragStatus()
|
|
10973
|
+
handleRowDragEndClearStatus()
|
|
10942
10974
|
return errRest
|
|
10943
10975
|
}
|
|
10944
10976
|
let insertRest: Promise<any> = Promise.resolve()
|
|
@@ -11204,86 +11236,58 @@ export default defineVxeComponent({
|
|
|
11204
11236
|
dragToChild: !!prevDragToChild,
|
|
11205
11237
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
11206
11238
|
}
|
|
11207
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
11208
|
-
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11209
|
-
if (!status) {
|
|
11210
|
-
return errRest
|
|
11211
|
-
}
|
|
11212
|
-
|
|
11213
|
-
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
11214
|
-
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
11215
|
-
let dragColWidth = 0
|
|
11216
|
-
if (animation) {
|
|
11217
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
11218
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11219
|
-
dragTargetColumn = column
|
|
11220
|
-
dragColWidth += column.renderWidth
|
|
11221
|
-
}
|
|
11222
|
-
dragAllTargetCols.push(column)
|
|
11223
|
-
})
|
|
11224
|
-
}
|
|
11225
|
-
if (!dragTargetColumn) {
|
|
11226
|
-
dragTargetColumn = dragColumn
|
|
11227
|
-
}
|
|
11228
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
11229
|
-
const _dragColIndex = dragColRest._index
|
|
11230
11239
|
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11240
|
+
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
11241
|
+
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
11242
|
+
let dragColWidth = 0
|
|
11243
|
+
if (animation) {
|
|
11244
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11245
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
11246
|
+
dragTargetColumn = column
|
|
11247
|
+
dragColWidth += column.renderWidth
|
|
11236
11248
|
}
|
|
11249
|
+
dragAllTargetCols.push(column)
|
|
11250
|
+
})
|
|
11251
|
+
}
|
|
11252
|
+
if (!dragTargetColumn) {
|
|
11253
|
+
dragTargetColumn = dragColumn
|
|
11254
|
+
}
|
|
11255
|
+
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
11256
|
+
const _dragColIndex = dragColRest._index
|
|
11257
|
+
|
|
11258
|
+
let dragOffsetLeft = -1
|
|
11259
|
+
if (animation) {
|
|
11260
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-table--column[colid="${dragTargetColumn.id}"]`)
|
|
11261
|
+
if (oldTrEl) {
|
|
11262
|
+
dragOffsetLeft = oldTrEl.offsetLeft
|
|
11237
11263
|
}
|
|
11264
|
+
}
|
|
11238
11265
|
|
|
11239
|
-
|
|
11240
|
-
|
|
11266
|
+
let oafIndex = -1
|
|
11267
|
+
let nafIndex = -1
|
|
11241
11268
|
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11269
|
+
const oldAllMaps: Record<string, any> = {}
|
|
11270
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
11271
|
+
oldAllMaps[column.id] = column
|
|
11272
|
+
})
|
|
11246
11273
|
|
|
11247
|
-
|
|
11274
|
+
let isSelfToChildStatus = false
|
|
11248
11275
|
|
|
11249
|
-
|
|
11250
|
-
|
|
11276
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
11277
|
+
// 子到子
|
|
11251
11278
|
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
} else {
|
|
11258
|
-
if (!isCrossDrag) {
|
|
11259
|
-
return errRest
|
|
11260
|
-
}
|
|
11261
|
-
|
|
11262
|
-
if (oldAllMaps[newColumn.id]) {
|
|
11263
|
-
isSelfToChildStatus = true
|
|
11264
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11265
|
-
if (VxeUI.modal) {
|
|
11266
|
-
VxeUI.modal.message({
|
|
11267
|
-
status: 'error',
|
|
11268
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
11269
|
-
})
|
|
11270
|
-
}
|
|
11271
|
-
return errRest
|
|
11272
|
-
}
|
|
11273
|
-
}
|
|
11279
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
11280
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
11281
|
+
// 非同级
|
|
11282
|
+
handleColDragEndClearStatus()
|
|
11283
|
+
return Promise.resolve(errRest)
|
|
11274
11284
|
}
|
|
11275
|
-
} else
|
|
11276
|
-
// 子到根
|
|
11277
|
-
|
|
11285
|
+
} else {
|
|
11278
11286
|
if (!isCrossDrag) {
|
|
11279
|
-
|
|
11287
|
+
handleColDragEndClearStatus()
|
|
11288
|
+
return Promise.resolve(errRest)
|
|
11280
11289
|
}
|
|
11281
|
-
} else if (newColumn.parentId) {
|
|
11282
|
-
// 根到子
|
|
11283
11290
|
|
|
11284
|
-
if (!isCrossDrag) {
|
|
11285
|
-
return errRest
|
|
11286
|
-
}
|
|
11287
11291
|
if (oldAllMaps[newColumn.id]) {
|
|
11288
11292
|
isSelfToChildStatus = true
|
|
11289
11293
|
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
@@ -11293,11 +11297,46 @@ export default defineVxeComponent({
|
|
|
11293
11297
|
content: getI18n('vxe.error.treeDragChild')
|
|
11294
11298
|
})
|
|
11295
11299
|
}
|
|
11296
|
-
|
|
11300
|
+
handleColDragEndClearStatus()
|
|
11301
|
+
return Promise.resolve(errRest)
|
|
11297
11302
|
}
|
|
11298
11303
|
}
|
|
11299
|
-
}
|
|
11300
|
-
|
|
11304
|
+
}
|
|
11305
|
+
} else if (dragColumn.parentId) {
|
|
11306
|
+
// 子到根
|
|
11307
|
+
|
|
11308
|
+
if (!isCrossDrag) {
|
|
11309
|
+
handleColDragEndClearStatus()
|
|
11310
|
+
return Promise.resolve(errRest)
|
|
11311
|
+
}
|
|
11312
|
+
} else if (newColumn.parentId) {
|
|
11313
|
+
// 根到子
|
|
11314
|
+
|
|
11315
|
+
if (!isCrossDrag) {
|
|
11316
|
+
handleColDragEndClearStatus()
|
|
11317
|
+
return Promise.resolve(errRest)
|
|
11318
|
+
}
|
|
11319
|
+
if (oldAllMaps[newColumn.id]) {
|
|
11320
|
+
isSelfToChildStatus = true
|
|
11321
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
11322
|
+
if (VxeUI.modal) {
|
|
11323
|
+
VxeUI.modal.message({
|
|
11324
|
+
status: 'error',
|
|
11325
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
11326
|
+
})
|
|
11327
|
+
}
|
|
11328
|
+
handleColDragEndClearStatus()
|
|
11329
|
+
return Promise.resolve(errRest)
|
|
11330
|
+
}
|
|
11331
|
+
}
|
|
11332
|
+
} else {
|
|
11333
|
+
// 根到根
|
|
11334
|
+
}
|
|
11335
|
+
|
|
11336
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
11337
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
11338
|
+
if (!status) {
|
|
11339
|
+
return errRest
|
|
11301
11340
|
}
|
|
11302
11341
|
|
|
11303
11342
|
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id)
|
|
@@ -11465,13 +11504,11 @@ export default defineVxeComponent({
|
|
|
11465
11504
|
}).catch(() => {
|
|
11466
11505
|
return errRest
|
|
11467
11506
|
}).then((rest) => {
|
|
11468
|
-
|
|
11469
|
-
clearCrossTableDragStatus()
|
|
11507
|
+
handleColDragEndClearStatus()
|
|
11470
11508
|
return rest
|
|
11471
11509
|
})
|
|
11472
11510
|
}
|
|
11473
|
-
|
|
11474
|
-
clearCrossTableDragStatus()
|
|
11511
|
+
handleColDragEndClearStatus()
|
|
11475
11512
|
return Promise.resolve(errRest)
|
|
11476
11513
|
},
|
|
11477
11514
|
handleHeaderCellDragDragendEvent (evnt) {
|
|
@@ -12393,7 +12430,7 @@ export default defineVxeComponent({
|
|
|
12393
12430
|
}
|
|
12394
12431
|
},
|
|
12395
12432
|
handleUpdateAggData () {
|
|
12396
|
-
return loadTableData(internalData.tableSynchData, true)
|
|
12433
|
+
return loadTableData(internalData.tableSynchData, false, true)
|
|
12397
12434
|
},
|
|
12398
12435
|
updateZindex () {
|
|
12399
12436
|
if (props.zIndex) {
|
|
@@ -12929,7 +12966,9 @@ export default defineVxeComponent({
|
|
|
12929
12966
|
'checkbox--range': checkboxOpts.range,
|
|
12930
12967
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
12931
12968
|
'is--header': showHeader,
|
|
12969
|
+
'not--header': !showHeader,
|
|
12932
12970
|
'is--footer': showFooter,
|
|
12971
|
+
'not--footer': !showFooter,
|
|
12933
12972
|
'is--group': isGroup,
|
|
12934
12973
|
'is-row-group': isRowGroupStatus,
|
|
12935
12974
|
'is--tree-line': treeConfig && (treeOpts.showLine || treeOpts.line),
|
|
@@ -12941,7 +12980,9 @@ export default defineVxeComponent({
|
|
|
12941
12980
|
'is--loading': currLoading,
|
|
12942
12981
|
'is--empty': !currLoading && !tableData.length,
|
|
12943
12982
|
'is--scroll-y': overflowY,
|
|
12983
|
+
'not--scroll-y': !overflowY,
|
|
12944
12984
|
'is--scroll-x': overflowX,
|
|
12985
|
+
'not--scroll-x': !overflowX,
|
|
12945
12986
|
'is--virtual-x': scrollXLoad,
|
|
12946
12987
|
'is--virtual-y': scrollYLoad
|
|
12947
12988
|
}],
|
|
@@ -13226,7 +13267,7 @@ export default defineVxeComponent({
|
|
|
13226
13267
|
if (value && value.length >= 20000) {
|
|
13227
13268
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
|
|
13228
13269
|
}
|
|
13229
|
-
loadTableData(value, true).then(() => {
|
|
13270
|
+
loadTableData(value, false, true).then(() => {
|
|
13230
13271
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
13231
13272
|
const expandOpts = computeExpandOpts.value
|
|
13232
13273
|
internalData.inited = true
|