vxe-table 4.8.8 → 4.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +4 -8
- package/es/table/src/footer.js +2 -4
- package/es/table/src/table.js +137 -56
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +140 -67
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +4 -8
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +2 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/table.js +134 -55
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/src/body.ts +4 -8
- package/packages/table/src/footer.ts +2 -4
- package/packages/table/src/table.ts +133 -54
- /package/es/{iconfont.1731060581842.ttf → iconfont.1731144197614.ttf} +0 -0
- /package/es/{iconfont.1731060581842.woff → iconfont.1731144197614.woff} +0 -0
- /package/es/{iconfont.1731060581842.woff2 → iconfont.1731144197614.woff2} +0 -0
- /package/lib/{iconfont.1731060581842.ttf → iconfont.1731144197614.ttf} +0 -0
- /package/lib/{iconfont.1731060581842.woff → iconfont.1731144197614.woff} +0 -0
- /package/lib/{iconfont.1731060581842.woff2 → iconfont.1731144197614.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -2851,11 +2851,9 @@ export default defineComponent({
|
|
|
2851
2851
|
reactData.lastScrollTime = Date.now();
|
|
2852
2852
|
handleSyncScrollX(scrollLeft);
|
|
2853
2853
|
$xeTable.triggerScrollXEvent(evnt);
|
|
2854
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
2854
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
2855
2855
|
type: 'table',
|
|
2856
|
-
fixed: ''
|
|
2857
|
-
scrollTop,
|
|
2858
|
-
scrollLeft
|
|
2856
|
+
fixed: ''
|
|
2859
2857
|
});
|
|
2860
2858
|
};
|
|
2861
2859
|
const debounceScrollYCalculate = XEUtils.debounce(function () {
|
|
@@ -2881,11 +2879,9 @@ export default defineComponent({
|
|
|
2881
2879
|
reactData.lastScrollTime = Date.now();
|
|
2882
2880
|
handleSyncScrollY(scrollTop);
|
|
2883
2881
|
$xeTable.triggerScrollYEvent(evnt);
|
|
2884
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
2882
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
2885
2883
|
type: 'table',
|
|
2886
|
-
fixed: ''
|
|
2887
|
-
scrollTop,
|
|
2888
|
-
scrollLeft
|
|
2884
|
+
fixed: ''
|
|
2889
2885
|
});
|
|
2890
2886
|
};
|
|
2891
2887
|
let keyCtxTimeout;
|
|
@@ -3545,25 +3541,35 @@ export default defineComponent({
|
|
|
3545
3541
|
* 设置为固定列
|
|
3546
3542
|
*/
|
|
3547
3543
|
setColumnFixed(fieldOrColumn, fixed) {
|
|
3548
|
-
|
|
3549
|
-
const
|
|
3550
|
-
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
3544
|
+
let status = false;
|
|
3545
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
3551
3546
|
const columnOpts = computeColumnOpts.value;
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3547
|
+
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
3548
|
+
for (let i = 0; i < cols.length; i++) {
|
|
3549
|
+
const item = cols[i];
|
|
3550
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
3551
|
+
const targetColumn = getRootColumn($xeTable, column);
|
|
3552
|
+
if (targetColumn && targetColumn.fixed !== fixed) {
|
|
3553
|
+
// 是否超过最大固定列数量
|
|
3554
|
+
if (!targetColumn.fixed && isMaxFixedColumn) {
|
|
3555
|
+
if (VxeUI.modal) {
|
|
3556
|
+
VxeUI.modal.message({
|
|
3557
|
+
status: 'error',
|
|
3558
|
+
content: getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
|
|
3559
|
+
});
|
|
3560
|
+
}
|
|
3561
|
+
return nextTick();
|
|
3562
|
+
}
|
|
3563
|
+
XEUtils.eachTree([targetColumn], (column) => {
|
|
3564
|
+
column.fixed = fixed;
|
|
3565
|
+
});
|
|
3566
|
+
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
3567
|
+
if (!status) {
|
|
3568
|
+
status = true;
|
|
3560
3569
|
}
|
|
3561
|
-
return nextTick();
|
|
3562
3570
|
}
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
});
|
|
3566
|
-
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
3571
|
+
}
|
|
3572
|
+
if (status) {
|
|
3567
3573
|
return tableMethods.refreshColumn();
|
|
3568
3574
|
}
|
|
3569
3575
|
return nextTick();
|
|
@@ -3572,13 +3578,22 @@ export default defineComponent({
|
|
|
3572
3578
|
* 取消指定固定列
|
|
3573
3579
|
*/
|
|
3574
3580
|
clearColumnFixed(fieldOrColumn) {
|
|
3575
|
-
|
|
3576
|
-
const
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3581
|
+
let status = false;
|
|
3582
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
3583
|
+
cols.forEach(item => {
|
|
3584
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
3585
|
+
const targetColumn = getRootColumn($xeTable, column);
|
|
3586
|
+
if (targetColumn && targetColumn.fixed) {
|
|
3587
|
+
XEUtils.eachTree([targetColumn], (column) => {
|
|
3588
|
+
column.fixed = null;
|
|
3589
|
+
});
|
|
3590
|
+
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
3591
|
+
if (!status) {
|
|
3592
|
+
status = true;
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
});
|
|
3596
|
+
if (status) {
|
|
3582
3597
|
return tableMethods.refreshColumn();
|
|
3583
3598
|
}
|
|
3584
3599
|
return nextTick();
|
|
@@ -3587,9 +3602,18 @@ export default defineComponent({
|
|
|
3587
3602
|
* 隐藏指定列
|
|
3588
3603
|
*/
|
|
3589
3604
|
hideColumn(fieldOrColumn) {
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3605
|
+
let status = false;
|
|
3606
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
3607
|
+
cols.forEach(item => {
|
|
3608
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
3609
|
+
if (column && column.visible) {
|
|
3610
|
+
column.visible = false;
|
|
3611
|
+
if (!status) {
|
|
3612
|
+
status = true;
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3615
|
+
});
|
|
3616
|
+
if (status) {
|
|
3593
3617
|
return tablePrivateMethods.handleCustom();
|
|
3594
3618
|
}
|
|
3595
3619
|
return nextTick();
|
|
@@ -3598,25 +3622,43 @@ export default defineComponent({
|
|
|
3598
3622
|
* 显示指定列
|
|
3599
3623
|
*/
|
|
3600
3624
|
showColumn(fieldOrColumn) {
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3625
|
+
let status = false;
|
|
3626
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
3627
|
+
cols.forEach(item => {
|
|
3628
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
3629
|
+
if (column && !column.visible) {
|
|
3630
|
+
column.visible = true;
|
|
3631
|
+
if (!status) {
|
|
3632
|
+
status = true;
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
});
|
|
3636
|
+
if (status) {
|
|
3604
3637
|
return tablePrivateMethods.handleCustom();
|
|
3605
3638
|
}
|
|
3606
3639
|
return nextTick();
|
|
3607
3640
|
},
|
|
3608
3641
|
setColumnWidth(fieldOrColumn, width) {
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
if (
|
|
3614
|
-
const
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3642
|
+
let status = false;
|
|
3643
|
+
const cols = XEUtils.isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
3644
|
+
cols.forEach(item => {
|
|
3645
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
3646
|
+
if (column) {
|
|
3647
|
+
const colWidth = XEUtils.toInteger(width);
|
|
3648
|
+
let rdWidth = colWidth;
|
|
3649
|
+
if (isScale(width)) {
|
|
3650
|
+
const tableBody = refTableBody.value;
|
|
3651
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
3652
|
+
const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0;
|
|
3653
|
+
rdWidth = Math.floor(colWidth * bodyWidth);
|
|
3654
|
+
}
|
|
3655
|
+
column.resizeWidth = rdWidth;
|
|
3656
|
+
if (!status) {
|
|
3657
|
+
status = true;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
});
|
|
3661
|
+
if (status) {
|
|
3620
3662
|
return tableMethods.refreshColumn();
|
|
3621
3663
|
}
|
|
3622
3664
|
return nextTick();
|
|
@@ -4584,16 +4626,36 @@ export default defineComponent({
|
|
|
4584
4626
|
*/
|
|
4585
4627
|
scrollTo(scrollLeft, scrollTop) {
|
|
4586
4628
|
const tableBody = refTableBody.value;
|
|
4629
|
+
const tableHeader = refTableHeader.value;
|
|
4587
4630
|
const tableFooter = refTableFooter.value;
|
|
4631
|
+
const leftBody = refTableLeftBody.value;
|
|
4588
4632
|
const rightBody = refTableRightBody.value;
|
|
4589
4633
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
4634
|
+
const leftBodyElem = leftBody ? leftBody.$el : null;
|
|
4590
4635
|
const rightBodyElem = rightBody ? rightBody.$el : null;
|
|
4636
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
4591
4637
|
const tableFooterElem = tableFooter ? tableFooter.$el : null;
|
|
4592
4638
|
if (XEUtils.isNumber(scrollLeft)) {
|
|
4593
|
-
|
|
4639
|
+
const xHandleEl = refScrollXHandleElem.value;
|
|
4640
|
+
if (xHandleEl) {
|
|
4641
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
4642
|
+
}
|
|
4643
|
+
else {
|
|
4644
|
+
setScrollLeft(tableBodyElem, scrollLeft);
|
|
4645
|
+
setScrollLeft(tableHeaderElem, scrollLeft);
|
|
4646
|
+
setScrollLeft(tableFooterElem, scrollLeft);
|
|
4647
|
+
}
|
|
4594
4648
|
}
|
|
4595
4649
|
if (XEUtils.isNumber(scrollTop)) {
|
|
4596
|
-
|
|
4650
|
+
const yHandleEl = refScrollYHandleElem.value;
|
|
4651
|
+
if (yHandleEl) {
|
|
4652
|
+
setScrollTop(yHandleEl, scrollTop);
|
|
4653
|
+
}
|
|
4654
|
+
else {
|
|
4655
|
+
setScrollTop(tableBodyElem, scrollTop);
|
|
4656
|
+
setScrollTop(leftBodyElem, scrollTop);
|
|
4657
|
+
setScrollTop(rightBodyElem, scrollTop);
|
|
4658
|
+
}
|
|
4597
4659
|
}
|
|
4598
4660
|
if (reactData.scrollXLoad || reactData.scrollYLoad) {
|
|
4599
4661
|
return new Promise(resolve => {
|
|
@@ -6773,7 +6835,7 @@ export default defineComponent({
|
|
|
6773
6835
|
triggerScrollXEvent() {
|
|
6774
6836
|
loadScrollXData();
|
|
6775
6837
|
},
|
|
6776
|
-
handleScrollEvent(evnt, isRollY, isRollX, params) {
|
|
6838
|
+
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
6777
6839
|
const { highlightHoverRow } = props;
|
|
6778
6840
|
const tableBody = refTableBody.value;
|
|
6779
6841
|
const bodyElem = tableBody ? tableBody.$el : null;
|
|
@@ -6789,17 +6851,36 @@ export default defineComponent({
|
|
|
6789
6851
|
if (tooltip && tooltip.reactData.visible) {
|
|
6790
6852
|
tooltip.close();
|
|
6791
6853
|
}
|
|
6792
|
-
if (isRollX) {
|
|
6793
|
-
tablePrivateMethods.checkScrolling();
|
|
6794
|
-
}
|
|
6795
6854
|
const bodyHeight = bodyElem ? bodyElem.clientHeight : 0;
|
|
6796
6855
|
const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
|
|
6797
6856
|
const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
|
|
6798
6857
|
const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
|
|
6799
|
-
|
|
6858
|
+
let isTop = false;
|
|
6859
|
+
let isBottom = false;
|
|
6860
|
+
let isLeft = false;
|
|
6861
|
+
let isRight = false;
|
|
6862
|
+
if (isRollX) {
|
|
6863
|
+
isLeft = scrollLeft <= 0;
|
|
6864
|
+
if (!isTop) {
|
|
6865
|
+
isRight = scrollLeft + bodyWidth >= scrollWidth;
|
|
6866
|
+
}
|
|
6867
|
+
tablePrivateMethods.checkScrolling();
|
|
6868
|
+
}
|
|
6869
|
+
else {
|
|
6870
|
+
isTop = scrollTop <= 0;
|
|
6871
|
+
if (!isTop) {
|
|
6872
|
+
isBottom = scrollTop + bodyHeight >= scrollHeight;
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6875
|
+
const evntParams = Object.assign({ scrollTop,
|
|
6876
|
+
scrollLeft,
|
|
6877
|
+
bodyHeight,
|
|
6800
6878
|
bodyWidth,
|
|
6801
6879
|
scrollHeight,
|
|
6802
|
-
scrollWidth, isX: isRollX, isY: isRollY
|
|
6880
|
+
scrollWidth, isX: isRollX, isY: isRollY, isTop,
|
|
6881
|
+
isBottom,
|
|
6882
|
+
isLeft,
|
|
6883
|
+
isRight }, params);
|
|
6803
6884
|
dispatchEvent('scroll', evntParams, evnt);
|
|
6804
6885
|
},
|
|
6805
6886
|
/**
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -1998,7 +1998,7 @@ function eqEmptyValue(cellValue) {
|
|
|
1998
1998
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
1999
1999
|
|
|
2000
2000
|
|
|
2001
|
-
const version = "4.8.
|
|
2001
|
+
const version = "4.8.9";
|
|
2002
2002
|
core_.VxeUI.version = version;
|
|
2003
2003
|
core_.VxeUI.tableVersion = version;
|
|
2004
2004
|
core_.VxeUI.setConfig({
|
|
@@ -2389,7 +2389,7 @@ var es_array_push = __webpack_require__(4114);
|
|
|
2389
2389
|
const {
|
|
2390
2390
|
log: log_log
|
|
2391
2391
|
} = core_.VxeUI;
|
|
2392
|
-
const log_version = `table v${"4.8.
|
|
2392
|
+
const log_version = `table v${"4.8.9"}`;
|
|
2393
2393
|
const warnLog = log_log.create('warn', log_version);
|
|
2394
2394
|
const errLog = log_log.create('error', log_version);
|
|
2395
2395
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -5378,11 +5378,9 @@ const lineOffsetSizes = {
|
|
|
5378
5378
|
setScrollTop(leftElem, scrollTop);
|
|
5379
5379
|
setScrollTop(rightElem, scrollTop);
|
|
5380
5380
|
}
|
|
5381
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
5381
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
5382
5382
|
type: renderType,
|
|
5383
|
-
fixed: fixedType
|
|
5384
|
-
scrollTop,
|
|
5385
|
-
scrollLeft
|
|
5383
|
+
fixed: fixedType
|
|
5386
5384
|
});
|
|
5387
5385
|
}
|
|
5388
5386
|
if (xHandleEl) {
|
|
@@ -5392,11 +5390,9 @@ const lineOffsetSizes = {
|
|
|
5392
5390
|
tableInternalData.lastScrollLeft = scrollLeft;
|
|
5393
5391
|
setScrollLeft(headerElem, scrollLeft);
|
|
5394
5392
|
setScrollLeft(footerElem, scrollLeft);
|
|
5395
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
5393
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
5396
5394
|
type: renderType,
|
|
5397
|
-
fixed: fixedType
|
|
5398
|
-
scrollTop,
|
|
5399
|
-
scrollLeft
|
|
5395
|
+
fixed: fixedType
|
|
5400
5396
|
});
|
|
5401
5397
|
}
|
|
5402
5398
|
};
|
|
@@ -6186,11 +6182,9 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
6186
6182
|
tableReactData.lastScrollTime = Date.now();
|
|
6187
6183
|
setScrollLeft(headerElem, scrollLeft);
|
|
6188
6184
|
setScrollLeft(bodyElem, scrollLeft);
|
|
6189
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
6185
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
6190
6186
|
type: footer_renderType,
|
|
6191
|
-
fixed: fixedType
|
|
6192
|
-
scrollTop,
|
|
6193
|
-
scrollLeft
|
|
6187
|
+
fixed: fixedType
|
|
6194
6188
|
});
|
|
6195
6189
|
}
|
|
6196
6190
|
};
|
|
@@ -11867,11 +11861,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11867
11861
|
reactData.lastScrollTime = Date.now();
|
|
11868
11862
|
handleSyncScrollX(scrollLeft);
|
|
11869
11863
|
$xeTable.triggerScrollXEvent(evnt);
|
|
11870
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
11864
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
11871
11865
|
type: 'table',
|
|
11872
|
-
fixed: ''
|
|
11873
|
-
scrollTop,
|
|
11874
|
-
scrollLeft
|
|
11866
|
+
fixed: ''
|
|
11875
11867
|
});
|
|
11876
11868
|
};
|
|
11877
11869
|
const debounceScrollYCalculate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(function () {
|
|
@@ -11903,11 +11895,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11903
11895
|
reactData.lastScrollTime = Date.now();
|
|
11904
11896
|
handleSyncScrollY(scrollTop);
|
|
11905
11897
|
$xeTable.triggerScrollYEvent(evnt);
|
|
11906
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
11898
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
11907
11899
|
type: 'table',
|
|
11908
|
-
fixed: ''
|
|
11909
|
-
scrollTop,
|
|
11910
|
-
scrollLeft
|
|
11900
|
+
fixed: ''
|
|
11911
11901
|
});
|
|
11912
11902
|
};
|
|
11913
11903
|
let keyCtxTimeout;
|
|
@@ -12658,25 +12648,35 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12658
12648
|
* 设置为固定列
|
|
12659
12649
|
*/
|
|
12660
12650
|
setColumnFixed(fieldOrColumn, fixed) {
|
|
12661
|
-
|
|
12662
|
-
const
|
|
12663
|
-
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
12651
|
+
let status = false;
|
|
12652
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12664
12653
|
const columnOpts = computeColumnOpts.value;
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12668
|
-
|
|
12669
|
-
|
|
12670
|
-
|
|
12671
|
-
|
|
12672
|
-
|
|
12654
|
+
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
12655
|
+
for (let i = 0; i < cols.length; i++) {
|
|
12656
|
+
const item = cols[i];
|
|
12657
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12658
|
+
const targetColumn = getRootColumn($xeTable, column);
|
|
12659
|
+
if (targetColumn && targetColumn.fixed !== fixed) {
|
|
12660
|
+
// 是否超过最大固定列数量
|
|
12661
|
+
if (!targetColumn.fixed && isMaxFixedColumn) {
|
|
12662
|
+
if (core_.VxeUI.modal) {
|
|
12663
|
+
core_.VxeUI.modal.message({
|
|
12664
|
+
status: 'error',
|
|
12665
|
+
content: table_getI18n('vxe.table.maxFixedCol', [columnOpts.maxFixedSize])
|
|
12666
|
+
});
|
|
12667
|
+
}
|
|
12668
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12669
|
+
}
|
|
12670
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
|
|
12671
|
+
column.fixed = fixed;
|
|
12672
|
+
});
|
|
12673
|
+
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
12674
|
+
if (!status) {
|
|
12675
|
+
status = true;
|
|
12673
12676
|
}
|
|
12674
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12675
12677
|
}
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
});
|
|
12679
|
-
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
12678
|
+
}
|
|
12679
|
+
if (status) {
|
|
12680
12680
|
return tableMethods.refreshColumn();
|
|
12681
12681
|
}
|
|
12682
12682
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -12685,13 +12685,22 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12685
12685
|
* 取消指定固定列
|
|
12686
12686
|
*/
|
|
12687
12687
|
clearColumnFixed(fieldOrColumn) {
|
|
12688
|
-
|
|
12689
|
-
const
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12688
|
+
let status = false;
|
|
12689
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12690
|
+
cols.forEach(item => {
|
|
12691
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12692
|
+
const targetColumn = getRootColumn($xeTable, column);
|
|
12693
|
+
if (targetColumn && targetColumn.fixed) {
|
|
12694
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
|
|
12695
|
+
column.fixed = null;
|
|
12696
|
+
});
|
|
12697
|
+
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
12698
|
+
if (!status) {
|
|
12699
|
+
status = true;
|
|
12700
|
+
}
|
|
12701
|
+
}
|
|
12702
|
+
});
|
|
12703
|
+
if (status) {
|
|
12695
12704
|
return tableMethods.refreshColumn();
|
|
12696
12705
|
}
|
|
12697
12706
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -12700,9 +12709,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12700
12709
|
* 隐藏指定列
|
|
12701
12710
|
*/
|
|
12702
12711
|
hideColumn(fieldOrColumn) {
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12712
|
+
let status = false;
|
|
12713
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12714
|
+
cols.forEach(item => {
|
|
12715
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12716
|
+
if (column && column.visible) {
|
|
12717
|
+
column.visible = false;
|
|
12718
|
+
if (!status) {
|
|
12719
|
+
status = true;
|
|
12720
|
+
}
|
|
12721
|
+
}
|
|
12722
|
+
});
|
|
12723
|
+
if (status) {
|
|
12706
12724
|
return tablePrivateMethods.handleCustom();
|
|
12707
12725
|
}
|
|
12708
12726
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -12711,25 +12729,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12711
12729
|
* 显示指定列
|
|
12712
12730
|
*/
|
|
12713
12731
|
showColumn(fieldOrColumn) {
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12732
|
+
let status = false;
|
|
12733
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12734
|
+
cols.forEach(item => {
|
|
12735
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12736
|
+
if (column && !column.visible) {
|
|
12737
|
+
column.visible = true;
|
|
12738
|
+
if (!status) {
|
|
12739
|
+
status = true;
|
|
12740
|
+
}
|
|
12741
|
+
}
|
|
12742
|
+
});
|
|
12743
|
+
if (status) {
|
|
12717
12744
|
return tablePrivateMethods.handleCustom();
|
|
12718
12745
|
}
|
|
12719
12746
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
12720
12747
|
},
|
|
12721
12748
|
setColumnWidth(fieldOrColumn, width) {
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
if (
|
|
12727
|
-
const
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12749
|
+
let status = false;
|
|
12750
|
+
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
12751
|
+
cols.forEach(item => {
|
|
12752
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
12753
|
+
if (column) {
|
|
12754
|
+
const colWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
|
|
12755
|
+
let rdWidth = colWidth;
|
|
12756
|
+
if (isScale(width)) {
|
|
12757
|
+
const tableBody = refTableBody.value;
|
|
12758
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
12759
|
+
const bodyWidth = bodyElem ? bodyElem.clientWidth - 1 : 0;
|
|
12760
|
+
rdWidth = Math.floor(colWidth * bodyWidth);
|
|
12761
|
+
}
|
|
12762
|
+
column.resizeWidth = rdWidth;
|
|
12763
|
+
if (!status) {
|
|
12764
|
+
status = true;
|
|
12765
|
+
}
|
|
12731
12766
|
}
|
|
12732
|
-
|
|
12767
|
+
});
|
|
12768
|
+
if (status) {
|
|
12733
12769
|
return tableMethods.refreshColumn();
|
|
12734
12770
|
}
|
|
12735
12771
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
@@ -13857,16 +13893,34 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13857
13893
|
*/
|
|
13858
13894
|
scrollTo(scrollLeft, scrollTop) {
|
|
13859
13895
|
const tableBody = refTableBody.value;
|
|
13896
|
+
const tableHeader = refTableHeader.value;
|
|
13860
13897
|
const tableFooter = refTableFooter.value;
|
|
13898
|
+
const leftBody = refTableLeftBody.value;
|
|
13861
13899
|
const rightBody = refTableRightBody.value;
|
|
13862
13900
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
13901
|
+
const leftBodyElem = leftBody ? leftBody.$el : null;
|
|
13863
13902
|
const rightBodyElem = rightBody ? rightBody.$el : null;
|
|
13903
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
13864
13904
|
const tableFooterElem = tableFooter ? tableFooter.$el : null;
|
|
13865
13905
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
13866
|
-
|
|
13906
|
+
const xHandleEl = refScrollXHandleElem.value;
|
|
13907
|
+
if (xHandleEl) {
|
|
13908
|
+
setScrollLeft(xHandleEl, scrollLeft);
|
|
13909
|
+
} else {
|
|
13910
|
+
setScrollLeft(tableBodyElem, scrollLeft);
|
|
13911
|
+
setScrollLeft(tableHeaderElem, scrollLeft);
|
|
13912
|
+
setScrollLeft(tableFooterElem, scrollLeft);
|
|
13913
|
+
}
|
|
13867
13914
|
}
|
|
13868
13915
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollTop)) {
|
|
13869
|
-
|
|
13916
|
+
const yHandleEl = refScrollYHandleElem.value;
|
|
13917
|
+
if (yHandleEl) {
|
|
13918
|
+
setScrollTop(yHandleEl, scrollTop);
|
|
13919
|
+
} else {
|
|
13920
|
+
setScrollTop(tableBodyElem, scrollTop);
|
|
13921
|
+
setScrollTop(leftBodyElem, scrollTop);
|
|
13922
|
+
setScrollTop(rightBodyElem, scrollTop);
|
|
13923
|
+
}
|
|
13870
13924
|
}
|
|
13871
13925
|
if (reactData.scrollXLoad || reactData.scrollYLoad) {
|
|
13872
13926
|
return new Promise(resolve => {
|
|
@@ -16379,7 +16433,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16379
16433
|
triggerScrollXEvent() {
|
|
16380
16434
|
loadScrollXData();
|
|
16381
16435
|
},
|
|
16382
|
-
handleScrollEvent(evnt, isRollY, isRollX, params) {
|
|
16436
|
+
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
16383
16437
|
const {
|
|
16384
16438
|
highlightHoverRow
|
|
16385
16439
|
} = props;
|
|
@@ -16397,20 +16451,39 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16397
16451
|
if (tooltip && tooltip.reactData.visible) {
|
|
16398
16452
|
tooltip.close();
|
|
16399
16453
|
}
|
|
16400
|
-
if (isRollX) {
|
|
16401
|
-
tablePrivateMethods.checkScrolling();
|
|
16402
|
-
}
|
|
16403
16454
|
const bodyHeight = bodyElem ? bodyElem.clientHeight : 0;
|
|
16404
16455
|
const bodyWidth = bodyElem ? bodyElem.clientWidth : 0;
|
|
16405
16456
|
const scrollHeight = bodyElem ? bodyElem.scrollHeight : 0;
|
|
16406
16457
|
const scrollWidth = bodyElem ? bodyElem.scrollWidth : 0;
|
|
16458
|
+
let isTop = false;
|
|
16459
|
+
let isBottom = false;
|
|
16460
|
+
let isLeft = false;
|
|
16461
|
+
let isRight = false;
|
|
16462
|
+
if (isRollX) {
|
|
16463
|
+
isLeft = scrollLeft <= 0;
|
|
16464
|
+
if (!isTop) {
|
|
16465
|
+
isRight = scrollLeft + bodyWidth >= scrollWidth;
|
|
16466
|
+
}
|
|
16467
|
+
tablePrivateMethods.checkScrolling();
|
|
16468
|
+
} else {
|
|
16469
|
+
isTop = scrollTop <= 0;
|
|
16470
|
+
if (!isTop) {
|
|
16471
|
+
isBottom = scrollTop + bodyHeight >= scrollHeight;
|
|
16472
|
+
}
|
|
16473
|
+
}
|
|
16407
16474
|
const evntParams = {
|
|
16475
|
+
scrollTop,
|
|
16476
|
+
scrollLeft,
|
|
16408
16477
|
bodyHeight,
|
|
16409
16478
|
bodyWidth,
|
|
16410
16479
|
scrollHeight,
|
|
16411
16480
|
scrollWidth,
|
|
16412
16481
|
isX: isRollX,
|
|
16413
16482
|
isY: isRollY,
|
|
16483
|
+
isTop,
|
|
16484
|
+
isBottom,
|
|
16485
|
+
isLeft,
|
|
16486
|
+
isRight,
|
|
16414
16487
|
...params
|
|
16415
16488
|
};
|
|
16416
16489
|
dispatchEvent('scroll', evntParams, evnt);
|