vxe-table 3.12.16 → 3.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/src/body.js +60 -47
- package/es/table/src/methods.js +123 -24
- package/es/table/src/table.js +101 -23
- package/es/table/style.css +26 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +26 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +350 -113
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +10 -5
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +71 -59
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +141 -23
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +126 -24
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +26 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +26 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/src/body.ts +62 -48
- package/packages/table/src/methods.ts +125 -24
- package/packages/table/src/table.ts +108 -24
- package/styles/components/table.scss +26 -0
- /package/es/{iconfont.1739333092714.ttf → iconfont.1739428244406.ttf} +0 -0
- /package/es/{iconfont.1739333092714.woff → iconfont.1739428244406.woff} +0 -0
- /package/es/{iconfont.1739333092714.woff2 → iconfont.1739428244406.woff2} +0 -0
- /package/lib/{iconfont.1739333092714.ttf → iconfont.1739428244406.ttf} +0 -0
- /package/lib/{iconfont.1739333092714.woff → iconfont.1739428244406.woff} +0 -0
- /package/lib/{iconfont.1739333092714.woff2 → iconfont.1739428244406.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -381,7 +381,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
381
381
|
const tableReactData = $xeTable;
|
|
382
382
|
const tableInternalData = $xeTable;
|
|
383
383
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
384
|
-
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData;
|
|
384
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove, rowExpandHeightFlag } = tableReactData;
|
|
385
385
|
const { fullAllDataRowIdData } = tableInternalData;
|
|
386
386
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
387
387
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -414,19 +414,19 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
416
|
const rowid = getRowid($xeTable, row);
|
|
417
|
-
const
|
|
417
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
418
418
|
let rowLevel = 0;
|
|
419
419
|
let seq = -1;
|
|
420
420
|
let _rowIndex = 0;
|
|
421
|
-
if (
|
|
422
|
-
rowLevel =
|
|
421
|
+
if (rowRest) {
|
|
422
|
+
rowLevel = rowRest.level;
|
|
423
423
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
424
|
-
seq =
|
|
424
|
+
seq = rowRest._index + 1;
|
|
425
425
|
}
|
|
426
426
|
else {
|
|
427
|
-
seq =
|
|
427
|
+
seq = rowRest.seq;
|
|
428
428
|
}
|
|
429
|
-
_rowIndex =
|
|
429
|
+
_rowIndex = rowRest._index;
|
|
430
430
|
}
|
|
431
431
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
432
432
|
// 行是否被展开
|
|
@@ -493,46 +493,63 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
493
493
|
// 如果行被展开了
|
|
494
494
|
if (isExpandRow) {
|
|
495
495
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
496
|
-
const { height: expandHeight, padding } = expandOpts;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
if (treeConfig) {
|
|
502
|
-
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
503
|
-
}
|
|
504
|
-
const { showOverflow } = expandColumn;
|
|
505
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
506
|
-
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
507
|
-
rows.push(h('tr', {
|
|
508
|
-
class: ['vxe-body--expanded-row', {
|
|
509
|
-
'is--padding': padding
|
|
510
|
-
}],
|
|
511
|
-
key: `expand_${rowid}`,
|
|
512
|
-
style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle) : undefined,
|
|
513
|
-
on: trOn
|
|
514
|
-
}, [
|
|
515
|
-
h('td', {
|
|
516
|
-
class: {
|
|
517
|
-
'vxe-body--expanded-column': 1,
|
|
518
|
-
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
519
|
-
'col--ellipsis': hasEllipsis
|
|
520
|
-
},
|
|
496
|
+
const { height: expandHeight, padding, mode: expandMode } = expandOpts;
|
|
497
|
+
if (expandMode === 'fixed') {
|
|
498
|
+
rows.push(h('tr', {
|
|
499
|
+
class: 'vxe-body--row-expanded-place',
|
|
500
|
+
key: `expand_${rowid}`,
|
|
521
501
|
attrs: {
|
|
522
|
-
|
|
502
|
+
rowid
|
|
523
503
|
}
|
|
524
504
|
}, [
|
|
525
|
-
h('
|
|
526
|
-
class:
|
|
527
|
-
|
|
528
|
-
|
|
505
|
+
h('td', {
|
|
506
|
+
class: 'vxe-body--row-expanded-place-column',
|
|
507
|
+
attrs: {
|
|
508
|
+
colspan: tableColumn.length
|
|
529
509
|
},
|
|
530
|
-
style:
|
|
510
|
+
style: {
|
|
511
|
+
height: `${rowExpandHeightFlag ? (rowRest.expandHeight || expandHeight) : 0}px`
|
|
512
|
+
}
|
|
513
|
+
})
|
|
514
|
+
]));
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
const cellStyle = {};
|
|
518
|
+
if (expandHeight) {
|
|
519
|
+
cellStyle.height = `${expandHeight}px`;
|
|
520
|
+
}
|
|
521
|
+
if (treeConfig) {
|
|
522
|
+
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`;
|
|
523
|
+
}
|
|
524
|
+
const { showOverflow } = expandColumn;
|
|
525
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow;
|
|
526
|
+
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
527
|
+
rows.push(h('tr', {
|
|
528
|
+
class: ['vxe-body--expanded-row', {
|
|
529
|
+
'is--padding': padding
|
|
530
|
+
}],
|
|
531
|
+
key: `expand_${rowid}`
|
|
532
|
+
}, [
|
|
533
|
+
h('td', {
|
|
534
|
+
class: ['vxe-body--expanded-column', {
|
|
535
|
+
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
536
|
+
'col--ellipsis': hasEllipsis
|
|
537
|
+
}],
|
|
538
|
+
attrs: {
|
|
539
|
+
colspan: tableColumn.length
|
|
540
|
+
}
|
|
531
541
|
}, [
|
|
532
|
-
|
|
542
|
+
h('div', {
|
|
543
|
+
class: ['vxe-body--expanded-cell', {
|
|
544
|
+
'is--ellipsis': expandHeight
|
|
545
|
+
}],
|
|
546
|
+
style: cellStyle
|
|
547
|
+
}, [
|
|
548
|
+
expandColumn.renderData(h, expandParams)
|
|
549
|
+
])
|
|
533
550
|
])
|
|
534
|
-
])
|
|
535
|
-
|
|
551
|
+
]));
|
|
552
|
+
}
|
|
536
553
|
}
|
|
537
554
|
// 如果是树形表格
|
|
538
555
|
if (isExpandTree) {
|
|
@@ -600,14 +617,13 @@ export default {
|
|
|
600
617
|
const emptyOpts = $xeTable.computeEmptyOpts;
|
|
601
618
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
602
619
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
603
|
-
const
|
|
604
|
-
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
620
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
605
621
|
let renderDataList = tableData;
|
|
606
622
|
let renderColumnList = tableColumn;
|
|
607
623
|
let isOptimizeMode = false;
|
|
608
624
|
// 如果是使用优化模式
|
|
609
625
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
610
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
626
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
611
627
|
// 如果不支持优化模式
|
|
612
628
|
}
|
|
613
629
|
else {
|
|
@@ -687,9 +703,6 @@ export default {
|
|
|
687
703
|
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
688
704
|
}
|
|
689
705
|
};
|
|
690
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
691
|
-
ons.wheel = $xeTable.triggerBodyWheelEvent;
|
|
692
|
-
}
|
|
693
706
|
return h('div', {
|
|
694
707
|
ref: 'refElem',
|
|
695
708
|
class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
package/es/table/src/methods.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
|
-
import { browse, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft } from '../../ui/src/dom';
|
|
2
|
+
import { browse, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, getOffsetPos, setScrollTop, setScrollLeft, toCssUnit } from '../../ui/src/dom';
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import Cell from './cell';
|
|
@@ -308,7 +308,7 @@ function updateAfterListIndex($xeTable) {
|
|
|
308
308
|
rowRest._index = index;
|
|
309
309
|
}
|
|
310
310
|
else {
|
|
311
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 };
|
|
311
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
312
312
|
fullAllDataRowIdData[rowid] = rest;
|
|
313
313
|
fullDataRowIdData[rowid] = rest;
|
|
314
314
|
}
|
|
@@ -339,7 +339,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
339
339
|
rowRest.treeIndex = index;
|
|
340
340
|
}
|
|
341
341
|
else {
|
|
342
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 };
|
|
342
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, items: [], parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
343
343
|
fullAllDataRowIdData[rowid] = rest;
|
|
344
344
|
fullDataRowIdData[rowid] = rest;
|
|
345
345
|
}
|
|
@@ -403,6 +403,7 @@ function updateStyle($xeTable) {
|
|
|
403
403
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
|
|
404
404
|
const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
|
|
405
405
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
406
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
406
407
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
407
408
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
408
409
|
if (emptyPlaceholderElem) {
|
|
@@ -472,6 +473,11 @@ function updateStyle($xeTable) {
|
|
|
472
473
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
|
|
473
474
|
yBottomCornerEl.style.display = footerHeight ? 'block' : '';
|
|
474
475
|
}
|
|
476
|
+
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
477
|
+
if (rowExpandEl) {
|
|
478
|
+
rowExpandEl.style.height = `${bodyHeight}px`;
|
|
479
|
+
rowExpandEl.style.top = `${headerHeight}px`;
|
|
480
|
+
}
|
|
475
481
|
containerList.forEach((name, index) => {
|
|
476
482
|
const fixedType = index > 0 ? name : '';
|
|
477
483
|
const layoutList = ['header', 'body', 'footer'];
|
|
@@ -580,7 +586,7 @@ function updateStyle($xeTable) {
|
|
|
580
586
|
let isOptimizeMode = false;
|
|
581
587
|
// 如果是使用优化模式
|
|
582
588
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
583
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
589
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
584
590
|
// 如果不支持优化模式
|
|
585
591
|
}
|
|
586
592
|
else {
|
|
@@ -707,6 +713,13 @@ function updateStyle($xeTable) {
|
|
|
707
713
|
}
|
|
708
714
|
return $xeTable.$nextTick();
|
|
709
715
|
}
|
|
716
|
+
function calcVarRowHeightConfig($xeTable, sizeKey, sizeEl) {
|
|
717
|
+
const reactData = $xeTable;
|
|
718
|
+
const { rowHeightStore } = reactData;
|
|
719
|
+
if (sizeEl && sizeEl.clientHeight) {
|
|
720
|
+
rowHeightStore[sizeKey] = sizeEl.clientHeight;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
710
723
|
function computeRowHeight($xeTable) {
|
|
711
724
|
const reactData = $xeTable;
|
|
712
725
|
const { isAllOverflow } = reactData;
|
|
@@ -740,8 +753,9 @@ function computeRowHeight($xeTable) {
|
|
|
740
753
|
function handleVirtualYVisible($xeTable, currScrollTop) {
|
|
741
754
|
const reactData = $xeTable;
|
|
742
755
|
const internalData = $xeTable;
|
|
743
|
-
const { isAllOverflow } = reactData;
|
|
756
|
+
const { isAllOverflow, expandColumn, rowExpandedMaps } = reactData;
|
|
744
757
|
const { elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData;
|
|
758
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
745
759
|
const rowOpts = $xeTable.computeRowOpts;
|
|
746
760
|
const cellOpts = $xeTable.computeCellOpts;
|
|
747
761
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
@@ -754,7 +768,7 @@ function handleVirtualYVisible($xeTable, currScrollTop) {
|
|
|
754
768
|
let offsetTop = 0;
|
|
755
769
|
let visibleSize = 0;
|
|
756
770
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
757
|
-
if (!isCustomCellHeight && isAllOverflow) {
|
|
771
|
+
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
758
772
|
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
759
773
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
760
774
|
}
|
|
@@ -773,6 +787,10 @@ function handleVirtualYVisible($xeTable, currScrollTop) {
|
|
|
773
787
|
break;
|
|
774
788
|
}
|
|
775
789
|
}
|
|
790
|
+
// 是否展开行
|
|
791
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
792
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
793
|
+
}
|
|
776
794
|
}
|
|
777
795
|
}
|
|
778
796
|
return { toVisibleIndex: Math.max(0, toVisibleIndex), visibleSize: Math.max(6, visibleSize) };
|
|
@@ -1393,9 +1411,18 @@ function handleRecalculateLayout($xeTable, reFull) {
|
|
|
1393
1411
|
if (!el || !el.clientWidth) {
|
|
1394
1412
|
return $xeTable.$nextTick();
|
|
1395
1413
|
}
|
|
1414
|
+
const varEl = $xeTable.$refs.refVarElem;
|
|
1415
|
+
if (varEl) {
|
|
1416
|
+
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
1417
|
+
calcVarRowHeightConfig($xeTable, 'default', defEl);
|
|
1418
|
+
calcVarRowHeightConfig($xeTable, 'medium', mediumEl);
|
|
1419
|
+
calcVarRowHeightConfig($xeTable, 'small', smallEl);
|
|
1420
|
+
calcVarRowHeightConfig($xeTable, 'mini', miniEl);
|
|
1421
|
+
}
|
|
1396
1422
|
calcCellWidth($xeTable);
|
|
1397
1423
|
autoCellWidth($xeTable);
|
|
1398
1424
|
updateStyle($xeTable);
|
|
1425
|
+
updateRowExpandStyle($xeTable);
|
|
1399
1426
|
return computeScrollLoad($xeTable).then(() => {
|
|
1400
1427
|
if (reFull === true) {
|
|
1401
1428
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
@@ -1403,6 +1430,7 @@ function handleRecalculateLayout($xeTable, reFull) {
|
|
|
1403
1430
|
calcCellWidth($xeTable);
|
|
1404
1431
|
autoCellWidth($xeTable);
|
|
1405
1432
|
updateStyle($xeTable);
|
|
1433
|
+
updateRowExpandStyle($xeTable);
|
|
1406
1434
|
return computeScrollLoad($xeTable);
|
|
1407
1435
|
}
|
|
1408
1436
|
});
|
|
@@ -1823,7 +1851,7 @@ function calcCellWidth($xeTable) {
|
|
|
1823
1851
|
el.removeAttribute('data-calc-col');
|
|
1824
1852
|
}
|
|
1825
1853
|
}
|
|
1826
|
-
|
|
1854
|
+
function handleUpdateColResize($xeTable, evnt, params) {
|
|
1827
1855
|
$xeTable.analyColumnWidth();
|
|
1828
1856
|
$xeTable.recalculate(true).then(() => {
|
|
1829
1857
|
$xeTable.saveCustomStore('update:width');
|
|
@@ -1833,8 +1861,8 @@ const handleUpdateColResize = ($xeTable, evnt, params) => {
|
|
|
1833
1861
|
$xeTable.dispatchEvent('resizable-change', params, evnt);
|
|
1834
1862
|
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
1835
1863
|
});
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1864
|
+
}
|
|
1865
|
+
function handleUpdateRowResize($xeTable, evnt, params) {
|
|
1838
1866
|
const reactData = $xeTable;
|
|
1839
1867
|
reactData.resizeHeightFlag++;
|
|
1840
1868
|
$xeTable.recalculate(true).then(() => {
|
|
@@ -1842,7 +1870,65 @@ const handleUpdateRowResize = ($xeTable, evnt, params) => {
|
|
|
1842
1870
|
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
1843
1871
|
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
1844
1872
|
});
|
|
1845
|
-
}
|
|
1873
|
+
}
|
|
1874
|
+
function updateRowExpandStyle($xeTable) {
|
|
1875
|
+
const reactData = $xeTable;
|
|
1876
|
+
const internalData = $xeTable;
|
|
1877
|
+
const { expandColumn, scrollYLoad, rowExpandedMaps } = reactData;
|
|
1878
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
1879
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
1880
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
1881
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
1882
|
+
const { mode } = expandOpts;
|
|
1883
|
+
if (expandColumn && mode === 'fixed') {
|
|
1884
|
+
const { elemStore, afterFullData, fullAllDataRowIdData } = internalData;
|
|
1885
|
+
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
1886
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
1887
|
+
if (rowExpandEl && bodyScrollElem) {
|
|
1888
|
+
let isUpdateHeight = false;
|
|
1889
|
+
if (scrollYLoad) {
|
|
1890
|
+
let offsetTop = 0;
|
|
1891
|
+
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
1892
|
+
const row = afterFullData[rIndex];
|
|
1893
|
+
const rowid = getRowid($xeTable, row);
|
|
1894
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
1895
|
+
rowRest.oTop = offsetTop;
|
|
1896
|
+
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
1897
|
+
// 是否展开行
|
|
1898
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
1899
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
XEUtils.arrayEach(rowExpandEl.children, reEl => {
|
|
1904
|
+
const expandEl = reEl;
|
|
1905
|
+
const rowid = expandEl.getAttribute('rowid') || '';
|
|
1906
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
1907
|
+
if (rowRest) {
|
|
1908
|
+
const expandHeight = expandEl.offsetHeight + 1;
|
|
1909
|
+
if (scrollYLoad) {
|
|
1910
|
+
expandEl.style.top = toCssUnit(rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight));
|
|
1911
|
+
}
|
|
1912
|
+
else {
|
|
1913
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
1914
|
+
if (trEl) {
|
|
1915
|
+
expandEl.style.top = toCssUnit(trEl.offsetTop + trEl.offsetHeight);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
if (!isUpdateHeight) {
|
|
1919
|
+
if (rowRest.expandHeight !== expandHeight) {
|
|
1920
|
+
isUpdateHeight = true;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
rowRest.expandHeight = expandHeight;
|
|
1924
|
+
}
|
|
1925
|
+
});
|
|
1926
|
+
if (isUpdateHeight) {
|
|
1927
|
+
reactData.rowExpandHeightFlag++;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1846
1932
|
const Methods = {
|
|
1847
1933
|
callSlot(slotFunc, params, h, vNodes) {
|
|
1848
1934
|
if (slotFunc) {
|
|
@@ -2223,7 +2309,7 @@ const Methods = {
|
|
|
2223
2309
|
}
|
|
2224
2310
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
2225
2311
|
if (isReset || !cacheItem) {
|
|
2226
|
-
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0 };
|
|
2312
|
+
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
2227
2313
|
}
|
|
2228
2314
|
cacheItem.row = row;
|
|
2229
2315
|
cacheItem.items = items;
|
|
@@ -2297,7 +2383,7 @@ const Methods = {
|
|
|
2297
2383
|
XEUtils.eachTree(rows, (childRow, index, items, path, parentItem, nodes) => {
|
|
2298
2384
|
const rowid = getRowid($xeTable, childRow);
|
|
2299
2385
|
const parentRow = parentItem || parentRest.row;
|
|
2300
|
-
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0 };
|
|
2386
|
+
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
2301
2387
|
fullDataRowIdData[rowid] = rest;
|
|
2302
2388
|
fullAllDataRowIdData[rowid] = rest;
|
|
2303
2389
|
}, { children: childrenField });
|
|
@@ -4121,6 +4207,7 @@ const Methods = {
|
|
|
4121
4207
|
const el = $xeTable.$refs.refElem;
|
|
4122
4208
|
if (el && el.clientWidth) {
|
|
4123
4209
|
autoCellWidth($xeTable);
|
|
4210
|
+
updateRowExpandStyle($xeTable);
|
|
4124
4211
|
}
|
|
4125
4212
|
if (rceTimeout) {
|
|
4126
4213
|
clearTimeout(rceTimeout);
|
|
@@ -7781,6 +7868,7 @@ const Methods = {
|
|
|
7781
7868
|
isLeft,
|
|
7782
7869
|
isRight,
|
|
7783
7870
|
direction }, params);
|
|
7871
|
+
updateRowExpandStyle($xeTable);
|
|
7784
7872
|
checkLastSyncScroll($xeTable, isRollX, isRollY);
|
|
7785
7873
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
7786
7874
|
$xeTable.clearHoverRow();
|
|
@@ -7835,6 +7923,7 @@ const Methods = {
|
|
|
7835
7923
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
7836
7924
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
7837
7925
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
7926
|
+
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
7838
7927
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
7839
7928
|
return;
|
|
7840
7929
|
}
|
|
@@ -7885,6 +7974,7 @@ const Methods = {
|
|
|
7885
7974
|
setScrollTop(rightScrollElem, scrollTop);
|
|
7886
7975
|
}
|
|
7887
7976
|
setScrollTop(yHandleEl, scrollTop);
|
|
7977
|
+
setScrollTop(rowExpandEl, scrollTop);
|
|
7888
7978
|
if (scrollYLoad) {
|
|
7889
7979
|
$xeTable.triggerScrollYEvent(evnt);
|
|
7890
7980
|
}
|
|
@@ -8004,6 +8094,7 @@ const Methods = {
|
|
|
8004
8094
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8005
8095
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8006
8096
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8097
|
+
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
8007
8098
|
if (!xHandleEl) {
|
|
8008
8099
|
return;
|
|
8009
8100
|
}
|
|
@@ -8039,6 +8130,7 @@ const Methods = {
|
|
|
8039
8130
|
setScrollTop(bodyScrollElem, currTopNum);
|
|
8040
8131
|
setScrollTop(leftScrollElem, currTopNum);
|
|
8041
8132
|
setScrollTop(rightScrollElem, currTopNum);
|
|
8133
|
+
setScrollTop(rowExpandEl, currTopNum);
|
|
8042
8134
|
if (scrollYLoad) {
|
|
8043
8135
|
$xeTable.triggerScrollYEvent(evnt);
|
|
8044
8136
|
}
|
|
@@ -8047,16 +8139,6 @@ const Methods = {
|
|
|
8047
8139
|
fixed: ''
|
|
8048
8140
|
});
|
|
8049
8141
|
});
|
|
8050
|
-
// internalData.inWheelScroll = true
|
|
8051
|
-
// setScrollTop(yHandleEl, scrollTop)
|
|
8052
|
-
// setScrollTop(bodyScrollElem, scrollTop)
|
|
8053
|
-
// setScrollTop(leftScrollElem, scrollTop)
|
|
8054
|
-
// setScrollTop(rightScrollElem, scrollTop)
|
|
8055
|
-
// loadScrollYData($xeTable, scrollTop)
|
|
8056
|
-
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8057
|
-
// type: 'footer',
|
|
8058
|
-
// fixed: ''
|
|
8059
|
-
// })
|
|
8060
8142
|
}
|
|
8061
8143
|
},
|
|
8062
8144
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -8111,6 +8193,7 @@ const Methods = {
|
|
|
8111
8193
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8112
8194
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8113
8195
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8196
|
+
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
8114
8197
|
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
8115
8198
|
const wrapperEl = evnt.currentTarget;
|
|
8116
8199
|
const { scrollTop } = wrapperEl;
|
|
@@ -8125,6 +8208,7 @@ const Methods = {
|
|
|
8125
8208
|
setScrollTop(bodyScrollElem, scrollTop);
|
|
8126
8209
|
setScrollTop(leftScrollElem, scrollTop);
|
|
8127
8210
|
setScrollTop(rightScrollElem, scrollTop);
|
|
8211
|
+
setScrollTop(rowExpandEl, scrollTop);
|
|
8128
8212
|
if (scrollYLoad) {
|
|
8129
8213
|
$xeTable.triggerScrollYEvent(evnt);
|
|
8130
8214
|
}
|
|
@@ -8138,6 +8222,7 @@ const Methods = {
|
|
|
8138
8222
|
const reactData = $xeTable;
|
|
8139
8223
|
const { isAllOverflow } = reactData;
|
|
8140
8224
|
handleTableColumn($xeTable);
|
|
8225
|
+
$xeTable.updateScrollXSpace();
|
|
8141
8226
|
return $xeTable.$nextTick().then(() => {
|
|
8142
8227
|
handleTableColumn($xeTable);
|
|
8143
8228
|
$xeTable.updateScrollXSpace();
|
|
@@ -8197,6 +8282,7 @@ const Methods = {
|
|
|
8197
8282
|
updateScrollYData() {
|
|
8198
8283
|
const $xeTable = this;
|
|
8199
8284
|
$xeTable.handleTableData();
|
|
8285
|
+
$xeTable.updateScrollYSpace();
|
|
8200
8286
|
return $xeTable.$nextTick().then(() => {
|
|
8201
8287
|
$xeTable.handleTableData();
|
|
8202
8288
|
$xeTable.updateScrollYSpace();
|
|
@@ -8207,9 +8293,10 @@ const Methods = {
|
|
|
8207
8293
|
const $xeTable = this;
|
|
8208
8294
|
const reactData = $xeTable;
|
|
8209
8295
|
const internalData = $xeTable;
|
|
8210
|
-
const { isAllOverflow, scrollYLoad } = reactData;
|
|
8296
|
+
const { isAllOverflow, scrollYLoad, expandColumn, rowExpandedMaps } = reactData;
|
|
8211
8297
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData;
|
|
8212
8298
|
const { startIndex } = scrollYStore;
|
|
8299
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
8213
8300
|
const rowOpts = $xeTable.computeRowOpts;
|
|
8214
8301
|
const cellOpts = $xeTable.computeCellOpts;
|
|
8215
8302
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
@@ -8219,7 +8306,7 @@ const Methods = {
|
|
|
8219
8306
|
let ySpaceHeight = 0;
|
|
8220
8307
|
if (scrollYLoad) {
|
|
8221
8308
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
8222
|
-
if (!isCustomCellHeight && isAllOverflow) {
|
|
8309
|
+
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
8223
8310
|
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
8224
8311
|
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
8225
8312
|
}
|
|
@@ -8229,12 +8316,20 @@ const Methods = {
|
|
|
8229
8316
|
const rowid = getRowid($xeTable, row);
|
|
8230
8317
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
8231
8318
|
ySpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
8319
|
+
// 是否展开行
|
|
8320
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
8321
|
+
ySpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
8322
|
+
}
|
|
8232
8323
|
}
|
|
8233
8324
|
for (let i = 0; i < startIndex; i++) {
|
|
8234
8325
|
const row = afterFullData[i];
|
|
8235
8326
|
const rowid = getRowid($xeTable, row);
|
|
8236
8327
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
8237
8328
|
topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
8329
|
+
// 是否展开行
|
|
8330
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
8331
|
+
topSpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
8332
|
+
}
|
|
8238
8333
|
}
|
|
8239
8334
|
}
|
|
8240
8335
|
}
|
|
@@ -8260,6 +8355,10 @@ const Methods = {
|
|
|
8260
8355
|
if (scrollYSpaceEl) {
|
|
8261
8356
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
8262
8357
|
}
|
|
8358
|
+
const rowExpandYSpaceEl = $xeTable.$refs.refRowExpandYSpaceElem;
|
|
8359
|
+
if (rowExpandYSpaceEl) {
|
|
8360
|
+
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
8361
|
+
}
|
|
8263
8362
|
return $xeTable.$nextTick().then(() => {
|
|
8264
8363
|
updateStyle($xeTable);
|
|
8265
8364
|
});
|