vxe-table 3.19.28 → 3.19.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/methods.js +210 -170
- package/es/table/src/table.js +5 -1
- 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 +33 -28
- 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/methods.js +212 -172
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +5 -1
- 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/methods.ts +216 -174
- package/packages/table/src/table.ts +5 -1
- package/styles/components/table.scss +326 -129
- /package/es/{iconfont.1765353143587.ttf → iconfont.1765844135646.ttf} +0 -0
- /package/es/{iconfont.1765353143587.woff → iconfont.1765844135646.woff} +0 -0
- /package/es/{iconfont.1765353143587.woff2 → iconfont.1765844135646.woff2} +0 -0
- /package/lib/{iconfont.1765353143587.ttf → iconfont.1765844135646.ttf} +0 -0
- /package/lib/{iconfont.1765353143587.woff → iconfont.1765844135646.woff} +0 -0
- /package/lib/{iconfont.1765353143587.woff2 → iconfont.1765844135646.woff2} +0 -0
|
@@ -9,7 +9,6 @@ import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimat
|
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
10
10
|
import { getCrossTableDragRowInfo } from './store'
|
|
11
11
|
|
|
12
|
-
import type { VxeGanttConstructor, VxeGanttPrivateMethods } from 'vxe-gantt'
|
|
13
12
|
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, VxeToolbarInstance, TableInternalData, VxeGridConstructor, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes, VxeGridPrivateMethods } from '../../../types'
|
|
14
13
|
|
|
15
14
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
|
|
@@ -2633,6 +2632,18 @@ function clearDragStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
2633
2632
|
}
|
|
2634
2633
|
}
|
|
2635
2634
|
|
|
2635
|
+
function handleRowDragEndClearStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
2636
|
+
clearRowDragData($xeTable)
|
|
2637
|
+
clearCrossTableDragStatus($xeTable)
|
|
2638
|
+
handleRecalculateStyle($xeTable, false, true, true)
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
function handleColDragEndClearStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
2642
|
+
clearColDragData($xeTable)
|
|
2643
|
+
clearCrossTableDragStatus($xeTable)
|
|
2644
|
+
handleRecalculateStyle($xeTable, true, true, true)
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2636
2647
|
function clearRowDropOrigin ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
2637
2648
|
const el = $xeTable.$el
|
|
2638
2649
|
if (el) {
|
|
@@ -3352,14 +3363,14 @@ function handleGroupData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
3352
3363
|
* 加载表格数据
|
|
3353
3364
|
* @param {Array} datas 数据
|
|
3354
3365
|
*/
|
|
3355
|
-
function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, datas: any[], isReset: boolean) {
|
|
3366
|
+
function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, datas: any[], isReload: boolean, isReset: boolean) {
|
|
3356
3367
|
const props = $xeTable
|
|
3357
3368
|
const reactData = $xeTable as unknown as TableReactData
|
|
3358
3369
|
const internalData = $xeTable as unknown as TableInternalData
|
|
3359
3370
|
|
|
3360
3371
|
const { keepSource, treeConfig, aggregateConfig, rowGroupConfig } = props
|
|
3361
3372
|
const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData
|
|
3362
|
-
const { scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3373
|
+
const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
|
|
3363
3374
|
const rowOpts = $xeTable.computeRowOpts
|
|
3364
3375
|
const treeOpts = $xeTable.computeTreeOpts
|
|
3365
3376
|
const expandOpts = $xeTable.computeExpandOpts
|
|
@@ -3498,6 +3509,18 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
|
|
|
3498
3509
|
|
|
3499
3510
|
handleReserveStatus($xeTable)
|
|
3500
3511
|
$xeTable.checkSelectionStatus()
|
|
3512
|
+
if (initStatus) {
|
|
3513
|
+
$xeTable.dispatchEvent('data-rendered', {
|
|
3514
|
+
isReload,
|
|
3515
|
+
visibleColumn: internalData.visibleColumn,
|
|
3516
|
+
visibleData: internalData.afterFullData
|
|
3517
|
+
}, null)
|
|
3518
|
+
} else {
|
|
3519
|
+
$xeTable.dispatchEvent('init-rendered', {
|
|
3520
|
+
visibleColumn: internalData.visibleColumn,
|
|
3521
|
+
visibleData: internalData.afterFullData
|
|
3522
|
+
}, null)
|
|
3523
|
+
}
|
|
3501
3524
|
$xeTable.dispatchEvent('data-change', {
|
|
3502
3525
|
visibleColumn: internalData.visibleColumn,
|
|
3503
3526
|
visibleData: internalData.afterFullData
|
|
@@ -3569,7 +3592,14 @@ function handleLoadDefaults ($xeTable: VxeTableConstructor & VxeTablePrivateMeth
|
|
|
3569
3592
|
handleDefaultMergeCells($xeTable)
|
|
3570
3593
|
handleDefaultMergeHeaderItems($xeTable)
|
|
3571
3594
|
handleDefaultMergeFooterItems($xeTable)
|
|
3572
|
-
$xeTable.$nextTick(() =>
|
|
3595
|
+
$xeTable.$nextTick(() => {
|
|
3596
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
3597
|
+
$xeTable.dispatchEvent('init-rendered', {
|
|
3598
|
+
visibleColumn: internalData.visibleColumn,
|
|
3599
|
+
visibleData: internalData.afterFullData
|
|
3600
|
+
}, null)
|
|
3601
|
+
setTimeout(() => $xeTable.recalculate())
|
|
3602
|
+
})
|
|
3573
3603
|
}
|
|
3574
3604
|
|
|
3575
3605
|
/**
|
|
@@ -4446,7 +4476,7 @@ const tableMethods: any = {
|
|
|
4446
4476
|
getParentHeight () {
|
|
4447
4477
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
4448
4478
|
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & VxeGridPrivateMethods
|
|
4449
|
-
const $xeGantt = $xeTable.$xeGantt
|
|
4479
|
+
const $xeGantt = $xeTable.$xeGantt
|
|
4450
4480
|
const props = $xeTable
|
|
4451
4481
|
|
|
4452
4482
|
const { height } = props
|
|
@@ -4505,7 +4535,7 @@ const tableMethods: any = {
|
|
|
4505
4535
|
errLog('vxe.error.delFunc', ['syncData', 'getData'])
|
|
4506
4536
|
return $xeTable.$nextTick().then(() => {
|
|
4507
4537
|
reactData.tableData = []
|
|
4508
|
-
return $xeTable.$nextTick().then(() => loadTableData($xeTable, internalData.tableFullData, true))
|
|
4538
|
+
return $xeTable.$nextTick().then(() => loadTableData($xeTable, internalData.tableFullData, true, true))
|
|
4509
4539
|
})
|
|
4510
4540
|
},
|
|
4511
4541
|
/**
|
|
@@ -4576,7 +4606,8 @@ const tableMethods: any = {
|
|
|
4576
4606
|
const internalData = $xeTable as unknown as TableInternalData
|
|
4577
4607
|
|
|
4578
4608
|
const { data } = props
|
|
4579
|
-
|
|
4609
|
+
$xeTable.dispatchEvent('ready', {}, null)
|
|
4610
|
+
loadTableData($xeTable, data || [], true, true).then(() => {
|
|
4580
4611
|
if (data && data.length) {
|
|
4581
4612
|
internalData.inited = true
|
|
4582
4613
|
internalData.initStatus = true
|
|
@@ -4594,10 +4625,10 @@ const tableMethods: any = {
|
|
|
4594
4625
|
* 加载表格数据
|
|
4595
4626
|
* @param {Array} datas 数据
|
|
4596
4627
|
*/
|
|
4597
|
-
loadTableData (datas: any[], isReset: boolean) {
|
|
4628
|
+
loadTableData (datas: any[], isReload: boolean, isReset: boolean) {
|
|
4598
4629
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
4599
4630
|
|
|
4600
|
-
return loadTableData($xeTable, datas, isReset)
|
|
4631
|
+
return loadTableData($xeTable, datas, isReload, isReset)
|
|
4601
4632
|
},
|
|
4602
4633
|
/**
|
|
4603
4634
|
* 重新加载数据,不会清空表格状态
|
|
@@ -4605,12 +4636,13 @@ const tableMethods: any = {
|
|
|
4605
4636
|
*/
|
|
4606
4637
|
loadData (datas: any) {
|
|
4607
4638
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
4639
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
4608
4640
|
|
|
4609
|
-
const { initStatus } =
|
|
4610
|
-
return loadTableData($xeTable, datas, false).then(() => {
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
if (
|
|
4641
|
+
const { initStatus } = internalData
|
|
4642
|
+
return loadTableData($xeTable, datas, false, false).then(() => {
|
|
4643
|
+
internalData.inited = true
|
|
4644
|
+
internalData.initStatus = true
|
|
4645
|
+
if (initStatus) {
|
|
4614
4646
|
handleLoadDefaults($xeTable)
|
|
4615
4647
|
}
|
|
4616
4648
|
return handleLazyRecalculate($xeTable, false, true, true)
|
|
@@ -4622,12 +4654,13 @@ const tableMethods: any = {
|
|
|
4622
4654
|
*/
|
|
4623
4655
|
reloadData (datas: any) {
|
|
4624
4656
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
4657
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
4625
4658
|
|
|
4626
|
-
return
|
|
4659
|
+
return $xeTable.clearAll()
|
|
4627
4660
|
.then(() => {
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
return loadTableData($xeTable, datas, true)
|
|
4661
|
+
internalData.inited = true
|
|
4662
|
+
internalData.initStatus = true
|
|
4663
|
+
return loadTableData($xeTable, datas, true, true)
|
|
4631
4664
|
})
|
|
4632
4665
|
.then(() => {
|
|
4633
4666
|
handleLoadDefaults($xeTable)
|
|
@@ -4638,6 +4671,8 @@ const tableMethods: any = {
|
|
|
4638
4671
|
* 修改行数据
|
|
4639
4672
|
*/
|
|
4640
4673
|
setRow (rows: any, record: any) {
|
|
4674
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
4675
|
+
|
|
4641
4676
|
if (record) {
|
|
4642
4677
|
let rest = rows
|
|
4643
4678
|
if (!XEUtils.isArray(rows)) {
|
|
@@ -4645,7 +4680,7 @@ const tableMethods: any = {
|
|
|
4645
4680
|
}
|
|
4646
4681
|
rest.forEach((item:any) => Object.assign(item, record))
|
|
4647
4682
|
}
|
|
4648
|
-
return
|
|
4683
|
+
return $xeTable.$nextTick()
|
|
4649
4684
|
},
|
|
4650
4685
|
/**
|
|
4651
4686
|
* 局部加载行数据并恢复到初始状态
|
|
@@ -9026,80 +9061,48 @@ const tableMethods: any = {
|
|
|
9026
9061
|
dragToChild: !!prevDragToChild,
|
|
9027
9062
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
9028
9063
|
}
|
|
9029
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
9030
|
-
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
9031
|
-
if (!status) {
|
|
9032
|
-
return errRest
|
|
9033
|
-
}
|
|
9034
9064
|
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
}
|
|
9065
|
+
const dragRowid = getRowid($xeTable, dragRow)
|
|
9066
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid] || {}
|
|
9067
|
+
const _dragRowIndex = dragRowRest._index
|
|
9068
|
+
let dragRowHeight = 0
|
|
9069
|
+
let dragOffsetTop = -1
|
|
9070
|
+
if (animation) {
|
|
9071
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight)
|
|
9072
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-body--row[rowid="${dragRowid}"]`)
|
|
9073
|
+
if (oldTrEl) {
|
|
9074
|
+
dragOffsetTop = oldTrEl.offsetTop
|
|
9046
9075
|
}
|
|
9076
|
+
}
|
|
9047
9077
|
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
const newRowid = getRowid($xeTable, prevDragRow)
|
|
9056
|
-
const newRest = fullAllDataRowIdData[newRowid]
|
|
9057
|
-
|
|
9058
|
-
if (oldRest && newRest) {
|
|
9059
|
-
const { level: oldLevel } = oldRest
|
|
9060
|
-
const { level: newLevel } = newRest
|
|
9061
|
-
|
|
9062
|
-
const oldAllMaps: Record<string, any> = {}
|
|
9063
|
-
XEUtils.eachTree([dragRow], item => {
|
|
9064
|
-
oldAllMaps[getRowid($xeTable, item)] = item
|
|
9065
|
-
}, { children: mapChildrenField })
|
|
9078
|
+
let oafIndex = -1
|
|
9079
|
+
let nafIndex = -1
|
|
9080
|
+
const oldRest = dragRowRest
|
|
9081
|
+
const newRowid = getRowid($xeTable, prevDragRow)
|
|
9082
|
+
const newRest = fullAllDataRowIdData[newRowid]
|
|
9083
|
+
const oldAllMaps: Record<string, any> = {}
|
|
9084
|
+
let isSelfToChildStatus = false
|
|
9066
9085
|
|
|
9067
|
-
|
|
9086
|
+
// 如果为树结构
|
|
9087
|
+
if (treeConfig) {
|
|
9088
|
+
if (transform) {
|
|
9089
|
+
if (oldRest && newRest) {
|
|
9090
|
+
const { level: oldLevel } = oldRest
|
|
9091
|
+
const { level: newLevel } = newRest
|
|
9068
9092
|
|
|
9069
|
-
|
|
9070
|
-
|
|
9093
|
+
XEUtils.eachTree([dragRow], item => {
|
|
9094
|
+
oldAllMaps[getRowid($xeTable, item)] = item
|
|
9095
|
+
}, { children: mapChildrenField })
|
|
9071
9096
|
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
// 非同级
|
|
9075
|
-
return errRest
|
|
9076
|
-
}
|
|
9077
|
-
} else {
|
|
9078
|
-
if (!isCrossDrag) {
|
|
9079
|
-
return errRest
|
|
9080
|
-
}
|
|
9081
|
-
if (oldAllMaps[newRowid]) {
|
|
9082
|
-
isSelfToChildStatus = true
|
|
9083
|
-
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
9084
|
-
if (VxeUI.modal) {
|
|
9085
|
-
VxeUI.modal.message({
|
|
9086
|
-
status: 'error',
|
|
9087
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
9088
|
-
})
|
|
9089
|
-
}
|
|
9090
|
-
return errRest
|
|
9091
|
-
}
|
|
9092
|
-
}
|
|
9093
|
-
}
|
|
9094
|
-
} else if (oldLevel) {
|
|
9095
|
-
// 子到根
|
|
9097
|
+
if (oldLevel && newLevel) {
|
|
9098
|
+
// 子到子
|
|
9096
9099
|
|
|
9097
|
-
|
|
9100
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
9101
|
+
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
9102
|
+
// 非同级
|
|
9098
9103
|
return errRest
|
|
9099
9104
|
}
|
|
9100
|
-
} else
|
|
9101
|
-
// 根到子
|
|
9102
|
-
|
|
9105
|
+
} else {
|
|
9103
9106
|
if (!isCrossDrag) {
|
|
9104
9107
|
return errRest
|
|
9105
9108
|
}
|
|
@@ -9115,10 +9118,49 @@ const tableMethods: any = {
|
|
|
9115
9118
|
return errRest
|
|
9116
9119
|
}
|
|
9117
9120
|
}
|
|
9118
|
-
} else {
|
|
9119
|
-
// 根到根
|
|
9120
9121
|
}
|
|
9122
|
+
} else if (oldLevel) {
|
|
9123
|
+
// 子到根
|
|
9124
|
+
|
|
9125
|
+
if (!isCrossDrag) {
|
|
9126
|
+
return errRest
|
|
9127
|
+
}
|
|
9128
|
+
} else if (newLevel) {
|
|
9129
|
+
// 根到子
|
|
9130
|
+
|
|
9131
|
+
if (!isCrossDrag) {
|
|
9132
|
+
return errRest
|
|
9133
|
+
}
|
|
9134
|
+
if (oldAllMaps[newRowid]) {
|
|
9135
|
+
isSelfToChildStatus = true
|
|
9136
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
9137
|
+
if (VxeUI.modal) {
|
|
9138
|
+
VxeUI.modal.message({
|
|
9139
|
+
status: 'error',
|
|
9140
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
9141
|
+
})
|
|
9142
|
+
}
|
|
9143
|
+
return errRest
|
|
9144
|
+
}
|
|
9145
|
+
}
|
|
9146
|
+
} else {
|
|
9147
|
+
// 根到根
|
|
9148
|
+
}
|
|
9149
|
+
}
|
|
9150
|
+
}
|
|
9151
|
+
}
|
|
9152
|
+
|
|
9153
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
9154
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
9155
|
+
if (!status) {
|
|
9156
|
+
return errRest
|
|
9157
|
+
}
|
|
9121
9158
|
|
|
9159
|
+
// 如果为树结构
|
|
9160
|
+
if (treeConfig) {
|
|
9161
|
+
if (transform) {
|
|
9162
|
+
// 移出源位置
|
|
9163
|
+
if (oldRest && newRest) {
|
|
9122
9164
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
9123
9165
|
key: rowField,
|
|
9124
9166
|
parentKey: parentField,
|
|
@@ -9274,20 +9316,17 @@ const tableMethods: any = {
|
|
|
9274
9316
|
}).catch(() => {
|
|
9275
9317
|
return errRest
|
|
9276
9318
|
}).then((rest) => {
|
|
9277
|
-
|
|
9278
|
-
clearCrossTableDragStatus($xeTable)
|
|
9319
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9279
9320
|
return rest
|
|
9280
9321
|
})
|
|
9281
9322
|
}
|
|
9282
|
-
|
|
9283
|
-
clearCrossTableDragStatus($xeTable)
|
|
9323
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9284
9324
|
return Promise.resolve(errRest)
|
|
9285
9325
|
},
|
|
9286
9326
|
handleCrossTableRowDragCancelEvent () {
|
|
9287
9327
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9288
9328
|
|
|
9289
|
-
|
|
9290
|
-
clearCrossTableDragStatus($xeTable)
|
|
9329
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9291
9330
|
},
|
|
9292
9331
|
/**
|
|
9293
9332
|
* 处理跨表拖拽完成
|
|
@@ -9353,8 +9392,7 @@ const tableMethods: any = {
|
|
|
9353
9392
|
$xeTable.dispatchEvent('row-remove-dragend', {
|
|
9354
9393
|
row: dragRow
|
|
9355
9394
|
}, evnt)
|
|
9356
|
-
|
|
9357
|
-
clearCrossTableDragStatus($xeTable)
|
|
9395
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9358
9396
|
}
|
|
9359
9397
|
}
|
|
9360
9398
|
},
|
|
@@ -9438,8 +9476,7 @@ const tableMethods: any = {
|
|
|
9438
9476
|
$oldTable.handleCrossTableRowDragCancelEvent(evnt)
|
|
9439
9477
|
}
|
|
9440
9478
|
}
|
|
9441
|
-
|
|
9442
|
-
clearCrossTableDragStatus($xeTable)
|
|
9479
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9443
9480
|
return errRest
|
|
9444
9481
|
}
|
|
9445
9482
|
let insertRest: Promise<any> = Promise.resolve()
|
|
@@ -9736,86 +9773,58 @@ const tableMethods: any = {
|
|
|
9736
9773
|
dragToChild: !!prevDragToChild,
|
|
9737
9774
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
9738
9775
|
}
|
|
9739
|
-
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
9740
|
-
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
9741
|
-
if (!status) {
|
|
9742
|
-
return errRest
|
|
9743
|
-
}
|
|
9744
|
-
|
|
9745
|
-
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
9746
|
-
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
9747
|
-
let dragColWidth = 0
|
|
9748
|
-
if (animation) {
|
|
9749
|
-
XEUtils.eachTree([dragColumn], column => {
|
|
9750
|
-
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
9751
|
-
dragTargetColumn = column
|
|
9752
|
-
dragColWidth += column.renderWidth
|
|
9753
|
-
}
|
|
9754
|
-
dragAllTargetCols.push(column)
|
|
9755
|
-
})
|
|
9756
|
-
}
|
|
9757
|
-
if (!dragTargetColumn) {
|
|
9758
|
-
dragTargetColumn = dragColumn
|
|
9759
|
-
}
|
|
9760
|
-
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
9761
|
-
const _dragColIndex = dragColRest._index
|
|
9762
9776
|
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9777
|
+
let dragTargetColumn: VxeTableDefines.ColumnInfo | null = null
|
|
9778
|
+
const dragAllTargetCols: VxeTableDefines.ColumnInfo[] = []
|
|
9779
|
+
let dragColWidth = 0
|
|
9780
|
+
if (animation) {
|
|
9781
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
9782
|
+
if (!dragTargetColumn && (!column.children || !column.children.length)) {
|
|
9783
|
+
dragTargetColumn = column
|
|
9784
|
+
dragColWidth += column.renderWidth
|
|
9768
9785
|
}
|
|
9769
|
-
|
|
9786
|
+
dragAllTargetCols.push(column)
|
|
9787
|
+
})
|
|
9788
|
+
}
|
|
9789
|
+
if (!dragTargetColumn) {
|
|
9790
|
+
dragTargetColumn = dragColumn
|
|
9791
|
+
}
|
|
9792
|
+
const dragColRest = fullColumnIdData[dragTargetColumn.id] || {}
|
|
9793
|
+
const _dragColIndex = dragColRest._index
|
|
9770
9794
|
|
|
9771
|
-
|
|
9772
|
-
|
|
9795
|
+
let dragOffsetLeft = -1
|
|
9796
|
+
if (animation) {
|
|
9797
|
+
const oldTrEl = el.querySelector<HTMLElement>(`.vxe-table--column[colid="${dragTargetColumn.id}"]`)
|
|
9798
|
+
if (oldTrEl) {
|
|
9799
|
+
dragOffsetLeft = oldTrEl.offsetLeft
|
|
9800
|
+
}
|
|
9801
|
+
}
|
|
9773
9802
|
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
oldAllMaps[column.id] = column
|
|
9777
|
-
})
|
|
9803
|
+
let oafIndex = -1
|
|
9804
|
+
let nafIndex = -1
|
|
9778
9805
|
|
|
9779
|
-
|
|
9806
|
+
const oldAllMaps: Record<string, any> = {}
|
|
9807
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
9808
|
+
oldAllMaps[column.id] = column
|
|
9809
|
+
})
|
|
9780
9810
|
|
|
9781
|
-
|
|
9782
|
-
// 子到子
|
|
9811
|
+
let isSelfToChildStatus = false
|
|
9783
9812
|
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
// 非同级
|
|
9787
|
-
return errRest
|
|
9788
|
-
}
|
|
9789
|
-
} else {
|
|
9790
|
-
if (!isCrossDrag) {
|
|
9791
|
-
return errRest
|
|
9792
|
-
}
|
|
9813
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
9814
|
+
// 子到子
|
|
9793
9815
|
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
status: 'error',
|
|
9800
|
-
content: getI18n('vxe.error.treeDragChild')
|
|
9801
|
-
})
|
|
9802
|
-
}
|
|
9803
|
-
return errRest
|
|
9804
|
-
}
|
|
9805
|
-
}
|
|
9816
|
+
if (isPeerDrag && !isCrossDrag) {
|
|
9817
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
9818
|
+
// 非同级
|
|
9819
|
+
handleColDragEndClearStatus($xeTable)
|
|
9820
|
+
return Promise.resolve(errRest)
|
|
9806
9821
|
}
|
|
9807
|
-
} else
|
|
9808
|
-
// 子到根
|
|
9809
|
-
|
|
9822
|
+
} else {
|
|
9810
9823
|
if (!isCrossDrag) {
|
|
9811
|
-
|
|
9824
|
+
handleColDragEndClearStatus($xeTable)
|
|
9825
|
+
return Promise.resolve(errRest)
|
|
9812
9826
|
}
|
|
9813
|
-
} else if (newColumn.parentId) {
|
|
9814
|
-
// 根到子
|
|
9815
9827
|
|
|
9816
|
-
if (!isCrossDrag) {
|
|
9817
|
-
return errRest
|
|
9818
|
-
}
|
|
9819
9828
|
if (oldAllMaps[newColumn.id]) {
|
|
9820
9829
|
isSelfToChildStatus = true
|
|
9821
9830
|
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
@@ -9825,11 +9834,46 @@ const tableMethods: any = {
|
|
|
9825
9834
|
content: getI18n('vxe.error.treeDragChild')
|
|
9826
9835
|
})
|
|
9827
9836
|
}
|
|
9828
|
-
|
|
9837
|
+
handleColDragEndClearStatus($xeTable)
|
|
9838
|
+
return Promise.resolve(errRest)
|
|
9829
9839
|
}
|
|
9830
9840
|
}
|
|
9831
|
-
}
|
|
9832
|
-
|
|
9841
|
+
}
|
|
9842
|
+
} else if (dragColumn.parentId) {
|
|
9843
|
+
// 子到根
|
|
9844
|
+
|
|
9845
|
+
if (!isCrossDrag) {
|
|
9846
|
+
handleColDragEndClearStatus($xeTable)
|
|
9847
|
+
return Promise.resolve(errRest)
|
|
9848
|
+
}
|
|
9849
|
+
} else if (newColumn.parentId) {
|
|
9850
|
+
// 根到子
|
|
9851
|
+
|
|
9852
|
+
if (!isCrossDrag) {
|
|
9853
|
+
handleColDragEndClearStatus($xeTable)
|
|
9854
|
+
return Promise.resolve(errRest)
|
|
9855
|
+
}
|
|
9856
|
+
if (oldAllMaps[newColumn.id]) {
|
|
9857
|
+
isSelfToChildStatus = true
|
|
9858
|
+
if (!(isCrossDrag && isSelfToChildDrag)) {
|
|
9859
|
+
if (VxeUI.modal) {
|
|
9860
|
+
VxeUI.modal.message({
|
|
9861
|
+
status: 'error',
|
|
9862
|
+
content: getI18n('vxe.error.treeDragChild')
|
|
9863
|
+
})
|
|
9864
|
+
}
|
|
9865
|
+
handleColDragEndClearStatus($xeTable)
|
|
9866
|
+
return Promise.resolve(errRest)
|
|
9867
|
+
}
|
|
9868
|
+
}
|
|
9869
|
+
} else {
|
|
9870
|
+
// 根到根
|
|
9871
|
+
}
|
|
9872
|
+
|
|
9873
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild
|
|
9874
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
9875
|
+
if (!status) {
|
|
9876
|
+
return errRest
|
|
9833
9877
|
}
|
|
9834
9878
|
|
|
9835
9879
|
const oldewMatchRest = XEUtils.findTree(collectColumn as VxeTableDefines.ColumnInfo[], item => item.id === dragColumn.id)
|
|
@@ -9997,13 +10041,11 @@ const tableMethods: any = {
|
|
|
9997
10041
|
}).catch(() => {
|
|
9998
10042
|
return errRest
|
|
9999
10043
|
}).then((rest) => {
|
|
10000
|
-
|
|
10001
|
-
clearCrossTableDragStatus($xeTable)
|
|
10044
|
+
handleColDragEndClearStatus($xeTable)
|
|
10002
10045
|
return rest
|
|
10003
10046
|
})
|
|
10004
10047
|
}
|
|
10005
|
-
|
|
10006
|
-
clearCrossTableDragStatus($xeTable)
|
|
10048
|
+
handleColDragEndClearStatus($xeTable)
|
|
10007
10049
|
return Promise.resolve(errRest)
|
|
10008
10050
|
},
|
|
10009
10051
|
handleHeaderCellDragDragendEvent (evnt: DragEvent) {
|
|
@@ -10756,7 +10798,7 @@ const tableMethods: any = {
|
|
|
10756
10798
|
handleUpdateRowGroup($xeTable, confList.map(fieldOrColumn => {
|
|
10757
10799
|
return XEUtils.isString(fieldOrColumn) ? fieldOrColumn : fieldOrColumn.field
|
|
10758
10800
|
}))
|
|
10759
|
-
return loadTableData($xeTable, internalData.tableSynchData, true)
|
|
10801
|
+
return loadTableData($xeTable, internalData.tableSynchData, false, true)
|
|
10760
10802
|
}
|
|
10761
10803
|
return $xeTable.$nextTick()
|
|
10762
10804
|
},
|
|
@@ -10796,7 +10838,7 @@ const tableMethods: any = {
|
|
|
10796
10838
|
return $xeTable.$nextTick()
|
|
10797
10839
|
}
|
|
10798
10840
|
handleUpdateRowGroup($xeTable, [])
|
|
10799
|
-
return loadTableData($xeTable, internalData.tableSynchData, true)
|
|
10841
|
+
return loadTableData($xeTable, internalData.tableSynchData, false, true)
|
|
10800
10842
|
},
|
|
10801
10843
|
isRowGroupRecord (row: any) {
|
|
10802
10844
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -12460,7 +12502,7 @@ const tableMethods: any = {
|
|
|
12460
12502
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12461
12503
|
const internalData = $xeTable as unknown as TableInternalData
|
|
12462
12504
|
|
|
12463
|
-
return loadTableData($xeTable, internalData.tableSynchData, true)
|
|
12505
|
+
return loadTableData($xeTable, internalData.tableSynchData, false, true)
|
|
12464
12506
|
},
|
|
12465
12507
|
updateZindex () {
|
|
12466
12508
|
if (this.zIndex) {
|
|
@@ -1601,7 +1601,7 @@ export default {
|
|
|
1601
1601
|
if (value && value.length >= 20000) {
|
|
1602
1602
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)'])
|
|
1603
1603
|
}
|
|
1604
|
-
this.loadTableData(value || [], true).then(() => {
|
|
1604
|
+
this.loadTableData(value || [], true, true).then(() => {
|
|
1605
1605
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
1606
1606
|
const expandOpts = $xeTable.computeExpandOpts
|
|
1607
1607
|
this.inited = true
|
|
@@ -2261,7 +2261,9 @@ export default {
|
|
|
2261
2261
|
'checkbox--range': checkboxOpts.range,
|
|
2262
2262
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
2263
2263
|
'is--header': showHeader,
|
|
2264
|
+
'not--header': !showHeader,
|
|
2264
2265
|
'is--footer': showFooter,
|
|
2266
|
+
'not--footer': !showFooter,
|
|
2265
2267
|
'is--group': isGroup,
|
|
2266
2268
|
'is-row-group': isRowGroupStatus,
|
|
2267
2269
|
'is--tree-line': treeConfig && (treeOpts.showLine || treeOpts.line),
|
|
@@ -2273,7 +2275,9 @@ export default {
|
|
|
2273
2275
|
'is--loading': currLoading,
|
|
2274
2276
|
'is--empty': !currLoading && !tableData.length,
|
|
2275
2277
|
'is--scroll-y': overflowY,
|
|
2278
|
+
'not--scroll-y': !overflowY,
|
|
2276
2279
|
'is--scroll-x': overflowX,
|
|
2280
|
+
'not--scroll-x': !overflowX,
|
|
2277
2281
|
'is--virtual-x': scrollXLoad,
|
|
2278
2282
|
'is--virtual-y': scrollYLoad
|
|
2279
2283
|
}],
|