vxe-table 4.10.6-beta.8 → 4.10.6
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/grid/src/grid.js +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +4 -3
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +7 -7
- package/es/table/module/export/hook.js +97 -62
- package/es/table/module/keyboard/hook.js +63 -27
- package/es/table/src/body.js +128 -81
- package/es/table/src/cell.js +41 -55
- package/es/table/src/column.js +13 -1
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/emits.js +2 -0
- package/es/table/src/footer.js +48 -10
- package/es/table/src/header.js +70 -168
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +884 -426
- package/es/table/src/util.js +77 -62
- package/es/table/style.css +253 -189
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +26 -11
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +253 -189
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1533 -917
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +7 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +97 -57
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +71 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +129 -80
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +13 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/footer.js +48 -8
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +54 -181
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +935 -417
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +100 -82
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +253 -189
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +26 -11
- 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 +253 -189
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +4 -3
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/hook.ts +7 -7
- package/packages/table/module/export/hook.ts +118 -65
- package/packages/table/module/keyboard/hook.ts +59 -25
- package/packages/table/src/body.ts +148 -91
- package/packages/table/src/cell.ts +41 -63
- package/packages/table/src/column.ts +13 -1
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/emits.ts +5 -1
- package/packages/table/src/footer.ts +51 -11
- package/packages/table/src/header.ts +70 -168
- package/packages/table/src/props.ts +14 -5
- package/packages/table/src/table.ts +890 -428
- package/packages/table/src/util.ts +81 -62
- package/packages/ui/index.ts +25 -10
- package/styles/components/table.scss +319 -271
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -1
- /package/es/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/es/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/es/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
- /package/lib/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/lib/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/lib/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -58,7 +58,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
58
58
|
computeSize
|
|
59
59
|
} = useFns.useSize(props);
|
|
60
60
|
const reactData = (0, _vue.reactive)({
|
|
61
|
-
isCalcColumn: false,
|
|
62
61
|
// 低性能的静态列
|
|
63
62
|
staticColumns: [],
|
|
64
63
|
// 渲染的列分组
|
|
@@ -271,15 +270,17 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
271
270
|
isFooter: false
|
|
272
271
|
},
|
|
273
272
|
scrollVMLoading: false,
|
|
274
|
-
|
|
273
|
+
calcCellHeightFlag: 0,
|
|
274
|
+
resizeHeightFlag: 0,
|
|
275
275
|
isCustomStatus: false,
|
|
276
276
|
isDragRowMove: false,
|
|
277
277
|
dragRow: null,
|
|
278
278
|
isDragColMove: false,
|
|
279
279
|
dragCol: null,
|
|
280
280
|
dragTipText: '',
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
isDragResize: false,
|
|
282
|
+
isRowLoading: false,
|
|
283
|
+
isColLoading: false
|
|
283
284
|
});
|
|
284
285
|
const internalData = {
|
|
285
286
|
tZindex: 0,
|
|
@@ -353,10 +354,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
353
354
|
fullDataRowIdData: {},
|
|
354
355
|
fullColumnIdData: {},
|
|
355
356
|
fullColumnFieldData: {},
|
|
356
|
-
// 列选取状态
|
|
357
|
-
columnStatusMaps: {},
|
|
358
|
-
// 行选取状态
|
|
359
|
-
rowStatusMaps: {},
|
|
360
357
|
// prevDragRow: null,
|
|
361
358
|
inited: false,
|
|
362
359
|
tooltipTimeout: null,
|
|
@@ -384,8 +381,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
384
381
|
const refTableRightFooter = (0, _vue.ref)();
|
|
385
382
|
const refLeftContainer = (0, _vue.ref)();
|
|
386
383
|
const refRightContainer = (0, _vue.ref)();
|
|
387
|
-
const
|
|
388
|
-
const
|
|
384
|
+
const refColResizeBar = (0, _vue.ref)();
|
|
385
|
+
const refRowResizeBar = (0, _vue.ref)();
|
|
389
386
|
const refEmptyPlaceholder = (0, _vue.ref)();
|
|
390
387
|
const refDragTipElem = (0, _vue.ref)();
|
|
391
388
|
const refDragRowLineElem = (0, _vue.ref)();
|
|
@@ -484,7 +481,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
484
481
|
const computeDefaultRowHeight = (0, _vue.computed)(() => {
|
|
485
482
|
const vSize = computeSize.value;
|
|
486
483
|
const rowHeightMaps = computeRowHeightMaps.value;
|
|
487
|
-
return rowHeightMaps[vSize || 'default'];
|
|
484
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
488
485
|
});
|
|
489
486
|
const computeColumnOpts = (0, _vue.computed)(() => {
|
|
490
487
|
return Object.assign({}, getConfig().table.columnConfig, props.columnConfig);
|
|
@@ -492,6 +489,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
492
489
|
const computeCellOpts = (0, _vue.computed)(() => {
|
|
493
490
|
return Object.assign({}, getConfig().table.cellConfig, props.cellConfig);
|
|
494
491
|
});
|
|
492
|
+
const computeHeaderCellOpts = (0, _vue.computed)(() => {
|
|
493
|
+
return Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
494
|
+
});
|
|
495
|
+
const computeFooterCellOpts = (0, _vue.computed)(() => {
|
|
496
|
+
return Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
497
|
+
});
|
|
495
498
|
const computeRowOpts = (0, _vue.computed)(() => {
|
|
496
499
|
return Object.assign({}, getConfig().table.rowConfig, props.rowConfig);
|
|
497
500
|
});
|
|
@@ -521,6 +524,17 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
521
524
|
const computeTooltipOpts = (0, _vue.computed)(() => {
|
|
522
525
|
return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
523
526
|
});
|
|
527
|
+
const computeTableTipConfig = (0, _vue.computed)(() => {
|
|
528
|
+
const {
|
|
529
|
+
tooltipStore
|
|
530
|
+
} = reactData;
|
|
531
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
532
|
+
return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
|
|
533
|
+
});
|
|
534
|
+
const computeValidTipConfig = (0, _vue.computed)(() => {
|
|
535
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
536
|
+
return Object.assign({}, tooltipOpts);
|
|
537
|
+
});
|
|
524
538
|
const computeEditOpts = (0, _vue.computed)(() => {
|
|
525
539
|
return Object.assign({}, getConfig().table.editConfig, props.editConfig);
|
|
526
540
|
});
|
|
@@ -751,8 +765,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
751
765
|
refTableRightFooter,
|
|
752
766
|
refLeftContainer,
|
|
753
767
|
refRightContainer,
|
|
754
|
-
|
|
755
|
-
|
|
768
|
+
refColResizeBar,
|
|
769
|
+
refRowResizeBar,
|
|
756
770
|
refScrollXVirtualElem,
|
|
757
771
|
refScrollYVirtualElem,
|
|
758
772
|
refScrollXHandleElem,
|
|
@@ -774,6 +788,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
774
788
|
computeScrollYThreshold,
|
|
775
789
|
computeDefaultRowHeight,
|
|
776
790
|
computeCellOpts,
|
|
791
|
+
computeHeaderCellOpts,
|
|
792
|
+
computeFooterCellOpts,
|
|
777
793
|
computeRowOpts,
|
|
778
794
|
computeRowDragOpts,
|
|
779
795
|
computeColumnDragOpts,
|
|
@@ -924,59 +940,66 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
924
940
|
};
|
|
925
941
|
};
|
|
926
942
|
const computeRowHeight = () => {
|
|
943
|
+
const {
|
|
944
|
+
isAllOverflow
|
|
945
|
+
} = reactData;
|
|
927
946
|
const tableHeader = refTableHeader.value;
|
|
928
947
|
const tableBody = refTableBody.value;
|
|
929
948
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
930
949
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
931
950
|
let rowHeight = 0;
|
|
932
|
-
if (
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
firstTrElem
|
|
951
|
+
if (isAllOverflow) {
|
|
952
|
+
if (tableBodyElem) {
|
|
953
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
954
|
+
let firstTrElem;
|
|
955
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
956
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
957
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
958
|
+
}
|
|
959
|
+
if (firstTrElem) {
|
|
960
|
+
rowHeight = firstTrElem.clientHeight;
|
|
961
|
+
}
|
|
938
962
|
}
|
|
939
|
-
if (
|
|
940
|
-
rowHeight =
|
|
963
|
+
if (!rowHeight) {
|
|
964
|
+
rowHeight = defaultRowHeight;
|
|
941
965
|
}
|
|
942
|
-
}
|
|
943
|
-
if (!rowHeight) {
|
|
966
|
+
} else {
|
|
944
967
|
rowHeight = defaultRowHeight;
|
|
945
968
|
}
|
|
946
969
|
// 最低支持 18px 行高
|
|
947
970
|
return Math.max(18, rowHeight);
|
|
948
971
|
};
|
|
949
|
-
const handleVirtualYVisible =
|
|
972
|
+
const handleVirtualYVisible = currScrollTop => {
|
|
950
973
|
const {
|
|
951
|
-
|
|
952
|
-
} = props;
|
|
953
|
-
const {
|
|
954
|
-
rowHeight
|
|
974
|
+
isAllOverflow
|
|
955
975
|
} = reactData;
|
|
956
976
|
const {
|
|
957
977
|
elemStore,
|
|
978
|
+
isResizeCellHeight,
|
|
958
979
|
afterFullData,
|
|
959
980
|
fullAllDataRowIdData
|
|
960
981
|
} = internalData;
|
|
982
|
+
const rowOpts = computeRowOpts.value;
|
|
983
|
+
const cellOpts = computeCellOpts.value;
|
|
984
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
961
985
|
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
962
986
|
if (bodyScrollElem) {
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
clientHeight
|
|
966
|
-
} = bodyScrollElem;
|
|
987
|
+
const clientHeight = bodyScrollElem.clientHeight;
|
|
988
|
+
const scrollTop = _xeUtils.default.isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
|
|
967
989
|
const endHeight = scrollTop + clientHeight;
|
|
968
990
|
let toVisibleIndex = -1;
|
|
969
991
|
let offsetTop = 0;
|
|
970
992
|
let visibleSize = 0;
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
993
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
994
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
995
|
+
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
996
|
+
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
974
997
|
} else {
|
|
975
998
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
976
999
|
const row = afterFullData[rIndex];
|
|
977
1000
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
978
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
979
|
-
offsetTop += rowRest
|
|
1001
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
1002
|
+
offsetTop += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
980
1003
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
981
1004
|
toVisibleIndex = rIndex;
|
|
982
1005
|
}
|
|
@@ -1367,56 +1390,40 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1367
1390
|
internalData.customMaxHeight = calcTableHeight('maxHeight');
|
|
1368
1391
|
};
|
|
1369
1392
|
const calcColumnAutoWidth = (column, wrapperEl) => {
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
if (firstCellEl) {
|
|
1374
|
-
const cellStyle = getComputedStyle(firstCellEl);
|
|
1375
|
-
|
|
1376
|
-
}
|
|
1377
|
-
let colWidth = column.renderAutoWidth -
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
_xeUtils.default.arrayEach(cellEl.children, btnEl => {
|
|
1384
|
-
titleWidth += btnEl.offsetWidth + 1;
|
|
1385
|
-
});
|
|
1386
|
-
} else {
|
|
1387
|
-
const labelEl = cellEl.firstElementChild;
|
|
1388
|
-
if (labelEl) {
|
|
1389
|
-
titleWidth = labelEl.offsetWidth;
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
if (titleWidth) {
|
|
1393
|
-
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
1394
|
-
}
|
|
1395
|
-
});
|
|
1396
|
-
return colWidth + paddingSize;
|
|
1393
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);
|
|
1394
|
+
let leftRightPadding = 0;
|
|
1395
|
+
const firstCellEl = cellElemList[0];
|
|
1396
|
+
if (firstCellEl && firstCellEl.parentElement) {
|
|
1397
|
+
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
1398
|
+
leftRightPadding = Math.ceil(_xeUtils.default.toNumber(cellStyle.paddingLeft) + _xeUtils.default.toNumber(cellStyle.paddingRight));
|
|
1399
|
+
}
|
|
1400
|
+
let colWidth = column.renderAutoWidth - leftRightPadding;
|
|
1401
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
1402
|
+
const celEl = cellElemList[i];
|
|
1403
|
+
colWidth = Math.max(colWidth, celEl ? Math.ceil(celEl.scrollWidth) + 4 : 0);
|
|
1404
|
+
}
|
|
1405
|
+
return colWidth + leftRightPadding;
|
|
1397
1406
|
};
|
|
1398
1407
|
const calcCellWidth = () => {
|
|
1399
1408
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
reactData.isCalcColumn = false;
|
|
1419
|
-
});
|
|
1409
|
+
const {
|
|
1410
|
+
fullColumnIdData
|
|
1411
|
+
} = internalData;
|
|
1412
|
+
const el = refElem.value;
|
|
1413
|
+
if (el) {
|
|
1414
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
1415
|
+
autoWidthColumnList.forEach(column => {
|
|
1416
|
+
const colid = column.id;
|
|
1417
|
+
const colRest = fullColumnIdData[colid];
|
|
1418
|
+
const colWidth = calcColumnAutoWidth(column, el);
|
|
1419
|
+
if (colRest) {
|
|
1420
|
+
colRest.width = Math.max(colWidth, colRest.width);
|
|
1421
|
+
}
|
|
1422
|
+
column.renderAutoWidth = colWidth;
|
|
1423
|
+
});
|
|
1424
|
+
$xeTable.analyColumnWidth();
|
|
1425
|
+
el.removeAttribute('data-calc-col');
|
|
1426
|
+
}
|
|
1420
1427
|
};
|
|
1421
1428
|
/**
|
|
1422
1429
|
* 列宽算法,计算单元格列宽,动态分配可用剩余空间
|
|
@@ -1472,39 +1479,39 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1472
1479
|
});
|
|
1473
1480
|
// 最小自适应
|
|
1474
1481
|
autoMinList.forEach(column => {
|
|
1475
|
-
const
|
|
1476
|
-
tableWidth +=
|
|
1477
|
-
column.renderWidth =
|
|
1482
|
+
const caWidth = Math.max(60, _xeUtils.default.toInteger(column.renderAutoWidth));
|
|
1483
|
+
tableWidth += caWidth;
|
|
1484
|
+
column.renderWidth = caWidth;
|
|
1478
1485
|
});
|
|
1479
1486
|
// 最小百分比
|
|
1480
1487
|
scaleMinList.forEach(column => {
|
|
1481
|
-
const
|
|
1482
|
-
tableWidth +=
|
|
1483
|
-
column.renderWidth =
|
|
1488
|
+
const smWidth = Math.floor(_xeUtils.default.toInteger(column.minWidth) * meanWidth);
|
|
1489
|
+
tableWidth += smWidth;
|
|
1490
|
+
column.renderWidth = smWidth;
|
|
1484
1491
|
});
|
|
1485
1492
|
// 固定百分比
|
|
1486
1493
|
scaleList.forEach(column => {
|
|
1487
|
-
const
|
|
1488
|
-
tableWidth +=
|
|
1489
|
-
column.renderWidth =
|
|
1494
|
+
const sfWidth = Math.floor(_xeUtils.default.toInteger(column.width) * meanWidth);
|
|
1495
|
+
tableWidth += sfWidth;
|
|
1496
|
+
column.renderWidth = sfWidth;
|
|
1490
1497
|
});
|
|
1491
1498
|
// 固定宽
|
|
1492
1499
|
pxList.forEach(column => {
|
|
1493
|
-
const
|
|
1494
|
-
tableWidth +=
|
|
1495
|
-
column.renderWidth =
|
|
1500
|
+
const pWidth = _xeUtils.default.toInteger(column.width);
|
|
1501
|
+
tableWidth += pWidth;
|
|
1502
|
+
column.renderWidth = pWidth;
|
|
1496
1503
|
});
|
|
1497
1504
|
// 自适应宽
|
|
1498
1505
|
autoList.forEach(column => {
|
|
1499
|
-
const
|
|
1500
|
-
tableWidth +=
|
|
1501
|
-
column.renderWidth =
|
|
1506
|
+
const aWidth = Math.max(60, _xeUtils.default.toInteger(column.renderAutoWidth));
|
|
1507
|
+
tableWidth += aWidth;
|
|
1508
|
+
column.renderWidth = aWidth;
|
|
1502
1509
|
});
|
|
1503
1510
|
// 调整了列宽
|
|
1504
1511
|
resizeList.forEach(column => {
|
|
1505
|
-
const
|
|
1506
|
-
tableWidth +=
|
|
1507
|
-
column.renderWidth =
|
|
1512
|
+
const reWidth = _xeUtils.default.toInteger(column.resizeWidth);
|
|
1513
|
+
tableWidth += reWidth;
|
|
1514
|
+
column.renderWidth = reWidth;
|
|
1508
1515
|
});
|
|
1509
1516
|
remainWidth -= tableWidth;
|
|
1510
1517
|
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0;
|
|
@@ -1544,7 +1551,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1544
1551
|
}
|
|
1545
1552
|
const tableHeight = bodyElem.offsetHeight;
|
|
1546
1553
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
1547
|
-
reactData.scrollbarWidth =
|
|
1554
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
1548
1555
|
reactData.overflowY = overflowY;
|
|
1549
1556
|
internalData.tableWidth = tableWidth;
|
|
1550
1557
|
internalData.tableHeight = tableHeight;
|
|
@@ -1553,7 +1560,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1553
1560
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
1554
1561
|
const overflowX = tableWidth > bodyWidth;
|
|
1555
1562
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
1556
|
-
reactData.scrollbarHeight =
|
|
1563
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
1557
1564
|
internalData.headerHeight = headerHeight;
|
|
1558
1565
|
internalData.footerHeight = footerHeight;
|
|
1559
1566
|
reactData.overflowX = overflowX;
|
|
@@ -1563,64 +1570,43 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1563
1570
|
$xeTable.checkScrolling();
|
|
1564
1571
|
}
|
|
1565
1572
|
};
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
// }
|
|
1573
|
+
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
1574
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
1575
|
+
let colHeight = rowRest.height;
|
|
1576
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
1577
|
+
const cellElem = cellElemList[i];
|
|
1578
|
+
const tdEl = cellElem.parentElement;
|
|
1579
|
+
const topBottomPadding = Math.ceil(_xeUtils.default.toNumber(tdEl.style.paddingTop) + _xeUtils.default.toNumber(tdEl.style.paddingBottom));
|
|
1580
|
+
const cellHeight = cellElem ? cellElem.clientHeight : 0;
|
|
1581
|
+
colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
|
|
1582
|
+
}
|
|
1583
|
+
return colHeight;
|
|
1584
|
+
};
|
|
1579
1585
|
const calcCellHeight = () => {
|
|
1580
|
-
const {
|
|
1581
|
-
showOverflow
|
|
1582
|
-
} = props;
|
|
1583
1586
|
const {
|
|
1584
1587
|
tableData,
|
|
1588
|
+
isAllOverflow,
|
|
1589
|
+
scrollYLoad,
|
|
1585
1590
|
scrollXLoad
|
|
1586
1591
|
} = reactData;
|
|
1587
1592
|
const {
|
|
1588
1593
|
fullAllDataRowIdData
|
|
1589
1594
|
} = internalData;
|
|
1595
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
1590
1596
|
const el = refElem.value;
|
|
1591
|
-
if (!
|
|
1592
|
-
|
|
1593
|
-
let paddingBottom = 0;
|
|
1594
|
-
let calcPadding = false;
|
|
1597
|
+
if (!isAllOverflow && scrollYLoad && el) {
|
|
1598
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
1595
1599
|
tableData.forEach(row => {
|
|
1596
1600
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
1597
1601
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
for (let i = 0; i < cellList.length; i++) {
|
|
1602
|
-
const cellElem = cellList[i];
|
|
1603
|
-
const tdEl = cellElem.parentElement;
|
|
1604
|
-
if (!tdEl || !tdEl.clientWidth) {
|
|
1605
|
-
break;
|
|
1606
|
-
}
|
|
1607
|
-
if (!calcPadding) {
|
|
1608
|
-
paddingTop = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingTop);
|
|
1609
|
-
paddingBottom = _xeUtils.default.toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
1610
|
-
calcPadding = true;
|
|
1611
|
-
}
|
|
1612
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
1613
|
-
if (cellElem) {
|
|
1614
|
-
cellHeight += cellElem.clientHeight;
|
|
1615
|
-
}
|
|
1616
|
-
height = Math.max(height, cellHeight);
|
|
1617
|
-
}
|
|
1618
|
-
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
1602
|
+
if (rowRest) {
|
|
1603
|
+
const reHeight = calcCellAutoHeight(rowRest, el);
|
|
1604
|
+
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, reHeight) : reHeight);
|
|
1619
1605
|
}
|
|
1606
|
+
el.removeAttribute('data-calc-row');
|
|
1620
1607
|
});
|
|
1621
|
-
reactData.
|
|
1608
|
+
reactData.calcCellHeightFlag++;
|
|
1622
1609
|
}
|
|
1623
|
-
// updateCellOffset()
|
|
1624
1610
|
};
|
|
1625
1611
|
const getOrderField = column => {
|
|
1626
1612
|
const {
|
|
@@ -1674,6 +1660,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1674
1660
|
parent: null,
|
|
1675
1661
|
level: 0,
|
|
1676
1662
|
height: 0,
|
|
1663
|
+
resizeHeight: 0,
|
|
1677
1664
|
oTop: 0
|
|
1678
1665
|
};
|
|
1679
1666
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -1723,6 +1710,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1723
1710
|
parent: null,
|
|
1724
1711
|
level: 0,
|
|
1725
1712
|
height: 0,
|
|
1713
|
+
resizeHeight: 0,
|
|
1726
1714
|
oTop: 0
|
|
1727
1715
|
};
|
|
1728
1716
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -1992,7 +1980,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1992
1980
|
const updateStyle = () => {
|
|
1993
1981
|
const {
|
|
1994
1982
|
border,
|
|
1995
|
-
showOverflow: allColumnOverflow,
|
|
1996
1983
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
1997
1984
|
showFooterOverflow: allColumnFooterOverflow,
|
|
1998
1985
|
mouseConfig,
|
|
@@ -2005,7 +1992,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2005
1992
|
tableColumn,
|
|
2006
1993
|
scrollXLoad,
|
|
2007
1994
|
scrollYLoad,
|
|
1995
|
+
overflowX,
|
|
2008
1996
|
scrollbarWidth,
|
|
1997
|
+
overflowY,
|
|
2009
1998
|
scrollbarHeight,
|
|
2010
1999
|
columnStore,
|
|
2011
2000
|
editStore,
|
|
@@ -2029,6 +2018,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2029
2018
|
return;
|
|
2030
2019
|
}
|
|
2031
2020
|
const containerList = ['main', 'left', 'right'];
|
|
2021
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
2022
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
2032
2023
|
const emptyPlaceholderElem = refEmptyPlaceholder.value;
|
|
2033
2024
|
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
2034
2025
|
const mouseOpts = computeMouseOpts.value;
|
|
@@ -2036,16 +2027,16 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2036
2027
|
const bodyTableElem = (0, _util.getRefElem)(elemStore['main-body-table']);
|
|
2037
2028
|
if (emptyPlaceholderElem) {
|
|
2038
2029
|
emptyPlaceholderElem.style.top = `${headerHeight}px`;
|
|
2039
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
2030
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
2040
2031
|
}
|
|
2041
2032
|
let bodyHeight = 0;
|
|
2042
2033
|
let bodyMaxHeight = 0;
|
|
2043
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
2034
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
|
|
2044
2035
|
if (customMaxHeight) {
|
|
2045
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
2036
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
|
|
2046
2037
|
}
|
|
2047
2038
|
if (customHeight) {
|
|
2048
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
2039
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
|
|
2049
2040
|
}
|
|
2050
2041
|
if (!bodyHeight) {
|
|
2051
2042
|
if (bodyTableElem) {
|
|
@@ -2063,27 +2054,27 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2063
2054
|
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
2064
2055
|
const scrollXVirtualEl = refScrollXVirtualElem.value;
|
|
2065
2056
|
if (scrollXVirtualEl) {
|
|
2066
|
-
scrollXVirtualEl.style.height = `${
|
|
2067
|
-
scrollXVirtualEl.style.visibility =
|
|
2057
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
2058
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
|
|
2068
2059
|
}
|
|
2069
2060
|
const xWrapperEl = refScrollXWrapperElem.value;
|
|
2070
2061
|
if (xWrapperEl) {
|
|
2071
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${
|
|
2072
|
-
xWrapperEl.style.width = `${el.clientWidth -
|
|
2062
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
2063
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
2073
2064
|
}
|
|
2074
2065
|
if (xLeftCornerEl) {
|
|
2075
|
-
xLeftCornerEl.style.width = scrollbarXToTop ? `${
|
|
2076
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
2066
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
2067
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
|
|
2077
2068
|
}
|
|
2078
2069
|
if (xRightCornerEl) {
|
|
2079
|
-
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${
|
|
2080
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
2070
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
2071
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
|
|
2081
2072
|
}
|
|
2082
2073
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
2083
2074
|
if (scrollYVirtualEl) {
|
|
2084
|
-
scrollYVirtualEl.style.width = `${
|
|
2075
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
2085
2076
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
|
|
2086
|
-
scrollYVirtualEl.style.visibility =
|
|
2077
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
|
|
2087
2078
|
}
|
|
2088
2079
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
2089
2080
|
if (yTopCornerEl) {
|
|
@@ -2202,14 +2193,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2202
2193
|
if (wrapperElem) {
|
|
2203
2194
|
wrapperElem.style.top = `${headerHeight}px`;
|
|
2204
2195
|
}
|
|
2205
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight +
|
|
2196
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
|
|
2206
2197
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
2207
2198
|
}
|
|
2208
2199
|
let tWidth = tableWidth;
|
|
2209
2200
|
let renderColumnList = tableColumn;
|
|
2210
2201
|
let isOptimizeMode = false;
|
|
2211
2202
|
// 如果是使用优化模式
|
|
2212
|
-
if (scrollXLoad || scrollYLoad ||
|
|
2203
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
2213
2204
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
2214
2205
|
// 如果不支持优化模式
|
|
2215
2206
|
} else {
|
|
@@ -2231,7 +2222,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2231
2222
|
if (tableElem) {
|
|
2232
2223
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
2233
2224
|
// 兼容性处理
|
|
2234
|
-
tableElem.style.paddingRight =
|
|
2225
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (_dom.browse['-moz'] || _dom.browse.safari) ? `${osbWidth}px` : '';
|
|
2235
2226
|
}
|
|
2236
2227
|
const emptyBlockElem = (0, _util.getRefElem)(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
2237
2228
|
if (emptyBlockElem) {
|
|
@@ -2266,7 +2257,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2266
2257
|
// 如果是固定列
|
|
2267
2258
|
if (fixedWrapperElem) {
|
|
2268
2259
|
if (wrapperElem) {
|
|
2269
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
2260
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
|
|
2270
2261
|
}
|
|
2271
2262
|
}
|
|
2272
2263
|
}
|
|
@@ -2293,7 +2284,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2293
2284
|
} else if (layout === 'footer') {
|
|
2294
2285
|
cellOverflow = _xeUtils.default.isUndefined(showFooterOverflow) || _xeUtils.default.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
2295
2286
|
} else {
|
|
2296
|
-
cellOverflow = _xeUtils.default.isUndefined(showOverflow) || _xeUtils.default.isNull(showOverflow) ?
|
|
2287
|
+
cellOverflow = _xeUtils.default.isUndefined(showOverflow) || _xeUtils.default.isNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
2297
2288
|
}
|
|
2298
2289
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
2299
2290
|
const showTitle = cellOverflow === 'title';
|
|
@@ -2916,16 +2907,16 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2916
2907
|
scrollXStore,
|
|
2917
2908
|
scrollYStore
|
|
2918
2909
|
} = internalData;
|
|
2919
|
-
const
|
|
2920
|
-
const
|
|
2910
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
2911
|
+
const virtualXOpts = computeVirtualXOpts.value;
|
|
2921
2912
|
// 计算 X 逻辑
|
|
2922
2913
|
if (scrollXLoad) {
|
|
2923
2914
|
const {
|
|
2924
2915
|
toVisibleIndex: toXVisibleIndex,
|
|
2925
2916
|
visibleSize: visibleXSize
|
|
2926
2917
|
} = handleVirtualXVisible();
|
|
2927
|
-
const offsetXSize = Math.max(0,
|
|
2928
|
-
scrollXStore.preloadSize =
|
|
2918
|
+
const offsetXSize = Math.max(0, virtualXOpts.oSize ? _xeUtils.default.toNumber(virtualXOpts.oSize) : 0);
|
|
2919
|
+
scrollXStore.preloadSize = _xeUtils.default.toNumber(virtualXOpts.preSize);
|
|
2929
2920
|
scrollXStore.offsetSize = offsetXSize;
|
|
2930
2921
|
scrollXStore.visibleSize = visibleXSize;
|
|
2931
2922
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
@@ -2937,7 +2928,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2937
2928
|
} else {
|
|
2938
2929
|
$xeTable.updateScrollXSpace();
|
|
2939
2930
|
}
|
|
2940
|
-
calcCellHeight();
|
|
2941
2931
|
// 计算 Y 逻辑
|
|
2942
2932
|
const rowHeight = computeRowHeight();
|
|
2943
2933
|
scrollYStore.rowHeight = rowHeight;
|
|
@@ -2947,8 +2937,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2947
2937
|
visibleSize: visibleYSize
|
|
2948
2938
|
} = handleVirtualYVisible();
|
|
2949
2939
|
if (scrollYLoad) {
|
|
2950
|
-
const offsetYSize = Math.max(0,
|
|
2951
|
-
scrollYStore.preloadSize =
|
|
2940
|
+
const offsetYSize = Math.max(0, virtualYOpts.oSize ? _xeUtils.default.toNumber(virtualYOpts.oSize) : 0);
|
|
2941
|
+
scrollYStore.preloadSize = _xeUtils.default.toNumber(virtualYOpts.preSize);
|
|
2952
2942
|
scrollYStore.offsetSize = offsetYSize;
|
|
2953
2943
|
scrollYStore.visibleSize = visibleYSize;
|
|
2954
2944
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -2977,7 +2967,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2977
2967
|
return computeScrollLoad().then(() => {
|
|
2978
2968
|
if (reFull === true) {
|
|
2979
2969
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2980
|
-
calcCellHeight();
|
|
2981
2970
|
calcCellWidth();
|
|
2982
2971
|
autoCellWidth();
|
|
2983
2972
|
updateStyle();
|
|
@@ -2989,11 +2978,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2989
2978
|
* 加载表格数据
|
|
2990
2979
|
* @param {Array} datas 数据
|
|
2991
2980
|
*/
|
|
2992
|
-
const loadTableData = datas => {
|
|
2981
|
+
const loadTableData = (datas, isReset) => {
|
|
2993
2982
|
const {
|
|
2994
2983
|
keepSource,
|
|
2995
|
-
treeConfig
|
|
2996
|
-
showOverflow
|
|
2984
|
+
treeConfig
|
|
2997
2985
|
} = props;
|
|
2998
2986
|
const {
|
|
2999
2987
|
editStore,
|
|
@@ -3006,7 +2994,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3006
2994
|
lastScrollTop
|
|
3007
2995
|
} = internalData;
|
|
3008
2996
|
const treeOpts = computeTreeOpts.value;
|
|
3009
|
-
const rowOpts = computeRowOpts.value;
|
|
3010
2997
|
const {
|
|
3011
2998
|
transform
|
|
3012
2999
|
} = treeOpts;
|
|
@@ -3053,42 +3040,30 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3053
3040
|
scrollYStore.endIndex = 1;
|
|
3054
3041
|
scrollXStore.startIndex = 0;
|
|
3055
3042
|
scrollXStore.endIndex = 1;
|
|
3043
|
+
reactData.isRowLoading = true;
|
|
3056
3044
|
reactData.scrollVMLoading = false;
|
|
3057
3045
|
editStore.insertMaps = {};
|
|
3058
3046
|
editStore.removeMaps = {};
|
|
3059
3047
|
const sYLoad = updateScrollYStatus(fullData);
|
|
3048
|
+
reactData.isDragColMove = false;
|
|
3060
3049
|
reactData.isDragRowMove = false;
|
|
3061
3050
|
// 全量数据
|
|
3062
3051
|
internalData.tableFullData = fullData;
|
|
3063
3052
|
internalData.tableFullTreeData = treeData;
|
|
3064
3053
|
// 缓存数据
|
|
3065
|
-
|
|
3054
|
+
$xeTable.cacheRowMap(true, isReset);
|
|
3066
3055
|
// 原始数据
|
|
3067
3056
|
internalData.tableSynchData = datas;
|
|
3057
|
+
if (isReset) {
|
|
3058
|
+
internalData.isResizeCellHeight = false;
|
|
3059
|
+
reactData.rowExpandedMaps = {};
|
|
3060
|
+
reactData.rowExpandLazyLoadedMaps = {};
|
|
3061
|
+
reactData.treeExpandedMaps = {};
|
|
3062
|
+
reactData.treeExpandLazyLoadedMaps = {};
|
|
3063
|
+
}
|
|
3068
3064
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
3069
3065
|
if (keepSource) {
|
|
3070
|
-
|
|
3071
|
-
}
|
|
3072
|
-
if (sYLoad) {
|
|
3073
|
-
if (showOverflow) {
|
|
3074
|
-
if (!rowOpts.height) {
|
|
3075
|
-
const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
|
|
3076
|
-
if (errColumn) {
|
|
3077
|
-
(0, _log.errLog)('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3081
|
-
if (process.env.NODE_ENV === 'development') {
|
|
3082
|
-
if (!(props.height || props.maxHeight)) {
|
|
3083
|
-
(0, _log.errLog)('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
3084
|
-
}
|
|
3085
|
-
// if (!props.showOverflow) {
|
|
3086
|
-
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
3087
|
-
// }
|
|
3088
|
-
if (props.spanMethod) {
|
|
3089
|
-
(0, _log.warnLog)('vxe.error.scrollErrProp', ['table.span-method']);
|
|
3090
|
-
}
|
|
3091
|
-
}
|
|
3066
|
+
$xeTable.cacheSourceMap(fullData);
|
|
3092
3067
|
}
|
|
3093
3068
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
3094
3069
|
$xeTable.clearCellAreas();
|
|
@@ -3108,6 +3083,27 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3108
3083
|
if (sYLoad) {
|
|
3109
3084
|
scrollYStore.endIndex = scrollYStore.visibleSize;
|
|
3110
3085
|
}
|
|
3086
|
+
if (sYLoad) {
|
|
3087
|
+
// if (showOverflow) {
|
|
3088
|
+
// if (!rowOpts.height) {
|
|
3089
|
+
// const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
|
|
3090
|
+
// if (errColumn) {
|
|
3091
|
+
// errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
|
|
3092
|
+
// }
|
|
3093
|
+
// }
|
|
3094
|
+
// }
|
|
3095
|
+
if (process.env.NODE_ENV === 'development') {
|
|
3096
|
+
if (!(props.height || props.maxHeight)) {
|
|
3097
|
+
(0, _log.errLog)('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
3098
|
+
}
|
|
3099
|
+
// if (!props.showOverflow) {
|
|
3100
|
+
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
3101
|
+
// }
|
|
3102
|
+
if (props.spanMethod) {
|
|
3103
|
+
(0, _log.warnLog)('vxe.error.scrollErrProp', ['table.span-method']);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3111
3107
|
handleReserveStatus();
|
|
3112
3108
|
tablePrivateMethods.checkSelectionStatus();
|
|
3113
3109
|
return new Promise(resolve => {
|
|
@@ -3123,6 +3119,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3123
3119
|
if (sYOpts.scrollToTopOnChange) {
|
|
3124
3120
|
targetScrollTop = 0;
|
|
3125
3121
|
}
|
|
3122
|
+
reactData.isRowLoading = false;
|
|
3123
|
+
calcCellHeight();
|
|
3126
3124
|
// 是否变更虚拟滚动
|
|
3127
3125
|
if (oldScrollYLoad === sYLoad) {
|
|
3128
3126
|
(0, _util.restoreScrollLocation)($xeTable, targetScrollLeft, targetScrollTop).then(() => {
|
|
@@ -3385,11 +3383,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3385
3383
|
internalData.collectColumn = collectColumn;
|
|
3386
3384
|
const tableFullColumn = getColumnList(collectColumn);
|
|
3387
3385
|
internalData.tableFullColumn = tableFullColumn;
|
|
3388
|
-
reactData.
|
|
3386
|
+
reactData.isColLoading = true;
|
|
3389
3387
|
reactData.isDragColMove = false;
|
|
3390
3388
|
initColumnSort();
|
|
3391
3389
|
return Promise.resolve(restoreCustomStorage()).then(() => {
|
|
3392
|
-
reactData.isLoading = false;
|
|
3393
3390
|
cacheColumnMap();
|
|
3394
3391
|
parseColumns(true).then(() => {
|
|
3395
3392
|
if (reactData.scrollXLoad) {
|
|
@@ -3414,6 +3411,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3414
3411
|
if ($xeTable.handleUpdateCustomColumn) {
|
|
3415
3412
|
$xeTable.handleUpdateCustomColumn();
|
|
3416
3413
|
}
|
|
3414
|
+
reactData.isColLoading = false;
|
|
3417
3415
|
return $xeTable.recalculate();
|
|
3418
3416
|
});
|
|
3419
3417
|
});
|
|
@@ -3553,12 +3551,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3553
3551
|
/**
|
|
3554
3552
|
* 纵向 Y 可视渲染处理
|
|
3555
3553
|
*/
|
|
3556
|
-
const loadScrollYData =
|
|
3557
|
-
const {
|
|
3558
|
-
showOverflow
|
|
3559
|
-
} = props;
|
|
3554
|
+
const loadScrollYData = scrollTop => {
|
|
3560
3555
|
const {
|
|
3561
|
-
mergeList
|
|
3556
|
+
mergeList,
|
|
3557
|
+
isAllOverflow
|
|
3562
3558
|
} = reactData;
|
|
3563
3559
|
const {
|
|
3564
3560
|
scrollYStore
|
|
@@ -3569,11 +3565,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3569
3565
|
endIndex,
|
|
3570
3566
|
offsetSize
|
|
3571
3567
|
} = scrollYStore;
|
|
3572
|
-
const autoOffsetYSize =
|
|
3568
|
+
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
3573
3569
|
const {
|
|
3574
3570
|
toVisibleIndex,
|
|
3575
3571
|
visibleSize
|
|
3576
|
-
} = handleVirtualYVisible();
|
|
3572
|
+
} = handleVirtualYVisible(scrollTop);
|
|
3577
3573
|
const offsetItem = {
|
|
3578
3574
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
3579
3575
|
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
|
|
@@ -3631,7 +3627,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3631
3627
|
const {
|
|
3632
3628
|
visibleSize
|
|
3633
3629
|
} = scrollXStore;
|
|
3634
|
-
const fpsTime = Math.max(5, Math.min(
|
|
3630
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
|
|
3635
3631
|
if (lxTimeout) {
|
|
3636
3632
|
clearTimeout(lxTimeout);
|
|
3637
3633
|
}
|
|
@@ -3646,9 +3642,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3646
3642
|
}, fpsTime);
|
|
3647
3643
|
};
|
|
3648
3644
|
const lazyScrollYData = () => {
|
|
3649
|
-
const {
|
|
3650
|
-
showOverflow
|
|
3651
|
-
} = props;
|
|
3652
3645
|
const {
|
|
3653
3646
|
lyTimeout,
|
|
3654
3647
|
lyRunTime,
|
|
@@ -3657,7 +3650,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3657
3650
|
const {
|
|
3658
3651
|
visibleSize
|
|
3659
3652
|
} = scrollYStore;
|
|
3660
|
-
const fpsTime =
|
|
3653
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
|
|
3661
3654
|
if (lyTimeout) {
|
|
3662
3655
|
clearTimeout(lyTimeout);
|
|
3663
3656
|
}
|
|
@@ -3685,27 +3678,63 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3685
3678
|
internalData.lcsTimeout = setTimeout(() => {
|
|
3686
3679
|
internalData.lcsRunTime = Date.now();
|
|
3687
3680
|
internalData.lcsTimeout = undefined;
|
|
3681
|
+
internalData.intoRunScroll = false;
|
|
3688
3682
|
internalData.inVirtualScroll = false;
|
|
3689
3683
|
internalData.inWheelScroll = false;
|
|
3690
3684
|
internalData.inHeaderScroll = false;
|
|
3691
3685
|
internalData.inBodyScroll = false;
|
|
3692
3686
|
internalData.inFooterScroll = false;
|
|
3693
3687
|
internalData.scrollRenderType = '';
|
|
3688
|
+
calcCellHeight();
|
|
3694
3689
|
if (isRollX && scrollXLoad) {
|
|
3695
|
-
$xeTable.updateScrollXData()
|
|
3696
|
-
calcCellHeight();
|
|
3697
|
-
loadScrollXData();
|
|
3698
|
-
});
|
|
3690
|
+
$xeTable.updateScrollXData();
|
|
3699
3691
|
}
|
|
3700
3692
|
if (isRollY && scrollYLoad) {
|
|
3701
3693
|
$xeTable.updateScrollYData().then(() => {
|
|
3702
3694
|
calcCellHeight();
|
|
3703
|
-
|
|
3695
|
+
$xeTable.updateScrollYSpace();
|
|
3704
3696
|
});
|
|
3705
3697
|
}
|
|
3706
3698
|
$xeTable.updateCellAreas();
|
|
3707
3699
|
}, 200);
|
|
3708
3700
|
};
|
|
3701
|
+
const getWheelSpeed = lastScrollTime => {
|
|
3702
|
+
let multiple = 1;
|
|
3703
|
+
const currTime = Date.now();
|
|
3704
|
+
if (lastScrollTime + 25 > currTime) {
|
|
3705
|
+
multiple = 1.18;
|
|
3706
|
+
} else if (lastScrollTime + 30 > currTime) {
|
|
3707
|
+
multiple = 1.15;
|
|
3708
|
+
} else if (lastScrollTime + 40 > currTime) {
|
|
3709
|
+
multiple = 1.12;
|
|
3710
|
+
} else if (lastScrollTime + 55 > currTime) {
|
|
3711
|
+
multiple = 1.09;
|
|
3712
|
+
} else if (lastScrollTime + 75 > currTime) {
|
|
3713
|
+
multiple = 1.06;
|
|
3714
|
+
} else if (lastScrollTime + 100 > currTime) {
|
|
3715
|
+
multiple = 1.03;
|
|
3716
|
+
}
|
|
3717
|
+
return multiple;
|
|
3718
|
+
};
|
|
3719
|
+
const wheelScrollTo = (diffNum, cb) => {
|
|
3720
|
+
const duration = Math.abs(diffNum);
|
|
3721
|
+
const startTime = performance.now();
|
|
3722
|
+
let countTop = 0;
|
|
3723
|
+
const step = timestamp => {
|
|
3724
|
+
let progress = (timestamp - startTime) / duration;
|
|
3725
|
+
if (progress > 1) {
|
|
3726
|
+
progress = 1;
|
|
3727
|
+
}
|
|
3728
|
+
const easedProgress = Math.pow(progress, 2);
|
|
3729
|
+
const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
|
|
3730
|
+
countTop += offsetTop;
|
|
3731
|
+
cb(offsetTop);
|
|
3732
|
+
if (progress < 1) {
|
|
3733
|
+
requestAnimationFrame(step);
|
|
3734
|
+
}
|
|
3735
|
+
};
|
|
3736
|
+
requestAnimationFrame(step);
|
|
3737
|
+
};
|
|
3709
3738
|
const dispatchEvent = (type, params, evnt) => {
|
|
3710
3739
|
emit(type, createEvent(evnt, {
|
|
3711
3740
|
$table: $xeTable,
|
|
@@ -3722,12 +3751,31 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3722
3751
|
}
|
|
3723
3752
|
return (0, _vue.nextTick)();
|
|
3724
3753
|
};
|
|
3725
|
-
|
|
3754
|
+
const handleUpdateResize = () => {
|
|
3726
3755
|
const el = refElem.value;
|
|
3727
3756
|
if (el && el.clientWidth && el.clientHeight) {
|
|
3728
3757
|
tableMethods.recalculate();
|
|
3729
3758
|
}
|
|
3730
|
-
}
|
|
3759
|
+
};
|
|
3760
|
+
const handleUpdateColResize = (evnt, params) => {
|
|
3761
|
+
$xeTable.analyColumnWidth();
|
|
3762
|
+
$xeTable.recalculate(true).then(() => {
|
|
3763
|
+
$xeTable.saveCustomStore('update:width');
|
|
3764
|
+
$xeTable.updateCellAreas();
|
|
3765
|
+
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
3766
|
+
// 已废弃 resizable-change
|
|
3767
|
+
$xeTable.dispatchEvent('resizable-change', params, evnt);
|
|
3768
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
3769
|
+
});
|
|
3770
|
+
};
|
|
3771
|
+
const handleUpdateRowResize = (evnt, params) => {
|
|
3772
|
+
reactData.resizeHeightFlag++;
|
|
3773
|
+
$xeTable.recalculate(true).then(() => {
|
|
3774
|
+
$xeTable.updateCellAreas();
|
|
3775
|
+
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
3776
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
3777
|
+
});
|
|
3778
|
+
};
|
|
3731
3779
|
tableMethods = {
|
|
3732
3780
|
dispatchEvent,
|
|
3733
3781
|
/**
|
|
@@ -3785,7 +3833,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3785
3833
|
const {
|
|
3786
3834
|
initStatus
|
|
3787
3835
|
} = internalData;
|
|
3788
|
-
return loadTableData(datas).then(() => {
|
|
3836
|
+
return loadTableData(datas, false).then(() => {
|
|
3789
3837
|
internalData.inited = true;
|
|
3790
3838
|
internalData.initStatus = true;
|
|
3791
3839
|
if (!initStatus) {
|
|
@@ -3802,7 +3850,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3802
3850
|
return tableMethods.clearAll().then(() => {
|
|
3803
3851
|
internalData.inited = true;
|
|
3804
3852
|
internalData.initStatus = true;
|
|
3805
|
-
return loadTableData(datas);
|
|
3853
|
+
return loadTableData(datas, true);
|
|
3806
3854
|
}).then(() => {
|
|
3807
3855
|
handleLoadDefaults();
|
|
3808
3856
|
return tableMethods.recalculate();
|
|
@@ -3921,6 +3969,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3921
3969
|
parent: parentRow,
|
|
3922
3970
|
level: parentLevel + nodes.length,
|
|
3923
3971
|
height: 0,
|
|
3972
|
+
resizeHeight: 0,
|
|
3924
3973
|
oTop: 0
|
|
3925
3974
|
};
|
|
3926
3975
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -4161,29 +4210,32 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
4161
4210
|
return (0, _vue.nextTick)();
|
|
4162
4211
|
},
|
|
4163
4212
|
getCellElement(row, fieldOrColumn) {
|
|
4213
|
+
const {
|
|
4214
|
+
elemStore
|
|
4215
|
+
} = internalData;
|
|
4164
4216
|
const column = (0, _util.handleFieldOrColumn)($xeTable, fieldOrColumn);
|
|
4165
4217
|
if (!column) {
|
|
4166
4218
|
return null;
|
|
4167
4219
|
}
|
|
4168
4220
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
4169
|
-
const
|
|
4170
|
-
const
|
|
4171
|
-
const
|
|
4221
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
4222
|
+
const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
|
|
4223
|
+
const rightScrollElem = (0, _util.getRefElem)(elemStore['right-body-scroll']);
|
|
4172
4224
|
let bodyElem;
|
|
4173
4225
|
if (column) {
|
|
4174
4226
|
if (column.fixed) {
|
|
4175
4227
|
if (column.fixed === 'left') {
|
|
4176
|
-
if (
|
|
4177
|
-
bodyElem =
|
|
4228
|
+
if (leftScrollElem) {
|
|
4229
|
+
bodyElem = leftScrollElem;
|
|
4178
4230
|
}
|
|
4179
4231
|
} else {
|
|
4180
|
-
if (
|
|
4181
|
-
bodyElem =
|
|
4232
|
+
if (rightScrollElem) {
|
|
4233
|
+
bodyElem = rightScrollElem;
|
|
4182
4234
|
}
|
|
4183
4235
|
}
|
|
4184
4236
|
}
|
|
4185
4237
|
if (!bodyElem) {
|
|
4186
|
-
bodyElem =
|
|
4238
|
+
bodyElem = bodyScrollElem;
|
|
4187
4239
|
}
|
|
4188
4240
|
if (bodyElem) {
|
|
4189
4241
|
return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
|
|
@@ -4656,29 +4708,40 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
4656
4708
|
return (0, _vue.nextTick)();
|
|
4657
4709
|
},
|
|
4658
4710
|
setColumnWidth(fieldOrColumn, width) {
|
|
4711
|
+
const {
|
|
4712
|
+
elemStore
|
|
4713
|
+
} = internalData;
|
|
4659
4714
|
let status = false;
|
|
4660
4715
|
const cols = _xeUtils.default.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4716
|
+
let cWidth = _xeUtils.default.toInteger(width);
|
|
4717
|
+
if ((0, _dom.isScale)(width)) {
|
|
4718
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
4719
|
+
const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
|
|
4720
|
+
cWidth = Math.floor(cWidth * bodyWidth);
|
|
4721
|
+
}
|
|
4722
|
+
if (cWidth) {
|
|
4723
|
+
cols.forEach(item => {
|
|
4724
|
+
const column = (0, _util.handleFieldOrColumn)($xeTable, item);
|
|
4725
|
+
if (column) {
|
|
4726
|
+
column.resizeWidth = cWidth;
|
|
4727
|
+
if (!status) {
|
|
4728
|
+
status = true;
|
|
4729
|
+
}
|
|
4675
4730
|
}
|
|
4731
|
+
});
|
|
4732
|
+
if (status) {
|
|
4733
|
+
return $xeTable.refreshColumn().then(() => {
|
|
4734
|
+
return {
|
|
4735
|
+
status
|
|
4736
|
+
};
|
|
4737
|
+
});
|
|
4676
4738
|
}
|
|
4677
|
-
});
|
|
4678
|
-
if (status) {
|
|
4679
|
-
return tableMethods.refreshColumn();
|
|
4680
4739
|
}
|
|
4681
|
-
return (0, _vue.nextTick)()
|
|
4740
|
+
return (0, _vue.nextTick)().then(() => {
|
|
4741
|
+
return {
|
|
4742
|
+
status
|
|
4743
|
+
};
|
|
4744
|
+
});
|
|
4682
4745
|
},
|
|
4683
4746
|
getColumnWidth(fieldOrColumn) {
|
|
4684
4747
|
const column = (0, _util.handleFieldOrColumn)($xeTable, fieldOrColumn);
|
|
@@ -4711,6 +4774,106 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
4711
4774
|
return tableMethods.recalculate();
|
|
4712
4775
|
});
|
|
4713
4776
|
},
|
|
4777
|
+
setRowHeightConf(heightConf) {
|
|
4778
|
+
const {
|
|
4779
|
+
fullAllDataRowIdData
|
|
4780
|
+
} = internalData;
|
|
4781
|
+
let status = false;
|
|
4782
|
+
if (heightConf) {
|
|
4783
|
+
_xeUtils.default.each(heightConf, (height, rowid) => {
|
|
4784
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
4785
|
+
if (rowRest) {
|
|
4786
|
+
const rHeight = _xeUtils.default.toInteger(height);
|
|
4787
|
+
if (rHeight) {
|
|
4788
|
+
rowRest.resizeHeight = rHeight;
|
|
4789
|
+
if (!status) {
|
|
4790
|
+
status = true;
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
}
|
|
4794
|
+
});
|
|
4795
|
+
if (status) {
|
|
4796
|
+
internalData.isResizeCellHeight = true;
|
|
4797
|
+
reactData.resizeHeightFlag++;
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
return (0, _vue.nextTick)().then(() => {
|
|
4801
|
+
return {
|
|
4802
|
+
status
|
|
4803
|
+
};
|
|
4804
|
+
});
|
|
4805
|
+
},
|
|
4806
|
+
getRowHeightConf(isFull) {
|
|
4807
|
+
const {
|
|
4808
|
+
fullAllDataRowIdData,
|
|
4809
|
+
afterFullData
|
|
4810
|
+
} = internalData;
|
|
4811
|
+
const rowOpts = computeRowOpts.value;
|
|
4812
|
+
const cellOpts = computeCellOpts.value;
|
|
4813
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
4814
|
+
const rest = {};
|
|
4815
|
+
afterFullData.forEach(row => {
|
|
4816
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
4817
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
4818
|
+
if (rowRest) {
|
|
4819
|
+
const resizeHeight = rowRest.resizeHeight;
|
|
4820
|
+
if (resizeHeight || isFull) {
|
|
4821
|
+
const currCellHeight = resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
4822
|
+
rest[rowid] = currCellHeight;
|
|
4823
|
+
}
|
|
4824
|
+
}
|
|
4825
|
+
});
|
|
4826
|
+
return rest;
|
|
4827
|
+
},
|
|
4828
|
+
setRowHeight(rowOrId, height) {
|
|
4829
|
+
const {
|
|
4830
|
+
fullAllDataRowIdData
|
|
4831
|
+
} = internalData;
|
|
4832
|
+
let status = false;
|
|
4833
|
+
const rows = _xeUtils.default.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
4834
|
+
let rHeight = _xeUtils.default.toInteger(height);
|
|
4835
|
+
if ((0, _dom.isScale)(height)) {
|
|
4836
|
+
const tableBody = refTableBody.value;
|
|
4837
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
4838
|
+
const bodyHeight = bodyElem ? bodyElem.clientHeight - 1 : 0;
|
|
4839
|
+
rHeight = Math.floor(rHeight * bodyHeight);
|
|
4840
|
+
}
|
|
4841
|
+
if (rHeight) {
|
|
4842
|
+
rows.forEach(row => {
|
|
4843
|
+
const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : (0, _util.getRowid)($xeTable, row);
|
|
4844
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
4845
|
+
if (rowRest) {
|
|
4846
|
+
rowRest.resizeHeight = rHeight;
|
|
4847
|
+
if (!status) {
|
|
4848
|
+
status = true;
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
});
|
|
4852
|
+
if (status) {
|
|
4853
|
+
internalData.isResizeCellHeight = true;
|
|
4854
|
+
reactData.resizeHeightFlag++;
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
return (0, _vue.nextTick)().then(() => {
|
|
4858
|
+
return {
|
|
4859
|
+
status
|
|
4860
|
+
};
|
|
4861
|
+
});
|
|
4862
|
+
},
|
|
4863
|
+
getRowHeight(rowOrId) {
|
|
4864
|
+
const {
|
|
4865
|
+
fullAllDataRowIdData
|
|
4866
|
+
} = internalData;
|
|
4867
|
+
const rowOpts = computeRowOpts.value;
|
|
4868
|
+
const cellOpts = computeCellOpts.value;
|
|
4869
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
4870
|
+
const rowid = _xeUtils.default.isString(rowOrId) || _xeUtils.default.isNumber(rowOrId) ? rowOrId : (0, _util.getRowid)($xeTable, rowOrId);
|
|
4871
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
4872
|
+
if (rowRest) {
|
|
4873
|
+
return rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
4874
|
+
}
|
|
4875
|
+
return 0;
|
|
4876
|
+
},
|
|
4714
4877
|
/**
|
|
4715
4878
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
4716
4879
|
*/
|
|
@@ -5915,13 +6078,15 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
5915
6078
|
scrollXLoad,
|
|
5916
6079
|
scrollYLoad
|
|
5917
6080
|
} = reactData;
|
|
5918
|
-
const
|
|
5919
|
-
|
|
6081
|
+
const {
|
|
6082
|
+
elemStore
|
|
6083
|
+
} = internalData;
|
|
6084
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
5920
6085
|
return {
|
|
5921
6086
|
virtualX: scrollXLoad,
|
|
5922
6087
|
virtualY: scrollYLoad,
|
|
5923
|
-
scrollTop:
|
|
5924
|
-
scrollLeft:
|
|
6088
|
+
scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
6089
|
+
scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
5925
6090
|
};
|
|
5926
6091
|
},
|
|
5927
6092
|
/**
|
|
@@ -5972,9 +6137,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
5972
6137
|
*/
|
|
5973
6138
|
scrollToRow(row, fieldOrColumn) {
|
|
5974
6139
|
const {
|
|
5975
|
-
|
|
5976
|
-
} = props;
|
|
5977
|
-
const {
|
|
6140
|
+
isAllOverflow,
|
|
5978
6141
|
scrollYLoad,
|
|
5979
6142
|
scrollXLoad
|
|
5980
6143
|
} = reactData;
|
|
@@ -5991,7 +6154,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
5991
6154
|
}
|
|
5992
6155
|
return Promise.all(rest).then(() => {
|
|
5993
6156
|
if (row) {
|
|
5994
|
-
if (!
|
|
6157
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad)) {
|
|
5995
6158
|
calcCellHeight();
|
|
5996
6159
|
calcCellWidth();
|
|
5997
6160
|
}
|
|
@@ -7059,13 +7222,17 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7059
7222
|
return;
|
|
7060
7223
|
}
|
|
7061
7224
|
const {
|
|
7225
|
+
overflowX,
|
|
7062
7226
|
scrollbarWidth,
|
|
7227
|
+
overflowY,
|
|
7063
7228
|
scrollbarHeight
|
|
7064
7229
|
} = reactData;
|
|
7065
7230
|
const {
|
|
7066
7231
|
prevDragToChild
|
|
7067
7232
|
} = internalData;
|
|
7068
7233
|
const wrapperRect = el.getBoundingClientRect();
|
|
7234
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
7235
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
7069
7236
|
const tableWidth = el.clientWidth;
|
|
7070
7237
|
const tableHeight = el.clientHeight;
|
|
7071
7238
|
if (trEl) {
|
|
@@ -7076,14 +7243,14 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7076
7243
|
const trRect = trEl.getBoundingClientRect();
|
|
7077
7244
|
let trHeight = trEl.clientHeight;
|
|
7078
7245
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
7079
|
-
if (offsetTop + trHeight > tableHeight -
|
|
7080
|
-
trHeight = tableHeight - offsetTop -
|
|
7246
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
7247
|
+
trHeight = tableHeight - offsetTop - osbHeight;
|
|
7081
7248
|
}
|
|
7082
7249
|
rdLineEl.style.display = 'block';
|
|
7083
|
-
rdLineEl.style.left = `${scrollbarYToLeft ?
|
|
7250
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
7084
7251
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
7085
7252
|
rdLineEl.style.height = `${trHeight}px`;
|
|
7086
|
-
rdLineEl.style.width = `${tableWidth -
|
|
7253
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`;
|
|
7087
7254
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
7088
7255
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
7089
7256
|
} else {
|
|
@@ -7108,7 +7275,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7108
7275
|
thWidth -= startX - offsetLeft;
|
|
7109
7276
|
offsetLeft = startX;
|
|
7110
7277
|
}
|
|
7111
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
7278
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
|
|
7112
7279
|
if (offsetLeft + thWidth > endX) {
|
|
7113
7280
|
thWidth = endX - offsetLeft;
|
|
7114
7281
|
}
|
|
@@ -7119,7 +7286,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7119
7286
|
if (prevDragToChild) {
|
|
7120
7287
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
7121
7288
|
} else {
|
|
7122
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 :
|
|
7289
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
|
|
7123
7290
|
}
|
|
7124
7291
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
7125
7292
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -7155,11 +7322,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7155
7322
|
* @param {Event} evnt 事件
|
|
7156
7323
|
* @param {Row} row 行对象
|
|
7157
7324
|
*/
|
|
7158
|
-
const handleTooltip = (evnt,
|
|
7325
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
7159
7326
|
if (!overflowElem) {
|
|
7160
7327
|
return (0, _vue.nextTick)();
|
|
7161
7328
|
}
|
|
7162
|
-
params.cell =
|
|
7329
|
+
params.cell = tdEl;
|
|
7163
7330
|
const {
|
|
7164
7331
|
tooltipStore
|
|
7165
7332
|
} = reactData;
|
|
@@ -7331,9 +7498,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7331
7498
|
},
|
|
7332
7499
|
/**
|
|
7333
7500
|
* 更新数据行的 Map
|
|
7334
|
-
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
7335
7501
|
*/
|
|
7336
|
-
cacheRowMap(isSource) {
|
|
7502
|
+
cacheRowMap(isReset, isSource) {
|
|
7337
7503
|
const {
|
|
7338
7504
|
treeConfig
|
|
7339
7505
|
} = props;
|
|
@@ -7361,7 +7527,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7361
7527
|
row[childrenField] = null;
|
|
7362
7528
|
}
|
|
7363
7529
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
7364
|
-
if (!cacheItem) {
|
|
7530
|
+
if (isReset || !cacheItem) {
|
|
7365
7531
|
cacheItem = {
|
|
7366
7532
|
row,
|
|
7367
7533
|
rowid,
|
|
@@ -7374,6 +7540,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7374
7540
|
parent: parentRow,
|
|
7375
7541
|
level,
|
|
7376
7542
|
height: 0,
|
|
7543
|
+
resizeHeight: 0,
|
|
7377
7544
|
oTop: 0
|
|
7378
7545
|
};
|
|
7379
7546
|
}
|
|
@@ -7487,13 +7654,166 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7487
7654
|
remainList
|
|
7488
7655
|
});
|
|
7489
7656
|
},
|
|
7490
|
-
|
|
7657
|
+
handleColResizeMousedownEvent(evnt, fixedType, params) {
|
|
7658
|
+
evnt.stopPropagation();
|
|
7659
|
+
evnt.preventDefault();
|
|
7660
|
+
const {
|
|
7661
|
+
column
|
|
7662
|
+
} = params;
|
|
7663
|
+
const {
|
|
7664
|
+
overflowX,
|
|
7665
|
+
scrollbarHeight
|
|
7666
|
+
} = reactData;
|
|
7667
|
+
const {
|
|
7668
|
+
elemStore,
|
|
7669
|
+
visibleColumn
|
|
7670
|
+
} = internalData;
|
|
7671
|
+
const resizableOpts = computeResizableOpts.value;
|
|
7672
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
7673
|
+
const tableEl = refElem.value;
|
|
7674
|
+
const leftContainerElem = refLeftContainer.value;
|
|
7675
|
+
const rightContainerElem = refRightContainer.value;
|
|
7676
|
+
const resizeBarElem = refColResizeBar.value;
|
|
7677
|
+
if (!resizeBarElem) {
|
|
7678
|
+
return;
|
|
7679
|
+
}
|
|
7680
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
7681
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
7682
|
+
const {
|
|
7683
|
+
clientX: dragClientX
|
|
7684
|
+
} = evnt;
|
|
7685
|
+
const wrapperElem = refElem.value;
|
|
7686
|
+
const dragBtnElem = evnt.target;
|
|
7687
|
+
let resizeColumn = column;
|
|
7688
|
+
if (column.children && column.children.length) {
|
|
7689
|
+
_xeUtils.default.eachTree(column.children, childColumn => {
|
|
7690
|
+
resizeColumn = childColumn;
|
|
7691
|
+
});
|
|
7692
|
+
}
|
|
7693
|
+
const cell = dragBtnElem.parentNode;
|
|
7694
|
+
const cellParams = Object.assign(params, {
|
|
7695
|
+
cell
|
|
7696
|
+
});
|
|
7697
|
+
let dragLeft = 0;
|
|
7698
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
7699
|
+
if (!bodyScrollElem) {
|
|
7700
|
+
return;
|
|
7701
|
+
}
|
|
7702
|
+
const pos = (0, _dom.getOffsetPos)(dragBtnElem, wrapperElem);
|
|
7703
|
+
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
7704
|
+
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
7705
|
+
const minInterval = (0, _util.getColReMinWidth)(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
7706
|
+
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
7707
|
+
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
7708
|
+
const isLeftFixed = fixedType === 'left';
|
|
7709
|
+
const isRightFixed = fixedType === 'right';
|
|
7710
|
+
// 计算左右侧固定列偏移量
|
|
7711
|
+
let fixedOffsetWidth = 0;
|
|
7712
|
+
if (isLeftFixed || isRightFixed) {
|
|
7713
|
+
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
7714
|
+
let tempCellElem = cell[siblingProp];
|
|
7715
|
+
while (tempCellElem) {
|
|
7716
|
+
if ((0, _dom.hasClass)(tempCellElem, 'fixed--hidden')) {
|
|
7717
|
+
break;
|
|
7718
|
+
} else if (!(0, _dom.hasClass)(tempCellElem, 'col--group')) {
|
|
7719
|
+
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
7720
|
+
}
|
|
7721
|
+
tempCellElem = tempCellElem[siblingProp];
|
|
7722
|
+
}
|
|
7723
|
+
if (isRightFixed && rightContainerElem) {
|
|
7724
|
+
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
7725
|
+
}
|
|
7726
|
+
}
|
|
7727
|
+
// 处理拖动事件
|
|
7728
|
+
const updateEvent = evnt => {
|
|
7729
|
+
evnt.stopPropagation();
|
|
7730
|
+
evnt.preventDefault();
|
|
7731
|
+
const tableHeight = tableEl.clientHeight;
|
|
7732
|
+
const offsetX = evnt.clientX - dragClientX;
|
|
7733
|
+
let left = dragPosLeft + offsetX;
|
|
7734
|
+
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
7735
|
+
if (isLeftFixed) {
|
|
7736
|
+
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
7737
|
+
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
7738
|
+
} else if (isRightFixed) {
|
|
7739
|
+
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
7740
|
+
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
7741
|
+
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
7742
|
+
} else {
|
|
7743
|
+
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
7744
|
+
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
7745
|
+
}
|
|
7746
|
+
dragLeft = Math.max(left, dragMinLeft);
|
|
7747
|
+
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
7748
|
+
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
7749
|
+
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
|
|
7750
|
+
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
|
|
7751
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
7752
|
+
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
7753
|
+
const tableWidth = tableEl.clientWidth;
|
|
7754
|
+
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
7755
|
+
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
7756
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
7757
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
7758
|
+
let resizeTipLeft = -resizeTipWidth;
|
|
7759
|
+
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
7760
|
+
resizeTipLeft = 0;
|
|
7761
|
+
} else if (resizeBarLeft > tableWidth) {
|
|
7762
|
+
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
7763
|
+
}
|
|
7764
|
+
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
7765
|
+
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
7766
|
+
}
|
|
7767
|
+
reactData.isDragResize = true;
|
|
7768
|
+
};
|
|
7769
|
+
reactData.isDragResize = true;
|
|
7770
|
+
(0, _dom.addClass)(tableEl, 'col-drag--resize');
|
|
7771
|
+
resizeBarElem.style.display = 'block';
|
|
7772
|
+
document.onmousemove = updateEvent;
|
|
7773
|
+
document.onmouseup = function (evnt) {
|
|
7774
|
+
document.onmousemove = null;
|
|
7775
|
+
document.onmouseup = null;
|
|
7776
|
+
resizeBarElem.style.display = 'none';
|
|
7777
|
+
internalData._lastResizeTime = Date.now();
|
|
7778
|
+
setTimeout(() => {
|
|
7779
|
+
reactData.isDragResize = false;
|
|
7780
|
+
}, 50);
|
|
7781
|
+
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
7782
|
+
const resizeParams = Object.assign(Object.assign({}, params), {
|
|
7783
|
+
resizeWidth,
|
|
7784
|
+
resizeColumn
|
|
7785
|
+
});
|
|
7786
|
+
if (resizableOpts.dragMode === 'fixed') {
|
|
7787
|
+
visibleColumn.forEach(item => {
|
|
7788
|
+
if (item.id !== resizeColumn.id) {
|
|
7789
|
+
if (!item.resizeWidth) {
|
|
7790
|
+
item.resizeWidth = item.renderWidth;
|
|
7791
|
+
}
|
|
7792
|
+
}
|
|
7793
|
+
});
|
|
7794
|
+
}
|
|
7795
|
+
if ($xeTable.handleColResizeCellAreaEvent) {
|
|
7796
|
+
$xeTable.handleColResizeCellAreaEvent(evnt, resizeParams);
|
|
7797
|
+
} else {
|
|
7798
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
7799
|
+
handleUpdateColResize(evnt, resizeParams);
|
|
7800
|
+
}
|
|
7801
|
+
(0, _dom.removeClass)(tableEl, 'col-drag--resize');
|
|
7802
|
+
};
|
|
7803
|
+
updateEvent(evnt);
|
|
7804
|
+
if ($xeTable.closeMenu) {
|
|
7805
|
+
$xeTable.closeMenu();
|
|
7806
|
+
}
|
|
7807
|
+
},
|
|
7808
|
+
handleColResizeDblclickEvent(evnt, params) {
|
|
7491
7809
|
const resizableOpts = computeResizableOpts.value;
|
|
7492
7810
|
const {
|
|
7493
7811
|
isDblclickAutoWidth
|
|
7494
7812
|
} = resizableOpts;
|
|
7495
7813
|
const el = refElem.value;
|
|
7496
7814
|
if (isDblclickAutoWidth && el) {
|
|
7815
|
+
evnt.stopPropagation();
|
|
7816
|
+
evnt.preventDefault();
|
|
7497
7817
|
const {
|
|
7498
7818
|
fullColumnIdData
|
|
7499
7819
|
} = internalData;
|
|
@@ -7514,22 +7834,192 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7514
7834
|
cell
|
|
7515
7835
|
});
|
|
7516
7836
|
const colMinWidth = (0, _util.getColReMinWidth)(cellParams);
|
|
7837
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
7517
7838
|
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
7839
|
+
el.removeAttribute('data-calc-col');
|
|
7518
7840
|
if (colRest) {
|
|
7519
7841
|
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
7520
7842
|
}
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
$xeTable.recalculate(true).then(() => {
|
|
7526
|
-
$xeTable.saveCustomStore('update:visible');
|
|
7527
|
-
$xeTable.updateCellAreas();
|
|
7528
|
-
$xeTable.dispatchEvent('resizable-change', Object.assign(Object.assign({}, params), {
|
|
7529
|
-
resizeWidth
|
|
7530
|
-
}), evnt);
|
|
7531
|
-
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7843
|
+
resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
7844
|
+
const resizeParams = Object.assign(Object.assign({}, params), {
|
|
7845
|
+
resizeWidth,
|
|
7846
|
+
resizeColumn
|
|
7532
7847
|
});
|
|
7848
|
+
reactData.isDragResize = false;
|
|
7849
|
+
internalData._lastResizeTime = Date.now();
|
|
7850
|
+
if ($xeTable.handleColResizeDblclickCellAreaEvent) {
|
|
7851
|
+
$xeTable.handleColResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
7852
|
+
} else {
|
|
7853
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
7854
|
+
handleUpdateColResize(evnt, resizeParams);
|
|
7855
|
+
}
|
|
7856
|
+
}
|
|
7857
|
+
},
|
|
7858
|
+
handleRowResizeMousedownEvent(evnt, params) {
|
|
7859
|
+
evnt.stopPropagation();
|
|
7860
|
+
evnt.preventDefault();
|
|
7861
|
+
const {
|
|
7862
|
+
row
|
|
7863
|
+
} = params;
|
|
7864
|
+
const {
|
|
7865
|
+
overflowX,
|
|
7866
|
+
scrollbarWidth,
|
|
7867
|
+
overflowY,
|
|
7868
|
+
scrollbarHeight
|
|
7869
|
+
} = reactData;
|
|
7870
|
+
const {
|
|
7871
|
+
elemStore,
|
|
7872
|
+
fullAllDataRowIdData
|
|
7873
|
+
} = internalData;
|
|
7874
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
7875
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
7876
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
7877
|
+
const resizableOpts = computeResizableOpts.value;
|
|
7878
|
+
const rowOpts = computeRowOpts.value;
|
|
7879
|
+
const cellOpts = computeCellOpts.value;
|
|
7880
|
+
const tableEl = refElem.value;
|
|
7881
|
+
const resizeBarElem = refRowResizeBar.value;
|
|
7882
|
+
if (!resizeBarElem) {
|
|
7883
|
+
return;
|
|
7884
|
+
}
|
|
7885
|
+
const {
|
|
7886
|
+
clientY: dragClientY
|
|
7887
|
+
} = evnt;
|
|
7888
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
7889
|
+
const dragBtnElem = evnt.currentTarget;
|
|
7890
|
+
const tdEl = dragBtnElem.parentNode;
|
|
7891
|
+
const trEl = tdEl.parentNode;
|
|
7892
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
7893
|
+
if (!bodyScrollElem) {
|
|
7894
|
+
return;
|
|
7895
|
+
}
|
|
7896
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
7897
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
7898
|
+
if (!rowRest) {
|
|
7899
|
+
return;
|
|
7900
|
+
}
|
|
7901
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
7902
|
+
const currCellHeight = rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
7903
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
7904
|
+
const trRect = trEl.getBoundingClientRect();
|
|
7905
|
+
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
7906
|
+
let resizeHeight = currCellHeight;
|
|
7907
|
+
const cellEl = tdEl.querySelector('.vxe-cell');
|
|
7908
|
+
let cellMinHeight = 0;
|
|
7909
|
+
if (cellEl) {
|
|
7910
|
+
const cellStyle = getComputedStyle(cellEl);
|
|
7911
|
+
cellMinHeight = Math.max(1, Math.ceil(_xeUtils.default.toNumber(cellStyle.paddingTop) + _xeUtils.default.toNumber(cellStyle.paddingBottom)));
|
|
7912
|
+
}
|
|
7913
|
+
const minTop = trRect.y - tableRect.y + cellMinHeight;
|
|
7914
|
+
// 处理拖动事件
|
|
7915
|
+
const updateEvent = evnt => {
|
|
7916
|
+
evnt.stopPropagation();
|
|
7917
|
+
evnt.preventDefault();
|
|
7918
|
+
const tableWidth = tableEl.clientWidth - osbWidth;
|
|
7919
|
+
const tableHeight = tableEl.clientHeight - osbHeight;
|
|
7920
|
+
let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
|
|
7921
|
+
if (dragTop < minTop) {
|
|
7922
|
+
dragTop = minTop;
|
|
7923
|
+
} else {
|
|
7924
|
+
resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
|
|
7925
|
+
}
|
|
7926
|
+
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
7927
|
+
resizeBarElem.style.top = `${dragTop}px`;
|
|
7928
|
+
resizeBarElem.style.width = `${tableWidth}px`;
|
|
7929
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
7930
|
+
resizeTipElem.textContent = getI18n('vxe.table.resizeRowTip', [resizeHeight]);
|
|
7931
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
7932
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
7933
|
+
let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
|
|
7934
|
+
let resizeBarTop = 0;
|
|
7935
|
+
if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
|
|
7936
|
+
resizeBarLeft = tableWidth - resizeTipWidth - 2;
|
|
7937
|
+
}
|
|
7938
|
+
if (dragTop + resizeTipHeight >= tableHeight) {
|
|
7939
|
+
resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
|
|
7940
|
+
}
|
|
7941
|
+
resizeTipElem.style.left = `${resizeBarLeft}px`;
|
|
7942
|
+
resizeTipElem.style.top = `${resizeBarTop}px`;
|
|
7943
|
+
}
|
|
7944
|
+
reactData.isDragResize = true;
|
|
7945
|
+
};
|
|
7946
|
+
reactData.isDragResize = true;
|
|
7947
|
+
(0, _dom.addClass)(tableEl, 'row-drag--resize');
|
|
7948
|
+
resizeBarElem.style.display = 'block';
|
|
7949
|
+
document.onmousemove = updateEvent;
|
|
7950
|
+
document.onmouseup = function (evnt) {
|
|
7951
|
+
document.onmousemove = null;
|
|
7952
|
+
document.onmouseup = null;
|
|
7953
|
+
resizeBarElem.style.display = 'none';
|
|
7954
|
+
internalData._lastResizeTime = Date.now();
|
|
7955
|
+
setTimeout(() => {
|
|
7956
|
+
reactData.isDragResize = false;
|
|
7957
|
+
}, 50);
|
|
7958
|
+
if (resizeHeight !== currCellHeight) {
|
|
7959
|
+
const resizeParams = Object.assign(Object.assign({}, params), {
|
|
7960
|
+
resizeHeight,
|
|
7961
|
+
resizeRow: row
|
|
7962
|
+
});
|
|
7963
|
+
internalData.isResizeCellHeight = true;
|
|
7964
|
+
if ($xeTable.handleRowResizeCellAreaEvent) {
|
|
7965
|
+
$xeTable.handleRowResizeCellAreaEvent(evnt, resizeParams);
|
|
7966
|
+
} else {
|
|
7967
|
+
rowRest.resizeHeight = resizeHeight;
|
|
7968
|
+
handleUpdateRowResize(evnt, resizeParams);
|
|
7969
|
+
}
|
|
7970
|
+
}
|
|
7971
|
+
(0, _dom.removeClass)(tableEl, 'row-drag--resize');
|
|
7972
|
+
};
|
|
7973
|
+
updateEvent(evnt);
|
|
7974
|
+
},
|
|
7975
|
+
handleRowResizeDblclickEvent(evnt, params) {
|
|
7976
|
+
const resizableOpts = computeResizableOpts.value;
|
|
7977
|
+
const {
|
|
7978
|
+
isDblclickAutoHeight
|
|
7979
|
+
} = resizableOpts;
|
|
7980
|
+
const el = refElem.value;
|
|
7981
|
+
if (isDblclickAutoHeight && el) {
|
|
7982
|
+
evnt.stopPropagation();
|
|
7983
|
+
evnt.preventDefault();
|
|
7984
|
+
const {
|
|
7985
|
+
editStore
|
|
7986
|
+
} = reactData;
|
|
7987
|
+
const {
|
|
7988
|
+
fullAllDataRowIdData
|
|
7989
|
+
} = internalData;
|
|
7990
|
+
const {
|
|
7991
|
+
actived
|
|
7992
|
+
} = editStore;
|
|
7993
|
+
const {
|
|
7994
|
+
row
|
|
7995
|
+
} = params;
|
|
7996
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
7997
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
7998
|
+
if (!rowRest) {
|
|
7999
|
+
return;
|
|
8000
|
+
}
|
|
8001
|
+
const handleRsHeight = () => {
|
|
8002
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
8003
|
+
const resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
8004
|
+
el.removeAttribute('data-calc-row');
|
|
8005
|
+
const resizeParams = Object.assign(Object.assign({}, params), {
|
|
8006
|
+
resizeHeight,
|
|
8007
|
+
resizeRow: row
|
|
8008
|
+
});
|
|
8009
|
+
reactData.isDragResize = false;
|
|
8010
|
+
internalData._lastResizeTime = Date.now();
|
|
8011
|
+
if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
|
|
8012
|
+
$xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
8013
|
+
} else {
|
|
8014
|
+
rowRest.resizeHeight = resizeHeight;
|
|
8015
|
+
handleUpdateRowResize(evnt, resizeParams);
|
|
8016
|
+
}
|
|
8017
|
+
};
|
|
8018
|
+
if (actived.row || actived.column) {
|
|
8019
|
+
$xeTable.clearEdit().then(handleRsHeight);
|
|
8020
|
+
} else {
|
|
8021
|
+
handleRsHeight();
|
|
8022
|
+
}
|
|
7533
8023
|
}
|
|
7534
8024
|
},
|
|
7535
8025
|
saveCustomStore(type) {
|
|
@@ -7935,10 +8425,21 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7935
8425
|
const {
|
|
7936
8426
|
column
|
|
7937
8427
|
} = params;
|
|
7938
|
-
const titleElem = evnt.currentTarget;
|
|
7939
8428
|
handleTargetEnterEvent(true);
|
|
8429
|
+
const titleElem = evnt.currentTarget;
|
|
8430
|
+
if (!titleElem) {
|
|
8431
|
+
return;
|
|
8432
|
+
}
|
|
8433
|
+
const cellEl = titleElem.parentElement;
|
|
8434
|
+
if (!cellEl) {
|
|
8435
|
+
return;
|
|
8436
|
+
}
|
|
8437
|
+
const thEl = cellEl.parentElement;
|
|
8438
|
+
if (!thEl) {
|
|
8439
|
+
return;
|
|
8440
|
+
}
|
|
7940
8441
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
7941
|
-
handleTooltip(evnt,
|
|
8442
|
+
handleTooltip(evnt, thEl, cellEl, null, params);
|
|
7942
8443
|
}
|
|
7943
8444
|
},
|
|
7944
8445
|
/**
|
|
@@ -7962,7 +8463,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7962
8463
|
row,
|
|
7963
8464
|
column
|
|
7964
8465
|
} = params;
|
|
7965
|
-
const
|
|
8466
|
+
const tdEl = evnt.currentTarget;
|
|
7966
8467
|
handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row);
|
|
7967
8468
|
// 单元格处于编辑状态时不触发提示框
|
|
7968
8469
|
if (column.editRender && (0, _utils.isEnableConf)(editConfig)) {
|
|
@@ -7976,17 +8477,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
7976
8477
|
}
|
|
7977
8478
|
}
|
|
7978
8479
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
7979
|
-
|
|
7980
|
-
let tipElem;
|
|
7981
|
-
if (column.treeNode) {
|
|
7982
|
-
overflowElem = cell.querySelector('.vxe-tree-cell');
|
|
7983
|
-
if (column.type === 'html') {
|
|
7984
|
-
tipElem = cell.querySelector('.vxe-cell--html');
|
|
7985
|
-
}
|
|
7986
|
-
} else {
|
|
7987
|
-
tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
7988
|
-
}
|
|
7989
|
-
handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
|
|
8480
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
|
|
7990
8481
|
}
|
|
7991
8482
|
},
|
|
7992
8483
|
/**
|
|
@@ -8002,7 +8493,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8002
8493
|
const cell = evnt.currentTarget;
|
|
8003
8494
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
8004
8495
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
8005
|
-
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--
|
|
8496
|
+
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
|
|
8006
8497
|
}
|
|
8007
8498
|
},
|
|
8008
8499
|
handleTargetLeaveEvent() {
|
|
@@ -8015,11 +8506,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8015
8506
|
internalData.tooltipTimeout = setTimeout(() => {
|
|
8016
8507
|
$tooltip = refTooltip.value;
|
|
8017
8508
|
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
8018
|
-
|
|
8509
|
+
$xeTable.closeTooltip();
|
|
8019
8510
|
}
|
|
8020
8511
|
}, tooltipOpts.leaveDelay);
|
|
8021
8512
|
} else {
|
|
8022
|
-
|
|
8513
|
+
$xeTable.closeTooltip();
|
|
8023
8514
|
}
|
|
8024
8515
|
},
|
|
8025
8516
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
@@ -8064,8 +8555,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8064
8555
|
editConfig
|
|
8065
8556
|
} = props;
|
|
8066
8557
|
const {
|
|
8067
|
-
editStore
|
|
8558
|
+
editStore,
|
|
8559
|
+
isDragResize
|
|
8068
8560
|
} = reactData;
|
|
8561
|
+
if (isDragResize) {
|
|
8562
|
+
return;
|
|
8563
|
+
}
|
|
8069
8564
|
const expandOpts = computeExpandOpts.value;
|
|
8070
8565
|
const editOpts = computeEditOpts.value;
|
|
8071
8566
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -8175,8 +8670,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8175
8670
|
editConfig
|
|
8176
8671
|
} = props;
|
|
8177
8672
|
const {
|
|
8178
|
-
editStore
|
|
8673
|
+
editStore,
|
|
8674
|
+
isDragResize
|
|
8179
8675
|
} = reactData;
|
|
8676
|
+
if (isDragResize) {
|
|
8677
|
+
return;
|
|
8678
|
+
}
|
|
8180
8679
|
const editOpts = computeEditOpts.value;
|
|
8181
8680
|
const {
|
|
8182
8681
|
actived
|
|
@@ -8465,13 +8964,19 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8465
8964
|
*/
|
|
8466
8965
|
triggerSortEvent(evnt, column, order) {
|
|
8467
8966
|
const sortOpts = computeSortOpts.value;
|
|
8967
|
+
const {
|
|
8968
|
+
multiple,
|
|
8969
|
+
allowClear
|
|
8970
|
+
} = sortOpts;
|
|
8468
8971
|
const {
|
|
8469
8972
|
field,
|
|
8470
8973
|
sortable
|
|
8471
8974
|
} = column;
|
|
8472
8975
|
if (sortable) {
|
|
8473
8976
|
if (!order || column.order === order) {
|
|
8474
|
-
|
|
8977
|
+
if (allowClear) {
|
|
8978
|
+
tableMethods.clearSort(multiple ? column : null);
|
|
8979
|
+
}
|
|
8475
8980
|
} else {
|
|
8476
8981
|
tableMethods.sort({
|
|
8477
8982
|
field,
|
|
@@ -8598,7 +9103,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8598
9103
|
isPeerDrag,
|
|
8599
9104
|
isCrossDrag,
|
|
8600
9105
|
isSelfToChildDrag,
|
|
8601
|
-
dragEndMethod
|
|
9106
|
+
dragEndMethod,
|
|
9107
|
+
dragToChildMethod
|
|
8602
9108
|
} = rowDragOpts;
|
|
8603
9109
|
const treeOpts = computeTreeOpts.value;
|
|
8604
9110
|
const {
|
|
@@ -8617,13 +9123,15 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8617
9123
|
if (prevDragRow && dragRow) {
|
|
8618
9124
|
// 判断是否有拖动
|
|
8619
9125
|
if (prevDragRow !== dragRow) {
|
|
8620
|
-
|
|
9126
|
+
const dragParams = {
|
|
8621
9127
|
oldRow: dragRow,
|
|
8622
9128
|
newRow: prevDragRow,
|
|
8623
9129
|
dragPos: prevDragPos,
|
|
8624
9130
|
dragToChild: !!prevDragToChild,
|
|
8625
9131
|
offsetIndex: dragOffsetIndex
|
|
8626
|
-
}
|
|
9132
|
+
};
|
|
9133
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
9134
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
8627
9135
|
if (!status) {
|
|
8628
9136
|
return;
|
|
8629
9137
|
}
|
|
@@ -8701,7 +9209,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8701
9209
|
// 根到根
|
|
8702
9210
|
}
|
|
8703
9211
|
const fullList = _xeUtils.default.toTreeArray(internalData.afterTreeFullData, {
|
|
8704
|
-
|
|
9212
|
+
key: rowField,
|
|
9213
|
+
parentKey: parentField,
|
|
9214
|
+
children: mapChildrenField
|
|
8705
9215
|
});
|
|
8706
9216
|
// 移出
|
|
8707
9217
|
const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
|
|
@@ -8716,12 +9226,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8716
9226
|
childRow[parentField] = dragRow[parentField];
|
|
8717
9227
|
});
|
|
8718
9228
|
}
|
|
8719
|
-
dragRow[parentField] =
|
|
9229
|
+
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
8720
9230
|
internalData.tableFullTreeData = _xeUtils.default.toArrayTree(fullList, {
|
|
8721
|
-
key:
|
|
8722
|
-
parentKey:
|
|
9231
|
+
key: rowField,
|
|
9232
|
+
parentKey: parentField,
|
|
8723
9233
|
children: childrenField,
|
|
8724
|
-
mapChildren:
|
|
9234
|
+
mapChildren: mapChildrenField
|
|
8725
9235
|
});
|
|
8726
9236
|
}
|
|
8727
9237
|
}
|
|
@@ -8741,7 +9251,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8741
9251
|
}
|
|
8742
9252
|
reactData.isDragRowMove = true;
|
|
8743
9253
|
$xeTable.handleTableData(treeConfig && transform);
|
|
8744
|
-
$xeTable.cacheRowMap();
|
|
9254
|
+
$xeTable.cacheRowMap(false);
|
|
8745
9255
|
updateScrollYStatus();
|
|
8746
9256
|
if (!(treeConfig && transform)) {
|
|
8747
9257
|
$xeTable.updateAfterDataIndex();
|
|
@@ -8758,7 +9268,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8758
9268
|
oldRow: dragRow,
|
|
8759
9269
|
newRow: prevDragRow,
|
|
8760
9270
|
dragPos: prevDragPos,
|
|
8761
|
-
dragToChild:
|
|
9271
|
+
dragToChild: isDragToChildFlag,
|
|
8762
9272
|
offsetIndex: dragOffsetIndex,
|
|
8763
9273
|
_index: {
|
|
8764
9274
|
newIndex: nafIndex,
|
|
@@ -8790,18 +9300,16 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8790
9300
|
prevDragRow,
|
|
8791
9301
|
prevDragPos
|
|
8792
9302
|
} = internalData;
|
|
8793
|
-
if (treeConfig && prevDragToChild) {
|
|
9303
|
+
if (treeConfig && lazy && prevDragToChild) {
|
|
8794
9304
|
// 懒加载
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
if (
|
|
8799
|
-
if (rowRest && rowRest.treeLoaded) {
|
|
8800
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
8801
|
-
}
|
|
8802
|
-
} else {
|
|
9305
|
+
const newRowid = (0, _util.getRowid)($xeTable, prevDragRow);
|
|
9306
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
9307
|
+
if (prevDragRow[hasChildField]) {
|
|
9308
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
8803
9309
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
8804
9310
|
}
|
|
9311
|
+
} else {
|
|
9312
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
8805
9313
|
}
|
|
8806
9314
|
} else {
|
|
8807
9315
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
@@ -8932,7 +9440,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8932
9440
|
isCrossDrag,
|
|
8933
9441
|
isSelfToChildDrag,
|
|
8934
9442
|
isToChildDrag,
|
|
8935
|
-
dragEndMethod
|
|
9443
|
+
dragEndMethod,
|
|
9444
|
+
dragToChildMethod
|
|
8936
9445
|
} = columnDragOpts;
|
|
8937
9446
|
const {
|
|
8938
9447
|
collectColumn
|
|
@@ -8943,13 +9452,15 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
8943
9452
|
if (prevDragCol !== dragCol) {
|
|
8944
9453
|
const oldColumn = dragCol;
|
|
8945
9454
|
const newColumn = prevDragCol;
|
|
8946
|
-
|
|
9455
|
+
const dragParams = {
|
|
8947
9456
|
oldColumn,
|
|
8948
9457
|
newColumn,
|
|
8949
9458
|
dragPos: prevDragPos,
|
|
8950
9459
|
dragToChild: !!prevDragToChild,
|
|
8951
9460
|
offsetIndex: dragOffsetIndex
|
|
8952
|
-
}
|
|
9461
|
+
};
|
|
9462
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
9463
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
8953
9464
|
if (!status) {
|
|
8954
9465
|
return;
|
|
8955
9466
|
}
|
|
@@ -9045,7 +9556,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9045
9556
|
parent: nParent
|
|
9046
9557
|
} = newMatchRest;
|
|
9047
9558
|
// 转子级
|
|
9048
|
-
if (isCrossDrag && isToChildDrag &&
|
|
9559
|
+
if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
|
|
9049
9560
|
oldColumn.parentId = newColumn.id;
|
|
9050
9561
|
newColumn.children = (newColumn.children || []).concat([oldColumn]);
|
|
9051
9562
|
} else {
|
|
@@ -9076,7 +9587,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9076
9587
|
oldColumn,
|
|
9077
9588
|
newColumn,
|
|
9078
9589
|
dragPos: prevDragPos,
|
|
9079
|
-
dragToChild:
|
|
9590
|
+
dragToChild: isDragToChildFlag,
|
|
9080
9591
|
offsetIndex: dragOffsetIndex,
|
|
9081
9592
|
_index: {
|
|
9082
9593
|
newIndex: nafIndex,
|
|
@@ -9344,6 +9855,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9344
9855
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
9345
9856
|
const {
|
|
9346
9857
|
elemStore,
|
|
9858
|
+
intoRunScroll,
|
|
9347
9859
|
lastScrollTop,
|
|
9348
9860
|
lastScrollLeft,
|
|
9349
9861
|
inWheelScroll,
|
|
@@ -9363,6 +9875,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9363
9875
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
9364
9876
|
return;
|
|
9365
9877
|
}
|
|
9878
|
+
if (intoRunScroll) {
|
|
9879
|
+
return;
|
|
9880
|
+
}
|
|
9366
9881
|
if (!bodyScrollElem) {
|
|
9367
9882
|
return;
|
|
9368
9883
|
}
|
|
@@ -9419,6 +9934,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9419
9934
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
9420
9935
|
const {
|
|
9421
9936
|
elemStore,
|
|
9937
|
+
intoRunScroll,
|
|
9422
9938
|
inWheelScroll,
|
|
9423
9939
|
inVirtualScroll,
|
|
9424
9940
|
inBodyScroll,
|
|
@@ -9429,16 +9945,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9429
9945
|
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
9430
9946
|
const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
|
|
9431
9947
|
const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
|
|
9432
|
-
if (inWheelScroll) {
|
|
9433
|
-
return;
|
|
9434
|
-
}
|
|
9435
|
-
if (inVirtualScroll) {
|
|
9436
|
-
return;
|
|
9437
|
-
}
|
|
9438
|
-
if (inBodyScroll) {
|
|
9948
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
9439
9949
|
return;
|
|
9440
9950
|
}
|
|
9441
|
-
if (
|
|
9951
|
+
if (intoRunScroll) {
|
|
9442
9952
|
return;
|
|
9443
9953
|
}
|
|
9444
9954
|
if (!headerScrollElem) {
|
|
@@ -9467,6 +9977,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9467
9977
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
9468
9978
|
const {
|
|
9469
9979
|
elemStore,
|
|
9980
|
+
intoRunScroll,
|
|
9470
9981
|
inWheelScroll,
|
|
9471
9982
|
inVirtualScroll,
|
|
9472
9983
|
inHeaderScroll,
|
|
@@ -9477,16 +9988,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9477
9988
|
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
9478
9989
|
const headerScrollElem = (0, _util.getRefElem)(elemStore['main-header-scroll']);
|
|
9479
9990
|
const footerScrollElem = (0, _util.getRefElem)(elemStore['main-footer-scroll']);
|
|
9480
|
-
if (inWheelScroll) {
|
|
9481
|
-
return;
|
|
9482
|
-
}
|
|
9483
|
-
if (inVirtualScroll) {
|
|
9991
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
9484
9992
|
return;
|
|
9485
9993
|
}
|
|
9486
|
-
if (
|
|
9487
|
-
return;
|
|
9488
|
-
}
|
|
9489
|
-
if (inBodyScroll) {
|
|
9994
|
+
if (intoRunScroll) {
|
|
9490
9995
|
return;
|
|
9491
9996
|
}
|
|
9492
9997
|
if (!footerScrollElem) {
|
|
@@ -9514,9 +10019,13 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9514
10019
|
},
|
|
9515
10020
|
triggerBodyWheelEvent(evnt) {
|
|
9516
10021
|
const {
|
|
10022
|
+
target,
|
|
9517
10023
|
deltaY,
|
|
9518
10024
|
deltaX
|
|
9519
10025
|
} = evnt;
|
|
10026
|
+
if (target && /^textarea$/i.test(target.tagName)) {
|
|
10027
|
+
return;
|
|
10028
|
+
}
|
|
9520
10029
|
const {
|
|
9521
10030
|
highlightHoverRow
|
|
9522
10031
|
} = _props.default;
|
|
@@ -9540,26 +10049,13 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9540
10049
|
if (!bodyScrollElem) {
|
|
9541
10050
|
return;
|
|
9542
10051
|
}
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
} else if (reactData.lastScrollTime + 30 > Date.now()) {
|
|
9547
|
-
multiple = 1.15;
|
|
9548
|
-
} else if (reactData.lastScrollTime + 40 > Date.now()) {
|
|
9549
|
-
multiple = 1.12;
|
|
9550
|
-
} else if (reactData.lastScrollTime + 55 > Date.now()) {
|
|
9551
|
-
multiple = 1.09;
|
|
9552
|
-
} else if (reactData.lastScrollTime + 75 > Date.now()) {
|
|
9553
|
-
multiple = 1.06;
|
|
9554
|
-
} else if (reactData.lastScrollTime + 100 > Date.now()) {
|
|
9555
|
-
multiple = 1.03;
|
|
9556
|
-
}
|
|
9557
|
-
const deltaTop = deltaY * multiple;
|
|
9558
|
-
const deltaLeft = deltaX * multiple;
|
|
10052
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
10053
|
+
const deltaTop = deltaY * wheelSpeed;
|
|
10054
|
+
const deltaLeft = deltaX * wheelSpeed;
|
|
9559
10055
|
const isTopWheel = deltaTop < 0;
|
|
9560
|
-
const currScrollTop =
|
|
10056
|
+
const currScrollTop = bodyScrollElem.scrollTop;
|
|
9561
10057
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
9562
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >=
|
|
10058
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
9563
10059
|
return;
|
|
9564
10060
|
}
|
|
9565
10061
|
const scrollTop = bodyScrollElem.scrollTop + deltaTop;
|
|
@@ -9572,16 +10068,29 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9572
10068
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
9573
10069
|
$xeTable.clearHoverRow();
|
|
9574
10070
|
}
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
10071
|
+
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
10072
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
10073
|
+
internalData.inWheelScroll = true;
|
|
10074
|
+
(0, _dom.setScrollTop)(yHandleEl, currTopNum);
|
|
10075
|
+
(0, _dom.setScrollTop)(bodyScrollElem, currTopNum);
|
|
10076
|
+
(0, _dom.setScrollTop)(leftScrollElem, currTopNum);
|
|
10077
|
+
(0, _dom.setScrollTop)(rightScrollElem, currTopNum);
|
|
10078
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
10079
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
10080
|
+
type: 'table',
|
|
10081
|
+
fixed: ''
|
|
10082
|
+
});
|
|
9584
10083
|
});
|
|
10084
|
+
// internalData.inWheelScroll = true
|
|
10085
|
+
// setScrollTop(yHandleEl, scrollTop)
|
|
10086
|
+
// setScrollTop(bodyScrollElem, scrollTop)
|
|
10087
|
+
// setScrollTop(leftScrollElem, scrollTop)
|
|
10088
|
+
// setScrollTop(rightScrollElem, scrollTop)
|
|
10089
|
+
// loadScrollYData(scrollTop)
|
|
10090
|
+
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
10091
|
+
// type: 'footer',
|
|
10092
|
+
// fixed: ''
|
|
10093
|
+
// })
|
|
9585
10094
|
}
|
|
9586
10095
|
},
|
|
9587
10096
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -9751,45 +10260,43 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9751
10260
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
9752
10261
|
updateScrollYSpace() {
|
|
9753
10262
|
const {
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
const {
|
|
9757
|
-
scrollYLoad,
|
|
9758
|
-
rowHeight
|
|
10263
|
+
isAllOverflow,
|
|
10264
|
+
scrollYLoad
|
|
9759
10265
|
} = reactData;
|
|
9760
10266
|
const {
|
|
9761
10267
|
scrollYStore,
|
|
9762
10268
|
elemStore,
|
|
10269
|
+
isResizeCellHeight,
|
|
9763
10270
|
afterFullData,
|
|
9764
10271
|
fullAllDataRowIdData
|
|
9765
10272
|
} = internalData;
|
|
9766
10273
|
const {
|
|
9767
10274
|
startIndex
|
|
9768
10275
|
} = scrollYStore;
|
|
10276
|
+
const rowOpts = computeRowOpts.value;
|
|
10277
|
+
const cellOpts = computeCellOpts.value;
|
|
10278
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
9769
10279
|
const bodyTableElem = (0, _util.getRefElem)(elemStore['main-body-table']);
|
|
9770
10280
|
const containerList = ['main', 'left', 'right'];
|
|
9771
10281
|
let topSpaceHeight = 0;
|
|
9772
10282
|
let ySpaceHeight = 0;
|
|
9773
10283
|
if (scrollYLoad) {
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
10284
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
10285
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
10286
|
+
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
10287
|
+
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
9777
10288
|
} else {
|
|
9778
10289
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
9779
10290
|
const row = afterFullData[i];
|
|
9780
10291
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
9781
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
9782
|
-
|
|
9783
|
-
ySpaceHeight += rowRest.height || rowHeight;
|
|
9784
|
-
}
|
|
10292
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
10293
|
+
ySpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9785
10294
|
}
|
|
9786
10295
|
for (let i = 0; i < startIndex; i++) {
|
|
9787
10296
|
const row = afterFullData[i];
|
|
9788
10297
|
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
9789
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
9790
|
-
|
|
9791
|
-
topSpaceHeight += rowRest.height || rowHeight;
|
|
9792
|
-
}
|
|
10298
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
10299
|
+
topSpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9793
10300
|
}
|
|
9794
10301
|
}
|
|
9795
10302
|
} else {
|
|
@@ -9814,30 +10321,26 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
9814
10321
|
if (scrollYSpaceEl) {
|
|
9815
10322
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
9816
10323
|
}
|
|
9817
|
-
(0, _vue.nextTick)(() => {
|
|
10324
|
+
return (0, _vue.nextTick)().then(() => {
|
|
9818
10325
|
updateStyle();
|
|
9819
10326
|
});
|
|
9820
10327
|
},
|
|
9821
10328
|
updateScrollXData() {
|
|
9822
10329
|
const {
|
|
9823
|
-
|
|
9824
|
-
} =
|
|
10330
|
+
isAllOverflow
|
|
10331
|
+
} = reactData;
|
|
9825
10332
|
handleTableColumn();
|
|
9826
|
-
// calcCellHeight()
|
|
9827
10333
|
return (0, _vue.nextTick)().then(() => {
|
|
9828
|
-
// calcCellHeight()
|
|
9829
10334
|
handleTableColumn();
|
|
9830
10335
|
$xeTable.updateScrollXSpace();
|
|
9831
|
-
if (!
|
|
10336
|
+
if (!isAllOverflow) {
|
|
9832
10337
|
$xeTable.updateScrollYSpace();
|
|
9833
10338
|
}
|
|
9834
10339
|
});
|
|
9835
10340
|
},
|
|
9836
10341
|
updateScrollYData() {
|
|
9837
10342
|
$xeTable.handleTableData();
|
|
9838
|
-
// calcCellHeight()
|
|
9839
10343
|
return (0, _vue.nextTick)().then(() => {
|
|
9840
|
-
// calcCellHeight()
|
|
9841
10344
|
$xeTable.handleTableData();
|
|
9842
10345
|
$xeTable.updateScrollYSpace();
|
|
9843
10346
|
});
|
|
@@ -10182,7 +10685,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10182
10685
|
editRules
|
|
10183
10686
|
} = props;
|
|
10184
10687
|
const {
|
|
10185
|
-
isCalcColumn,
|
|
10186
10688
|
isGroup,
|
|
10187
10689
|
overflowX,
|
|
10188
10690
|
overflowY,
|
|
@@ -10192,15 +10694,15 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10192
10694
|
initStore,
|
|
10193
10695
|
columnStore,
|
|
10194
10696
|
filterStore,
|
|
10195
|
-
customStore
|
|
10196
|
-
tooltipStore
|
|
10697
|
+
customStore
|
|
10197
10698
|
} = reactData;
|
|
10198
10699
|
const {
|
|
10199
10700
|
leftList,
|
|
10200
10701
|
rightList
|
|
10201
10702
|
} = columnStore;
|
|
10202
10703
|
const loadingSlot = slots.loading;
|
|
10203
|
-
const
|
|
10704
|
+
const tableTipConfig = computeTableTipConfig.value;
|
|
10705
|
+
const validTipConfig = computeValidTipConfig.value;
|
|
10204
10706
|
const validOpts = computeValidOpts.value;
|
|
10205
10707
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
10206
10708
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -10212,7 +10714,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10212
10714
|
const areaOpts = computeAreaOpts.value;
|
|
10213
10715
|
const loadingOpts = computeLoadingOpts.value;
|
|
10214
10716
|
const isMenu = computeIsMenu.value;
|
|
10215
|
-
const currLoading = reactData.
|
|
10717
|
+
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
|
|
10216
10718
|
const resizableOpts = computeResizableOpts.value;
|
|
10217
10719
|
const isArea = mouseConfig && mouseOpts.area;
|
|
10218
10720
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
@@ -10233,7 +10735,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10233
10735
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
10234
10736
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
10235
10737
|
'checkbox--range': checkboxOpts.range,
|
|
10236
|
-
'column--calc': isCalcColumn,
|
|
10237
10738
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
10238
10739
|
'is--header': showHeader,
|
|
10239
10740
|
'is--footer': showFooter,
|
|
@@ -10242,7 +10743,6 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10242
10743
|
'is--fixed-left': leftList.length,
|
|
10243
10744
|
'is--fixed-right': rightList.length,
|
|
10244
10745
|
'is--animat': !!props.animat,
|
|
10245
|
-
'is--padding': props.padding,
|
|
10246
10746
|
'is--round': props.round,
|
|
10247
10747
|
'is--stripe': !treeConfig && stripe,
|
|
10248
10748
|
'is--loading': currLoading,
|
|
@@ -10285,11 +10785,20 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10285
10785
|
* 列宽线
|
|
10286
10786
|
*/
|
|
10287
10787
|
(0, _vue.h)('div', {
|
|
10288
|
-
key: '
|
|
10289
|
-
ref:
|
|
10290
|
-
class: 'vxe-table--resizable-bar'
|
|
10788
|
+
key: 'tcl',
|
|
10789
|
+
ref: refColResizeBar,
|
|
10790
|
+
class: 'vxe-table--resizable-col-bar'
|
|
10791
|
+
}, resizableOpts.showDragTip ? [(0, _vue.h)('div', {
|
|
10792
|
+
class: 'vxe-table--resizable-number-tip'
|
|
10793
|
+
})] : []),
|
|
10794
|
+
/**
|
|
10795
|
+
* 行高线
|
|
10796
|
+
*/
|
|
10797
|
+
(0, _vue.h)('div', {
|
|
10798
|
+
key: 'trl',
|
|
10799
|
+
ref: refRowResizeBar,
|
|
10800
|
+
class: 'vxe-table--resizable-row-bar'
|
|
10291
10801
|
}, resizableOpts.showDragTip ? [(0, _vue.h)('div', {
|
|
10292
|
-
ref: refCellResizeTip,
|
|
10293
10802
|
class: 'vxe-table--resizable-number-tip'
|
|
10294
10803
|
})] : []),
|
|
10295
10804
|
/**
|
|
@@ -10375,22 +10884,28 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10375
10884
|
/**
|
|
10376
10885
|
* 工具提示
|
|
10377
10886
|
*/
|
|
10378
|
-
(0, _vue.h)(VxeUITooltipComponent,
|
|
10887
|
+
(0, _vue.h)(VxeUITooltipComponent, {
|
|
10379
10888
|
key: 'btp',
|
|
10380
|
-
ref: refTooltip
|
|
10381
|
-
|
|
10889
|
+
ref: refTooltip,
|
|
10890
|
+
theme: tableTipConfig.theme,
|
|
10891
|
+
enterable: tableTipConfig.enterable,
|
|
10892
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
10893
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
10894
|
+
}),
|
|
10382
10895
|
/**
|
|
10383
10896
|
* 校验提示
|
|
10384
10897
|
*/
|
|
10385
|
-
props.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? (0, _vue.h)(VxeUITooltipComponent,
|
|
10898
|
+
props.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? (0, _vue.h)(VxeUITooltipComponent, {
|
|
10386
10899
|
key: 'vtp',
|
|
10387
10900
|
ref: refValidTooltip,
|
|
10388
10901
|
class: [{
|
|
10389
10902
|
'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete'
|
|
10390
|
-
}, 'vxe-table--valid-error']
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10903
|
+
}, 'vxe-table--valid-error'],
|
|
10904
|
+
theme: validTipConfig.theme,
|
|
10905
|
+
enterable: validTipConfig.enterable,
|
|
10906
|
+
enterDelay: validTipConfig.enterDelay,
|
|
10907
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
10908
|
+
}) : renderEmptyElement($xeTable)]) : renderEmptyElement($xeTable)]);
|
|
10394
10909
|
};
|
|
10395
10910
|
const dataFlag = (0, _vue.ref)(0);
|
|
10396
10911
|
(0, _vue.watch)(() => props.data ? props.data.length : -1, () => {
|
|
@@ -10407,7 +10922,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10407
10922
|
if (value && value.length >= 50000) {
|
|
10408
10923
|
(0, _log.warnLog)('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
10409
10924
|
}
|
|
10410
|
-
loadTableData(value).then(() => {
|
|
10925
|
+
loadTableData(value, true).then(() => {
|
|
10411
10926
|
const {
|
|
10412
10927
|
scrollXLoad,
|
|
10413
10928
|
scrollYLoad,
|
|
@@ -10502,10 +11017,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10502
11017
|
});
|
|
10503
11018
|
(0, _vue.watch)(() => props.syncResize, value => {
|
|
10504
11019
|
if (value) {
|
|
10505
|
-
|
|
11020
|
+
handleUpdateResize();
|
|
10506
11021
|
(0, _vue.nextTick)(() => {
|
|
10507
|
-
|
|
10508
|
-
setTimeout(() =>
|
|
11022
|
+
handleUpdateResize();
|
|
11023
|
+
setTimeout(() => handleUpdateResize());
|
|
10509
11024
|
});
|
|
10510
11025
|
}
|
|
10511
11026
|
});
|
|
@@ -10620,6 +11135,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10620
11135
|
if (props.showFooter && !(props.footerMethod || props.footerData)) {
|
|
10621
11136
|
(0, _log.warnLog)('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
10622
11137
|
}
|
|
11138
|
+
if (rowOpts.height) {
|
|
11139
|
+
(0, _log.warnLog)('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
11140
|
+
}
|
|
10623
11141
|
// if (props.highlightCurrentRow) {
|
|
10624
11142
|
// warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
|
|
10625
11143
|
// }
|
|
@@ -10730,7 +11248,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
10730
11248
|
endIndex: 0,
|
|
10731
11249
|
visibleSize: 0
|
|
10732
11250
|
});
|
|
10733
|
-
loadTableData(data || []).then(() => {
|
|
11251
|
+
loadTableData(data || [], true).then(() => {
|
|
10734
11252
|
if (data && data.length) {
|
|
10735
11253
|
internalData.inited = true;
|
|
10736
11254
|
internalData.initStatus = true;
|