vxe-table 4.11.14 → 4.12.0-beta.0
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/README.md +4 -3
- package/es/grid/src/grid.js +20 -13
- package/es/locale/lang/ar-EG.js +1 -0
- package/es/locale/lang/de-DE.js +1 -0
- package/es/locale/lang/en-US.js +3 -2
- package/es/locale/lang/es-ES.js +1 -0
- package/es/locale/lang/fr-FR.js +1 -0
- package/es/locale/lang/hu-HU.js +1 -0
- package/es/locale/lang/hy-AM.js +1 -0
- package/es/locale/lang/id-ID.js +1 -0
- package/es/locale/lang/it-IT.js +1 -0
- package/es/locale/lang/ja-JP.js +1 -0
- package/es/locale/lang/ko-KR.js +1 -0
- package/es/locale/lang/nb-NO.js +1 -0
- package/es/locale/lang/pt-BR.js +1 -0
- package/es/locale/lang/ru-RU.js +1 -0
- package/es/locale/lang/th-TH.js +1 -0
- package/es/locale/lang/ug-CN.js +1 -0
- package/es/locale/lang/uk-UA.js +1 -0
- package/es/locale/lang/vi-VN.js +1 -0
- package/es/locale/lang/zh-CHT.js +1 -0
- package/es/locale/lang/zh-CN.js +1 -0
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +18 -16
- package/es/table/module/edit/hook.js +3 -1
- package/es/table/src/cell.js +3 -2
- package/es/table/src/table.js +401 -291
- package/es/ui/index.js +5 -5
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +20 -14
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +2281 -2064
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +1 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +1 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +3 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -2
- package/lib/locale/lang/es-ES.js +1 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +1 -0
- package/lib/locale/lang/fr-FR.js +1 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +1 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -0
- package/lib/locale/lang/hy-AM.js +1 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +1 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +1 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +1 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +1 -0
- package/lib/locale/lang/ko-KR.js +1 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -0
- package/lib/locale/lang/nb-NO.js +1 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +1 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +1 -0
- package/lib/locale/lang/ru-RU.js +1 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +1 -0
- package/lib/locale/lang/th-TH.js +1 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +1 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +1 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -0
- package/lib/locale/lang/vi-VN.js +1 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +1 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +1 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +1 -0
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +18 -16
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +3 -1
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/cell.js +4 -2
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +413 -295
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +5 -5
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +20 -13
- package/packages/locale/lang/ar-EG.ts +1 -0
- package/packages/locale/lang/de-DE.ts +1 -0
- package/packages/locale/lang/en-US.ts +3 -2
- package/packages/locale/lang/es-ES.ts +1 -0
- package/packages/locale/lang/fr-FR.ts +1 -0
- package/packages/locale/lang/hu-HU.ts +1 -0
- package/packages/locale/lang/hy-AM.ts +1 -0
- package/packages/locale/lang/id-ID.ts +1 -0
- package/packages/locale/lang/it-IT.ts +1 -0
- package/packages/locale/lang/ja-JP.ts +1 -0
- package/packages/locale/lang/ko-KR.ts +1 -0
- package/packages/locale/lang/nb-NO.ts +1 -0
- package/packages/locale/lang/pt-BR.ts +1 -0
- package/packages/locale/lang/ru-RU.ts +1 -0
- package/packages/locale/lang/th-TH.ts +1 -0
- package/packages/locale/lang/ug-CN.ts +1 -0
- package/packages/locale/lang/uk-UA.ts +1 -0
- package/packages/locale/lang/vi-VN.ts +1 -0
- package/packages/locale/lang/zh-CHT.ts +1 -0
- package/packages/locale/lang/zh-CN.ts +1 -0
- package/packages/table/module/custom/panel.ts +18 -16
- package/packages/table/module/edit/hook.ts +3 -1
- package/packages/table/src/cell.ts +3 -2
- package/packages/table/src/table.ts +406 -292
- package/packages/ui/index.ts +4 -4
- /package/es/{iconfont.1740640573077.ttf → iconfont.1740732137800.ttf} +0 -0
- /package/es/{iconfont.1740640573077.woff → iconfont.1740732137800.woff} +0 -0
- /package/es/{iconfont.1740640573077.woff2 → iconfont.1740732137800.woff2} +0 -0
- /package/lib/{iconfont.1740640573077.ttf → iconfont.1740732137800.ttf} +0 -0
- /package/lib/{iconfont.1740640573077.woff → iconfont.1740732137800.woff} +0 -0
- /package/lib/{iconfont.1740640573077.woff2 → iconfont.1740732137800.woff2} +0 -0
|
@@ -24,6 +24,8 @@ import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, Ta
|
|
|
24
24
|
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
|
|
25
25
|
|
|
26
26
|
const customStorageKey = 'VXE_CUSTOM_STORE'
|
|
27
|
+
const maxYHeight = 5e6
|
|
28
|
+
const maxXWidth = 5e6
|
|
27
29
|
|
|
28
30
|
export default defineComponent({
|
|
29
31
|
name: 'VxeTable',
|
|
@@ -939,27 +941,41 @@ export default defineComponent({
|
|
|
939
941
|
}
|
|
940
942
|
|
|
941
943
|
const handleVirtualXVisible = () => {
|
|
942
|
-
const {
|
|
944
|
+
const { isScrollXBig, scrollXWidth } = reactData
|
|
945
|
+
const { elemStore, visibleColumn, fullColumnIdData } = internalData
|
|
943
946
|
const leftFixedWidth = computeLeftFixedWidth.value
|
|
944
947
|
const rightFixedWidth = computeRightFixedWidth.value
|
|
945
948
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
946
949
|
if (bodyScrollElem) {
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
950
|
+
const clientWidth = bodyScrollElem.clientWidth
|
|
951
|
+
let scrollLeft = bodyScrollElem.scrollLeft
|
|
952
|
+
if (isScrollXBig) {
|
|
953
|
+
scrollLeft = Math.ceil((scrollXWidth - clientWidth) * Math.min(1, (scrollLeft / (maxXWidth - clientWidth))))
|
|
954
|
+
}
|
|
955
|
+
const startLeft = scrollLeft + leftFixedWidth
|
|
956
|
+
const endLeft = scrollLeft + clientWidth - rightFixedWidth
|
|
957
|
+
let leftIndex = 0
|
|
958
|
+
let rightIndex = visibleColumn.length
|
|
959
|
+
while (leftIndex < rightIndex) {
|
|
960
|
+
const cIndex = Math.floor((leftIndex + rightIndex) / 2)
|
|
961
|
+
const column = visibleColumn[cIndex]
|
|
962
|
+
const colid = column.id
|
|
963
|
+
const colRest = fullColumnIdData[colid] || {}
|
|
964
|
+
if (colRest.oLeft <= startLeft) {
|
|
965
|
+
leftIndex = cIndex + 1
|
|
966
|
+
} else {
|
|
967
|
+
rightIndex = cIndex
|
|
957
968
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
969
|
+
}
|
|
970
|
+
let visibleSize = 0
|
|
971
|
+
const toVisibleIndex = Math.max(0, leftIndex < visibleColumn.length ? leftIndex - 2 : 0)
|
|
972
|
+
for (let cIndex = toVisibleIndex, cLen = visibleColumn.length; cIndex < cLen; cIndex++) {
|
|
973
|
+
const column = visibleColumn[cIndex]
|
|
974
|
+
const colid = column.id
|
|
975
|
+
const colRest = fullColumnIdData[colid] || {}
|
|
976
|
+
visibleSize++
|
|
977
|
+
if (colRest.oLeft > endLeft || visibleSize >= 60) {
|
|
978
|
+
break
|
|
963
979
|
}
|
|
964
980
|
}
|
|
965
981
|
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(1, visibleSize) }
|
|
@@ -1003,43 +1019,49 @@ export default defineComponent({
|
|
|
1003
1019
|
return Math.max(18, rowHeight)
|
|
1004
1020
|
}
|
|
1005
1021
|
|
|
1006
|
-
const handleVirtualYVisible = (
|
|
1007
|
-
const { isAllOverflow, expandColumn,
|
|
1022
|
+
const handleVirtualYVisible = () => {
|
|
1023
|
+
const { isAllOverflow, expandColumn, isScrollYBig, scrollYHeight } = reactData
|
|
1008
1024
|
const { elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData
|
|
1009
|
-
const expandOpts = computeExpandOpts.value
|
|
1010
1025
|
const rowOpts = computeRowOpts.value
|
|
1011
1026
|
const cellOpts = computeCellOpts.value
|
|
1012
1027
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
1013
1028
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
1014
1029
|
if (bodyScrollElem) {
|
|
1015
1030
|
const clientHeight = bodyScrollElem.clientHeight
|
|
1016
|
-
|
|
1017
|
-
|
|
1031
|
+
let scrollTop = bodyScrollElem.scrollTop
|
|
1032
|
+
if (isScrollYBig) {
|
|
1033
|
+
scrollTop = Math.ceil((scrollYHeight - clientHeight) * Math.min(1, (scrollTop / (maxYHeight - clientHeight))))
|
|
1034
|
+
}
|
|
1035
|
+
const startTop = scrollTop
|
|
1036
|
+
const endTop = scrollTop + clientHeight
|
|
1018
1037
|
let toVisibleIndex = -1
|
|
1019
|
-
let offsetTop = 0
|
|
1020
1038
|
let visibleSize = 0
|
|
1021
1039
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
1022
1040
|
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
1023
|
-
toVisibleIndex = Math.floor(
|
|
1041
|
+
toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1
|
|
1024
1042
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1
|
|
1025
1043
|
} else {
|
|
1026
|
-
|
|
1044
|
+
let leftIndex = 0
|
|
1045
|
+
let rightIndex = afterFullData.length
|
|
1046
|
+
while (leftIndex < rightIndex) {
|
|
1047
|
+
const rIndex = Math.floor((leftIndex + rightIndex) / 2)
|
|
1027
1048
|
const row = afterFullData[rIndex]
|
|
1028
1049
|
const rowid = getRowid($xeTable, row)
|
|
1029
1050
|
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
if (toVisibleIndex >= 0) {
|
|
1035
|
-
visibleSize++
|
|
1036
|
-
if (offsetTop > endHeight) {
|
|
1037
|
-
break
|
|
1038
|
-
}
|
|
1051
|
+
if (rowRest.oTop <= startTop) {
|
|
1052
|
+
leftIndex = rIndex + 1
|
|
1053
|
+
} else {
|
|
1054
|
+
rightIndex = rIndex
|
|
1039
1055
|
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1056
|
+
}
|
|
1057
|
+
toVisibleIndex = Math.max(0, leftIndex < afterFullData.length ? leftIndex - 2 : 0)
|
|
1058
|
+
for (let rIndex = toVisibleIndex, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
1059
|
+
const row = afterFullData[rIndex]
|
|
1060
|
+
const rowid = getRowid($xeTable, row)
|
|
1061
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
1062
|
+
visibleSize++
|
|
1063
|
+
if (rowRest.oTop > endTop || visibleSize >= 100) {
|
|
1064
|
+
break
|
|
1043
1065
|
}
|
|
1044
1066
|
}
|
|
1045
1067
|
}
|
|
@@ -1426,7 +1448,7 @@ export default defineComponent({
|
|
|
1426
1448
|
if (!xHandleEl) {
|
|
1427
1449
|
return
|
|
1428
1450
|
}
|
|
1429
|
-
let
|
|
1451
|
+
let tWidth = 0
|
|
1430
1452
|
const minCellWidth = 40 // 列宽最少限制 40px
|
|
1431
1453
|
const bodyWidth = bodyElem.clientWidth
|
|
1432
1454
|
let remainWidth = bodyWidth
|
|
@@ -1437,51 +1459,51 @@ export default defineComponent({
|
|
|
1437
1459
|
// 最小宽
|
|
1438
1460
|
pxMinList.forEach((column) => {
|
|
1439
1461
|
const minWidth = XEUtils.toInteger(column.minWidth)
|
|
1440
|
-
|
|
1462
|
+
tWidth += minWidth
|
|
1441
1463
|
column.renderWidth = minWidth
|
|
1442
1464
|
})
|
|
1443
1465
|
// 最小自适应
|
|
1444
1466
|
autoMinList.forEach((column) => {
|
|
1445
1467
|
const caWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
|
|
1446
|
-
|
|
1468
|
+
tWidth += caWidth
|
|
1447
1469
|
column.renderWidth = caWidth
|
|
1448
1470
|
})
|
|
1449
1471
|
// 最小百分比
|
|
1450
1472
|
scaleMinList.forEach((column) => {
|
|
1451
1473
|
const smWidth = Math.floor(XEUtils.toInteger(column.minWidth) * meanWidth)
|
|
1452
|
-
|
|
1474
|
+
tWidth += smWidth
|
|
1453
1475
|
column.renderWidth = smWidth
|
|
1454
1476
|
})
|
|
1455
1477
|
// 固定百分比
|
|
1456
1478
|
scaleList.forEach((column) => {
|
|
1457
1479
|
const sfWidth = Math.floor(XEUtils.toInteger(column.width) * meanWidth)
|
|
1458
|
-
|
|
1480
|
+
tWidth += sfWidth
|
|
1459
1481
|
column.renderWidth = sfWidth
|
|
1460
1482
|
})
|
|
1461
1483
|
// 固定宽
|
|
1462
1484
|
pxList.forEach((column) => {
|
|
1463
1485
|
const pWidth = XEUtils.toInteger(column.width)
|
|
1464
|
-
|
|
1486
|
+
tWidth += pWidth
|
|
1465
1487
|
column.renderWidth = pWidth
|
|
1466
1488
|
})
|
|
1467
1489
|
// 自适应宽
|
|
1468
1490
|
autoList.forEach((column) => {
|
|
1469
1491
|
const aWidth = Math.max(60, XEUtils.toInteger(column.renderAutoWidth))
|
|
1470
|
-
|
|
1492
|
+
tWidth += aWidth
|
|
1471
1493
|
column.renderWidth = aWidth
|
|
1472
1494
|
})
|
|
1473
1495
|
// 调整了列宽
|
|
1474
1496
|
resizeList.forEach((column) => {
|
|
1475
1497
|
const reWidth = XEUtils.toInteger(column.resizeWidth)
|
|
1476
|
-
|
|
1498
|
+
tWidth += reWidth
|
|
1477
1499
|
column.renderWidth = reWidth
|
|
1478
1500
|
})
|
|
1479
|
-
remainWidth -=
|
|
1501
|
+
remainWidth -= tWidth
|
|
1480
1502
|
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0
|
|
1481
1503
|
if (fit) {
|
|
1482
1504
|
if (remainWidth > 0) {
|
|
1483
1505
|
scaleMinList.concat(pxMinList).concat(autoMinList).forEach((column) => {
|
|
1484
|
-
|
|
1506
|
+
tWidth += meanWidth
|
|
1485
1507
|
column.renderWidth += meanWidth
|
|
1486
1508
|
})
|
|
1487
1509
|
}
|
|
@@ -1492,7 +1514,7 @@ export default defineComponent({
|
|
|
1492
1514
|
remainList.forEach((column) => {
|
|
1493
1515
|
const width = Math.max(meanWidth, minCellWidth)
|
|
1494
1516
|
column.renderWidth = width
|
|
1495
|
-
|
|
1517
|
+
tWidth += width
|
|
1496
1518
|
})
|
|
1497
1519
|
if (fit) {
|
|
1498
1520
|
/**
|
|
@@ -1502,13 +1524,13 @@ export default defineComponent({
|
|
|
1502
1524
|
const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList)
|
|
1503
1525
|
let dynamicSize = dynamicList.length - 1
|
|
1504
1526
|
if (dynamicSize > 0) {
|
|
1505
|
-
let i = bodyWidth -
|
|
1527
|
+
let i = bodyWidth - tWidth
|
|
1506
1528
|
if (i > 0) {
|
|
1507
1529
|
while (i > 0 && dynamicSize >= 0) {
|
|
1508
1530
|
i--
|
|
1509
1531
|
dynamicList[dynamicSize--].renderWidth++
|
|
1510
1532
|
}
|
|
1511
|
-
|
|
1533
|
+
tWidth = bodyWidth
|
|
1512
1534
|
}
|
|
1513
1535
|
}
|
|
1514
1536
|
}
|
|
@@ -1516,18 +1538,19 @@ export default defineComponent({
|
|
|
1516
1538
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight
|
|
1517
1539
|
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth)
|
|
1518
1540
|
reactData.overflowY = overflowY
|
|
1519
|
-
|
|
1541
|
+
reactData.scrollXWidth = tWidth
|
|
1520
1542
|
internalData.tableHeight = tableHeight
|
|
1521
1543
|
|
|
1522
1544
|
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
1523
1545
|
const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
1524
1546
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0
|
|
1525
|
-
const overflowX =
|
|
1547
|
+
const overflowX = tWidth > bodyWidth
|
|
1526
1548
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0
|
|
1527
1549
|
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight)
|
|
1528
1550
|
internalData.headerHeight = headerHeight
|
|
1529
1551
|
internalData.footerHeight = footerHeight
|
|
1530
1552
|
reactData.overflowX = overflowX
|
|
1553
|
+
updateColumnOffsetLeft()
|
|
1531
1554
|
updateHeight()
|
|
1532
1555
|
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight())
|
|
1533
1556
|
if (overflowX) {
|
|
@@ -1832,8 +1855,8 @@ export default defineComponent({
|
|
|
1832
1855
|
|
|
1833
1856
|
const updateStyle = () => {
|
|
1834
1857
|
const { border, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props
|
|
1835
|
-
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, columnStore, editStore, isAllOverflow, expandColumn } = reactData
|
|
1836
|
-
const { visibleColumn, fullColumnIdData, tableHeight,
|
|
1858
|
+
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn } = reactData
|
|
1859
|
+
const { visibleColumn, fullColumnIdData, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData
|
|
1837
1860
|
const el = refElem.value
|
|
1838
1861
|
if (!el) {
|
|
1839
1862
|
return
|
|
@@ -1873,9 +1896,10 @@ export default defineComponent({
|
|
|
1873
1896
|
bodyHeight = Math.max(bodyMinHeight, bodyHeight)
|
|
1874
1897
|
}
|
|
1875
1898
|
|
|
1899
|
+
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
1900
|
+
|
|
1876
1901
|
const xLeftCornerEl = refScrollXLeftCornerElem.value
|
|
1877
1902
|
const xRightCornerEl = refScrollXRightCornerElem.value
|
|
1878
|
-
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
1879
1903
|
const scrollXVirtualEl = refScrollXVirtualElem.value
|
|
1880
1904
|
if (scrollXVirtualEl) {
|
|
1881
1905
|
scrollXVirtualEl.style.height = `${osbHeight}px`
|
|
@@ -1970,7 +1994,7 @@ export default defineComponent({
|
|
|
1970
1994
|
if (fixedType) {
|
|
1971
1995
|
if (isGroup) {
|
|
1972
1996
|
if (wrapperElem) {
|
|
1973
|
-
wrapperElem.style.width =
|
|
1997
|
+
wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : ''
|
|
1974
1998
|
}
|
|
1975
1999
|
} else {
|
|
1976
2000
|
if (isOptimizeMode) {
|
|
@@ -1979,7 +2003,7 @@ export default defineComponent({
|
|
|
1979
2003
|
}
|
|
1980
2004
|
} else {
|
|
1981
2005
|
if (wrapperElem) {
|
|
1982
|
-
wrapperElem.style.width =
|
|
2006
|
+
wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : ''
|
|
1983
2007
|
}
|
|
1984
2008
|
}
|
|
1985
2009
|
}
|
|
@@ -2063,7 +2087,7 @@ export default defineComponent({
|
|
|
2063
2087
|
}
|
|
2064
2088
|
} else {
|
|
2065
2089
|
if (wrapperElem) {
|
|
2066
|
-
wrapperElem.style.width =
|
|
2090
|
+
wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : ''
|
|
2067
2091
|
}
|
|
2068
2092
|
}
|
|
2069
2093
|
}
|
|
@@ -2105,7 +2129,7 @@ export default defineComponent({
|
|
|
2105
2129
|
}
|
|
2106
2130
|
} else {
|
|
2107
2131
|
if (wrapperElem) {
|
|
2108
|
-
wrapperElem.style.width =
|
|
2132
|
+
wrapperElem.style.width = scrollXWidth ? `${scrollXWidth}px` : ''
|
|
2109
2133
|
}
|
|
2110
2134
|
}
|
|
2111
2135
|
}
|
|
@@ -2727,6 +2751,9 @@ export default defineComponent({
|
|
|
2727
2751
|
calcCellWidth()
|
|
2728
2752
|
autoCellWidth()
|
|
2729
2753
|
updateStyle()
|
|
2754
|
+
if (reFull) {
|
|
2755
|
+
updateRowOffsetTop()
|
|
2756
|
+
}
|
|
2730
2757
|
updateRowExpandStyle()
|
|
2731
2758
|
return computeScrollLoad().then(() => {
|
|
2732
2759
|
if (reFull === true) {
|
|
@@ -2734,6 +2761,9 @@ export default defineComponent({
|
|
|
2734
2761
|
calcCellWidth()
|
|
2735
2762
|
autoCellWidth()
|
|
2736
2763
|
updateStyle()
|
|
2764
|
+
if (reFull) {
|
|
2765
|
+
updateRowOffsetTop()
|
|
2766
|
+
}
|
|
2737
2767
|
updateRowExpandStyle()
|
|
2738
2768
|
return computeScrollLoad()
|
|
2739
2769
|
}
|
|
@@ -2875,6 +2905,7 @@ export default defineComponent({
|
|
|
2875
2905
|
}
|
|
2876
2906
|
reactData.isRowLoading = false
|
|
2877
2907
|
calcCellHeight()
|
|
2908
|
+
updateRowOffsetTop()
|
|
2878
2909
|
// 是否变更虚拟滚动
|
|
2879
2910
|
if (oldScrollYLoad === sYLoad) {
|
|
2880
2911
|
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
|
|
@@ -2939,16 +2970,16 @@ export default defineComponent({
|
|
|
2939
2970
|
}
|
|
2940
2971
|
|
|
2941
2972
|
const loadScrollXData = () => {
|
|
2942
|
-
const { mergeList, mergeFooterList } = reactData
|
|
2973
|
+
const { mergeList, mergeFooterList, isScrollXBig } = reactData
|
|
2943
2974
|
const { scrollXStore } = internalData
|
|
2944
2975
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollXStore
|
|
2945
2976
|
const { toVisibleIndex, visibleSize } = handleVirtualXVisible()
|
|
2946
2977
|
const offsetItem = {
|
|
2947
|
-
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
2948
|
-
endIndex: toVisibleIndex + visibleSize + offsetSize + preloadSize
|
|
2978
|
+
startIndex: Math.max(0, isScrollXBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
2979
|
+
endIndex: isScrollXBig ? toVisibleIndex + visibleSize : toVisibleIndex + visibleSize + offsetSize + preloadSize
|
|
2949
2980
|
}
|
|
2950
|
-
scrollXStore.visibleStartIndex = toVisibleIndex
|
|
2951
|
-
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize
|
|
2981
|
+
scrollXStore.visibleStartIndex = toVisibleIndex - 1
|
|
2982
|
+
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1
|
|
2952
2983
|
calculateMergerOffsetIndex(mergeList.concat(mergeFooterList), offsetItem, 'col')
|
|
2953
2984
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem
|
|
2954
2985
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
@@ -3085,6 +3116,7 @@ export default defineComponent({
|
|
|
3085
3116
|
internalData.visibleColumn = visibleColumn
|
|
3086
3117
|
handleTableColumn()
|
|
3087
3118
|
if (isReset) {
|
|
3119
|
+
updateColumnOffsetLeft()
|
|
3088
3120
|
return $xeTable.updateFooter().then(() => {
|
|
3089
3121
|
return $xeTable.recalculate()
|
|
3090
3122
|
}).then(() => {
|
|
@@ -3260,18 +3292,18 @@ export default defineComponent({
|
|
|
3260
3292
|
/**
|
|
3261
3293
|
* 纵向 Y 可视渲染处理
|
|
3262
3294
|
*/
|
|
3263
|
-
const loadScrollYData = (
|
|
3264
|
-
const { mergeList, isAllOverflow } = reactData
|
|
3295
|
+
const loadScrollYData = () => {
|
|
3296
|
+
const { mergeList, isAllOverflow, isScrollYBig } = reactData
|
|
3265
3297
|
const { scrollYStore } = internalData
|
|
3266
3298
|
const { preloadSize, startIndex, endIndex, offsetSize } = scrollYStore
|
|
3267
3299
|
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1
|
|
3268
|
-
const { toVisibleIndex, visibleSize } = handleVirtualYVisible(
|
|
3300
|
+
const { toVisibleIndex, visibleSize } = handleVirtualYVisible()
|
|
3269
3301
|
const offsetItem = {
|
|
3270
|
-
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
3271
|
-
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
|
|
3302
|
+
startIndex: Math.max(0, isScrollYBig ? toVisibleIndex - 1 : toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
3303
|
+
endIndex: isScrollYBig ? (toVisibleIndex + visibleSize) : (toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize)
|
|
3272
3304
|
}
|
|
3273
|
-
scrollYStore.visibleStartIndex = toVisibleIndex
|
|
3274
|
-
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize
|
|
3305
|
+
scrollYStore.visibleStartIndex = toVisibleIndex - 1
|
|
3306
|
+
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1
|
|
3275
3307
|
calculateMergerOffsetIndex(mergeList, offsetItem, 'row')
|
|
3276
3308
|
const { startIndex: offsetStartIndex, endIndex: offsetEndIndex } = offsetItem
|
|
3277
3309
|
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
@@ -3373,6 +3405,7 @@ export default defineComponent({
|
|
|
3373
3405
|
$xeTable.updateScrollYSpace()
|
|
3374
3406
|
})
|
|
3375
3407
|
}
|
|
3408
|
+
updateRowExpandStyle()
|
|
3376
3409
|
$xeTable.updateCellAreas()
|
|
3377
3410
|
}, 200)
|
|
3378
3411
|
}
|
|
@@ -3463,47 +3496,76 @@ export default defineComponent({
|
|
|
3463
3496
|
})
|
|
3464
3497
|
}
|
|
3465
3498
|
|
|
3499
|
+
const updateColumnOffsetLeft = () => {
|
|
3500
|
+
const { visibleColumn, fullColumnIdData } = internalData
|
|
3501
|
+
let offsetLeft = 0
|
|
3502
|
+
for (let cIndex = 0, rLen = visibleColumn.length; cIndex < rLen; cIndex++) {
|
|
3503
|
+
const column = visibleColumn[cIndex]
|
|
3504
|
+
const colid = column.id
|
|
3505
|
+
const colRest = fullColumnIdData[colid]
|
|
3506
|
+
colRest.oLeft = offsetLeft
|
|
3507
|
+
offsetLeft += column.renderWidth
|
|
3508
|
+
}
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
const updateRowOffsetTop = () => {
|
|
3512
|
+
const { expandColumn, rowExpandedMaps } = reactData
|
|
3513
|
+
const { afterFullData, fullAllDataRowIdData } = internalData
|
|
3514
|
+
const expandOpts = computeExpandOpts.value
|
|
3515
|
+
const rowOpts = computeRowOpts.value
|
|
3516
|
+
const cellOpts = computeCellOpts.value
|
|
3517
|
+
const defaultRowHeight = computeDefaultRowHeight.value
|
|
3518
|
+
let offsetTop = 0
|
|
3519
|
+
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
3520
|
+
const row = afterFullData[rIndex]
|
|
3521
|
+
const rowid = getRowid($xeTable, row)
|
|
3522
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
3523
|
+
rowRest.oTop = offsetTop
|
|
3524
|
+
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
3525
|
+
// 是否展开行
|
|
3526
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
3527
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3466
3532
|
const updateRowExpandStyle = () => {
|
|
3467
|
-
const { expandColumn, scrollYLoad,
|
|
3533
|
+
const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData
|
|
3468
3534
|
const expandOpts = computeExpandOpts.value
|
|
3469
3535
|
const rowOpts = computeRowOpts.value
|
|
3470
3536
|
const cellOpts = computeCellOpts.value
|
|
3471
3537
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
3472
3538
|
const { mode } = expandOpts
|
|
3473
3539
|
if (expandColumn && mode === 'fixed') {
|
|
3474
|
-
const { elemStore,
|
|
3540
|
+
const { elemStore, fullAllDataRowIdData } = internalData
|
|
3475
3541
|
const rowExpandEl = refRowExpandElem.value
|
|
3476
3542
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
3477
3543
|
if (rowExpandEl && bodyScrollElem) {
|
|
3478
3544
|
let isUpdateHeight = false
|
|
3479
|
-
if (scrollYLoad) {
|
|
3480
|
-
let offsetTop = 0
|
|
3481
|
-
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
3482
|
-
const row = afterFullData[rIndex]
|
|
3483
|
-
const rowid = getRowid($xeTable, row)
|
|
3484
|
-
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
3485
|
-
rowRest.oTop = offsetTop
|
|
3486
|
-
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
3487
|
-
// 是否展开行
|
|
3488
|
-
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
3489
|
-
offsetTop += rowRest.expandHeight || expandOpts.height || 0
|
|
3490
|
-
}
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
3545
|
XEUtils.arrayEach(rowExpandEl.children, reEl => {
|
|
3494
3546
|
const expandEl = reEl as HTMLDivElement
|
|
3495
3547
|
const rowid = expandEl.getAttribute('rowid') || ''
|
|
3496
3548
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
3497
3549
|
if (rowRest) {
|
|
3498
3550
|
const expandHeight = expandEl.offsetHeight + 1
|
|
3551
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`) as HTMLTableCellElement
|
|
3552
|
+
let offsetTop = 0
|
|
3499
3553
|
if (scrollYLoad) {
|
|
3500
|
-
|
|
3554
|
+
if (isScrollYBig && trEl) {
|
|
3555
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight
|
|
3556
|
+
} else {
|
|
3557
|
+
offsetTop = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight)
|
|
3558
|
+
}
|
|
3501
3559
|
} else {
|
|
3502
|
-
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`) as HTMLTableCellElement
|
|
3503
3560
|
if (trEl) {
|
|
3504
|
-
|
|
3561
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight
|
|
3505
3562
|
}
|
|
3506
3563
|
}
|
|
3564
|
+
if (isScrollYBig) {
|
|
3565
|
+
offsetTop += scrollYTop
|
|
3566
|
+
}
|
|
3567
|
+
expandEl.style.top = toCssUnit(offsetTop)
|
|
3568
|
+
|
|
3507
3569
|
if (!isUpdateHeight) {
|
|
3508
3570
|
if (rowRest.expandHeight !== expandHeight) {
|
|
3509
3571
|
isUpdateHeight = true
|
|
@@ -3514,6 +3576,9 @@ export default defineComponent({
|
|
|
3514
3576
|
})
|
|
3515
3577
|
if (isUpdateHeight) {
|
|
3516
3578
|
reactData.rowExpandHeightFlag++
|
|
3579
|
+
nextTick(() => {
|
|
3580
|
+
updateRowOffsetTop()
|
|
3581
|
+
})
|
|
3517
3582
|
}
|
|
3518
3583
|
}
|
|
3519
3584
|
}
|
|
@@ -4422,6 +4487,7 @@ export default defineComponent({
|
|
|
4422
4487
|
}
|
|
4423
4488
|
}
|
|
4424
4489
|
return nextTick().then(() => {
|
|
4490
|
+
updateRowOffsetTop()
|
|
4425
4491
|
return { status }
|
|
4426
4492
|
})
|
|
4427
4493
|
},
|
|
@@ -5289,12 +5355,12 @@ export default defineComponent({
|
|
|
5289
5355
|
}
|
|
5290
5356
|
reactData.rowExpandedMaps = rExpandedMaps
|
|
5291
5357
|
return Promise.all(lazyRests)
|
|
5292
|
-
.then(() =>
|
|
5358
|
+
.then(() => nextTick())
|
|
5359
|
+
.then(() => $xeTable.recalculate(true))
|
|
5293
5360
|
.then(() => {
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
}
|
|
5361
|
+
updateRowOffsetTop()
|
|
5362
|
+
updateRowExpandStyle()
|
|
5363
|
+
handleRowExpandScroll()
|
|
5298
5364
|
return $xeTable.updateCellAreas()
|
|
5299
5365
|
})
|
|
5300
5366
|
},
|
|
@@ -5321,16 +5387,21 @@ export default defineComponent({
|
|
|
5321
5387
|
const { tableFullData } = internalData
|
|
5322
5388
|
const expandOpts = computeExpandOpts.value
|
|
5323
5389
|
const { reserve } = expandOpts
|
|
5324
|
-
const expList =
|
|
5390
|
+
const expList = $xeTable.getRowExpandRecords()
|
|
5325
5391
|
reactData.rowExpandedMaps = {}
|
|
5326
5392
|
if (reserve) {
|
|
5327
5393
|
tableFullData.forEach((row) => handleRowExpandReserve(row, false))
|
|
5328
5394
|
}
|
|
5329
5395
|
return nextTick().then(() => {
|
|
5330
5396
|
if (expList.length) {
|
|
5331
|
-
|
|
5397
|
+
return $xeTable.recalculate(true)
|
|
5332
5398
|
}
|
|
5333
|
-
}).then(() =>
|
|
5399
|
+
}).then(() => {
|
|
5400
|
+
updateRowOffsetTop()
|
|
5401
|
+
updateRowExpandStyle()
|
|
5402
|
+
handleRowExpandScroll()
|
|
5403
|
+
return $xeTable.updateCellAreas()
|
|
5404
|
+
})
|
|
5334
5405
|
},
|
|
5335
5406
|
clearRowExpandReserve () {
|
|
5336
5407
|
internalData.rowExpandedReserveRowMap = {}
|
|
@@ -6524,8 +6595,8 @@ export default defineComponent({
|
|
|
6524
6595
|
const wrapperRect = el.getBoundingClientRect()
|
|
6525
6596
|
const osbWidth = overflowY ? scrollbarWidth : 0
|
|
6526
6597
|
const osbHeight = overflowX ? scrollbarHeight : 0
|
|
6527
|
-
const
|
|
6528
|
-
const
|
|
6598
|
+
const tableWrapperWidth = el.clientWidth
|
|
6599
|
+
const tableWrapperHeight = el.clientHeight
|
|
6529
6600
|
if (trEl) {
|
|
6530
6601
|
const rdLineEl = refDragRowLineElem.value
|
|
6531
6602
|
if (rdLineEl) {
|
|
@@ -6534,14 +6605,14 @@ export default defineComponent({
|
|
|
6534
6605
|
const trRect = trEl.getBoundingClientRect()
|
|
6535
6606
|
let trHeight = trEl.clientHeight
|
|
6536
6607
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y)
|
|
6537
|
-
if (offsetTop + trHeight >
|
|
6538
|
-
trHeight =
|
|
6608
|
+
if (offsetTop + trHeight > tableWrapperHeight - osbHeight) {
|
|
6609
|
+
trHeight = tableWrapperHeight - offsetTop - osbHeight
|
|
6539
6610
|
}
|
|
6540
6611
|
rdLineEl.style.display = 'block'
|
|
6541
6612
|
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`
|
|
6542
6613
|
rdLineEl.style.top = `${offsetTop}px`
|
|
6543
6614
|
rdLineEl.style.height = `${trHeight}px`
|
|
6544
|
-
rdLineEl.style.width = `${
|
|
6615
|
+
rdLineEl.style.width = `${tableWrapperWidth - osbWidth}px`
|
|
6545
6616
|
rdLineEl.setAttribute('drag-pos', dragPos)
|
|
6546
6617
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
|
|
6547
6618
|
} else {
|
|
@@ -6566,7 +6637,7 @@ export default defineComponent({
|
|
|
6566
6637
|
thWidth -= startX - offsetLeft
|
|
6567
6638
|
offsetLeft = startX
|
|
6568
6639
|
}
|
|
6569
|
-
const endX =
|
|
6640
|
+
const endX = tableWrapperWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth)
|
|
6570
6641
|
if (offsetLeft + thWidth > endX) {
|
|
6571
6642
|
thWidth = endX - offsetLeft
|
|
6572
6643
|
}
|
|
@@ -6577,7 +6648,7 @@ export default defineComponent({
|
|
|
6577
6648
|
if (prevDragToChild) {
|
|
6578
6649
|
cdLineEl.style.height = `${thRect.height}px`
|
|
6579
6650
|
} else {
|
|
6580
|
-
cdLineEl.style.height = `${
|
|
6651
|
+
cdLineEl.style.height = `${tableWrapperHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`
|
|
6581
6652
|
}
|
|
6582
6653
|
cdLineEl.setAttribute('drag-pos', dragPos)
|
|
6583
6654
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
|
|
@@ -6965,7 +7036,7 @@ export default defineComponent({
|
|
|
6965
7036
|
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`
|
|
6966
7037
|
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
6967
7038
|
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)])
|
|
6968
|
-
const
|
|
7039
|
+
const tableWrapperWidth = tableEl.clientWidth
|
|
6969
7040
|
const wrapperRect = wrapperElem.getBoundingClientRect()
|
|
6970
7041
|
const resizeBarWidth = resizeBarElem.clientWidth
|
|
6971
7042
|
const resizeTipWidth = resizeTipElem.clientWidth
|
|
@@ -6973,8 +7044,8 @@ export default defineComponent({
|
|
|
6973
7044
|
let resizeTipLeft = -resizeTipWidth
|
|
6974
7045
|
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
6975
7046
|
resizeTipLeft = 0
|
|
6976
|
-
} else if (resizeBarLeft >
|
|
6977
|
-
resizeTipLeft +=
|
|
7047
|
+
} else if (resizeBarLeft > tableWrapperWidth) {
|
|
7048
|
+
resizeTipLeft += tableWrapperWidth - resizeBarLeft
|
|
6978
7049
|
}
|
|
6979
7050
|
resizeTipElem.style.left = `${resizeTipLeft}px`
|
|
6980
7051
|
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`
|
|
@@ -7110,7 +7181,7 @@ export default defineComponent({
|
|
|
7110
7181
|
const updateEvent = (evnt: MouseEvent) => {
|
|
7111
7182
|
evnt.stopPropagation()
|
|
7112
7183
|
evnt.preventDefault()
|
|
7113
|
-
const
|
|
7184
|
+
const rtWidth = tableEl.clientWidth - osbWidth
|
|
7114
7185
|
const tableHeight = tableEl.clientHeight - osbHeight
|
|
7115
7186
|
let dragTop = evnt.clientY - tableRect.y - targetOffsetY
|
|
7116
7187
|
if (dragTop < minTop) {
|
|
@@ -7120,15 +7191,15 @@ export default defineComponent({
|
|
|
7120
7191
|
}
|
|
7121
7192
|
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`
|
|
7122
7193
|
resizeBarElem.style.top = `${dragTop}px`
|
|
7123
|
-
resizeBarElem.style.width = `${
|
|
7194
|
+
resizeBarElem.style.width = `${rtWidth}px`
|
|
7124
7195
|
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
7125
7196
|
resizeTipElem.textContent = getI18n('vxe.table.resizeRowTip', [resizeHeight])
|
|
7126
7197
|
const resizeTipWidth = resizeTipElem.clientWidth
|
|
7127
7198
|
const resizeTipHeight = resizeTipElem.clientHeight
|
|
7128
7199
|
let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x)
|
|
7129
7200
|
let resizeBarTop = 0
|
|
7130
|
-
if (resizeBarLeft + resizeTipWidth >=
|
|
7131
|
-
resizeBarLeft =
|
|
7201
|
+
if (resizeBarLeft + resizeTipWidth >= rtWidth - 2) {
|
|
7202
|
+
resizeBarLeft = rtWidth - resizeTipWidth - 2
|
|
7132
7203
|
}
|
|
7133
7204
|
if (dragTop + resizeTipHeight >= tableHeight) {
|
|
7134
7205
|
resizeBarTop = tableHeight - (dragTop + resizeTipHeight)
|
|
@@ -7161,6 +7232,7 @@ export default defineComponent({
|
|
|
7161
7232
|
} else {
|
|
7162
7233
|
rowRest.resizeHeight = resizeHeight
|
|
7163
7234
|
handleUpdateRowResize(evnt, resizeParams)
|
|
7235
|
+
updateRowOffsetTop()
|
|
7164
7236
|
}
|
|
7165
7237
|
}
|
|
7166
7238
|
removeClass(tableEl, 'row-drag--resize')
|
|
@@ -8092,6 +8164,7 @@ export default defineComponent({
|
|
|
8092
8164
|
const dragParams = {
|
|
8093
8165
|
oldRow: dragRow,
|
|
8094
8166
|
newRow: prevDragRow,
|
|
8167
|
+
dragRow,
|
|
8095
8168
|
dragPos: prevDragPos as 'top' | 'bottom',
|
|
8096
8169
|
dragToChild: !!prevDragToChild,
|
|
8097
8170
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
@@ -8242,6 +8315,7 @@ export default defineComponent({
|
|
|
8242
8315
|
dispatchEvent('row-dragend', {
|
|
8243
8316
|
oldRow: dragRow,
|
|
8244
8317
|
newRow: prevDragRow,
|
|
8318
|
+
dragRow,
|
|
8245
8319
|
dragPos: prevDragPos as any,
|
|
8246
8320
|
dragToChild: isDragToChildFlag,
|
|
8247
8321
|
offsetIndex: dragOffsetIndex,
|
|
@@ -8382,11 +8456,12 @@ export default defineComponent({
|
|
|
8382
8456
|
if (prevDragCol && dragCol) {
|
|
8383
8457
|
// 判断是否有拖动
|
|
8384
8458
|
if (prevDragCol !== dragCol) {
|
|
8385
|
-
const
|
|
8459
|
+
const dragColumn = dragCol
|
|
8386
8460
|
const newColumn = prevDragCol
|
|
8387
8461
|
const dragParams = {
|
|
8388
|
-
oldColumn,
|
|
8462
|
+
oldColumn: dragColumn,
|
|
8389
8463
|
newColumn,
|
|
8464
|
+
dragColumn,
|
|
8390
8465
|
dragPos: prevDragPos as 'left' | 'right',
|
|
8391
8466
|
dragToChild: !!prevDragToChild,
|
|
8392
8467
|
offsetIndex: dragOffsetIndex as 0 | 1
|
|
@@ -8401,17 +8476,17 @@ export default defineComponent({
|
|
|
8401
8476
|
let nafIndex = -1
|
|
8402
8477
|
|
|
8403
8478
|
const oldAllMaps: Record<string, any> = {}
|
|
8404
|
-
XEUtils.eachTree([
|
|
8479
|
+
XEUtils.eachTree([dragColumn], column => {
|
|
8405
8480
|
oldAllMaps[column.id] = column
|
|
8406
8481
|
})
|
|
8407
8482
|
|
|
8408
8483
|
let isSelfToChildStatus = false
|
|
8409
8484
|
|
|
8410
|
-
if (
|
|
8485
|
+
if (dragColumn.parentId && newColumn.parentId) {
|
|
8411
8486
|
// 子到子
|
|
8412
8487
|
|
|
8413
8488
|
if (isPeerDrag && !isCrossDrag) {
|
|
8414
|
-
if (
|
|
8489
|
+
if (dragColumn.parentId !== newColumn.parentId) {
|
|
8415
8490
|
// 非同级
|
|
8416
8491
|
return
|
|
8417
8492
|
}
|
|
@@ -8433,7 +8508,7 @@ export default defineComponent({
|
|
|
8433
8508
|
}
|
|
8434
8509
|
}
|
|
8435
8510
|
}
|
|
8436
|
-
} else if (
|
|
8511
|
+
} else if (dragColumn.parentId) {
|
|
8437
8512
|
// 子到根
|
|
8438
8513
|
|
|
8439
8514
|
if (!isCrossDrag) {
|
|
@@ -8461,18 +8536,18 @@ export default defineComponent({
|
|
|
8461
8536
|
// 根到根
|
|
8462
8537
|
}
|
|
8463
8538
|
|
|
8464
|
-
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id ===
|
|
8539
|
+
const oldewMatchRest = XEUtils.findTree(collectColumn, item => item.id === dragColumn.id)
|
|
8465
8540
|
|
|
8466
8541
|
// 改变层级
|
|
8467
8542
|
if (isSelfToChildStatus && (isCrossDrag && isSelfToChildDrag)) {
|
|
8468
8543
|
if (oldewMatchRest) {
|
|
8469
8544
|
const { items: oCols, index: oIndex } = oldewMatchRest
|
|
8470
|
-
const childList =
|
|
8545
|
+
const childList = dragColumn.children || []
|
|
8471
8546
|
childList.forEach(column => {
|
|
8472
|
-
column.parentId =
|
|
8547
|
+
column.parentId = dragColumn.parentId
|
|
8473
8548
|
})
|
|
8474
8549
|
oCols.splice(oIndex, 1, ...childList)
|
|
8475
|
-
|
|
8550
|
+
dragColumn.children = []
|
|
8476
8551
|
}
|
|
8477
8552
|
} else {
|
|
8478
8553
|
if (oldewMatchRest) {
|
|
@@ -8489,11 +8564,11 @@ export default defineComponent({
|
|
|
8489
8564
|
const { items: nCols, index: nIndex, parent: nParent } = newMatchRest
|
|
8490
8565
|
// 转子级
|
|
8491
8566
|
if ((isCrossDrag && isToChildDrag) && isDragToChildFlag) {
|
|
8492
|
-
|
|
8493
|
-
newColumn.children = (newColumn.children || []).concat([
|
|
8567
|
+
dragColumn.parentId = newColumn.id
|
|
8568
|
+
newColumn.children = (newColumn.children || []).concat([dragColumn])
|
|
8494
8569
|
} else {
|
|
8495
|
-
|
|
8496
|
-
nCols.splice(nIndex + dragOffsetIndex, 0,
|
|
8570
|
+
dragColumn.parentId = newColumn.parentId
|
|
8571
|
+
nCols.splice(nIndex + dragOffsetIndex, 0, dragColumn)
|
|
8497
8572
|
}
|
|
8498
8573
|
if (!nParent) {
|
|
8499
8574
|
nafIndex = nIndex
|
|
@@ -8519,8 +8594,9 @@ export default defineComponent({
|
|
|
8519
8594
|
}
|
|
8520
8595
|
|
|
8521
8596
|
dispatchEvent('column-dragend', {
|
|
8522
|
-
oldColumn,
|
|
8597
|
+
oldColumn: dragColumn,
|
|
8523
8598
|
newColumn,
|
|
8599
|
+
dragColumn,
|
|
8524
8600
|
dragPos: prevDragPos,
|
|
8525
8601
|
dragToChild: isDragToChildFlag,
|
|
8526
8602
|
offsetIndex: dragOffsetIndex,
|
|
@@ -8600,21 +8676,21 @@ export default defineComponent({
|
|
|
8600
8676
|
const scrollTargetEl = xHandleEl || tableBodyElem
|
|
8601
8677
|
if (scrollTargetEl) {
|
|
8602
8678
|
const wrapperRect = el.getBoundingClientRect()
|
|
8603
|
-
const
|
|
8679
|
+
const tableWrapperWidth = el.clientWidth
|
|
8604
8680
|
const leftContainerElem = refLeftContainer.value
|
|
8605
8681
|
const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0
|
|
8606
8682
|
const rightContainerElem = refRightContainer.value
|
|
8607
8683
|
const rightContainerWidth = rightContainerElem ? rightContainerElem.clientWidth : 0
|
|
8608
8684
|
const srartX = wrapperRect.x + leftContainerWidth
|
|
8609
|
-
const endX = wrapperRect.x +
|
|
8685
|
+
const endX = wrapperRect.x + tableWrapperWidth - rightContainerWidth
|
|
8610
8686
|
const distSize = 28
|
|
8611
8687
|
const startDistSize = clientX - srartX
|
|
8612
8688
|
const endDistSize = endX - clientX
|
|
8613
8689
|
if (startDistSize > 0 && startDistSize <= distSize) {
|
|
8614
|
-
const scrollRatio = Math.floor(
|
|
8690
|
+
const scrollRatio = Math.floor(tableWrapperWidth / (startDistSize > distSize / 2 ? 240 : 120))
|
|
8615
8691
|
scrollTargetEl.scrollLeft -= scrollRatio * (distSize - startDistSize)
|
|
8616
8692
|
} else if (endDistSize > 0 && endDistSize <= distSize) {
|
|
8617
|
-
const scrollRatio = Math.floor(
|
|
8693
|
+
const scrollRatio = Math.floor(tableWrapperWidth / (endDistSize > distSize / 2 ? 240 : 120))
|
|
8618
8694
|
scrollTargetEl.scrollLeft += scrollRatio * (distSize - endDistSize)
|
|
8619
8695
|
}
|
|
8620
8696
|
}
|
|
@@ -8924,7 +9000,7 @@ export default defineComponent({
|
|
|
8924
9000
|
})
|
|
8925
9001
|
},
|
|
8926
9002
|
triggerBodyWheelEvent (evnt) {
|
|
8927
|
-
const { target, deltaY, deltaX } = evnt
|
|
9003
|
+
const { target, deltaY, deltaX, shiftKey } = evnt
|
|
8928
9004
|
if (target && /^textarea$/i.test((target as HTMLElement).tagName)) {
|
|
8929
9005
|
return
|
|
8930
9006
|
}
|
|
@@ -8958,8 +9034,8 @@ export default defineComponent({
|
|
|
8958
9034
|
}
|
|
8959
9035
|
|
|
8960
9036
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime)
|
|
8961
|
-
const deltaTop = Math.ceil(deltaY * wheelSpeed)
|
|
8962
|
-
const deltaLeft = Math.ceil(deltaX * wheelSpeed)
|
|
9037
|
+
const deltaTop = Math.ceil((shiftKey ? deltaX : deltaY) * wheelSpeed)
|
|
9038
|
+
const deltaLeft = Math.ceil((shiftKey ? deltaY : deltaX) * wheelSpeed)
|
|
8963
9039
|
|
|
8964
9040
|
const isTopWheel = deltaTop < 0
|
|
8965
9041
|
const currScrollTop = bodyScrollElem.scrollTop
|
|
@@ -9114,43 +9190,70 @@ export default defineComponent({
|
|
|
9114
9190
|
updateScrollYStatus,
|
|
9115
9191
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
9116
9192
|
updateScrollXSpace () {
|
|
9117
|
-
const { isGroup, scrollXLoad, overflowX } = reactData
|
|
9118
|
-
const { visibleColumn, scrollXStore, elemStore,
|
|
9119
|
-
const tableHeader = refTableHeader.value
|
|
9193
|
+
const { isGroup, scrollXLoad, overflowX, scrollXWidth } = reactData
|
|
9194
|
+
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData
|
|
9120
9195
|
const tableBody = refTableBody.value
|
|
9121
|
-
const tableFooter = refTableFooter.value
|
|
9122
9196
|
const tableBodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
9123
9197
|
if (tableBodyElem) {
|
|
9124
|
-
const
|
|
9125
|
-
const
|
|
9126
|
-
const
|
|
9127
|
-
const
|
|
9128
|
-
|
|
9129
|
-
|
|
9198
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
9199
|
+
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
9200
|
+
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
9201
|
+
const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
9202
|
+
|
|
9203
|
+
let xSpaceLeft = 0
|
|
9204
|
+
const firstColumn = visibleColumn[scrollXStore.startIndex]
|
|
9205
|
+
if (firstColumn) {
|
|
9206
|
+
const colRest = fullColumnIdData[firstColumn.id] || {}
|
|
9207
|
+
xSpaceLeft = colRest.oLeft
|
|
9208
|
+
}
|
|
9209
|
+
|
|
9210
|
+
let clientWidth = 0
|
|
9211
|
+
if (bodyScrollElem) {
|
|
9212
|
+
clientWidth = bodyScrollElem.clientWidth
|
|
9213
|
+
}
|
|
9214
|
+
// 虚拟渲染
|
|
9215
|
+
let isScrollXBig = false
|
|
9216
|
+
let ySpaceWidth = scrollXWidth
|
|
9217
|
+
if (scrollXWidth > maxXWidth) {
|
|
9218
|
+
// 触右
|
|
9219
|
+
if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollLeft + clientWidth >= maxXWidth) {
|
|
9220
|
+
xSpaceLeft = maxXWidth - bodyTableElem.clientWidth
|
|
9221
|
+
} else {
|
|
9222
|
+
xSpaceLeft = (maxXWidth - clientWidth) * (xSpaceLeft / (scrollXWidth - clientWidth))
|
|
9223
|
+
}
|
|
9224
|
+
ySpaceWidth = maxXWidth
|
|
9225
|
+
isScrollXBig = true
|
|
9226
|
+
}
|
|
9227
|
+
|
|
9130
9228
|
let marginLeft = ''
|
|
9131
9229
|
if (scrollXLoad && overflowX) {
|
|
9132
|
-
marginLeft = `${
|
|
9230
|
+
marginLeft = `${xSpaceLeft}px`
|
|
9133
9231
|
}
|
|
9134
|
-
if (
|
|
9135
|
-
|
|
9232
|
+
if (headerTableElem) {
|
|
9233
|
+
headerTableElem.style.marginLeft = isGroup ? '' : marginLeft
|
|
9136
9234
|
}
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
footerElem.style.marginLeft = marginLeft
|
|
9235
|
+
if (bodyTableElem) {
|
|
9236
|
+
bodyTableElem.style.marginLeft = marginLeft
|
|
9140
9237
|
}
|
|
9238
|
+
if (footerTableElem) {
|
|
9239
|
+
footerTableElem.style.marginLeft = marginLeft
|
|
9240
|
+
}
|
|
9241
|
+
|
|
9242
|
+
reactData.isScrollXBig = isScrollXBig
|
|
9243
|
+
|
|
9141
9244
|
const containerList = ['main']
|
|
9142
9245
|
containerList.forEach(name => {
|
|
9143
9246
|
const layoutList = ['header', 'body', 'footer']
|
|
9144
9247
|
layoutList.forEach(layout => {
|
|
9145
9248
|
const xSpaceElem = getRefElem(elemStore[`${name}-${layout}-xSpace`])
|
|
9146
9249
|
if (xSpaceElem) {
|
|
9147
|
-
xSpaceElem.style.width = scrollXLoad ? `${
|
|
9250
|
+
xSpaceElem.style.width = scrollXLoad ? `${ySpaceWidth}px` : ''
|
|
9148
9251
|
}
|
|
9149
9252
|
})
|
|
9150
9253
|
})
|
|
9151
9254
|
const scrollXSpaceEl = refScrollXSpaceElem.value
|
|
9152
9255
|
if (scrollXSpaceEl) {
|
|
9153
|
-
scrollXSpaceEl.style.width = `${
|
|
9256
|
+
scrollXSpaceEl.style.width = `${ySpaceWidth}px`
|
|
9154
9257
|
}
|
|
9155
9258
|
nextTick(() => {
|
|
9156
9259
|
updateStyle()
|
|
@@ -9166,48 +9269,64 @@ export default defineComponent({
|
|
|
9166
9269
|
const rowOpts = computeRowOpts.value
|
|
9167
9270
|
const cellOpts = computeCellOpts.value
|
|
9168
9271
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
9272
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
9169
9273
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
9170
9274
|
const containerList = ['main', 'left', 'right']
|
|
9171
|
-
let
|
|
9172
|
-
let
|
|
9173
|
-
|
|
9275
|
+
let ySpaceTop = 0
|
|
9276
|
+
let scrollYHeight = 0
|
|
9277
|
+
let isScrollYBig = false
|
|
9174
9278
|
if (scrollYLoad) {
|
|
9175
9279
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
9176
9280
|
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
9177
|
-
|
|
9178
|
-
|
|
9281
|
+
scrollYHeight = afterFullData.length * defaultRowHeight
|
|
9282
|
+
if (scrollYHeight > maxYHeight) {
|
|
9283
|
+
isScrollYBig = true
|
|
9284
|
+
}
|
|
9285
|
+
ySpaceTop = Math.max(0, startIndex * defaultRowHeight)
|
|
9179
9286
|
} else {
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9287
|
+
const firstRow = afterFullData[startIndex]
|
|
9288
|
+
let rowid = getRowid($xeTable, firstRow)
|
|
9289
|
+
let rowRest = fullAllDataRowIdData[rowid] || {}
|
|
9290
|
+
ySpaceTop = rowRest.oTop
|
|
9291
|
+
|
|
9292
|
+
const lastRow = afterFullData[afterFullData.length - 1]
|
|
9293
|
+
rowid = getRowid($xeTable, lastRow)
|
|
9294
|
+
rowRest = fullAllDataRowIdData[rowid] || {}
|
|
9295
|
+
scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight)
|
|
9296
|
+
// 是否展开行
|
|
9297
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9298
|
+
scrollYHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
9189
9299
|
}
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
const rowid = getRowid($xeTable, row)
|
|
9193
|
-
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
9194
|
-
topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
9195
|
-
// 是否展开行
|
|
9196
|
-
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9197
|
-
topSpaceHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
9198
|
-
}
|
|
9300
|
+
if (scrollYHeight > maxYHeight) {
|
|
9301
|
+
isScrollYBig = true
|
|
9199
9302
|
}
|
|
9200
9303
|
}
|
|
9201
9304
|
} else {
|
|
9202
9305
|
if (bodyTableElem) {
|
|
9203
|
-
|
|
9306
|
+
scrollYHeight = bodyTableElem.clientHeight
|
|
9307
|
+
}
|
|
9308
|
+
}
|
|
9309
|
+
let clientHeight = 0
|
|
9310
|
+
if (bodyScrollElem) {
|
|
9311
|
+
clientHeight = bodyScrollElem.clientHeight
|
|
9312
|
+
}
|
|
9313
|
+
// 虚拟渲染
|
|
9314
|
+
let ySpaceHeight = scrollYHeight
|
|
9315
|
+
let scrollYTop = ySpaceTop
|
|
9316
|
+
if (isScrollYBig) {
|
|
9317
|
+
// 触底
|
|
9318
|
+
if (bodyScrollElem && bodyTableElem && bodyScrollElem.scrollTop + clientHeight >= maxYHeight) {
|
|
9319
|
+
scrollYTop = maxYHeight - bodyTableElem.clientHeight
|
|
9320
|
+
} else {
|
|
9321
|
+
scrollYTop = (maxYHeight - clientHeight) * (ySpaceTop / (scrollYHeight - clientHeight))
|
|
9204
9322
|
}
|
|
9323
|
+
ySpaceHeight = maxYHeight
|
|
9205
9324
|
}
|
|
9206
9325
|
containerList.forEach(name => {
|
|
9207
9326
|
const layoutList = ['header', 'body', 'footer']
|
|
9208
9327
|
const tableElem = getRefElem(elemStore[`${name}-body-table`])
|
|
9209
9328
|
if (tableElem) {
|
|
9210
|
-
tableElem.style.marginTop =
|
|
9329
|
+
tableElem.style.marginTop = scrollYTop ? `${scrollYTop}px` : ''
|
|
9211
9330
|
}
|
|
9212
9331
|
layoutList.forEach(layout => {
|
|
9213
9332
|
const ySpaceElem = getRefElem(elemStore[`${name}-${layout}-ySpace`])
|
|
@@ -9224,6 +9343,9 @@ export default defineComponent({
|
|
|
9224
9343
|
if (rowExpandYSpaceEl) {
|
|
9225
9344
|
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
9226
9345
|
}
|
|
9346
|
+
reactData.scrollYTop = scrollYTop
|
|
9347
|
+
reactData.scrollYHeight = scrollYHeight
|
|
9348
|
+
reactData.isScrollYBig = isScrollYBig
|
|
9227
9349
|
return nextTick().then(() => {
|
|
9228
9350
|
updateStyle()
|
|
9229
9351
|
})
|
|
@@ -10133,7 +10255,7 @@ export default defineComponent({
|
|
|
10133
10255
|
}
|
|
10134
10256
|
|
|
10135
10257
|
nextTick(() => {
|
|
10136
|
-
const { data, treeConfig, showOverflow } = props
|
|
10258
|
+
const { data, exportConfig, importConfig, treeConfig, showOverflow } = props
|
|
10137
10259
|
const { scrollXStore, scrollYStore } = internalData
|
|
10138
10260
|
const sYOpts = computeSYOpts.value
|
|
10139
10261
|
const editOpts = computeEditOpts.value
|
|
@@ -10142,132 +10264,124 @@ export default defineComponent({
|
|
|
10142
10264
|
const checkboxOpts = computeCheckboxOpts.value
|
|
10143
10265
|
const expandOpts = computeExpandOpts.value
|
|
10144
10266
|
const rowOpts = computeRowOpts.value
|
|
10267
|
+
const customOpts = computeCustomOpts.value
|
|
10268
|
+
const mouseOpts = computeMouseOpts.value
|
|
10269
|
+
const exportOpts = computeExportOpts.value
|
|
10270
|
+
const importOpts = computeImportOpts.value
|
|
10145
10271
|
|
|
10146
|
-
if (
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type: string) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')])
|
|
10192
|
-
}
|
|
10193
|
-
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
10194
|
-
warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type: string) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')])
|
|
10195
|
-
}
|
|
10272
|
+
if (props.rowId) {
|
|
10273
|
+
warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField'])
|
|
10274
|
+
}
|
|
10275
|
+
if (props.rowKey) {
|
|
10276
|
+
warnLog('vxe.error.delProp', ['row-key', 'row-config.useKey'])
|
|
10277
|
+
}
|
|
10278
|
+
if (props.columnKey) {
|
|
10279
|
+
warnLog('vxe.error.delProp', ['column-id', 'column-config.useKey'])
|
|
10280
|
+
}
|
|
10281
|
+
if (!(props.rowId || rowOpts.keyField) && (checkboxOpts.reserve || checkboxOpts.checkRowKeys || radioOpts.reserve || radioOpts.checkRowKey || expandOpts.expandRowKeys || treeOpts.expandRowKeys)) {
|
|
10282
|
+
warnLog('vxe.error.reqProp', ['row-config.keyField'])
|
|
10283
|
+
}
|
|
10284
|
+
if (props.editConfig && (editOpts.showStatus || editOpts.showUpdateStatus || editOpts.showInsertStatus) && !props.keepSource) {
|
|
10285
|
+
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
10286
|
+
}
|
|
10287
|
+
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(props.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
10288
|
+
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow'])
|
|
10289
|
+
}
|
|
10290
|
+
if (treeConfig && !treeOpts.transform && props.stripe) {
|
|
10291
|
+
warnLog('vxe.error.noTree', ['stripe'])
|
|
10292
|
+
}
|
|
10293
|
+
if (props.showFooter && !(props.footerMethod || props.footerData)) {
|
|
10294
|
+
warnLog('vxe.error.reqProp', ['footer-data | footer-method'])
|
|
10295
|
+
}
|
|
10296
|
+
if (rowOpts.height) {
|
|
10297
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height'])
|
|
10298
|
+
}
|
|
10299
|
+
if (props.highlightCurrentRow) {
|
|
10300
|
+
warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
|
|
10301
|
+
}
|
|
10302
|
+
if (props.highlightHoverRow) {
|
|
10303
|
+
warnLog('vxe.error.delProp', ['highlight-hover-row', 'row-config.isHover'])
|
|
10304
|
+
}
|
|
10305
|
+
if (props.highlightCurrentColumn) {
|
|
10306
|
+
warnLog('vxe.error.delProp', ['highlight-current-column', 'column-config.isCurrent'])
|
|
10307
|
+
}
|
|
10308
|
+
if (props.highlightHoverColumn) {
|
|
10309
|
+
warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover'])
|
|
10310
|
+
}
|
|
10311
|
+
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
10312
|
+
if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
|
|
10313
|
+
warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')])
|
|
10314
|
+
}
|
|
10315
|
+
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
10316
|
+
warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')])
|
|
10196
10317
|
}
|
|
10197
10318
|
|
|
10198
|
-
if (
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
const rowOpts = computeRowOpts.value
|
|
10202
|
-
if (!props.id) {
|
|
10203
|
-
if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
10204
|
-
errLog('vxe.error.reqProp', ['id'])
|
|
10205
|
-
}
|
|
10206
|
-
}
|
|
10207
|
-
if (props.treeConfig && checkboxOpts.range) {
|
|
10208
|
-
errLog('vxe.error.noTree', ['checkbox-config.range'])
|
|
10209
|
-
}
|
|
10210
|
-
if (rowOpts.height && !props.showOverflow) {
|
|
10211
|
-
warnLog('vxe.error.notProp', ['table.show-overflow'])
|
|
10212
|
-
}
|
|
10213
|
-
if (!$xeTable.handleMousedownCellAreaEvent) {
|
|
10214
|
-
if (props.areaConfig) {
|
|
10215
|
-
warnLog('vxe.error.notProp', ['area-config'])
|
|
10216
|
-
}
|
|
10217
|
-
if (props.clipConfig) {
|
|
10218
|
-
warnLog('vxe.error.notProp', ['clip-config'])
|
|
10219
|
-
}
|
|
10220
|
-
if (props.fnrConfig) {
|
|
10221
|
-
warnLog('vxe.error.notProp', ['fnr-config'])
|
|
10222
|
-
}
|
|
10223
|
-
if (mouseOpts.area) {
|
|
10224
|
-
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
10225
|
-
return
|
|
10226
|
-
}
|
|
10227
|
-
}
|
|
10228
|
-
if (props.dragConfig) {
|
|
10229
|
-
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config'])
|
|
10230
|
-
}
|
|
10231
|
-
if (props.treeConfig && treeOpts.children) {
|
|
10232
|
-
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
|
|
10233
|
-
}
|
|
10234
|
-
if (props.treeConfig && treeOpts.line) {
|
|
10235
|
-
warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine'])
|
|
10236
|
-
}
|
|
10237
|
-
if (mouseOpts.area && mouseOpts.selected) {
|
|
10238
|
-
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected'])
|
|
10319
|
+
if (!props.id) {
|
|
10320
|
+
if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
10321
|
+
errLog('vxe.error.reqProp', ['id'])
|
|
10239
10322
|
}
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10323
|
+
}
|
|
10324
|
+
if (props.treeConfig && checkboxOpts.range) {
|
|
10325
|
+
errLog('vxe.error.noTree', ['checkbox-config.range'])
|
|
10326
|
+
}
|
|
10327
|
+
if (rowOpts.height && !props.showOverflow) {
|
|
10328
|
+
warnLog('vxe.error.notProp', ['table.show-overflow'])
|
|
10329
|
+
}
|
|
10330
|
+
if (!$xeTable.handleMousedownCellAreaEvent) {
|
|
10331
|
+
if (props.areaConfig) {
|
|
10332
|
+
warnLog('vxe.error.notProp', ['area-config'])
|
|
10245
10333
|
}
|
|
10246
|
-
if (props.
|
|
10247
|
-
warnLog('vxe.error.
|
|
10334
|
+
if (props.clipConfig) {
|
|
10335
|
+
warnLog('vxe.error.notProp', ['clip-config'])
|
|
10248
10336
|
}
|
|
10249
|
-
if (props.
|
|
10250
|
-
|
|
10337
|
+
if (props.fnrConfig) {
|
|
10338
|
+
warnLog('vxe.error.notProp', ['fnr-config'])
|
|
10251
10339
|
}
|
|
10252
|
-
if (
|
|
10253
|
-
|
|
10340
|
+
if (mouseOpts.area) {
|
|
10341
|
+
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
10342
|
+
return
|
|
10254
10343
|
}
|
|
10255
10344
|
}
|
|
10345
|
+
if (treeConfig && rowOpts.drag && !treeOpts.transform) {
|
|
10346
|
+
errLog('vxe.error.notSupportProp', ['column-config.drag', 'tree-config.transform=false', 'tree-config.transform=true'])
|
|
10347
|
+
}
|
|
10348
|
+
if (props.dragConfig) {
|
|
10349
|
+
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config'])
|
|
10350
|
+
}
|
|
10351
|
+
if (props.treeConfig && treeOpts.children) {
|
|
10352
|
+
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
|
|
10353
|
+
}
|
|
10354
|
+
if (props.treeConfig && treeOpts.line) {
|
|
10355
|
+
warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine'])
|
|
10356
|
+
}
|
|
10357
|
+
if (mouseOpts.area && mouseOpts.selected) {
|
|
10358
|
+
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected'])
|
|
10359
|
+
}
|
|
10360
|
+
if (mouseOpts.area && (props.treeConfig && !treeOpts.transform)) {
|
|
10361
|
+
errLog('vxe.error.noTree', ['mouse-config.area'])
|
|
10362
|
+
}
|
|
10363
|
+
if (props.editConfig && editOpts.activeMethod) {
|
|
10364
|
+
warnLog('vxe.error.delProp', ['edit-config.activeMethod', 'edit-config.beforeEditMethod'])
|
|
10365
|
+
}
|
|
10366
|
+
if (props.treeConfig && checkboxOpts.isShiftKey) {
|
|
10367
|
+
errLog('vxe.error.errConflicts', ['tree-config', 'checkbox-config.isShiftKey'])
|
|
10368
|
+
}
|
|
10369
|
+
if (checkboxOpts.halfField) {
|
|
10370
|
+
warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField'])
|
|
10371
|
+
}
|
|
10256
10372
|
|
|
10257
10373
|
// 检查是否有安装需要的模块
|
|
10258
|
-
if (
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
errLog('vxe.error.reqModule', ['Export'])
|
|
10270
|
-
}
|
|
10374
|
+
if (props.editConfig && !$xeTable.insert) {
|
|
10375
|
+
errLog('vxe.error.reqModule', ['Edit'])
|
|
10376
|
+
}
|
|
10377
|
+
if (props.editRules && !$xeTable.validate) {
|
|
10378
|
+
errLog('vxe.error.reqModule', ['Validator'])
|
|
10379
|
+
}
|
|
10380
|
+
if ((checkboxOpts.range || props.keyboardConfig || props.mouseConfig) && !$xeTable.handleCellMousedownEvent) {
|
|
10381
|
+
errLog('vxe.error.reqModule', ['Keyboard'])
|
|
10382
|
+
}
|
|
10383
|
+
if ((props.printConfig || props.importConfig || props.exportConfig) && !$xeTable.exportData) {
|
|
10384
|
+
errLog('vxe.error.reqModule', ['Export'])
|
|
10271
10385
|
}
|
|
10272
10386
|
|
|
10273
10387
|
Object.assign(scrollYStore, {
|