vxe-table 4.10.6-beta.7 → 4.10.6-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +40 -27
- package/es/table/src/footer.js +4 -4
- package/es/table/src/header.js +11 -6
- package/es/table/src/table.js +298 -226
- package/es/table/style.css +128 -38
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +7 -5
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +128 -38
- 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 +347 -270
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +33 -25
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +14 -6
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +288 -229
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +128 -38
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +7 -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/lib/vxe-table/style/style.css +128 -38
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/src/body.ts +40 -25
- package/packages/table/src/footer.ts +4 -4
- package/packages/table/src/header.ts +11 -6
- package/packages/table/src/table.ts +309 -236
- package/packages/ui/index.ts +6 -4
- package/styles/components/table.scss +158 -60
- /package/es/{iconfont.1736820154664.ttf → iconfont.1736854674495.ttf} +0 -0
- /package/es/{iconfont.1736820154664.woff → iconfont.1736854674495.woff} +0 -0
- /package/es/{iconfont.1736820154664.woff2 → iconfont.1736854674495.woff2} +0 -0
- /package/lib/{iconfont.1736820154664.ttf → iconfont.1736854674495.ttf} +0 -0
- /package/lib/{iconfont.1736820154664.woff → iconfont.1736854674495.woff} +0 -0
- /package/lib/{iconfont.1736820154664.woff2 → iconfont.1736854674495.woff2} +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -393,9 +393,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
393
393
|
const refScrollXVirtualElem = (0, _vue.ref)();
|
|
394
394
|
const refScrollYVirtualElem = (0, _vue.ref)();
|
|
395
395
|
const refScrollXHandleElem = (0, _vue.ref)();
|
|
396
|
+
const refScrollXLeftCornerElem = (0, _vue.ref)();
|
|
396
397
|
const refScrollXRightCornerElem = (0, _vue.ref)();
|
|
397
398
|
const refScrollYHandleElem = (0, _vue.ref)();
|
|
398
399
|
const refScrollYTopCornerElem = (0, _vue.ref)();
|
|
400
|
+
const refScrollXWrapperElem = (0, _vue.ref)();
|
|
401
|
+
const refScrollYWrapperElem = (0, _vue.ref)();
|
|
399
402
|
const refScrollYBottomCornerElem = (0, _vue.ref)();
|
|
400
403
|
const refScrollXSpaceElem = (0, _vue.ref)();
|
|
401
404
|
const refScrollYSpaceElem = (0, _vue.ref)();
|
|
@@ -452,6 +455,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
452
455
|
const computeScrollbarOpts = (0, _vue.computed)(() => {
|
|
453
456
|
return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig);
|
|
454
457
|
});
|
|
458
|
+
const computeScrollbarXToTop = (0, _vue.computed)(() => {
|
|
459
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
460
|
+
return !!(scrollbarOpts.x && scrollbarOpts.x.position === 'top');
|
|
461
|
+
});
|
|
462
|
+
const computeScrollbarYToLeft = (0, _vue.computed)(() => {
|
|
463
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
464
|
+
return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left');
|
|
465
|
+
});
|
|
455
466
|
const computeScrollYThreshold = (0, _vue.computed)(() => {
|
|
456
467
|
const sYOpts = computeSYOpts.value;
|
|
457
468
|
const {
|
|
@@ -756,6 +767,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
756
767
|
computeVirtualXOpts,
|
|
757
768
|
computeVirtualYOpts,
|
|
758
769
|
computeScrollbarOpts,
|
|
770
|
+
computeScrollbarXToTop,
|
|
771
|
+
computeScrollbarYToLeft,
|
|
759
772
|
computeColumnOpts,
|
|
760
773
|
computeScrollXThreshold,
|
|
761
774
|
computeScrollYThreshold,
|
|
@@ -911,29 +924,36 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
911
924
|
};
|
|
912
925
|
};
|
|
913
926
|
const computeRowHeight = () => {
|
|
927
|
+
const {
|
|
928
|
+
showOverflow
|
|
929
|
+
} = props;
|
|
914
930
|
const tableHeader = refTableHeader.value;
|
|
915
931
|
const tableBody = refTableBody.value;
|
|
916
932
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
917
933
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
918
934
|
let rowHeight = 0;
|
|
919
|
-
if (
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
firstTrElem
|
|
935
|
+
if (showOverflow) {
|
|
936
|
+
if (tableBodyElem) {
|
|
937
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
938
|
+
let firstTrElem;
|
|
939
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
940
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
941
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
942
|
+
}
|
|
943
|
+
if (firstTrElem) {
|
|
944
|
+
rowHeight = firstTrElem.clientHeight;
|
|
945
|
+
}
|
|
925
946
|
}
|
|
926
|
-
if (
|
|
927
|
-
rowHeight =
|
|
947
|
+
if (!rowHeight) {
|
|
948
|
+
rowHeight = defaultRowHeight;
|
|
928
949
|
}
|
|
929
|
-
}
|
|
930
|
-
if (!rowHeight) {
|
|
950
|
+
} else {
|
|
931
951
|
rowHeight = defaultRowHeight;
|
|
932
952
|
}
|
|
933
953
|
// 最低支持 18px 行高
|
|
934
954
|
return Math.max(18, rowHeight);
|
|
935
955
|
};
|
|
936
|
-
const handleVirtualYVisible =
|
|
956
|
+
const handleVirtualYVisible = currScrollTop => {
|
|
937
957
|
const {
|
|
938
958
|
showOverflow
|
|
939
959
|
} = props;
|
|
@@ -947,10 +967,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
947
967
|
} = internalData;
|
|
948
968
|
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
949
969
|
if (bodyScrollElem) {
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
clientHeight
|
|
953
|
-
} = bodyScrollElem;
|
|
970
|
+
const clientHeight = bodyScrollElem.clientHeight;
|
|
971
|
+
const scrollTop = _xeUtils.default.isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
|
|
954
972
|
const endHeight = scrollTop + clientHeight;
|
|
955
973
|
let toVisibleIndex = -1;
|
|
956
974
|
let offsetTop = 0;
|
|
@@ -1582,7 +1600,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1582
1600
|
tableData.forEach(row => {
|
|
1583
1601
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
1584
1602
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
1585
|
-
const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell`);
|
|
1603
|
+
const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell>.vxe-cell--auto-wrapper`);
|
|
1586
1604
|
if (rowRest && cellList.length) {
|
|
1587
1605
|
let height = 0;
|
|
1588
1606
|
for (let i = 0; i < cellList.length; i++) {
|
|
@@ -2045,19 +2063,26 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2045
2063
|
}
|
|
2046
2064
|
bodyHeight = Math.max(bodyMinHeight, bodyHeight);
|
|
2047
2065
|
}
|
|
2066
|
+
const xLeftCornerEl = refScrollXLeftCornerElem.value;
|
|
2067
|
+
const xRightCornerEl = refScrollXRightCornerElem.value;
|
|
2068
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
2048
2069
|
const scrollXVirtualEl = refScrollXVirtualElem.value;
|
|
2049
2070
|
if (scrollXVirtualEl) {
|
|
2050
2071
|
scrollXVirtualEl.style.height = `${scrollbarHeight}px`;
|
|
2051
2072
|
scrollXVirtualEl.style.visibility = scrollbarHeight ? 'visible' : 'hidden';
|
|
2052
2073
|
}
|
|
2053
|
-
const
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2074
|
+
const xWrapperEl = refScrollXWrapperElem.value;
|
|
2075
|
+
if (xWrapperEl) {
|
|
2076
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${scrollbarWidth}px` : '';
|
|
2077
|
+
xWrapperEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
|
|
2078
|
+
}
|
|
2079
|
+
if (xLeftCornerEl) {
|
|
2080
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${scrollbarWidth}px` : '';
|
|
2081
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? scrollbarWidth && scrollbarHeight ? 'block' : '' : '';
|
|
2056
2082
|
}
|
|
2057
|
-
const xRightCornerEl = refScrollXRightCornerElem.value;
|
|
2058
2083
|
if (xRightCornerEl) {
|
|
2059
|
-
xRightCornerEl.style.width = `${scrollbarWidth}px`;
|
|
2060
|
-
xRightCornerEl.style.display = scrollbarWidth && scrollbarHeight ? 'block' : '';
|
|
2084
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${scrollbarWidth}px`;
|
|
2085
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : scrollbarWidth && scrollbarHeight ? 'block' : '';
|
|
2061
2086
|
}
|
|
2062
2087
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
2063
2088
|
if (scrollYVirtualEl) {
|
|
@@ -2070,10 +2095,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2070
2095
|
yTopCornerEl.style.height = `${headerHeight}px`;
|
|
2071
2096
|
yTopCornerEl.style.display = headerHeight ? 'block' : '';
|
|
2072
2097
|
}
|
|
2073
|
-
const
|
|
2074
|
-
if (
|
|
2075
|
-
|
|
2076
|
-
|
|
2098
|
+
const yWrapperEl = refScrollYWrapperElem.value;
|
|
2099
|
+
if (yWrapperEl) {
|
|
2100
|
+
yWrapperEl.style.height = `${bodyHeight}px`;
|
|
2101
|
+
yWrapperEl.style.top = `${headerHeight}px`;
|
|
2077
2102
|
}
|
|
2078
2103
|
const yBottomCornerEl = refScrollYBottomCornerElem.value;
|
|
2079
2104
|
if (yBottomCornerEl) {
|
|
@@ -2896,16 +2921,16 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2896
2921
|
scrollXStore,
|
|
2897
2922
|
scrollYStore
|
|
2898
2923
|
} = internalData;
|
|
2899
|
-
const
|
|
2900
|
-
const
|
|
2924
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
2925
|
+
const virtualXOpts = computeVirtualXOpts.value;
|
|
2901
2926
|
// 计算 X 逻辑
|
|
2902
2927
|
if (scrollXLoad) {
|
|
2903
2928
|
const {
|
|
2904
2929
|
toVisibleIndex: toXVisibleIndex,
|
|
2905
2930
|
visibleSize: visibleXSize
|
|
2906
2931
|
} = handleVirtualXVisible();
|
|
2907
|
-
const offsetXSize = Math.max(0,
|
|
2908
|
-
scrollXStore.preloadSize =
|
|
2932
|
+
const offsetXSize = Math.max(0, virtualXOpts.oSize ? _xeUtils.default.toNumber(virtualXOpts.oSize) : 0);
|
|
2933
|
+
scrollXStore.preloadSize = _xeUtils.default.toNumber(virtualXOpts.preSize);
|
|
2909
2934
|
scrollXStore.offsetSize = offsetXSize;
|
|
2910
2935
|
scrollXStore.visibleSize = visibleXSize;
|
|
2911
2936
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
@@ -2917,7 +2942,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2917
2942
|
} else {
|
|
2918
2943
|
$xeTable.updateScrollXSpace();
|
|
2919
2944
|
}
|
|
2920
|
-
calcCellHeight();
|
|
2921
2945
|
// 计算 Y 逻辑
|
|
2922
2946
|
const rowHeight = computeRowHeight();
|
|
2923
2947
|
scrollYStore.rowHeight = rowHeight;
|
|
@@ -2927,8 +2951,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2927
2951
|
visibleSize: visibleYSize
|
|
2928
2952
|
} = handleVirtualYVisible();
|
|
2929
2953
|
if (scrollYLoad) {
|
|
2930
|
-
const offsetYSize = Math.max(0,
|
|
2931
|
-
scrollYStore.preloadSize =
|
|
2954
|
+
const offsetYSize = Math.max(0, virtualYOpts.oSize ? _xeUtils.default.toNumber(virtualYOpts.oSize) : 0);
|
|
2955
|
+
scrollYStore.preloadSize = _xeUtils.default.toNumber(virtualYOpts.preSize);
|
|
2932
2956
|
scrollYStore.offsetSize = offsetYSize;
|
|
2933
2957
|
scrollYStore.visibleSize = visibleYSize;
|
|
2934
2958
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -2957,7 +2981,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2957
2981
|
return computeScrollLoad().then(() => {
|
|
2958
2982
|
if (reFull === true) {
|
|
2959
2983
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2960
|
-
calcCellHeight();
|
|
2961
2984
|
calcCellWidth();
|
|
2962
2985
|
autoCellWidth();
|
|
2963
2986
|
updateStyle();
|
|
@@ -3103,6 +3126,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3103
3126
|
if (sYOpts.scrollToTopOnChange) {
|
|
3104
3127
|
targetScrollTop = 0;
|
|
3105
3128
|
}
|
|
3129
|
+
calcCellHeight();
|
|
3106
3130
|
// 是否变更虚拟滚动
|
|
3107
3131
|
if (oldScrollYLoad === sYLoad) {
|
|
3108
3132
|
(0, _util.restoreScrollLocation)($xeTable, targetScrollLeft, targetScrollTop).then(() => {
|
|
@@ -3533,7 +3557,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3533
3557
|
/**
|
|
3534
3558
|
* 纵向 Y 可视渲染处理
|
|
3535
3559
|
*/
|
|
3536
|
-
const loadScrollYData =
|
|
3560
|
+
const loadScrollYData = scrollTop => {
|
|
3537
3561
|
const {
|
|
3538
3562
|
showOverflow
|
|
3539
3563
|
} = props;
|
|
@@ -3553,7 +3577,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3553
3577
|
const {
|
|
3554
3578
|
toVisibleIndex,
|
|
3555
3579
|
visibleSize
|
|
3556
|
-
} = handleVirtualYVisible();
|
|
3580
|
+
} = handleVirtualYVisible(scrollTop);
|
|
3557
3581
|
const offsetItem = {
|
|
3558
3582
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
3559
3583
|
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
|
|
@@ -3626,18 +3650,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3626
3650
|
}, fpsTime);
|
|
3627
3651
|
};
|
|
3628
3652
|
const lazyScrollYData = () => {
|
|
3629
|
-
const {
|
|
3630
|
-
showOverflow
|
|
3631
|
-
} = props;
|
|
3632
3653
|
const {
|
|
3633
3654
|
lyTimeout,
|
|
3634
|
-
lyRunTime
|
|
3635
|
-
scrollYStore
|
|
3655
|
+
lyRunTime
|
|
3636
3656
|
} = internalData;
|
|
3637
|
-
const
|
|
3638
|
-
visibleSize
|
|
3639
|
-
} = scrollYStore;
|
|
3640
|
-
const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)));
|
|
3657
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, 20 / 3)));
|
|
3641
3658
|
if (lyTimeout) {
|
|
3642
3659
|
clearTimeout(lyTimeout);
|
|
3643
3660
|
}
|
|
@@ -3651,86 +3668,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3651
3668
|
loadScrollYData();
|
|
3652
3669
|
}, fpsTime);
|
|
3653
3670
|
};
|
|
3654
|
-
const scrollXEvent = evnt => {
|
|
3655
|
-
const {
|
|
3656
|
-
elemStore,
|
|
3657
|
-
inWheelScroll,
|
|
3658
|
-
lastScrollTop,
|
|
3659
|
-
inHeaderScroll,
|
|
3660
|
-
inBodyScroll,
|
|
3661
|
-
inFooterScroll
|
|
3662
|
-
} = internalData;
|
|
3663
|
-
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
3664
|
-
return;
|
|
3665
|
-
}
|
|
3666
|
-
if (inWheelScroll) {
|
|
3667
|
-
return;
|
|
3668
|
-
}
|
|
3669
|
-
const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
|
|
3670
|
-
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
3671
|
-
const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
|
|
3672
|
-
const yHandleEl = refScrollYHandleElem.value;
|
|
3673
|
-
const wrapperEl = evnt.currentTarget;
|
|
3674
|
-
const {
|
|
3675
|
-
scrollLeft
|
|
3676
|
-
} = wrapperEl;
|
|
3677
|
-
const yBodyEl = yHandleEl || bodyScrollElem;
|
|
3678
|
-
let scrollTop = 0;
|
|
3679
|
-
if (yBodyEl) {
|
|
3680
|
-
scrollTop = yBodyEl.scrollTop;
|
|
3681
|
-
}
|
|
3682
|
-
const isRollX = true;
|
|
3683
|
-
const isRollY = scrollTop !== lastScrollTop;
|
|
3684
|
-
internalData.inVirtualScroll = true;
|
|
3685
|
-
(0, _dom.setScrollLeft)(bodyScrollElem, scrollLeft);
|
|
3686
|
-
(0, _dom.setScrollLeft)(headerScrollElem, scrollLeft);
|
|
3687
|
-
(0, _dom.setScrollLeft)(footerScrollElem, scrollLeft);
|
|
3688
|
-
$xeTable.triggerScrollXEvent(evnt);
|
|
3689
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
3690
|
-
type: 'table',
|
|
3691
|
-
fixed: ''
|
|
3692
|
-
});
|
|
3693
|
-
};
|
|
3694
|
-
const scrollYEvent = evnt => {
|
|
3695
|
-
const {
|
|
3696
|
-
elemStore,
|
|
3697
|
-
inWheelScroll,
|
|
3698
|
-
lastScrollLeft,
|
|
3699
|
-
inHeaderScroll,
|
|
3700
|
-
inBodyScroll,
|
|
3701
|
-
inFooterScroll
|
|
3702
|
-
} = internalData;
|
|
3703
|
-
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
3704
|
-
return;
|
|
3705
|
-
}
|
|
3706
|
-
if (inWheelScroll) {
|
|
3707
|
-
return;
|
|
3708
|
-
}
|
|
3709
|
-
const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
|
|
3710
|
-
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
3711
|
-
const rightScrollElem = (0, _util.getRefElem)(elemStore['right-body-scroll']);
|
|
3712
|
-
const xHandleEl = refScrollXHandleElem.value;
|
|
3713
|
-
const wrapperEl = evnt.currentTarget;
|
|
3714
|
-
const {
|
|
3715
|
-
scrollTop
|
|
3716
|
-
} = wrapperEl;
|
|
3717
|
-
const xBodyEl = xHandleEl || bodyScrollElem;
|
|
3718
|
-
let scrollLeft = 0;
|
|
3719
|
-
if (xBodyEl) {
|
|
3720
|
-
scrollLeft = xBodyEl.scrollLeft;
|
|
3721
|
-
}
|
|
3722
|
-
const isRollX = scrollLeft !== lastScrollLeft;
|
|
3723
|
-
const isRollY = true;
|
|
3724
|
-
internalData.inVirtualScroll = true;
|
|
3725
|
-
(0, _dom.setScrollTop)(bodyScrollElem, scrollTop);
|
|
3726
|
-
(0, _dom.setScrollTop)(leftScrollElem, scrollTop);
|
|
3727
|
-
(0, _dom.setScrollTop)(rightScrollElem, scrollTop);
|
|
3728
|
-
$xeTable.triggerScrollYEvent(evnt);
|
|
3729
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
3730
|
-
type: 'table',
|
|
3731
|
-
fixed: ''
|
|
3732
|
-
});
|
|
3733
|
-
};
|
|
3734
3671
|
const checkLastSyncScroll = (isRollX, isRollY) => {
|
|
3735
3672
|
const {
|
|
3736
3673
|
scrollXLoad,
|
|
@@ -3751,16 +3688,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3751
3688
|
internalData.inBodyScroll = false;
|
|
3752
3689
|
internalData.inFooterScroll = false;
|
|
3753
3690
|
internalData.scrollRenderType = '';
|
|
3691
|
+
calcCellHeight();
|
|
3754
3692
|
if (isRollX && scrollXLoad) {
|
|
3755
|
-
$xeTable.updateScrollXData()
|
|
3756
|
-
calcCellHeight();
|
|
3757
|
-
loadScrollXData();
|
|
3758
|
-
});
|
|
3693
|
+
$xeTable.updateScrollXData();
|
|
3759
3694
|
}
|
|
3760
3695
|
if (isRollY && scrollYLoad) {
|
|
3761
3696
|
$xeTable.updateScrollYData().then(() => {
|
|
3762
3697
|
calcCellHeight();
|
|
3763
|
-
|
|
3698
|
+
$xeTable.updateScrollYSpace();
|
|
3764
3699
|
});
|
|
3765
3700
|
}
|
|
3766
3701
|
$xeTable.updateCellAreas();
|
|
@@ -3782,6 +3717,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3782
3717
|
}
|
|
3783
3718
|
return (0, _vue.nextTick)();
|
|
3784
3719
|
};
|
|
3720
|
+
function handleUupdateResize() {
|
|
3721
|
+
const el = refElem.value;
|
|
3722
|
+
if (el && el.clientWidth && el.clientHeight) {
|
|
3723
|
+
tableMethods.recalculate();
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3785
3726
|
tableMethods = {
|
|
3786
3727
|
dispatchEvent,
|
|
3787
3728
|
/**
|
|
@@ -7126,6 +7067,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7126
7067
|
const rdLineEl = refDragRowLineElem.value;
|
|
7127
7068
|
if (rdLineEl) {
|
|
7128
7069
|
if (showLine) {
|
|
7070
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
7129
7071
|
const trRect = trEl.getBoundingClientRect();
|
|
7130
7072
|
let trHeight = trEl.clientHeight;
|
|
7131
7073
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
@@ -7133,6 +7075,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7133
7075
|
trHeight = tableHeight - offsetTop - scrollbarHeight;
|
|
7134
7076
|
}
|
|
7135
7077
|
rdLineEl.style.display = 'block';
|
|
7078
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`;
|
|
7136
7079
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
7137
7080
|
rdLineEl.style.height = `${trHeight}px`;
|
|
7138
7081
|
rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
|
|
@@ -7146,6 +7089,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7146
7089
|
const cdLineEl = refDragColLineElem.value;
|
|
7147
7090
|
if (cdLineEl) {
|
|
7148
7091
|
if (showLine) {
|
|
7092
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
7149
7093
|
const leftContainerElem = refLeftContainer.value;
|
|
7150
7094
|
const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
|
|
7151
7095
|
const rightContainerElem = refRightContainer.value;
|
|
@@ -7170,7 +7114,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7170
7114
|
if (prevDragToChild) {
|
|
7171
7115
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
7172
7116
|
} else {
|
|
7173
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - scrollbarHeight}px`;
|
|
7117
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : scrollbarHeight)}px`;
|
|
7174
7118
|
}
|
|
7175
7119
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
7176
7120
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -9628,13 +9572,93 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9628
9572
|
(0, _dom.setScrollTop)(bodyScrollElem, scrollTop);
|
|
9629
9573
|
(0, _dom.setScrollTop)(leftScrollElem, scrollTop);
|
|
9630
9574
|
(0, _dom.setScrollTop)(rightScrollElem, scrollTop);
|
|
9631
|
-
|
|
9575
|
+
loadScrollYData(scrollTop);
|
|
9632
9576
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
9633
|
-
type: '
|
|
9577
|
+
type: 'table',
|
|
9634
9578
|
fixed: ''
|
|
9635
9579
|
});
|
|
9636
9580
|
}
|
|
9637
9581
|
},
|
|
9582
|
+
triggerVirtualScrollXEvent(evnt) {
|
|
9583
|
+
const {
|
|
9584
|
+
elemStore,
|
|
9585
|
+
inWheelScroll,
|
|
9586
|
+
lastScrollTop,
|
|
9587
|
+
inHeaderScroll,
|
|
9588
|
+
inBodyScroll,
|
|
9589
|
+
inFooterScroll
|
|
9590
|
+
} = internalData;
|
|
9591
|
+
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
9592
|
+
return;
|
|
9593
|
+
}
|
|
9594
|
+
if (inWheelScroll) {
|
|
9595
|
+
return;
|
|
9596
|
+
}
|
|
9597
|
+
const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
|
|
9598
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
9599
|
+
const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
|
|
9600
|
+
const yHandleEl = refScrollYHandleElem.value;
|
|
9601
|
+
const wrapperEl = evnt.currentTarget;
|
|
9602
|
+
const {
|
|
9603
|
+
scrollLeft
|
|
9604
|
+
} = wrapperEl;
|
|
9605
|
+
const yBodyEl = yHandleEl || bodyScrollElem;
|
|
9606
|
+
let scrollTop = 0;
|
|
9607
|
+
if (yBodyEl) {
|
|
9608
|
+
scrollTop = yBodyEl.scrollTop;
|
|
9609
|
+
}
|
|
9610
|
+
const isRollX = true;
|
|
9611
|
+
const isRollY = scrollTop !== lastScrollTop;
|
|
9612
|
+
internalData.inVirtualScroll = true;
|
|
9613
|
+
(0, _dom.setScrollLeft)(bodyScrollElem, scrollLeft);
|
|
9614
|
+
(0, _dom.setScrollLeft)(headerScrollElem, scrollLeft);
|
|
9615
|
+
(0, _dom.setScrollLeft)(footerScrollElem, scrollLeft);
|
|
9616
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
9617
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
9618
|
+
type: 'table',
|
|
9619
|
+
fixed: ''
|
|
9620
|
+
});
|
|
9621
|
+
},
|
|
9622
|
+
triggerVirtualScrollYEvent(evnt) {
|
|
9623
|
+
const {
|
|
9624
|
+
elemStore,
|
|
9625
|
+
inWheelScroll,
|
|
9626
|
+
lastScrollLeft,
|
|
9627
|
+
inHeaderScroll,
|
|
9628
|
+
inBodyScroll,
|
|
9629
|
+
inFooterScroll
|
|
9630
|
+
} = internalData;
|
|
9631
|
+
if (inHeaderScroll || inBodyScroll || inFooterScroll) {
|
|
9632
|
+
return;
|
|
9633
|
+
}
|
|
9634
|
+
if (inWheelScroll) {
|
|
9635
|
+
return;
|
|
9636
|
+
}
|
|
9637
|
+
const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
|
|
9638
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
9639
|
+
const rightScrollElem = (0, _util.getRefElem)(elemStore['right-body-scroll']);
|
|
9640
|
+
const xHandleEl = refScrollXHandleElem.value;
|
|
9641
|
+
const wrapperEl = evnt.currentTarget;
|
|
9642
|
+
const {
|
|
9643
|
+
scrollTop
|
|
9644
|
+
} = wrapperEl;
|
|
9645
|
+
const xBodyEl = xHandleEl || bodyScrollElem;
|
|
9646
|
+
let scrollLeft = 0;
|
|
9647
|
+
if (xBodyEl) {
|
|
9648
|
+
scrollLeft = xBodyEl.scrollLeft;
|
|
9649
|
+
}
|
|
9650
|
+
const isRollX = scrollLeft !== lastScrollLeft;
|
|
9651
|
+
const isRollY = true;
|
|
9652
|
+
internalData.inVirtualScroll = true;
|
|
9653
|
+
(0, _dom.setScrollTop)(bodyScrollElem, scrollTop);
|
|
9654
|
+
(0, _dom.setScrollTop)(leftScrollElem, scrollTop);
|
|
9655
|
+
(0, _dom.setScrollTop)(rightScrollElem, scrollTop);
|
|
9656
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
9657
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
9658
|
+
type: 'table',
|
|
9659
|
+
fixed: ''
|
|
9660
|
+
});
|
|
9661
|
+
},
|
|
9638
9662
|
/**
|
|
9639
9663
|
* 对于树形结构中,可以直接滚动到指定深层节点中
|
|
9640
9664
|
* 对于某些特定的场景可能会用到,比如定位到某一节点
|
|
@@ -9794,9 +9818,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9794
9818
|
showOverflow
|
|
9795
9819
|
} = props;
|
|
9796
9820
|
handleTableColumn();
|
|
9797
|
-
// calcCellHeight()
|
|
9798
9821
|
return (0, _vue.nextTick)().then(() => {
|
|
9799
|
-
// calcCellHeight()
|
|
9800
9822
|
handleTableColumn();
|
|
9801
9823
|
$xeTable.updateScrollXSpace();
|
|
9802
9824
|
if (!showOverflow) {
|
|
@@ -9806,9 +9828,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9806
9828
|
},
|
|
9807
9829
|
updateScrollYData() {
|
|
9808
9830
|
$xeTable.handleTableData();
|
|
9809
|
-
// calcCellHeight()
|
|
9810
9831
|
return (0, _vue.nextTick)().then(() => {
|
|
9811
|
-
// calcCellHeight()
|
|
9812
9832
|
$xeTable.handleTableData();
|
|
9813
9833
|
$xeTable.updateScrollYSpace();
|
|
9814
9834
|
});
|
|
@@ -10035,12 +10055,108 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10035
10055
|
}
|
|
10036
10056
|
return renderEmptyElement($xeTable);
|
|
10037
10057
|
};
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10058
|
+
const renderScrollX = () => {
|
|
10059
|
+
return (0, _vue.h)('div', {
|
|
10060
|
+
key: 'vsx',
|
|
10061
|
+
ref: refScrollXVirtualElem,
|
|
10062
|
+
class: 'vxe-table--scroll-x-virtual'
|
|
10063
|
+
}, [(0, _vue.h)('div', {
|
|
10064
|
+
ref: refScrollXLeftCornerElem,
|
|
10065
|
+
class: 'vxe-table--scroll-x-left-corner'
|
|
10066
|
+
}), (0, _vue.h)('div', {
|
|
10067
|
+
ref: refScrollXWrapperElem,
|
|
10068
|
+
class: 'vxe-table--scroll-x-wrapper'
|
|
10069
|
+
}, [(0, _vue.h)('div', {
|
|
10070
|
+
ref: refScrollXHandleElem,
|
|
10071
|
+
class: 'vxe-table--scroll-x-handle',
|
|
10072
|
+
onScroll: $xeTable.triggerVirtualScrollXEvent
|
|
10073
|
+
}, [(0, _vue.h)('div', {
|
|
10074
|
+
ref: refScrollXSpaceElem,
|
|
10075
|
+
class: 'vxe-table--scroll-x-space'
|
|
10076
|
+
})])]), (0, _vue.h)('div', {
|
|
10077
|
+
ref: refScrollXRightCornerElem,
|
|
10078
|
+
class: 'vxe-table--scroll-x-right-corner'
|
|
10079
|
+
})]);
|
|
10080
|
+
};
|
|
10081
|
+
const renderScrollY = () => {
|
|
10082
|
+
return (0, _vue.h)('div', {
|
|
10083
|
+
ref: refScrollYVirtualElem,
|
|
10084
|
+
class: 'vxe-table--scroll-y-virtual'
|
|
10085
|
+
}, [(0, _vue.h)('div', {
|
|
10086
|
+
ref: refScrollYTopCornerElem,
|
|
10087
|
+
class: 'vxe-table--scroll-y-top-corner'
|
|
10088
|
+
}), (0, _vue.h)('div', {
|
|
10089
|
+
ref: refScrollYWrapperElem,
|
|
10090
|
+
class: 'vxe-table--scroll-y-wrapper'
|
|
10091
|
+
}, [(0, _vue.h)('div', {
|
|
10092
|
+
ref: refScrollYHandleElem,
|
|
10093
|
+
class: 'vxe-table--scroll-y-handle',
|
|
10094
|
+
onScroll: $xeTable.triggerVirtualScrollYEvent
|
|
10095
|
+
}, [(0, _vue.h)('div', {
|
|
10096
|
+
ref: refScrollYSpaceElem,
|
|
10097
|
+
class: 'vxe-table--scroll-y-space'
|
|
10098
|
+
})])]), (0, _vue.h)('div', {
|
|
10099
|
+
ref: refScrollYBottomCornerElem,
|
|
10100
|
+
class: 'vxe-table--scroll-y-bottom-corner'
|
|
10101
|
+
})]);
|
|
10102
|
+
};
|
|
10103
|
+
const renderViewport = () => {
|
|
10104
|
+
const {
|
|
10105
|
+
showHeader,
|
|
10106
|
+
showFooter
|
|
10107
|
+
} = props;
|
|
10108
|
+
const {
|
|
10109
|
+
overflowX,
|
|
10110
|
+
tableData,
|
|
10111
|
+
tableColumn,
|
|
10112
|
+
tableGroupColumn,
|
|
10113
|
+
footerTableData,
|
|
10114
|
+
columnStore
|
|
10115
|
+
} = reactData;
|
|
10116
|
+
const {
|
|
10117
|
+
leftList,
|
|
10118
|
+
rightList
|
|
10119
|
+
} = columnStore;
|
|
10120
|
+
return (0, _vue.h)('div', {
|
|
10121
|
+
ref: refTableViewportElem,
|
|
10122
|
+
class: 'vxe-table--viewport-wrapper'
|
|
10123
|
+
}, [(0, _vue.h)('div', {
|
|
10124
|
+
class: 'vxe-table--main-wrapper'
|
|
10125
|
+
}, [
|
|
10126
|
+
/**
|
|
10127
|
+
* 表头
|
|
10128
|
+
*/
|
|
10129
|
+
showHeader ? (0, _vue.h)(_header.default, {
|
|
10130
|
+
ref: refTableHeader,
|
|
10131
|
+
tableData,
|
|
10132
|
+
tableColumn,
|
|
10133
|
+
tableGroupColumn
|
|
10134
|
+
}) : renderEmptyElement($xeTable),
|
|
10135
|
+
/**
|
|
10136
|
+
* 表体
|
|
10137
|
+
*/
|
|
10138
|
+
(0, _vue.h)(_body.default, {
|
|
10139
|
+
ref: refTableBody,
|
|
10140
|
+
tableData,
|
|
10141
|
+
tableColumn
|
|
10142
|
+
}),
|
|
10143
|
+
/**
|
|
10144
|
+
* 表尾
|
|
10145
|
+
*/
|
|
10146
|
+
showFooter ? (0, _vue.h)(_footer.default, {
|
|
10147
|
+
ref: refTableFooter,
|
|
10148
|
+
footerTableData,
|
|
10149
|
+
tableColumn
|
|
10150
|
+
}) : renderEmptyElement($xeTable)]), (0, _vue.h)('div', {
|
|
10151
|
+
class: 'vxe-table--fixed-wrapper'
|
|
10152
|
+
}, [leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)])]);
|
|
10153
|
+
};
|
|
10154
|
+
const renderBody = () => {
|
|
10155
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
10156
|
+
return (0, _vue.h)('div', {
|
|
10157
|
+
class: 'vxe-table--layout-wrapper'
|
|
10158
|
+
}, scrollbarYToLeft ? [renderScrollY(), renderViewport()] : [renderViewport(), renderScrollY()]);
|
|
10159
|
+
};
|
|
10044
10160
|
const renderVN = () => {
|
|
10045
10161
|
const {
|
|
10046
10162
|
loading,
|
|
@@ -10063,11 +10179,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10063
10179
|
overflowY,
|
|
10064
10180
|
scrollXLoad,
|
|
10065
10181
|
scrollYLoad,
|
|
10066
|
-
scrollbarHeight,
|
|
10067
10182
|
tableData,
|
|
10068
|
-
tableColumn,
|
|
10069
|
-
tableGroupColumn,
|
|
10070
|
-
footerTableData,
|
|
10071
10183
|
initStore,
|
|
10072
10184
|
columnStore,
|
|
10073
10185
|
filterStore,
|
|
@@ -10095,9 +10207,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10095
10207
|
const resizableOpts = computeResizableOpts.value;
|
|
10096
10208
|
const isArea = mouseConfig && mouseOpts.area;
|
|
10097
10209
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
10210
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
10211
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
10098
10212
|
return (0, _vue.h)('div', {
|
|
10099
10213
|
ref: refElem,
|
|
10100
|
-
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
|
|
10214
|
+
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
10101
10215
|
[`size--${vSize}`]: vSize,
|
|
10102
10216
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
10103
10217
|
'vxe-editable': !!editConfig,
|
|
@@ -10140,69 +10254,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10140
10254
|
}, slots.default ? slots.default({}) : []), (0, _vue.h)('div', {
|
|
10141
10255
|
key: 'tw',
|
|
10142
10256
|
class: 'vxe-table--render-wrapper'
|
|
10143
|
-
}, [(
|
|
10144
|
-
ref: refTableViewportElem,
|
|
10145
|
-
class: 'vxe-table--viewport-wrapper'
|
|
10146
|
-
}, [(0, _vue.h)('div', {
|
|
10147
|
-
class: 'vxe-table--main-wrapper'
|
|
10148
|
-
}, [
|
|
10149
|
-
/**
|
|
10150
|
-
* 表头
|
|
10151
|
-
*/
|
|
10152
|
-
showHeader ? (0, _vue.h)(_header.default, {
|
|
10153
|
-
ref: refTableHeader,
|
|
10154
|
-
tableData,
|
|
10155
|
-
tableColumn,
|
|
10156
|
-
tableGroupColumn
|
|
10157
|
-
}) : renderEmptyElement($xeTable),
|
|
10158
|
-
/**
|
|
10159
|
-
* 表体
|
|
10160
|
-
*/
|
|
10161
|
-
(0, _vue.h)(_body.default, {
|
|
10162
|
-
ref: refTableBody,
|
|
10163
|
-
tableData,
|
|
10164
|
-
tableColumn
|
|
10165
|
-
}),
|
|
10166
|
-
/**
|
|
10167
|
-
* 表尾
|
|
10168
|
-
*/
|
|
10169
|
-
showFooter ? (0, _vue.h)(_footer.default, {
|
|
10170
|
-
ref: refTableFooter,
|
|
10171
|
-
footerTableData,
|
|
10172
|
-
tableColumn
|
|
10173
|
-
}) : renderEmptyElement($xeTable)]), (0, _vue.h)('div', {
|
|
10174
|
-
class: 'vxe-table--fixed-wrapper'
|
|
10175
|
-
}, [leftList && leftList.length && overflowX ? renderFixed('left') : renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed('right') : renderEmptyElement($xeTable)])]), (0, _vue.h)('div', {
|
|
10176
|
-
ref: refScrollYVirtualElem,
|
|
10177
|
-
class: 'vxe-table--scroll-y-virtual'
|
|
10178
|
-
}, [(0, _vue.h)('div', {
|
|
10179
|
-
ref: refScrollYTopCornerElem,
|
|
10180
|
-
class: 'vxe-table--scroll-y-top-corner'
|
|
10181
|
-
}), (0, _vue.h)('div', {
|
|
10182
|
-
ref: refScrollYHandleElem,
|
|
10183
|
-
class: 'vxe-table--scroll-y-handle',
|
|
10184
|
-
onScroll: scrollYEvent
|
|
10185
|
-
}, [(0, _vue.h)('div', {
|
|
10186
|
-
ref: refScrollYSpaceElem,
|
|
10187
|
-
class: 'vxe-table--scroll-y-space'
|
|
10188
|
-
})]), (0, _vue.h)('div', {
|
|
10189
|
-
ref: refScrollYBottomCornerElem,
|
|
10190
|
-
class: 'vxe-table--scroll-y-bottom-corner'
|
|
10191
|
-
})])]), (0, _vue.h)('div', {
|
|
10192
|
-
key: 'vx',
|
|
10193
|
-
ref: refScrollXVirtualElem,
|
|
10194
|
-
class: 'vxe-table--scroll-x-virtual'
|
|
10195
|
-
}, [(0, _vue.h)('div', {
|
|
10196
|
-
ref: refScrollXHandleElem,
|
|
10197
|
-
class: 'vxe-table--scroll-x-handle',
|
|
10198
|
-
onScroll: scrollXEvent
|
|
10199
|
-
}, [(0, _vue.h)('div', {
|
|
10200
|
-
ref: refScrollXSpaceElem,
|
|
10201
|
-
class: 'vxe-table--scroll-x-space'
|
|
10202
|
-
})]), (0, _vue.h)('div', {
|
|
10203
|
-
ref: refScrollXRightCornerElem,
|
|
10204
|
-
class: 'vxe-table--scroll-x-right-corner'
|
|
10205
|
-
})]),
|
|
10257
|
+
}, scrollbarXToTop ? [renderScrollX(), renderBody()] : [renderBody(), renderScrollX()]),
|
|
10206
10258
|
/**
|
|
10207
10259
|
* 空数据
|
|
10208
10260
|
*/
|
|
@@ -10226,10 +10278,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10226
10278
|
(0, _vue.h)('div', {
|
|
10227
10279
|
key: 'cl',
|
|
10228
10280
|
ref: refCellResizeBar,
|
|
10229
|
-
class: 'vxe-table--resizable-bar'
|
|
10230
|
-
style: overflowX ? {
|
|
10231
|
-
'padding-bottom': `${scrollbarHeight}px`
|
|
10232
|
-
} : null
|
|
10281
|
+
class: 'vxe-table--resizable-bar'
|
|
10233
10282
|
}, resizableOpts.showDragTip ? [(0, _vue.h)('div', {
|
|
10234
10283
|
ref: refCellResizeTip,
|
|
10235
10284
|
class: 'vxe-table--resizable-number-tip'
|
|
@@ -10401,16 +10450,37 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10401
10450
|
tableMethods.refreshColumn();
|
|
10402
10451
|
});
|
|
10403
10452
|
});
|
|
10453
|
+
const reScrollFlag = (0, _vue.ref)(0);
|
|
10454
|
+
(0, _vue.watch)(computeSize, () => {
|
|
10455
|
+
reScrollFlag.value++;
|
|
10456
|
+
});
|
|
10404
10457
|
(0, _vue.watch)(() => props.showHeader, () => {
|
|
10405
|
-
|
|
10406
|
-
tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
|
|
10407
|
-
});
|
|
10458
|
+
reScrollFlag.value++;
|
|
10408
10459
|
});
|
|
10409
10460
|
(0, _vue.watch)(() => props.showFooter, () => {
|
|
10461
|
+
reScrollFlag.value++;
|
|
10462
|
+
});
|
|
10463
|
+
(0, _vue.watch)(reScrollFlag, () => {
|
|
10410
10464
|
(0, _vue.nextTick)(() => {
|
|
10411
10465
|
tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
|
|
10412
10466
|
});
|
|
10413
10467
|
});
|
|
10468
|
+
const reLayoutFlag = (0, _vue.ref)(0);
|
|
10469
|
+
(0, _vue.watch)(() => props.height, () => {
|
|
10470
|
+
reLayoutFlag.value++;
|
|
10471
|
+
});
|
|
10472
|
+
(0, _vue.watch)(() => props.maxHeight, () => {
|
|
10473
|
+
reLayoutFlag.value++;
|
|
10474
|
+
});
|
|
10475
|
+
(0, _vue.watch)(computeScrollbarXToTop, () => {
|
|
10476
|
+
reLayoutFlag.value++;
|
|
10477
|
+
});
|
|
10478
|
+
(0, _vue.watch)(computeScrollbarYToLeft, () => {
|
|
10479
|
+
reLayoutFlag.value++;
|
|
10480
|
+
});
|
|
10481
|
+
(0, _vue.watch)(reLayoutFlag, () => {
|
|
10482
|
+
(0, _vue.nextTick)(() => tableMethods.recalculate(true));
|
|
10483
|
+
});
|
|
10414
10484
|
const footFlag = (0, _vue.ref)(0);
|
|
10415
10485
|
(0, _vue.watch)(() => props.footerData ? props.footerData.length : -1, () => {
|
|
10416
10486
|
footFlag.value++;
|
|
@@ -10421,17 +10491,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10421
10491
|
(0, _vue.watch)(footFlag, () => {
|
|
10422
10492
|
tableMethods.updateFooter();
|
|
10423
10493
|
});
|
|
10424
|
-
(0, _vue.watch)(() => props.height, () => {
|
|
10425
|
-
(0, _vue.nextTick)(() => tableMethods.recalculate(true));
|
|
10426
|
-
});
|
|
10427
|
-
(0, _vue.watch)(() => props.maxHeight, () => {
|
|
10428
|
-
(0, _vue.nextTick)(() => tableMethods.recalculate(true));
|
|
10429
|
-
});
|
|
10430
|
-
(0, _vue.watch)(computeSize, () => {
|
|
10431
|
-
(0, _vue.nextTick)(() => {
|
|
10432
|
-
tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
|
|
10433
|
-
});
|
|
10434
|
-
});
|
|
10435
10494
|
(0, _vue.watch)(() => props.syncResize, value => {
|
|
10436
10495
|
if (value) {
|
|
10437
10496
|
handleUupdateResize();
|