vxe-table 4.10.13 → 4.10.15-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/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/module/edit/hook.js +138 -128
- package/es/table/src/body.js +57 -43
- package/es/table/src/table.js +236 -51
- package/es/table/style.css +26 -0
- 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 +26 -0
- 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 +531 -265
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +169 -154
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +65 -58
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +293 -49
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +26 -0
- 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 +26 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/hook.ts +141 -129
- package/packages/table/src/body.ts +60 -50
- package/packages/table/src/table.ts +247 -51
- package/styles/components/table.scss +26 -0
- /package/es/{iconfont.1739257038865.ttf → iconfont.1739426300784.ttf} +0 -0
- /package/es/{iconfont.1739257038865.woff → iconfont.1739426300784.woff} +0 -0
- /package/es/{iconfont.1739257038865.woff2 → iconfont.1739426300784.woff2} +0 -0
- /package/lib/{iconfont.1739257038865.ttf → iconfont.1739426300784.ttf} +0 -0
- /package/lib/{iconfont.1739257038865.woff → iconfont.1739426300784.woff} +0 -0
- /package/lib/{iconfont.1739257038865.woff2 → iconfont.1739426300784.woff2} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, ComponentPublicInstance, reactive, ref, Ref, provide, inject, nextTick, onActivated, onDeactivated, onBeforeUnmount, onUnmounted, watch, computed, onMounted } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { browse, initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft } from '../../ui/src/dom'
|
|
3
|
+
import { browse, initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft, toCssUnit } from '../../ui/src/dom'
|
|
4
4
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
5
5
|
import { VxeUI } from '../../ui'
|
|
6
6
|
import Cell from './cell'
|
|
@@ -264,8 +264,9 @@ export default defineComponent({
|
|
|
264
264
|
|
|
265
265
|
scrollVMLoading: false,
|
|
266
266
|
|
|
267
|
+
rowExpandHeightFlag: 1,
|
|
267
268
|
calcCellHeightFlag: 1,
|
|
268
|
-
resizeHeightFlag:
|
|
269
|
+
resizeHeightFlag: 1,
|
|
269
270
|
|
|
270
271
|
isCustomStatus: false,
|
|
271
272
|
|
|
@@ -393,6 +394,9 @@ export default defineComponent({
|
|
|
393
394
|
const refDragRowLineElem = ref<HTMLDivElement>()
|
|
394
395
|
const refDragColLineElem = ref<HTMLDivElement>()
|
|
395
396
|
|
|
397
|
+
const refRowExpandElem = ref<HTMLDivElement>()
|
|
398
|
+
const refRowExpandYSpaceElem = ref<HTMLDivElement>()
|
|
399
|
+
|
|
396
400
|
const refScrollXVirtualElem = ref<HTMLDivElement>()
|
|
397
401
|
const refScrollYVirtualElem = ref<HTMLDivElement>()
|
|
398
402
|
const refScrollXHandleElem = ref<HTMLDivElement>()
|
|
@@ -684,6 +688,23 @@ export default defineComponent({
|
|
|
684
688
|
return Object.assign({}, getConfig().table.customConfig, props.customConfig)
|
|
685
689
|
})
|
|
686
690
|
|
|
691
|
+
const computeTableRowExpandedList = computed(() => {
|
|
692
|
+
const { rowExpandedMaps, tableData, expandColumn } = reactData
|
|
693
|
+
const expandList: any[] = []
|
|
694
|
+
if (expandColumn) {
|
|
695
|
+
const rowKeys: Record<string, boolean> = {}
|
|
696
|
+
tableData.forEach(row => {
|
|
697
|
+
rowKeys[getRowid($xeTable, row)] = true
|
|
698
|
+
})
|
|
699
|
+
XEUtils.each(rowExpandedMaps, (row, rowid) => {
|
|
700
|
+
if (rowKeys[rowid]) {
|
|
701
|
+
expandList.push(row)
|
|
702
|
+
}
|
|
703
|
+
})
|
|
704
|
+
}
|
|
705
|
+
return expandList
|
|
706
|
+
})
|
|
707
|
+
|
|
687
708
|
const computeAutoWidthColumnList = computed(() => {
|
|
688
709
|
const { visibleColumn } = internalData
|
|
689
710
|
const { tableColumn } = reactData
|
|
@@ -940,6 +961,13 @@ export default defineComponent({
|
|
|
940
961
|
return { toVisibleIndex: 0, visibleSize: 6 }
|
|
941
962
|
}
|
|
942
963
|
|
|
964
|
+
const calcVarRowHeightConfig = (sizeKey: 'default' | 'medium' | 'small' | 'mini', sizeEl: Element) => {
|
|
965
|
+
const { rowHeightStore } = reactData
|
|
966
|
+
if (sizeEl && sizeEl.clientHeight) {
|
|
967
|
+
rowHeightStore[sizeKey] = sizeEl.clientHeight
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
943
971
|
const computeRowHeight = () => {
|
|
944
972
|
const { isAllOverflow } = reactData
|
|
945
973
|
const tableHeader = refTableHeader.value
|
|
@@ -970,8 +998,9 @@ export default defineComponent({
|
|
|
970
998
|
}
|
|
971
999
|
|
|
972
1000
|
const handleVirtualYVisible = (currScrollTop?: number) => {
|
|
973
|
-
const { isAllOverflow } = reactData
|
|
1001
|
+
const { isAllOverflow, expandColumn, rowExpandedMaps } = reactData
|
|
974
1002
|
const { elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData
|
|
1003
|
+
const expandOpts = computeExpandOpts.value
|
|
975
1004
|
const rowOpts = computeRowOpts.value
|
|
976
1005
|
const cellOpts = computeCellOpts.value
|
|
977
1006
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
@@ -984,7 +1013,7 @@ export default defineComponent({
|
|
|
984
1013
|
let offsetTop = 0
|
|
985
1014
|
let visibleSize = 0
|
|
986
1015
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
987
|
-
if (!isCustomCellHeight && isAllOverflow) {
|
|
1016
|
+
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
988
1017
|
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight)
|
|
989
1018
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1
|
|
990
1019
|
} else {
|
|
@@ -1002,6 +1031,10 @@ export default defineComponent({
|
|
|
1002
1031
|
break
|
|
1003
1032
|
}
|
|
1004
1033
|
}
|
|
1034
|
+
// 是否展开行
|
|
1035
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
1036
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0
|
|
1037
|
+
}
|
|
1005
1038
|
}
|
|
1006
1039
|
}
|
|
1007
1040
|
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(6, visibleSize) }
|
|
@@ -1561,7 +1594,7 @@ export default defineComponent({
|
|
|
1561
1594
|
rowRest.seq = seq
|
|
1562
1595
|
rowRest._index = index
|
|
1563
1596
|
} else {
|
|
1564
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 }
|
|
1597
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
1565
1598
|
fullAllDataRowIdData[rowid] = rest
|
|
1566
1599
|
fullDataRowIdData[rowid] = rest
|
|
1567
1600
|
}
|
|
@@ -1590,7 +1623,7 @@ export default defineComponent({
|
|
|
1590
1623
|
rowRest.seq = seq
|
|
1591
1624
|
rowRest.treeIndex = index
|
|
1592
1625
|
} else {
|
|
1593
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 }
|
|
1626
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
1594
1627
|
fullAllDataRowIdData[rowid] = rest
|
|
1595
1628
|
fullDataRowIdData[rowid] = rest
|
|
1596
1629
|
}
|
|
@@ -1803,6 +1836,7 @@ export default defineComponent({
|
|
|
1803
1836
|
const emptyPlaceholderElem = refEmptyPlaceholder.value
|
|
1804
1837
|
const cellOffsetWidth = computeCellOffsetWidth.value
|
|
1805
1838
|
const mouseOpts = computeMouseOpts.value
|
|
1839
|
+
const expandOpts = computeExpandOpts.value
|
|
1806
1840
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
1807
1841
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
1808
1842
|
if (emptyPlaceholderElem) {
|
|
@@ -1876,6 +1910,12 @@ export default defineComponent({
|
|
|
1876
1910
|
yBottomCornerEl.style.display = footerHeight ? 'block' : ''
|
|
1877
1911
|
}
|
|
1878
1912
|
|
|
1913
|
+
const rowExpandEl = refRowExpandElem.value
|
|
1914
|
+
if (rowExpandEl) {
|
|
1915
|
+
rowExpandEl.style.height = `${bodyHeight}px`
|
|
1916
|
+
rowExpandEl.style.top = `${headerHeight}px`
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1879
1919
|
containerList.forEach((name, index) => {
|
|
1880
1920
|
const fixedType = index > 0 ? name : ''
|
|
1881
1921
|
const layoutList = ['header', 'body', 'footer']
|
|
@@ -1993,7 +2033,7 @@ export default defineComponent({
|
|
|
1993
2033
|
let isOptimizeMode = false
|
|
1994
2034
|
// 如果是使用优化模式
|
|
1995
2035
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1996
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
2036
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
1997
2037
|
// 如果不支持优化模式
|
|
1998
2038
|
} else {
|
|
1999
2039
|
isOptimizeMode = true
|
|
@@ -2656,15 +2696,25 @@ export default defineComponent({
|
|
|
2656
2696
|
if (!el || !el.clientWidth) {
|
|
2657
2697
|
return nextTick()
|
|
2658
2698
|
}
|
|
2699
|
+
const varEl = refVarElem.value
|
|
2700
|
+
if (varEl) {
|
|
2701
|
+
const [defEl, mediumEl, smallEl, miniEl] = varEl.children
|
|
2702
|
+
calcVarRowHeightConfig('default', defEl)
|
|
2703
|
+
calcVarRowHeightConfig('medium', mediumEl)
|
|
2704
|
+
calcVarRowHeightConfig('small', smallEl)
|
|
2705
|
+
calcVarRowHeightConfig('mini', miniEl)
|
|
2706
|
+
}
|
|
2659
2707
|
calcCellWidth()
|
|
2660
2708
|
autoCellWidth()
|
|
2661
2709
|
updateStyle()
|
|
2710
|
+
updateRowExpandStyle()
|
|
2662
2711
|
return computeScrollLoad().then(() => {
|
|
2663
2712
|
if (reFull === true) {
|
|
2664
2713
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2665
2714
|
calcCellWidth()
|
|
2666
2715
|
autoCellWidth()
|
|
2667
2716
|
updateStyle()
|
|
2717
|
+
updateRowExpandStyle()
|
|
2668
2718
|
return computeScrollLoad()
|
|
2669
2719
|
}
|
|
2670
2720
|
})
|
|
@@ -3389,6 +3439,62 @@ export default defineComponent({
|
|
|
3389
3439
|
})
|
|
3390
3440
|
}
|
|
3391
3441
|
|
|
3442
|
+
const updateRowExpandStyle = () => {
|
|
3443
|
+
const { expandColumn, scrollYLoad, rowExpandedMaps } = reactData
|
|
3444
|
+
const expandOpts = computeExpandOpts.value
|
|
3445
|
+
const rowOpts = computeRowOpts.value
|
|
3446
|
+
const cellOpts = computeCellOpts.value
|
|
3447
|
+
const defaultRowHeight = computeDefaultRowHeight.value
|
|
3448
|
+
const { mode } = expandOpts
|
|
3449
|
+
if (expandColumn && mode === 'fixed') {
|
|
3450
|
+
const { elemStore, afterFullData, fullAllDataRowIdData } = internalData
|
|
3451
|
+
const rowExpandEl = refRowExpandElem.value
|
|
3452
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
3453
|
+
if (rowExpandEl && bodyScrollElem) {
|
|
3454
|
+
let isUpdateHeight = false
|
|
3455
|
+
if (scrollYLoad) {
|
|
3456
|
+
let offsetTop = 0
|
|
3457
|
+
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
3458
|
+
const row = afterFullData[rIndex]
|
|
3459
|
+
const rowid = getRowid($xeTable, row)
|
|
3460
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
3461
|
+
rowRest.oTop = offsetTop
|
|
3462
|
+
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
3463
|
+
// 是否展开行
|
|
3464
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
3465
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
XEUtils.arrayEach(rowExpandEl.children, reEl => {
|
|
3470
|
+
const expandEl = reEl as HTMLDivElement
|
|
3471
|
+
const rowid = expandEl.getAttribute('rowid') || ''
|
|
3472
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
3473
|
+
if (rowRest) {
|
|
3474
|
+
const expandHeight = expandEl.offsetHeight + 1
|
|
3475
|
+
if (scrollYLoad) {
|
|
3476
|
+
expandEl.style.top = toCssUnit(rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight))
|
|
3477
|
+
} else {
|
|
3478
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`) as HTMLTableCellElement
|
|
3479
|
+
if (trEl) {
|
|
3480
|
+
expandEl.style.top = toCssUnit(trEl.offsetTop + trEl.offsetHeight)
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
if (!isUpdateHeight) {
|
|
3484
|
+
if (rowRest.expandHeight !== expandHeight) {
|
|
3485
|
+
isUpdateHeight = true
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
rowRest.expandHeight = expandHeight
|
|
3489
|
+
}
|
|
3490
|
+
})
|
|
3491
|
+
if (isUpdateHeight) {
|
|
3492
|
+
reactData.rowExpandHeightFlag++
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3392
3498
|
tableMethods = {
|
|
3393
3499
|
dispatchEvent,
|
|
3394
3500
|
/**
|
|
@@ -3548,7 +3654,7 @@ export default defineComponent({
|
|
|
3548
3654
|
XEUtils.eachTree(rows, (childRow, index, items, path, parentItem, nodes) => {
|
|
3549
3655
|
const rowid = getRowid($xeTable, childRow)
|
|
3550
3656
|
const parentRow = parentItem || parentRest.row
|
|
3551
|
-
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0 }
|
|
3657
|
+
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
3552
3658
|
fullDataRowIdData[rowid] = rest
|
|
3553
3659
|
fullAllDataRowIdData[rowid] = rest
|
|
3554
3660
|
}, { children: childrenField })
|
|
@@ -4398,6 +4504,7 @@ export default defineComponent({
|
|
|
4398
4504
|
const el = refElem.value
|
|
4399
4505
|
if (el && el.clientWidth) {
|
|
4400
4506
|
autoCellWidth()
|
|
4507
|
+
updateRowExpandStyle()
|
|
4401
4508
|
}
|
|
4402
4509
|
if (rceTimeout) {
|
|
4403
4510
|
clearTimeout(rceTimeout)
|
|
@@ -6640,7 +6747,7 @@ export default defineComponent({
|
|
|
6640
6747
|
}
|
|
6641
6748
|
let cacheItem = fullAllDataRowIdData[rowid]
|
|
6642
6749
|
if (isReset || !cacheItem) {
|
|
6643
|
-
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0 }
|
|
6750
|
+
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
6644
6751
|
}
|
|
6645
6752
|
cacheItem.row = row
|
|
6646
6753
|
cacheItem.items = items
|
|
@@ -8583,6 +8690,7 @@ export default defineComponent({
|
|
|
8583
8690
|
direction,
|
|
8584
8691
|
...params
|
|
8585
8692
|
}
|
|
8693
|
+
updateRowExpandStyle()
|
|
8586
8694
|
checkLastSyncScroll(isRollX, isRollY)
|
|
8587
8695
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
8588
8696
|
$xeTable.clearHoverRow()
|
|
@@ -8621,6 +8729,7 @@ export default defineComponent({
|
|
|
8621
8729
|
}
|
|
8622
8730
|
},
|
|
8623
8731
|
triggerBodyScrollEvent (evnt, fixedType) {
|
|
8732
|
+
const { scrollYLoad, scrollXLoad } = reactData
|
|
8624
8733
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData
|
|
8625
8734
|
const xHandleEl = refScrollXHandleElem.value
|
|
8626
8735
|
const yHandleEl = refScrollYHandleElem.value
|
|
@@ -8629,6 +8738,7 @@ export default defineComponent({
|
|
|
8629
8738
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
8630
8739
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
8631
8740
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
8741
|
+
const rowExpandEl = refRowExpandElem.value
|
|
8632
8742
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
8633
8743
|
return
|
|
8634
8744
|
}
|
|
@@ -8675,13 +8785,18 @@ export default defineComponent({
|
|
|
8675
8785
|
setScrollTop(rightScrollElem, scrollTop)
|
|
8676
8786
|
}
|
|
8677
8787
|
setScrollTop(yHandleEl, scrollTop)
|
|
8678
|
-
|
|
8788
|
+
setScrollTop(rowExpandEl, scrollTop)
|
|
8789
|
+
if (scrollYLoad) {
|
|
8790
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
8791
|
+
}
|
|
8679
8792
|
}
|
|
8680
8793
|
if (isRollX) {
|
|
8681
8794
|
setScrollLeft(xHandleEl, scrollLeft)
|
|
8682
8795
|
setScrollLeft(headerScrollElem, scrollLeft)
|
|
8683
8796
|
setScrollLeft(footerScrollElem, scrollLeft)
|
|
8684
|
-
|
|
8797
|
+
if (scrollXLoad) {
|
|
8798
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8799
|
+
}
|
|
8685
8800
|
}
|
|
8686
8801
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8687
8802
|
type: 'body',
|
|
@@ -8689,6 +8804,7 @@ export default defineComponent({
|
|
|
8689
8804
|
})
|
|
8690
8805
|
},
|
|
8691
8806
|
triggerHeaderScrollEvent (evnt, fixedType) {
|
|
8807
|
+
const { scrollXLoad } = reactData
|
|
8692
8808
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8693
8809
|
const yHandleEl = refScrollYHandleElem.value
|
|
8694
8810
|
const xHandleEl = refScrollXHandleElem.value
|
|
@@ -8718,13 +8834,16 @@ export default defineComponent({
|
|
|
8718
8834
|
setScrollLeft(xHandleEl, scrollLeft)
|
|
8719
8835
|
setScrollLeft(footerScrollElem, scrollLeft)
|
|
8720
8836
|
setScrollLeft(bodyScrollElem, scrollLeft)
|
|
8721
|
-
|
|
8837
|
+
if (scrollXLoad) {
|
|
8838
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8839
|
+
}
|
|
8722
8840
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8723
8841
|
type: 'header',
|
|
8724
8842
|
fixed: fixedType
|
|
8725
8843
|
})
|
|
8726
8844
|
},
|
|
8727
8845
|
triggerFooterScrollEvent (evnt, fixedType) {
|
|
8846
|
+
const { scrollXLoad } = reactData
|
|
8728
8847
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
8729
8848
|
const yHandleEl = refScrollYHandleElem.value
|
|
8730
8849
|
const xHandleEl = refScrollXHandleElem.value
|
|
@@ -8754,7 +8873,9 @@ export default defineComponent({
|
|
|
8754
8873
|
setScrollLeft(xHandleEl, scrollLeft)
|
|
8755
8874
|
setScrollLeft(headerScrollElem, scrollLeft)
|
|
8756
8875
|
setScrollLeft(bodyScrollElem, scrollLeft)
|
|
8757
|
-
|
|
8876
|
+
if (scrollXLoad) {
|
|
8877
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8878
|
+
}
|
|
8758
8879
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8759
8880
|
type: 'footer',
|
|
8760
8881
|
fixed: fixedType
|
|
@@ -8766,6 +8887,7 @@ export default defineComponent({
|
|
|
8766
8887
|
return
|
|
8767
8888
|
}
|
|
8768
8889
|
const { highlightHoverRow } = tableProps
|
|
8890
|
+
const { scrollYLoad } = reactData
|
|
8769
8891
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
8770
8892
|
const rowOpts = computeRowOpts.value
|
|
8771
8893
|
const xHandleEl = refScrollXHandleElem.value
|
|
@@ -8773,6 +8895,7 @@ export default defineComponent({
|
|
|
8773
8895
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
8774
8896
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
8775
8897
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
8898
|
+
const rowExpandEl = refRowExpandElem.value
|
|
8776
8899
|
|
|
8777
8900
|
if (!xHandleEl) {
|
|
8778
8901
|
return
|
|
@@ -8813,27 +8936,19 @@ export default defineComponent({
|
|
|
8813
8936
|
setScrollTop(bodyScrollElem, currTopNum)
|
|
8814
8937
|
setScrollTop(leftScrollElem, currTopNum)
|
|
8815
8938
|
setScrollTop(rightScrollElem, currTopNum)
|
|
8816
|
-
|
|
8939
|
+
setScrollTop(rowExpandEl, currTopNum)
|
|
8940
|
+
if (scrollYLoad) {
|
|
8941
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
8942
|
+
}
|
|
8817
8943
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
8818
8944
|
type: 'table',
|
|
8819
8945
|
fixed: ''
|
|
8820
8946
|
})
|
|
8821
8947
|
})
|
|
8822
|
-
|
|
8823
|
-
// internalData.inWheelScroll = true
|
|
8824
|
-
// setScrollTop(yHandleEl, scrollTop)
|
|
8825
|
-
// setScrollTop(bodyScrollElem, scrollTop)
|
|
8826
|
-
// setScrollTop(leftScrollElem, scrollTop)
|
|
8827
|
-
// setScrollTop(rightScrollElem, scrollTop)
|
|
8828
|
-
|
|
8829
|
-
// loadScrollYData(scrollTop)
|
|
8830
|
-
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8831
|
-
// type: 'footer',
|
|
8832
|
-
// fixed: ''
|
|
8833
|
-
// })
|
|
8834
8948
|
}
|
|
8835
8949
|
},
|
|
8836
8950
|
triggerVirtualScrollXEvent (evnt) {
|
|
8951
|
+
const { scrollXLoad } = reactData
|
|
8837
8952
|
const { elemStore, inWheelScroll, lastScrollTop, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8838
8953
|
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
8839
8954
|
return
|
|
@@ -8859,13 +8974,16 @@ export default defineComponent({
|
|
|
8859
8974
|
setScrollLeft(bodyScrollElem, scrollLeft)
|
|
8860
8975
|
setScrollLeft(headerScrollElem, scrollLeft)
|
|
8861
8976
|
setScrollLeft(footerScrollElem, scrollLeft)
|
|
8862
|
-
|
|
8977
|
+
if (scrollXLoad) {
|
|
8978
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8979
|
+
}
|
|
8863
8980
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8864
8981
|
type: 'table',
|
|
8865
8982
|
fixed: ''
|
|
8866
8983
|
})
|
|
8867
8984
|
},
|
|
8868
8985
|
triggerVirtualScrollYEvent (evnt) {
|
|
8986
|
+
const { scrollYLoad } = reactData
|
|
8869
8987
|
const { elemStore, inWheelScroll, lastScrollLeft, inHeaderScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8870
8988
|
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
8871
8989
|
return
|
|
@@ -8876,6 +8994,7 @@ export default defineComponent({
|
|
|
8876
8994
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
8877
8995
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
8878
8996
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
8997
|
+
const rowExpandEl = refRowExpandElem.value
|
|
8879
8998
|
const xHandleEl = refScrollXHandleElem.value
|
|
8880
8999
|
const wrapperEl = evnt.currentTarget as HTMLDivElement
|
|
8881
9000
|
const { scrollTop } = wrapperEl
|
|
@@ -8891,7 +9010,10 @@ export default defineComponent({
|
|
|
8891
9010
|
setScrollTop(bodyScrollElem, scrollTop)
|
|
8892
9011
|
setScrollTop(leftScrollElem, scrollTop)
|
|
8893
9012
|
setScrollTop(rightScrollElem, scrollTop)
|
|
8894
|
-
|
|
9013
|
+
setScrollTop(rowExpandEl, scrollTop)
|
|
9014
|
+
if (scrollYLoad) {
|
|
9015
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
9016
|
+
}
|
|
8895
9017
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8896
9018
|
type: 'table',
|
|
8897
9019
|
fixed: ''
|
|
@@ -8969,9 +9091,10 @@ export default defineComponent({
|
|
|
8969
9091
|
},
|
|
8970
9092
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
8971
9093
|
updateScrollYSpace () {
|
|
8972
|
-
const { isAllOverflow, scrollYLoad } = reactData
|
|
9094
|
+
const { isAllOverflow, scrollYLoad, expandColumn, rowExpandedMaps } = reactData
|
|
8973
9095
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData
|
|
8974
9096
|
const { startIndex } = scrollYStore
|
|
9097
|
+
const expandOpts = computeExpandOpts.value
|
|
8975
9098
|
const rowOpts = computeRowOpts.value
|
|
8976
9099
|
const cellOpts = computeCellOpts.value
|
|
8977
9100
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
@@ -8982,7 +9105,7 @@ export default defineComponent({
|
|
|
8982
9105
|
|
|
8983
9106
|
if (scrollYLoad) {
|
|
8984
9107
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
8985
|
-
if (!isCustomCellHeight && isAllOverflow) {
|
|
9108
|
+
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
8986
9109
|
ySpaceHeight = afterFullData.length * defaultRowHeight
|
|
8987
9110
|
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight)
|
|
8988
9111
|
} else {
|
|
@@ -8991,12 +9114,20 @@ export default defineComponent({
|
|
|
8991
9114
|
const rowid = getRowid($xeTable, row)
|
|
8992
9115
|
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
8993
9116
|
ySpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
9117
|
+
// 是否展开行
|
|
9118
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9119
|
+
ySpaceHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
9120
|
+
}
|
|
8994
9121
|
}
|
|
8995
9122
|
for (let i = 0; i < startIndex; i++) {
|
|
8996
9123
|
const row = afterFullData[i]
|
|
8997
9124
|
const rowid = getRowid($xeTable, row)
|
|
8998
9125
|
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
8999
9126
|
topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
9127
|
+
// 是否展开行
|
|
9128
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9129
|
+
topSpaceHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
9130
|
+
}
|
|
9000
9131
|
}
|
|
9001
9132
|
}
|
|
9002
9133
|
} else {
|
|
@@ -9021,6 +9152,10 @@ export default defineComponent({
|
|
|
9021
9152
|
if (scrollYSpaceEl) {
|
|
9022
9153
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
9023
9154
|
}
|
|
9155
|
+
const rowExpandYSpaceEl = refRowExpandYSpaceElem.value
|
|
9156
|
+
if (rowExpandYSpaceEl) {
|
|
9157
|
+
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
9158
|
+
}
|
|
9024
9159
|
return nextTick().then(() => {
|
|
9025
9160
|
updateStyle()
|
|
9026
9161
|
})
|
|
@@ -9028,6 +9163,7 @@ export default defineComponent({
|
|
|
9028
9163
|
updateScrollXData () {
|
|
9029
9164
|
const { isAllOverflow } = reactData
|
|
9030
9165
|
handleTableColumn()
|
|
9166
|
+
$xeTable.updateScrollYSpace()
|
|
9031
9167
|
return nextTick().then(() => {
|
|
9032
9168
|
handleTableColumn()
|
|
9033
9169
|
$xeTable.updateScrollXSpace()
|
|
@@ -9038,6 +9174,7 @@ export default defineComponent({
|
|
|
9038
9174
|
},
|
|
9039
9175
|
updateScrollYData () {
|
|
9040
9176
|
$xeTable.handleTableData()
|
|
9177
|
+
$xeTable.updateScrollYSpace()
|
|
9041
9178
|
return nextTick().then(() => {
|
|
9042
9179
|
$xeTable.handleTableData()
|
|
9043
9180
|
$xeTable.updateScrollYSpace()
|
|
@@ -9270,6 +9407,73 @@ export default defineComponent({
|
|
|
9270
9407
|
return renderEmptyElement($xeTable)
|
|
9271
9408
|
}
|
|
9272
9409
|
|
|
9410
|
+
const renderRowExpandedVNs = () => {
|
|
9411
|
+
const { treeConfig } = props
|
|
9412
|
+
const { expandColumn } = reactData
|
|
9413
|
+
const tableRowExpandedList = computeTableRowExpandedList.value
|
|
9414
|
+
const expandOpts = computeExpandOpts.value
|
|
9415
|
+
const { mode } = expandOpts
|
|
9416
|
+
if (mode !== 'fixed') {
|
|
9417
|
+
return renderEmptyElement($xeTable)
|
|
9418
|
+
}
|
|
9419
|
+
const expandVNs = [
|
|
9420
|
+
h('div', {
|
|
9421
|
+
key: 'repY',
|
|
9422
|
+
ref: refRowExpandYSpaceElem
|
|
9423
|
+
})
|
|
9424
|
+
]
|
|
9425
|
+
|
|
9426
|
+
if (expandColumn) {
|
|
9427
|
+
tableRowExpandedList.forEach((row) => {
|
|
9428
|
+
const expandOpts = computeExpandOpts.value
|
|
9429
|
+
const { height: expandHeight, padding } = expandOpts
|
|
9430
|
+
const { fullAllDataRowIdData } = internalData
|
|
9431
|
+
const treeOpts = computeTreeOpts.value
|
|
9432
|
+
const { transform, seqMode } = treeOpts
|
|
9433
|
+
const cellStyle: Record<string, string> = {}
|
|
9434
|
+
const rowid = getRowid($xeTable, row)
|
|
9435
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
9436
|
+
let rowLevel = 0
|
|
9437
|
+
let seq: string | number = -1
|
|
9438
|
+
let _rowIndex = 0
|
|
9439
|
+
const rowIndex = $xeTable.getRowIndex(row)
|
|
9440
|
+
const $rowIndex = $xeTable.getVMRowIndex(row)
|
|
9441
|
+
if (rest) {
|
|
9442
|
+
rowLevel = rest.level
|
|
9443
|
+
if (treeConfig && transform && seqMode === 'increasing') {
|
|
9444
|
+
seq = rest._index + 1
|
|
9445
|
+
} else {
|
|
9446
|
+
seq = rest.seq
|
|
9447
|
+
}
|
|
9448
|
+
_rowIndex = rest._index
|
|
9449
|
+
}
|
|
9450
|
+
if (expandHeight) {
|
|
9451
|
+
cellStyle.height = `${expandHeight}px`
|
|
9452
|
+
}
|
|
9453
|
+
if (treeConfig) {
|
|
9454
|
+
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
|
|
9455
|
+
}
|
|
9456
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: '', type: 'body', level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
9457
|
+
expandVNs.push(
|
|
9458
|
+
h('div', {
|
|
9459
|
+
key: rowid,
|
|
9460
|
+
class: ['vxe-body--row-expanded-cell', {
|
|
9461
|
+
'is--padding': padding,
|
|
9462
|
+
'is--ellipsis': expandHeight
|
|
9463
|
+
}],
|
|
9464
|
+
rowid,
|
|
9465
|
+
style: cellStyle
|
|
9466
|
+
}, expandColumn.renderData(expandParams))
|
|
9467
|
+
)
|
|
9468
|
+
})
|
|
9469
|
+
}
|
|
9470
|
+
|
|
9471
|
+
return h('div', {
|
|
9472
|
+
ref: refRowExpandElem,
|
|
9473
|
+
class: 'vxe-table--row-expanded-wrapper'
|
|
9474
|
+
}, expandVNs)
|
|
9475
|
+
}
|
|
9476
|
+
|
|
9273
9477
|
const renderScrollX = () => {
|
|
9274
9478
|
return h('div', {
|
|
9275
9479
|
key: 'vsx',
|
|
@@ -9335,11 +9539,20 @@ export default defineComponent({
|
|
|
9335
9539
|
|
|
9336
9540
|
const renderViewport = () => {
|
|
9337
9541
|
const { showHeader, showFooter } = props
|
|
9338
|
-
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
|
|
9542
|
+
const { overflowX, scrollYLoad, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
|
|
9339
9543
|
const { leftList, rightList } = columnStore
|
|
9544
|
+
const leftFixedWidth = computeLeftFixedWidth.value
|
|
9545
|
+
const rightFixedWidth = computeRightFixedWidth.value
|
|
9546
|
+
|
|
9547
|
+
const ons: Record<string, any> = {}
|
|
9548
|
+
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
9549
|
+
ons.onWheel = $xeTable.triggerBodyWheelEvent
|
|
9550
|
+
}
|
|
9551
|
+
|
|
9340
9552
|
return h('div', {
|
|
9341
9553
|
ref: refTableViewportElem,
|
|
9342
|
-
class: 'vxe-table--viewport-wrapper'
|
|
9554
|
+
class: 'vxe-table--viewport-wrapper',
|
|
9555
|
+
...ons
|
|
9343
9556
|
}, [
|
|
9344
9557
|
h('div', {
|
|
9345
9558
|
class: 'vxe-table--main-wrapper'
|
|
@@ -9379,7 +9592,8 @@ export default defineComponent({
|
|
|
9379
9592
|
}, [
|
|
9380
9593
|
leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable),
|
|
9381
9594
|
rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)
|
|
9382
|
-
])
|
|
9595
|
+
]),
|
|
9596
|
+
renderRowExpandedVNs()
|
|
9383
9597
|
])
|
|
9384
9598
|
}
|
|
9385
9599
|
|
|
@@ -9843,28 +10057,10 @@ export default defineComponent({
|
|
|
9843
10057
|
})
|
|
9844
10058
|
|
|
9845
10059
|
onMounted(() => {
|
|
9846
|
-
const { rowHeightStore } = reactData
|
|
9847
|
-
const varEl = refVarElem.value
|
|
9848
10060
|
const columnOpts = computeColumnOpts.value
|
|
9849
10061
|
const rowOpts = computeRowOpts.value
|
|
9850
10062
|
const customOpts = computeCustomOpts.value
|
|
9851
10063
|
|
|
9852
|
-
if (varEl) {
|
|
9853
|
-
const [defEl, mediumEl, smallEl, miniEl] = varEl.children
|
|
9854
|
-
if (defEl) {
|
|
9855
|
-
rowHeightStore.default = defEl.clientHeight
|
|
9856
|
-
}
|
|
9857
|
-
if (mediumEl) {
|
|
9858
|
-
rowHeightStore.medium = mediumEl.clientHeight
|
|
9859
|
-
}
|
|
9860
|
-
if (smallEl) {
|
|
9861
|
-
rowHeightStore.small = smallEl.clientHeight
|
|
9862
|
-
}
|
|
9863
|
-
if (miniEl) {
|
|
9864
|
-
rowHeightStore.mini = miniEl.clientHeight
|
|
9865
|
-
}
|
|
9866
|
-
}
|
|
9867
|
-
|
|
9868
10064
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
9869
10065
|
initTpImg()
|
|
9870
10066
|
}
|
|
@@ -1629,6 +1629,32 @@
|
|
|
1629
1629
|
}
|
|
1630
1630
|
|
|
1631
1631
|
/*展开行*/
|
|
1632
|
+
.vxe-table--row-expanded-wrapper {
|
|
1633
|
+
position: absolute;
|
|
1634
|
+
top: 0;
|
|
1635
|
+
left: 0;
|
|
1636
|
+
width: 100%;
|
|
1637
|
+
height: 100%;
|
|
1638
|
+
overflow: hidden;
|
|
1639
|
+
pointer-events: none;
|
|
1640
|
+
}
|
|
1641
|
+
.vxe-body--row-expanded-cell {
|
|
1642
|
+
position: absolute;
|
|
1643
|
+
z-index: 5;
|
|
1644
|
+
top: 0;
|
|
1645
|
+
left: 0;
|
|
1646
|
+
width: 100%;
|
|
1647
|
+
overflow: auto;
|
|
1648
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
1649
|
+
pointer-events: all;
|
|
1650
|
+
&.is--padding {
|
|
1651
|
+
padding: var(--vxe-ui-table-expand-padding-default);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
.vxe-body--row-expanded-place-column {
|
|
1655
|
+
border-bottom: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1656
|
+
border-right: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1657
|
+
}
|
|
1632
1658
|
.vxe-table--expanded {
|
|
1633
1659
|
cursor: pointer;
|
|
1634
1660
|
.vxe-table--expand-btn {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|