vxe-table 3.9.21 → 3.10.0-beta.1
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/locale/lang/ja-JP.js +5 -5
- package/es/locale/lang/ko-KR.js +5 -5
- package/es/locale/lang/uk-UA.js +5 -5
- package/es/locale/lang/vi-VN.js +5 -5
- package/es/locale/lang/zh-CHT.js +5 -5
- package/es/locale/lang/zh-CN.js +5 -5
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +3 -3
- package/es/table/src/body.js +53 -115
- package/es/table/src/footer.js +24 -21
- package/es/table/src/methods.js +392 -123
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +71 -10
- package/es/table/src/util.js +58 -33
- package/es/table/style.css +47 -7
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +47 -7
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.umd.js +682 -361
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +5 -5
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -5
- package/lib/locale/lang/ko-KR.js +5 -5
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +5 -5
- package/lib/locale/lang/uk-UA.js +5 -5
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +5 -5
- package/lib/locale/lang/vi-VN.js +5 -5
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +5 -5
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +5 -5
- package/lib/locale/lang/zh-CN.js +5 -5
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -5
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +6 -3
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +54 -118
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +24 -33
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +449 -148
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +64 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +72 -38
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +47 -7
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- 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 +47 -7
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ja-JP.ts +5 -5
- package/packages/locale/lang/ko-KR.ts +5 -5
- package/packages/locale/lang/uk-UA.ts +5 -5
- package/packages/locale/lang/vi-VN.ts +5 -5
- package/packages/locale/lang/zh-CHT.ts +5 -5
- package/packages/locale/lang/zh-CN.ts +5 -5
- package/packages/table/module/edit/mixin.ts +3 -3
- package/packages/table/src/body.ts +53 -118
- package/packages/table/src/footer.ts +24 -22
- package/packages/table/src/methods.ts +418 -127
- package/packages/table/src/props.ts +10 -8
- package/packages/table/src/table.ts +73 -10
- package/packages/table/src/util.ts +61 -36
- package/packages/ui/index.ts +1 -1
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/components/table.scss +46 -13
- package/styles/modules.scss +0 -2
- package/styles/theme/base.scss +1 -1
- package/styles/theme/dark.scss +7 -4
- package/styles/variable.scss +5 -1
- /package/es/{iconfont.1729992873866.ttf → iconfont.1730364042434.ttf} +0 -0
- /package/es/{iconfont.1729992873866.woff → iconfont.1730364042434.woff} +0 -0
- /package/es/{iconfont.1729992873866.woff2 → iconfont.1730364042434.woff2} +0 -0
- /package/lib/{iconfont.1729992873866.ttf → iconfont.1730364042434.ttf} +0 -0
- /package/lib/{iconfont.1729992873866.woff → iconfont.1730364042434.woff} +0 -0
- /package/lib/{iconfont.1729992873866.woff2 → iconfont.1730364042434.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../ui';
|
|
3
3
|
import { isEnableConf, getClass } from '../../ui/src/utils';
|
|
4
|
-
import { getOffsetSize, calcTreeLine, mergeBodyMethod,
|
|
5
|
-
import { updateCellTitle } from '../../ui/src/dom';
|
|
4
|
+
import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util';
|
|
5
|
+
import { updateCellTitle, setScrollTop, setScrollLeft } from '../../ui/src/dom';
|
|
6
6
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
7
7
|
const { getI18n, renderer } = VxeUI;
|
|
8
8
|
const renderType = 'body';
|
|
@@ -49,8 +49,10 @@ function renderLine(h, _vm, $xetable, params) {
|
|
|
49
49
|
* 渲染列
|
|
50
50
|
*/
|
|
51
51
|
function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
|
|
52
|
-
const { $listeners: tableListeners, afterFullData, tableData, height, columnKey, overflowX, sYOpts,
|
|
52
|
+
const { $listeners: tableListeners, fullAllDataRowIdData, afterFullData, tableData, height, columnKey, overflowX, sYOpts, scrollYLoad, highlightCurrentRow, showOverflow: allColumnOverflow, isAllOverflow, align: allAlign, currentColumn, cellClassName: allCellClassName, cellStyle, mergeList, spanMethod, radioOpts, checkboxOpts, expandOpts, treeOpts, tooltipOpts, mouseConfig, editConfig, editOpts, editRules, validOpts, editStore, tooltipConfig, rowOpts, columnOpts, validErrorMaps } = $xetable;
|
|
53
|
+
const cellOpts = $xetable.computeCellOpts;
|
|
53
54
|
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column;
|
|
55
|
+
const { verticalAlign } = cellOpts;
|
|
54
56
|
const { actived } = editStore;
|
|
55
57
|
const { rHeight: scrollYRHeight } = sYOpts;
|
|
56
58
|
const { height: rowHeight } = rowOpts;
|
|
@@ -64,12 +66,13 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
64
66
|
const isEdit = isEnableConf(editRender);
|
|
65
67
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
66
68
|
const cellOverflow = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? allColumnOverflow : showOverflow;
|
|
67
|
-
|
|
69
|
+
const showEllipsis = cellOverflow === 'ellipsis';
|
|
68
70
|
const showTitle = cellOverflow === 'title';
|
|
69
71
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
70
|
-
|
|
72
|
+
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
71
73
|
let isDirty;
|
|
72
74
|
const tdOns = {};
|
|
75
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
73
76
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
74
77
|
const errorValidItem = validErrorMaps[`${rowid}:${column.id}`];
|
|
75
78
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline');
|
|
@@ -78,10 +81,6 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
78
81
|
const bindMouseleave = tableListeners['cell-mouseleave'];
|
|
79
82
|
const triggerDblclick = (editRender && editConfig && editOpts.trigger === 'dblclick');
|
|
80
83
|
const params = { $table: $xetable, $grid: $xetable.$xegrid, isEdit: false, seq, rowid, row, rowIndex, $rowIndex, _rowIndex, column, columnIndex, $columnIndex, _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items };
|
|
81
|
-
// 虚拟滚动不支持动态高度
|
|
82
|
-
if ((scrollXLoad || scrollYLoad) && !hasEllipsis) {
|
|
83
|
-
showEllipsis = hasEllipsis = true;
|
|
84
|
-
}
|
|
85
84
|
// hover 进入事件
|
|
86
85
|
if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
|
|
87
86
|
tdOns.mouseenter = (evnt) => {
|
|
@@ -231,6 +230,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
231
230
|
column.id,
|
|
232
231
|
{
|
|
233
232
|
[`col--${cellAlign}`]: cellAlign,
|
|
233
|
+
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
234
234
|
[`col--${type}`]: type,
|
|
235
235
|
'col--last': $columnIndex === columns.length - 1,
|
|
236
236
|
'col--tree-node': treeNode,
|
|
@@ -250,7 +250,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
250
250
|
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
251
251
|
attrs,
|
|
252
252
|
style: Object.assign({
|
|
253
|
-
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
253
|
+
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : (scrollYLoad ? `${rest.height || scrollYRHeight || rowHeight}px` : '')
|
|
254
254
|
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
|
|
255
255
|
on: tdOns
|
|
256
256
|
}, tdVNs);
|
|
@@ -374,45 +374,6 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
374
374
|
});
|
|
375
375
|
return rows;
|
|
376
376
|
}
|
|
377
|
-
/**
|
|
378
|
-
* 同步滚动条
|
|
379
|
-
*/
|
|
380
|
-
let scrollProcessTimeout;
|
|
381
|
-
function syncBodyScroll(_vm, fixedType, scrollTop, elem1, elem2) {
|
|
382
|
-
if (elem1 || elem2) {
|
|
383
|
-
if (elem1) {
|
|
384
|
-
removeScrollListener(elem1);
|
|
385
|
-
elem1.scrollTop = scrollTop;
|
|
386
|
-
}
|
|
387
|
-
if (elem2) {
|
|
388
|
-
removeScrollListener(elem2);
|
|
389
|
-
elem2.scrollTop = scrollTop;
|
|
390
|
-
}
|
|
391
|
-
clearTimeout(scrollProcessTimeout);
|
|
392
|
-
scrollProcessTimeout = setTimeout(() => {
|
|
393
|
-
// const { tableBody, leftBody, rightBody } = _vm.$refs
|
|
394
|
-
// const bodyElem = tableBody.$el
|
|
395
|
-
// const leftElem = leftBody ? leftBody.$el : null
|
|
396
|
-
// const rightElem = rightBody ? rightBody.$el : null
|
|
397
|
-
restoreScrollListener(elem1);
|
|
398
|
-
restoreScrollListener(elem2);
|
|
399
|
-
// 检查滚动条是的同步
|
|
400
|
-
// let targetTop = bodyElem.scrollTop
|
|
401
|
-
// if (fixedType === 'left') {
|
|
402
|
-
// if (leftElem) {
|
|
403
|
-
// targetTop = leftElem.scrollTop
|
|
404
|
-
// }
|
|
405
|
-
// } else if (fixedType === 'right') {
|
|
406
|
-
// if (rightElem) {
|
|
407
|
-
// targetTop = rightElem.scrollTop
|
|
408
|
-
// }
|
|
409
|
-
// }
|
|
410
|
-
// setScrollTop(bodyElem, targetTop)
|
|
411
|
-
// setScrollTop(leftElem, targetTop)
|
|
412
|
-
// setScrollTop(rightElem, targetTop)
|
|
413
|
-
}, 300);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
377
|
export default {
|
|
417
378
|
name: 'VxeTableBody',
|
|
418
379
|
props: {
|
|
@@ -441,17 +402,9 @@ export default {
|
|
|
441
402
|
elemStore[`${prefix}xSpace`] = $refs.xSpace;
|
|
442
403
|
elemStore[`${prefix}ySpace`] = $refs.ySpace;
|
|
443
404
|
elemStore[`${prefix}emptyBlock`] = $refs.emptyBlock;
|
|
444
|
-
if (this.$el) {
|
|
445
|
-
this.$el.onscroll = this.scrollEvent;
|
|
446
|
-
this.$el._onscroll = this.scrollEvent;
|
|
447
|
-
}
|
|
448
405
|
},
|
|
449
406
|
beforeDestroy() {
|
|
450
407
|
clearTimeout(this.wheelTime);
|
|
451
|
-
if (this.$el) {
|
|
452
|
-
this.$el._onscroll = null;
|
|
453
|
-
this.$el.onscroll = null;
|
|
454
|
-
}
|
|
455
408
|
},
|
|
456
409
|
destroyed() {
|
|
457
410
|
const { $parent: $xetable, fixedType } = this;
|
|
@@ -510,11 +463,9 @@ export default {
|
|
|
510
463
|
attrs: {
|
|
511
464
|
xid: tId
|
|
512
465
|
},
|
|
513
|
-
on:
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
: {}
|
|
466
|
+
on: Object.assign({
|
|
467
|
+
scroll: this.scrollEvent
|
|
468
|
+
}, scrollYLoad && sYOpts.mode === 'wheel' ? { wheel: this.wheelEvent } : null)
|
|
518
469
|
}, [
|
|
519
470
|
fixedType
|
|
520
471
|
? _e()
|
|
@@ -610,73 +561,60 @@ export default {
|
|
|
610
561
|
* 如果存在列固定右侧,同步更新滚动状态
|
|
611
562
|
*/
|
|
612
563
|
scrollEvent(evnt) {
|
|
613
|
-
const { $el: scrollBodyElem, $parent: $
|
|
614
|
-
const { $refs,
|
|
615
|
-
const { tableHeader, tableBody, leftBody, rightBody, tableFooter
|
|
564
|
+
const { $el: scrollBodyElem, $parent: $xeTable, fixedType } = this;
|
|
565
|
+
const { $refs, lastScrollTop, lastScrollLeft } = $xeTable;
|
|
566
|
+
const { tableHeader, tableBody, leftBody, rightBody, tableFooter } = $refs;
|
|
616
567
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
617
568
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
618
569
|
const bodyElem = tableBody.$el;
|
|
619
570
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
620
571
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
621
|
-
const
|
|
622
|
-
const bodyXElem = elemStore['main-body-xSpace'];
|
|
623
|
-
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight;
|
|
624
|
-
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth;
|
|
625
|
-
let scrollTop = scrollBodyElem.scrollTop;
|
|
572
|
+
const scrollTop = scrollBodyElem.scrollTop;
|
|
626
573
|
const scrollLeft = bodyElem.scrollLeft;
|
|
627
574
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
628
575
|
const isRollY = scrollTop !== lastScrollTop;
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
$xetable.clearHoverRow();
|
|
576
|
+
const xHandleEl = $refs.refScrollXHandleElem;
|
|
577
|
+
const yHandleEl = $refs.refScrollYHandleElem;
|
|
578
|
+
if (yHandleEl) {
|
|
579
|
+
yHandleEl.scrollTop = scrollTop;
|
|
634
580
|
}
|
|
635
|
-
if (
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
syncBodyScroll($xetable, fixedType, scrollTop, bodyElem, leftElem);
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
if (isRollX) {
|
|
645
|
-
if (headerElem) {
|
|
646
|
-
headerElem.scrollLeft = bodyElem.scrollLeft;
|
|
647
|
-
}
|
|
648
|
-
if (footerElem) {
|
|
649
|
-
footerElem.scrollLeft = bodyElem.scrollLeft;
|
|
650
|
-
}
|
|
581
|
+
else if (isRollY) {
|
|
582
|
+
$xeTable.lastScrollTop = scrollTop;
|
|
583
|
+
$xeTable.lastScrollLeft = scrollLeft;
|
|
584
|
+
if (leftElem && fixedType === 'left') {
|
|
585
|
+
setScrollTop(bodyElem, scrollTop);
|
|
586
|
+
setScrollTop(rightElem, scrollTop);
|
|
651
587
|
}
|
|
652
|
-
if (
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
syncBodyScroll($xetable, fixedType, scrollTop, leftElem, rightElem);
|
|
656
|
-
}
|
|
588
|
+
else if (rightElem && fixedType === 'right') {
|
|
589
|
+
setScrollTop(bodyElem, scrollTop);
|
|
590
|
+
setScrollTop(leftElem, scrollTop);
|
|
657
591
|
}
|
|
592
|
+
else {
|
|
593
|
+
setScrollTop(leftElem, scrollTop);
|
|
594
|
+
setScrollTop(rightElem, scrollTop);
|
|
595
|
+
}
|
|
596
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
597
|
+
type: renderType,
|
|
598
|
+
fixed: fixedType,
|
|
599
|
+
scrollTop,
|
|
600
|
+
scrollLeft
|
|
601
|
+
});
|
|
658
602
|
}
|
|
659
|
-
if (
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
if (scrollYLoad && isRollY) {
|
|
663
|
-
$xetable.triggerScrollYEvent(evnt);
|
|
603
|
+
if (xHandleEl) {
|
|
604
|
+
xHandleEl.scrollLeft = scrollLeft;
|
|
664
605
|
}
|
|
665
|
-
if (isRollX
|
|
666
|
-
|
|
606
|
+
else if (isRollX) {
|
|
607
|
+
$xeTable.lastScrollTop = scrollTop;
|
|
608
|
+
$xeTable.lastScrollLeft = scrollLeft;
|
|
609
|
+
setScrollLeft(headerElem, scrollLeft);
|
|
610
|
+
setScrollLeft(footerElem, scrollLeft);
|
|
611
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
612
|
+
type: renderType,
|
|
613
|
+
fixed: fixedType,
|
|
614
|
+
scrollTop,
|
|
615
|
+
scrollLeft
|
|
616
|
+
});
|
|
667
617
|
}
|
|
668
|
-
$xetable.emitEvent('scroll', {
|
|
669
|
-
type: renderType,
|
|
670
|
-
fixed: fixedType,
|
|
671
|
-
scrollTop,
|
|
672
|
-
scrollLeft,
|
|
673
|
-
scrollHeight: bodyElem.scrollHeight,
|
|
674
|
-
scrollWidth: bodyElem.scrollWidth,
|
|
675
|
-
bodyHeight,
|
|
676
|
-
bodyWidth,
|
|
677
|
-
isX: isRollX,
|
|
678
|
-
isY: isRollY
|
|
679
|
-
}, evnt);
|
|
680
618
|
},
|
|
681
619
|
handleWheel(evnt, isTopWheel, deltaTop, isRollX, isRollY) {
|
|
682
620
|
const { $parent: $xetable } = this;
|
package/es/table/src/footer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../ui';
|
|
3
3
|
import { getClass } from '../../ui/src/utils';
|
|
4
|
-
import { updateCellTitle } from '../../ui/src/dom';
|
|
5
|
-
const
|
|
4
|
+
import { updateCellTitle, setScrollLeft } from '../../ui/src/dom';
|
|
5
|
+
const renderType = 'footer';
|
|
6
6
|
const { renderer } = VxeUI;
|
|
7
7
|
function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
8
8
|
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
@@ -117,7 +117,7 @@ export default {
|
|
|
117
117
|
ref: 'tfoot'
|
|
118
118
|
}, footerTableData.map((list, _rowIndex) => {
|
|
119
119
|
const $rowIndex = _rowIndex;
|
|
120
|
-
const rowParams = { $table: $xetable, row: list, _rowIndex, $rowIndex, fixed: fixedType, type:
|
|
120
|
+
const rowParams = { $table: $xetable, row: list, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
121
121
|
return h('tr', {
|
|
122
122
|
class: ['vxe-footer--row', footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
|
|
123
123
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
152
152
|
itemIndex,
|
|
153
153
|
items: list,
|
|
154
154
|
fixed: fixedType,
|
|
155
|
-
type:
|
|
155
|
+
type: renderType,
|
|
156
156
|
data: footerTableData
|
|
157
157
|
};
|
|
158
158
|
// 虚拟滚动不支持动态高度
|
|
@@ -255,29 +255,32 @@ export default {
|
|
|
255
255
|
* 如果存在列固定右侧,同步更新滚动状态
|
|
256
256
|
*/
|
|
257
257
|
scrollEvent(evnt) {
|
|
258
|
-
const { $parent: $
|
|
259
|
-
const { $refs
|
|
260
|
-
const { tableHeader, tableBody, tableFooter
|
|
258
|
+
const { $parent: $xeTable, fixedType } = this;
|
|
259
|
+
const { $refs } = $xeTable;
|
|
260
|
+
const { tableHeader, tableBody, tableFooter } = $refs;
|
|
261
261
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
262
262
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
263
263
|
const bodyElem = tableBody.$el;
|
|
264
264
|
const scrollLeft = footerElem ? footerElem.scrollLeft : 0;
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (headerElem) {
|
|
269
|
-
headerElem.scrollLeft = scrollLeft;
|
|
265
|
+
const xHandleEl = $refs.refScrollXHandleElem;
|
|
266
|
+
if (xHandleEl) {
|
|
267
|
+
xHandleEl.scrollLeft = scrollLeft;
|
|
270
268
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
269
|
+
else {
|
|
270
|
+
const isRollX = true;
|
|
271
|
+
const isRollY = false;
|
|
272
|
+
const scrollTop = bodyElem.scrollTop;
|
|
273
|
+
$xeTable.lastScrollLeft = scrollLeft;
|
|
274
|
+
$xeTable.lastScrollTime = Date.now();
|
|
275
|
+
setScrollLeft(headerElem, scrollLeft);
|
|
276
|
+
setScrollLeft(bodyElem, scrollLeft);
|
|
277
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, {
|
|
278
|
+
type: renderType,
|
|
279
|
+
fixed: fixedType,
|
|
280
|
+
scrollTop,
|
|
281
|
+
scrollLeft
|
|
282
|
+
});
|
|
279
283
|
}
|
|
280
|
-
$xetable.emitEvent('scroll', { type: cellType, fixed: fixedType, scrollTop: bodyElem.scrollTop, scrollLeft, isX, isY: false }, evnt);
|
|
281
284
|
}
|
|
282
285
|
}
|
|
283
286
|
};
|