vxe-table 3.14.0-beta.9 → 3.14.0
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 +62 -42
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +4 -2
- package/es/table/module/custom/panel.js +24 -23
- package/es/table/module/edit/mixin.js +17 -11
- package/es/table/module/export/export-panel.js +5 -4
- package/es/table/module/export/import-panel.js +8 -7
- package/es/table/module/export/mixin.js +30 -27
- package/es/table/module/filter/panel.js +21 -10
- package/es/table/module/keyboard/mixin.js +141 -41
- package/es/table/module/menu/mixin.js +6 -3
- package/es/table/module/menu/panel.js +7 -7
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +2 -2
- package/es/table/src/body.js +39 -20
- package/es/table/src/cell.js +27 -22
- package/es/table/src/column.js +11 -9
- package/es/table/src/columnInfo.js +6 -6
- package/es/table/src/footer.js +12 -7
- package/es/table/src/group.js +6 -5
- package/es/table/src/header.js +15 -9
- package/es/table/src/methods.js +761 -698
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +85 -49
- package/es/table/src/util.js +55 -20
- package/es/toolbar/src/toolbar.js +3 -3
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +69 -59
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1558 -1232
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -3
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +22 -29
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +19 -13
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +5 -4
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +35 -34
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +16 -16
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +149 -47
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +6 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +7 -7
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +3 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +47 -20
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +39 -23
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +11 -9
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +12 -5
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +6 -5
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +16 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +898 -825
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +93 -52
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +62 -21
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -3
- package/lib/ui/index.js +2 -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/grid/src/grid.ts +75 -51
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/custom/mixin.ts +6 -3
- package/packages/table/module/custom/panel.ts +42 -37
- package/packages/table/module/edit/mixin.ts +20 -14
- package/packages/table/module/export/export-panel.ts +8 -5
- package/packages/table/module/export/import-panel.ts +11 -7
- package/packages/table/module/export/mixin.ts +37 -32
- package/packages/table/module/filter/panel.ts +25 -10
- package/packages/table/module/keyboard/mixin.ts +155 -49
- package/packages/table/module/menu/mixin.ts +12 -6
- package/packages/table/module/menu/panel.ts +10 -7
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +2 -2
- package/packages/table/src/body.ts +39 -20
- package/packages/table/src/cell.ts +27 -22
- package/packages/table/src/column.ts +14 -10
- package/packages/table/src/columnInfo.ts +9 -6
- package/packages/table/src/footer.ts +12 -7
- package/packages/table/src/group.ts +9 -5
- package/packages/table/src/header.ts +16 -9
- package/packages/table/src/methods.ts +840 -734
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +99 -52
- package/packages/table/src/util.ts +63 -21
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741336976538.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/es/{iconfont.1741336976538.woff → iconfont.1742955973002.woff} +0 -0
- /package/es/{iconfont.1741336976538.woff2 → iconfont.1742955973002.woff2} +0 -0
- /package/lib/{iconfont.1741336976538.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/lib/{iconfont.1741336976538.woff → iconfont.1742955973002.woff} +0 -0
- /package/lib/{iconfont.1741336976538.woff2 → iconfont.1742955973002.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -21,6 +21,7 @@ const {
|
|
|
21
21
|
interceptor,
|
|
22
22
|
createEvent
|
|
23
23
|
} = _ui.VxeUI;
|
|
24
|
+
const supportMaxRow = 5e6;
|
|
24
25
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
25
26
|
const maxYHeight = 5e6;
|
|
26
27
|
const maxXWidth = 5e6;
|
|
@@ -287,7 +288,7 @@ function cacheColumnMap($xeTable) {
|
|
|
287
288
|
fullColumnFieldData[field] = rest;
|
|
288
289
|
} else {
|
|
289
290
|
if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
|
|
290
|
-
(0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field
|
|
291
|
+
(0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
if (!hasFixed && fixed) {
|
|
@@ -393,9 +394,12 @@ function updateAfterListIndex($xeTable) {
|
|
|
393
394
|
fullDataRowIdData,
|
|
394
395
|
fullAllDataRowIdData
|
|
395
396
|
} = internalData;
|
|
397
|
+
const {
|
|
398
|
+
handleGetRowId
|
|
399
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
396
400
|
const fullMaps = {};
|
|
397
401
|
afterFullData.forEach((row, index) => {
|
|
398
|
-
const rowid = (
|
|
402
|
+
const rowid = handleGetRowId(row);
|
|
399
403
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
400
404
|
const seq = index + 1;
|
|
401
405
|
if (rowRest) {
|
|
@@ -449,8 +453,11 @@ function updateAfterDataIndex($xeTable) {
|
|
|
449
453
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
450
454
|
const fullMaps = {};
|
|
451
455
|
if (treeConfig) {
|
|
456
|
+
const {
|
|
457
|
+
handleGetRowId
|
|
458
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
452
459
|
_xeUtils.default.eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
453
|
-
const rowid = (
|
|
460
|
+
const rowid = handleGetRowId(row);
|
|
454
461
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
455
462
|
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
456
463
|
if (rowRest) {
|
|
@@ -492,25 +499,25 @@ function updateAfterDataIndex($xeTable) {
|
|
|
492
499
|
*/
|
|
493
500
|
function handleVirtualTreeToList($xeTable) {
|
|
494
501
|
const props = $xeTable;
|
|
495
|
-
const reactData = $xeTable;
|
|
496
502
|
const internalData = $xeTable;
|
|
497
503
|
const {
|
|
498
504
|
treeConfig
|
|
499
505
|
} = props;
|
|
500
506
|
const {
|
|
507
|
+
fullAllDataRowIdData,
|
|
501
508
|
treeExpandedMaps
|
|
502
|
-
} = reactData;
|
|
503
|
-
const {
|
|
504
|
-
fullAllDataRowIdData
|
|
505
509
|
} = internalData;
|
|
506
510
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
507
511
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
508
512
|
if (treeConfig && treeOpts.transform) {
|
|
513
|
+
const {
|
|
514
|
+
handleGetRowId
|
|
515
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
509
516
|
const fullData = [];
|
|
510
517
|
const expandMaps = {};
|
|
511
518
|
_xeUtils.default.eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
512
|
-
const rowid = (
|
|
513
|
-
const parentRowid = (
|
|
519
|
+
const rowid = handleGetRowId(row);
|
|
520
|
+
const parentRowid = handleGetRowId(parentRow);
|
|
514
521
|
if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
|
|
515
522
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
516
523
|
if (rowRest) {
|
|
@@ -558,7 +565,6 @@ function updateStyle($xeTable) {
|
|
|
558
565
|
} = reactData;
|
|
559
566
|
const {
|
|
560
567
|
visibleColumn,
|
|
561
|
-
fullColumnIdData,
|
|
562
568
|
tableHeight,
|
|
563
569
|
headerHeight,
|
|
564
570
|
footerHeight,
|
|
@@ -575,7 +581,6 @@ function updateStyle($xeTable) {
|
|
|
575
581
|
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
576
582
|
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
577
583
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
|
|
578
|
-
const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
|
|
579
584
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
580
585
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
581
586
|
const bodyWrapperElem = (0, _util.getRefElem)(elemStore['main-body-wrapper']);
|
|
@@ -837,58 +842,6 @@ function updateStyle($xeTable) {
|
|
|
837
842
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
838
843
|
}
|
|
839
844
|
}
|
|
840
|
-
const colgroupElem = (0, _util.getRefElem)(elemStore[`${name}-${layout}-colgroup`]);
|
|
841
|
-
if (colgroupElem) {
|
|
842
|
-
_xeUtils.default.arrayEach(colgroupElem.children, colElem => {
|
|
843
|
-
const colid = colElem.getAttribute('name');
|
|
844
|
-
if (fullColumnIdData[colid]) {
|
|
845
|
-
const colRest = fullColumnIdData[colid];
|
|
846
|
-
const column = colRest.column;
|
|
847
|
-
const {
|
|
848
|
-
showHeaderOverflow,
|
|
849
|
-
showFooterOverflow,
|
|
850
|
-
showOverflow
|
|
851
|
-
} = column;
|
|
852
|
-
let cellOverflow;
|
|
853
|
-
colElem.style.width = `${column.renderWidth}px`;
|
|
854
|
-
if (layout === 'header') {
|
|
855
|
-
cellOverflow = _xeUtils.default.isUndefined(showHeaderOverflow) || _xeUtils.default.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
856
|
-
} else if (layout === 'footer') {
|
|
857
|
-
cellOverflow = _xeUtils.default.isUndefined(showFooterOverflow) || _xeUtils.default.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
858
|
-
} else {
|
|
859
|
-
cellOverflow = _xeUtils.default.isUndefined(showOverflow) || _xeUtils.default.isNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
860
|
-
}
|
|
861
|
-
const showEllipsis = cellOverflow === 'ellipsis';
|
|
862
|
-
const showTitle = cellOverflow === 'title';
|
|
863
|
-
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
864
|
-
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
865
|
-
const listElem = (0, _util.getRefElem)(elemStore[`${name}-${layout}-list`]);
|
|
866
|
-
// 纵向虚拟滚动不支持动态行高
|
|
867
|
-
if (scrollYLoad && !hasEllipsis) {
|
|
868
|
-
hasEllipsis = true;
|
|
869
|
-
}
|
|
870
|
-
if (listElem) {
|
|
871
|
-
_xeUtils.default.arrayEach(listElem.querySelectorAll(`.${column.id}`), elem => {
|
|
872
|
-
const colspan = parseInt(elem.getAttribute('colspan') || 1);
|
|
873
|
-
const cellElem = elem.querySelector('.vxe-cell');
|
|
874
|
-
let colWidth = column.renderWidth;
|
|
875
|
-
if (cellElem) {
|
|
876
|
-
if (colspan > 1) {
|
|
877
|
-
const columnIndex = $xeTable.getColumnIndex(column);
|
|
878
|
-
for (let index = 1; index < colspan; index++) {
|
|
879
|
-
const nextColumn = $xeTable.getColumns(columnIndex + index);
|
|
880
|
-
if (nextColumn) {
|
|
881
|
-
colWidth += nextColumn.renderWidth;
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
cellElem.style.width = hasEllipsis ? `${colWidth - cellOffsetWidth * colspan}px` : '';
|
|
886
|
-
}
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
845
|
});
|
|
893
846
|
});
|
|
894
847
|
if (currentRow) {
|
|
@@ -899,6 +852,21 @@ function updateStyle($xeTable) {
|
|
|
899
852
|
}
|
|
900
853
|
return $xeTable.$nextTick();
|
|
901
854
|
}
|
|
855
|
+
function checkValidate($xeTable, type) {
|
|
856
|
+
if ($xeTable.triggerValidate) {
|
|
857
|
+
return $xeTable.triggerValidate(type);
|
|
858
|
+
}
|
|
859
|
+
return $xeTable.$nextTick();
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* 当单元格发生改变时
|
|
863
|
+
* 如果存在规则,则校验
|
|
864
|
+
*/
|
|
865
|
+
function handleChangeCell($xeTable, evnt, params) {
|
|
866
|
+
checkValidate($xeTable, 'blur').catch(e => e).then(() => {
|
|
867
|
+
$xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
868
|
+
});
|
|
869
|
+
}
|
|
902
870
|
function handleRadioReserveRow($xeTable, row) {
|
|
903
871
|
const internalData = $xeTable;
|
|
904
872
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -950,12 +918,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
950
918
|
const {
|
|
951
919
|
treeConfig
|
|
952
920
|
} = props;
|
|
953
|
-
const {
|
|
954
|
-
selectCheckboxMaps
|
|
955
|
-
} = reactData;
|
|
956
921
|
const {
|
|
957
922
|
afterFullData,
|
|
958
|
-
checkboxReserveRowMap
|
|
923
|
+
checkboxReserveRowMap,
|
|
924
|
+
selectCheckboxMaps
|
|
959
925
|
} = internalData;
|
|
960
926
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
961
927
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -965,6 +931,9 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
965
931
|
reserve,
|
|
966
932
|
checkMethod
|
|
967
933
|
} = checkboxOpts;
|
|
934
|
+
const {
|
|
935
|
+
handleGetRowId
|
|
936
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
968
937
|
// indeterminateField 仅支持读取
|
|
969
938
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
970
939
|
const selectRowMaps = {};
|
|
@@ -978,7 +947,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
978
947
|
row
|
|
979
948
|
})) {
|
|
980
949
|
if (checked) {
|
|
981
|
-
selectRowMaps[(
|
|
950
|
+
selectRowMaps[handleGetRowId(row)] = row;
|
|
982
951
|
}
|
|
983
952
|
_xeUtils.default.set(row, checkField, checked);
|
|
984
953
|
}
|
|
@@ -1010,7 +979,8 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1010
979
|
if (isForce || !checkMethod || checkMethod({
|
|
1011
980
|
row
|
|
1012
981
|
})) {
|
|
1013
|
-
|
|
982
|
+
const rowid = handleGetRowId(row);
|
|
983
|
+
selectRowMaps[rowid] = row;
|
|
1014
984
|
}
|
|
1015
985
|
}, {
|
|
1016
986
|
children: childrenField
|
|
@@ -1022,7 +992,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1022
992
|
*/
|
|
1023
993
|
if (!isForce && checkMethod) {
|
|
1024
994
|
_xeUtils.default.eachTree(afterFullData, row => {
|
|
1025
|
-
const rowid = (
|
|
995
|
+
const rowid = handleGetRowId(row);
|
|
1026
996
|
if (checkMethod({
|
|
1027
997
|
row
|
|
1028
998
|
}) ? 0 : selectCheckboxMaps[rowid]) {
|
|
@@ -1042,7 +1012,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1042
1012
|
*/
|
|
1043
1013
|
if (!isForce && checkMethod) {
|
|
1044
1014
|
afterFullData.forEach(row => {
|
|
1045
|
-
const rowid = (
|
|
1015
|
+
const rowid = handleGetRowId(row);
|
|
1046
1016
|
if (selectCheckboxMaps[rowid] || checkMethod({
|
|
1047
1017
|
row
|
|
1048
1018
|
})) {
|
|
@@ -1051,7 +1021,8 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1051
1021
|
});
|
|
1052
1022
|
} else {
|
|
1053
1023
|
afterFullData.forEach(row => {
|
|
1054
|
-
|
|
1024
|
+
const rowid = handleGetRowId(row);
|
|
1025
|
+
selectRowMaps[rowid] = row;
|
|
1055
1026
|
});
|
|
1056
1027
|
}
|
|
1057
1028
|
} else {
|
|
@@ -1062,7 +1033,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1062
1033
|
*/
|
|
1063
1034
|
if (!isForce && checkMethod) {
|
|
1064
1035
|
afterFullData.forEach(row => {
|
|
1065
|
-
const rowid = (
|
|
1036
|
+
const rowid = handleGetRowId(row);
|
|
1066
1037
|
if (checkMethod({
|
|
1067
1038
|
row
|
|
1068
1039
|
}) ? 0 : selectCheckboxMaps[rowid]) {
|
|
@@ -1082,10 +1053,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
1082
1053
|
afterFullData.forEach(row => handleCheckboxReserveRow($xeTable, row, false));
|
|
1083
1054
|
}
|
|
1084
1055
|
}
|
|
1085
|
-
reactData.
|
|
1056
|
+
reactData.updateCheckboxFlag++;
|
|
1057
|
+
internalData.selectCheckboxMaps = checkField ? {} : selectRowMaps;
|
|
1086
1058
|
reactData.isAllSelected = checked;
|
|
1087
1059
|
reactData.isIndeterminate = false;
|
|
1088
|
-
reactData.treeIndeterminateMaps = {};
|
|
1089
1060
|
internalData.treeIndeterminateRowMaps = {};
|
|
1090
1061
|
$xeTable.checkSelectionStatus();
|
|
1091
1062
|
return $xeTable.$nextTick();
|
|
@@ -1101,15 +1072,15 @@ function handleReserveStatus($xeTable) {
|
|
|
1101
1072
|
const {
|
|
1102
1073
|
expandColumn,
|
|
1103
1074
|
currentRow,
|
|
1104
|
-
|
|
1105
|
-
selectRadioRow,
|
|
1106
|
-
rowExpandedMaps,
|
|
1107
|
-
treeExpandedMaps
|
|
1075
|
+
selectRadioRow
|
|
1108
1076
|
} = reactData;
|
|
1109
1077
|
const {
|
|
1110
1078
|
fullDataRowIdData,
|
|
1111
1079
|
fullAllDataRowIdData,
|
|
1112
|
-
radioReserveRow
|
|
1080
|
+
radioReserveRow,
|
|
1081
|
+
selectCheckboxMaps,
|
|
1082
|
+
treeExpandedMaps,
|
|
1083
|
+
rowExpandedMaps
|
|
1113
1084
|
} = internalData;
|
|
1114
1085
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
1115
1086
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -1127,7 +1098,8 @@ function handleReserveStatus($xeTable) {
|
|
|
1127
1098
|
}
|
|
1128
1099
|
}
|
|
1129
1100
|
// 复选框
|
|
1130
|
-
|
|
1101
|
+
internalData.selectCheckboxMaps = getRecoverRowMaps($xeTable, selectCheckboxMaps); // 刷新多选行状态
|
|
1102
|
+
reactData.updateCheckboxFlag++;
|
|
1131
1103
|
// 还原保留选中状态
|
|
1132
1104
|
if (checkboxOpts.reserve) {
|
|
1133
1105
|
handleCheckedCheckboxRow($xeTable, handleReserveRow($xeTable, internalData.checkboxReserveRowMap), true, true);
|
|
@@ -1136,17 +1108,194 @@ function handleReserveStatus($xeTable) {
|
|
|
1136
1108
|
reactData.currentRow = null; // 刷新当前行状态
|
|
1137
1109
|
}
|
|
1138
1110
|
// 行展开
|
|
1139
|
-
|
|
1111
|
+
internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {}; // 刷新行展开状态
|
|
1112
|
+
reactData.rowExpandedFlag++;
|
|
1140
1113
|
// 还原保留状态
|
|
1141
1114
|
if (expandColumn && expandOpts.reserve) {
|
|
1142
1115
|
$xeTable.setRowExpand(handleReserveRow($xeTable, internalData.rowExpandedReserveRowMap), true);
|
|
1143
1116
|
}
|
|
1144
1117
|
// 树展开
|
|
1145
|
-
|
|
1118
|
+
internalData.treeExpandedMaps = treeConfig ? getRecoverRowMaps($xeTable, treeExpandedMaps) : {}; // 刷新树展开状态
|
|
1119
|
+
reactData.treeExpandedFlag++;
|
|
1146
1120
|
if (treeConfig && treeOpts.reserve) {
|
|
1147
1121
|
$xeTable.setTreeExpand(handleReserveRow($xeTable, internalData.treeExpandedReserveRowMap), true);
|
|
1148
1122
|
}
|
|
1149
1123
|
}
|
|
1124
|
+
/**
|
|
1125
|
+
* 处理默认展开树节点
|
|
1126
|
+
*/
|
|
1127
|
+
const handleDefaultTreeExpand = $xeTable => {
|
|
1128
|
+
const props = $xeTable;
|
|
1129
|
+
const internalData = $xeTable;
|
|
1130
|
+
const {
|
|
1131
|
+
treeConfig
|
|
1132
|
+
} = props;
|
|
1133
|
+
if (treeConfig) {
|
|
1134
|
+
const {
|
|
1135
|
+
tableFullData
|
|
1136
|
+
} = internalData;
|
|
1137
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
1138
|
+
const {
|
|
1139
|
+
expandAll,
|
|
1140
|
+
expandRowKeys
|
|
1141
|
+
} = treeOpts;
|
|
1142
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1143
|
+
if (expandAll) {
|
|
1144
|
+
$xeTable.setAllTreeExpand(true);
|
|
1145
|
+
} else if (expandRowKeys) {
|
|
1146
|
+
const defExpandeds = [];
|
|
1147
|
+
const rowkey = (0, _util.getRowkey)($xeTable);
|
|
1148
|
+
expandRowKeys.forEach(rowid => {
|
|
1149
|
+
const matchObj = _xeUtils.default.findTree(tableFullData, item => rowid === _xeUtils.default.get(item, rowkey), {
|
|
1150
|
+
children: childrenField
|
|
1151
|
+
});
|
|
1152
|
+
if (matchObj) {
|
|
1153
|
+
defExpandeds.push(matchObj.item);
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
$xeTable.setTreeExpand(defExpandeds, true);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
const handleAsyncTreeExpandChilds = ($xeTable, row) => {
|
|
1161
|
+
const reactData = $xeTable;
|
|
1162
|
+
const internalData = $xeTable;
|
|
1163
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
1164
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
1165
|
+
const {
|
|
1166
|
+
transform,
|
|
1167
|
+
loadMethod
|
|
1168
|
+
} = treeOpts;
|
|
1169
|
+
const {
|
|
1170
|
+
checkStrictly
|
|
1171
|
+
} = checkboxOpts;
|
|
1172
|
+
return new Promise(resolve => {
|
|
1173
|
+
if (loadMethod) {
|
|
1174
|
+
const {
|
|
1175
|
+
fullAllDataRowIdData,
|
|
1176
|
+
treeExpandLazyLoadedMaps
|
|
1177
|
+
} = internalData;
|
|
1178
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
1179
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
1180
|
+
treeExpandLazyLoadedMaps[rowid] = row;
|
|
1181
|
+
Promise.resolve(loadMethod({
|
|
1182
|
+
$table: $xeTable,
|
|
1183
|
+
row
|
|
1184
|
+
})).then(childRecords => {
|
|
1185
|
+
if (rowRest) {
|
|
1186
|
+
rowRest.treeLoaded = true;
|
|
1187
|
+
}
|
|
1188
|
+
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
1189
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
1190
|
+
}
|
|
1191
|
+
if (!_xeUtils.default.isArray(childRecords)) {
|
|
1192
|
+
childRecords = [];
|
|
1193
|
+
}
|
|
1194
|
+
if (childRecords) {
|
|
1195
|
+
return $xeTable.loadTreeChildren(row, childRecords).then(childRows => {
|
|
1196
|
+
const {
|
|
1197
|
+
treeExpandedMaps
|
|
1198
|
+
} = internalData;
|
|
1199
|
+
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
1200
|
+
treeExpandedMaps[rowid] = row;
|
|
1201
|
+
}
|
|
1202
|
+
reactData.treeExpandedFlag++;
|
|
1203
|
+
// 如果当前节点已选中,则展开后子节点也被选中
|
|
1204
|
+
if (!checkStrictly && $xeTable.isCheckedByCheckboxRow(row)) {
|
|
1205
|
+
handleCheckedCheckboxRow($xeTable, childRows, true);
|
|
1206
|
+
}
|
|
1207
|
+
return $xeTable.$nextTick().then(() => {
|
|
1208
|
+
if (transform) {
|
|
1209
|
+
$xeTable.handleTableData();
|
|
1210
|
+
updateAfterDataIndex($xeTable);
|
|
1211
|
+
return $xeTable.$nextTick();
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
}).catch(() => {
|
|
1217
|
+
const {
|
|
1218
|
+
treeExpandLazyLoadedMaps
|
|
1219
|
+
} = internalData;
|
|
1220
|
+
if (rowRest) {
|
|
1221
|
+
rowRest.treeLoaded = false;
|
|
1222
|
+
}
|
|
1223
|
+
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
1224
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
1225
|
+
}
|
|
1226
|
+
}).finally(() => {
|
|
1227
|
+
reactData.treeExpandedFlag++;
|
|
1228
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve());
|
|
1229
|
+
});
|
|
1230
|
+
} else {
|
|
1231
|
+
resolve();
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
};
|
|
1235
|
+
const handleTreeExpandReserve = ($xeTable, row, expanded) => {
|
|
1236
|
+
const internalData = $xeTable;
|
|
1237
|
+
const {
|
|
1238
|
+
treeExpandedReserveRowMap
|
|
1239
|
+
} = internalData;
|
|
1240
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
1241
|
+
if (treeOpts.reserve) {
|
|
1242
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
1243
|
+
if (expanded) {
|
|
1244
|
+
treeExpandedReserveRowMap[rowid] = row;
|
|
1245
|
+
} else if (treeExpandedReserveRowMap[rowid]) {
|
|
1246
|
+
delete treeExpandedReserveRowMap[rowid];
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
const handleAsyncRowExpand = ($xeTable, row) => {
|
|
1251
|
+
const reactData = $xeTable;
|
|
1252
|
+
const internalData = $xeTable;
|
|
1253
|
+
return new Promise(resolve => {
|
|
1254
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
1255
|
+
const {
|
|
1256
|
+
loadMethod
|
|
1257
|
+
} = expandOpts;
|
|
1258
|
+
if (loadMethod) {
|
|
1259
|
+
const {
|
|
1260
|
+
fullAllDataRowIdData,
|
|
1261
|
+
rowExpandLazyLoadedMaps
|
|
1262
|
+
} = internalData;
|
|
1263
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
1264
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
1265
|
+
rowExpandLazyLoadedMaps[rowid] = row;
|
|
1266
|
+
loadMethod({
|
|
1267
|
+
$table: $xeTable,
|
|
1268
|
+
row,
|
|
1269
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
1270
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
1271
|
+
}).then(() => {
|
|
1272
|
+
const {
|
|
1273
|
+
rowExpandedMaps
|
|
1274
|
+
} = internalData;
|
|
1275
|
+
if (rowRest) {
|
|
1276
|
+
rowRest.expandLoaded = true;
|
|
1277
|
+
}
|
|
1278
|
+
rowExpandedMaps[rowid] = row;
|
|
1279
|
+
reactData.rowExpandedFlag++;
|
|
1280
|
+
}).catch(() => {
|
|
1281
|
+
if (rowRest) {
|
|
1282
|
+
rowRest.expandLoaded = false;
|
|
1283
|
+
}
|
|
1284
|
+
}).finally(() => {
|
|
1285
|
+
const {
|
|
1286
|
+
rowExpandLazyLoadedMaps
|
|
1287
|
+
} = internalData;
|
|
1288
|
+
if (rowExpandLazyLoadedMaps[rowid]) {
|
|
1289
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
1290
|
+
}
|
|
1291
|
+
reactData.rowExpandedFlag++;
|
|
1292
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
|
|
1293
|
+
});
|
|
1294
|
+
} else {
|
|
1295
|
+
resolve();
|
|
1296
|
+
}
|
|
1297
|
+
});
|
|
1298
|
+
};
|
|
1150
1299
|
function calcVarRowHeightConfig($xeTable, sizeKey, sizeEl) {
|
|
1151
1300
|
const reactData = $xeTable;
|
|
1152
1301
|
const {
|
|
@@ -1221,12 +1370,15 @@ function handleVirtualYVisible($xeTable) {
|
|
|
1221
1370
|
toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1;
|
|
1222
1371
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
1223
1372
|
} else {
|
|
1373
|
+
const {
|
|
1374
|
+
handleGetRowId
|
|
1375
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
1224
1376
|
let leftIndex = 0;
|
|
1225
1377
|
let rightIndex = afterFullData.length;
|
|
1226
1378
|
while (leftIndex < rightIndex) {
|
|
1227
1379
|
const rIndex = Math.floor((leftIndex + rightIndex) / 2);
|
|
1228
1380
|
const row = afterFullData[rIndex];
|
|
1229
|
-
const rowid = (
|
|
1381
|
+
const rowid = handleGetRowId(row);
|
|
1230
1382
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
1231
1383
|
if (rowRest.oTop <= startTop) {
|
|
1232
1384
|
leftIndex = rIndex + 1;
|
|
@@ -1237,7 +1389,7 @@ function handleVirtualYVisible($xeTable) {
|
|
|
1237
1389
|
toVisibleIndex = Math.max(0, leftIndex < afterFullData.length ? leftIndex - 2 : 0);
|
|
1238
1390
|
for (let rIndex = toVisibleIndex, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
1239
1391
|
const row = afterFullData[rIndex];
|
|
1240
|
-
const rowid = (
|
|
1392
|
+
const rowid = handleGetRowId(row);
|
|
1241
1393
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
1242
1394
|
visibleSize++;
|
|
1243
1395
|
if (rowRest.oTop > endTop || visibleSize >= 100) {
|
|
@@ -1276,12 +1428,16 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
|
|
|
1276
1428
|
}
|
|
1277
1429
|
}
|
|
1278
1430
|
}
|
|
1279
|
-
function setMerges(
|
|
1431
|
+
function setMerges($xeTable, merges, mList, rowList) {
|
|
1432
|
+
const props = $xeTable;
|
|
1433
|
+
const internalData = $xeTable;
|
|
1280
1434
|
if (merges) {
|
|
1281
1435
|
const {
|
|
1282
|
-
treeConfig
|
|
1436
|
+
treeConfig
|
|
1437
|
+
} = props;
|
|
1438
|
+
const {
|
|
1283
1439
|
visibleColumn
|
|
1284
|
-
} =
|
|
1440
|
+
} = internalData;
|
|
1285
1441
|
if (!_xeUtils.default.isArray(merges)) {
|
|
1286
1442
|
merges = [merges];
|
|
1287
1443
|
}
|
|
@@ -1331,13 +1487,17 @@ function setMerges(_vm, merges, mList, rowList) {
|
|
|
1331
1487
|
});
|
|
1332
1488
|
}
|
|
1333
1489
|
}
|
|
1334
|
-
function removeMerges(
|
|
1490
|
+
function removeMerges($xeTable, merges, mList, rowList) {
|
|
1491
|
+
const props = $xeTable;
|
|
1492
|
+
const internalData = $xeTable;
|
|
1335
1493
|
const rest = [];
|
|
1336
1494
|
if (merges) {
|
|
1337
1495
|
const {
|
|
1338
|
-
treeConfig
|
|
1496
|
+
treeConfig
|
|
1497
|
+
} = props;
|
|
1498
|
+
const {
|
|
1339
1499
|
visibleColumn
|
|
1340
|
-
} =
|
|
1500
|
+
} = internalData;
|
|
1341
1501
|
if (!_xeUtils.default.isArray(merges)) {
|
|
1342
1502
|
merges = [merges];
|
|
1343
1503
|
}
|
|
@@ -1534,6 +1694,7 @@ function autoCellWidth($xeTable) {
|
|
|
1534
1694
|
internalData.headerHeight = headerHeight;
|
|
1535
1695
|
internalData.footerHeight = footerHeight;
|
|
1536
1696
|
reactData.overflowX = overflowX;
|
|
1697
|
+
reactData.resizeWidthFlag++;
|
|
1537
1698
|
updateColumnOffsetLeft($xeTable);
|
|
1538
1699
|
updateHeight($xeTable);
|
|
1539
1700
|
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
|
|
@@ -1568,8 +1729,11 @@ const calcCellHeight = $xeTable => {
|
|
|
1568
1729
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
1569
1730
|
const el = $xeTable.$refs.refElem;
|
|
1570
1731
|
if (!isAllOverflow && scrollYLoad && el) {
|
|
1732
|
+
const {
|
|
1733
|
+
handleGetRowId
|
|
1734
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
1571
1735
|
tableData.forEach(row => {
|
|
1572
|
-
const rowid = (
|
|
1736
|
+
const rowid = handleGetRowId(row);
|
|
1573
1737
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
1574
1738
|
if (rowRest) {
|
|
1575
1739
|
const height = calcCellAutoHeight(rowRest, el);
|
|
@@ -1826,9 +1990,10 @@ function hideDropTip($xeTable) {
|
|
|
1826
1990
|
* @param {Event} evnt 事件
|
|
1827
1991
|
* @param {Row} row 行对象
|
|
1828
1992
|
*/
|
|
1829
|
-
function handleTooltip($xeTable, evnt, tdEl, overflowElem,
|
|
1993
|
+
function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
1830
1994
|
const reactData = $xeTable;
|
|
1831
|
-
|
|
1995
|
+
const tipOverEl = overflowElem || tdEl;
|
|
1996
|
+
if (!tipOverEl) {
|
|
1832
1997
|
return $xeTable.$nextTick();
|
|
1833
1998
|
}
|
|
1834
1999
|
params.cell = tdEl;
|
|
@@ -1846,9 +2011,8 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
|
1846
2011
|
} = tooltipOpts;
|
|
1847
2012
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
1848
2013
|
const useCustom = contentMethod && !_xeUtils.default.eqNull(customContent);
|
|
1849
|
-
const content = useCustom ? customContent : _xeUtils.default.toString(column.type === 'html' ?
|
|
1850
|
-
|
|
1851
|
-
if (content && (showAll || useCustom || isCellOverflow)) {
|
|
2014
|
+
const content = useCustom ? customContent : _xeUtils.default.toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
2015
|
+
if (content && (showAll || useCustom || tipOverEl.scrollWidth > tipOverEl.clientWidth)) {
|
|
1852
2016
|
Object.assign(tooltipStore, {
|
|
1853
2017
|
row,
|
|
1854
2018
|
column,
|
|
@@ -1858,7 +2022,7 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
|
1858
2022
|
$xeTable.$nextTick(() => {
|
|
1859
2023
|
const $tooltip = $xeTable.$refs.refTooltip;
|
|
1860
2024
|
if ($tooltip && $tooltip.open) {
|
|
1861
|
-
$tooltip.open(
|
|
2025
|
+
$tooltip.open(tipOverEl, (0, _utils.formatText)(content));
|
|
1862
2026
|
}
|
|
1863
2027
|
});
|
|
1864
2028
|
}
|
|
@@ -2069,10 +2233,8 @@ function parseColumns($xeTable, isReset) {
|
|
|
2069
2233
|
const props = $xeTable;
|
|
2070
2234
|
const reactData = $xeTable;
|
|
2071
2235
|
const internalData = $xeTable;
|
|
2072
|
-
const {
|
|
2073
|
-
|
|
2074
|
-
} = props;
|
|
2075
|
-
const rowOpts = $xeTable.computeRowOpts;
|
|
2236
|
+
// const { showOverflow } = props
|
|
2237
|
+
// const rowOpts = $xeTable.computeRowOpts
|
|
2076
2238
|
const leftList = [];
|
|
2077
2239
|
const centerList = [];
|
|
2078
2240
|
const rightList = [];
|
|
@@ -2149,28 +2311,28 @@ function parseColumns($xeTable, isReset) {
|
|
|
2149
2311
|
rightList
|
|
2150
2312
|
});
|
|
2151
2313
|
if (scrollXLoad) {
|
|
2152
|
-
if (showOverflow) {
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
}
|
|
2160
|
-
if (process.env.NODE_ENV === 'development') {
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
}
|
|
2314
|
+
// if (showOverflow) {
|
|
2315
|
+
// if (!rowOpts.height) {
|
|
2316
|
+
// const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
|
|
2317
|
+
// if (errColumn) {
|
|
2318
|
+
// errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
|
|
2319
|
+
// }
|
|
2320
|
+
// }
|
|
2321
|
+
// }
|
|
2322
|
+
// if (process.env.NODE_ENV === 'development') {
|
|
2323
|
+
// if (props.showHeader && !props.showHeaderOverflow) {
|
|
2324
|
+
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
2325
|
+
// }
|
|
2326
|
+
// if (props.showFooter && !props.showFooterOverflow) {
|
|
2327
|
+
// warnLog('vxe.error.reqProp', ['show-footer-overflow'])
|
|
2328
|
+
// }
|
|
2329
|
+
if (props.spanMethod) {
|
|
2330
|
+
(0, _log.warnLog)('vxe.error.scrollErrProp', ['span-method']);
|
|
2331
|
+
}
|
|
2332
|
+
if (props.footerSpanMethod) {
|
|
2333
|
+
(0, _log.warnLog)('vxe.error.scrollErrProp', ['footer-span-method']);
|
|
2334
|
+
}
|
|
2335
|
+
// }
|
|
2174
2336
|
if (isReset) {
|
|
2175
2337
|
const {
|
|
2176
2338
|
visibleSize
|
|
@@ -2307,6 +2469,39 @@ function loadScrollYData($xeTable) {
|
|
|
2307
2469
|
}
|
|
2308
2470
|
}
|
|
2309
2471
|
}
|
|
2472
|
+
const createGetRowCacheProp = prop => {
|
|
2473
|
+
return function (row) {
|
|
2474
|
+
const $xeTable = this;
|
|
2475
|
+
const internalData = $xeTable;
|
|
2476
|
+
const {
|
|
2477
|
+
fullAllDataRowIdData
|
|
2478
|
+
} = internalData;
|
|
2479
|
+
if (row) {
|
|
2480
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
2481
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
2482
|
+
if (rowRest) {
|
|
2483
|
+
return rowRest[prop];
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
return -1;
|
|
2487
|
+
};
|
|
2488
|
+
};
|
|
2489
|
+
const createGetColumnCacheProp = prop => {
|
|
2490
|
+
return function (column) {
|
|
2491
|
+
const $xeTable = this;
|
|
2492
|
+
const internalData = $xeTable;
|
|
2493
|
+
const {
|
|
2494
|
+
fullColumnIdData
|
|
2495
|
+
} = internalData;
|
|
2496
|
+
if (column) {
|
|
2497
|
+
const colRest = fullColumnIdData[column.id];
|
|
2498
|
+
if (colRest) {
|
|
2499
|
+
return colRest[prop];
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
return -1;
|
|
2503
|
+
};
|
|
2504
|
+
};
|
|
2310
2505
|
function lazyScrollXData($xeTable) {
|
|
2311
2506
|
const internalData = $xeTable;
|
|
2312
2507
|
const {
|
|
@@ -2478,7 +2673,7 @@ function calcCellWidth($xeTable) {
|
|
|
2478
2673
|
}
|
|
2479
2674
|
function handleUpdateColResize($xeTable, evnt, params) {
|
|
2480
2675
|
$xeTable.analyColumnWidth();
|
|
2481
|
-
$xeTable.recalculate(
|
|
2676
|
+
$xeTable.recalculate().then(() => {
|
|
2482
2677
|
$xeTable.saveCustomStore('update:width');
|
|
2483
2678
|
$xeTable.updateCellAreas();
|
|
2484
2679
|
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
@@ -2490,7 +2685,7 @@ function handleUpdateColResize($xeTable, evnt, params) {
|
|
|
2490
2685
|
function handleUpdateRowResize($xeTable, evnt, params) {
|
|
2491
2686
|
const reactData = $xeTable;
|
|
2492
2687
|
reactData.resizeHeightFlag++;
|
|
2493
|
-
$xeTable.recalculate(
|
|
2688
|
+
$xeTable.recalculate().then(() => {
|
|
2494
2689
|
$xeTable.updateCellAreas();
|
|
2495
2690
|
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
2496
2691
|
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
@@ -2515,21 +2710,24 @@ function updateRowOffsetTop($xeTable) {
|
|
|
2515
2710
|
const reactData = $xeTable;
|
|
2516
2711
|
const internalData = $xeTable;
|
|
2517
2712
|
const {
|
|
2518
|
-
expandColumn
|
|
2519
|
-
rowExpandedMaps
|
|
2713
|
+
expandColumn
|
|
2520
2714
|
} = reactData;
|
|
2521
2715
|
const {
|
|
2522
2716
|
afterFullData,
|
|
2523
|
-
fullAllDataRowIdData
|
|
2717
|
+
fullAllDataRowIdData,
|
|
2718
|
+
rowExpandedMaps
|
|
2524
2719
|
} = internalData;
|
|
2525
2720
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
2526
2721
|
const rowOpts = $xeTable.computeRowOpts;
|
|
2527
2722
|
const cellOpts = $xeTable.computeCellOpts;
|
|
2528
2723
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
2724
|
+
const {
|
|
2725
|
+
handleGetRowId
|
|
2726
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
2529
2727
|
let offsetTop = 0;
|
|
2530
2728
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
2531
2729
|
const row = afterFullData[rIndex];
|
|
2532
|
-
const rowid = (
|
|
2730
|
+
const rowid = handleGetRowId(row);
|
|
2533
2731
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
2534
2732
|
rowRest.oTop = offsetTop;
|
|
2535
2733
|
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
@@ -2545,7 +2743,8 @@ function updateRowExpandStyle($xeTable) {
|
|
|
2545
2743
|
const {
|
|
2546
2744
|
expandColumn,
|
|
2547
2745
|
scrollYLoad,
|
|
2548
|
-
|
|
2746
|
+
scrollYTop,
|
|
2747
|
+
isScrollYBig
|
|
2549
2748
|
} = reactData;
|
|
2550
2749
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
2551
2750
|
const rowOpts = $xeTable.computeRowOpts;
|
|
@@ -2557,41 +2756,35 @@ function updateRowExpandStyle($xeTable) {
|
|
|
2557
2756
|
if (expandColumn && mode === 'fixed') {
|
|
2558
2757
|
const {
|
|
2559
2758
|
elemStore,
|
|
2560
|
-
afterFullData,
|
|
2561
2759
|
fullAllDataRowIdData
|
|
2562
2760
|
} = internalData;
|
|
2563
2761
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
2564
2762
|
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
2565
2763
|
if (rowExpandEl && bodyScrollElem) {
|
|
2566
2764
|
let isUpdateHeight = false;
|
|
2567
|
-
if (scrollYLoad) {
|
|
2568
|
-
let offsetTop = 0;
|
|
2569
|
-
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
2570
|
-
const row = afterFullData[rIndex];
|
|
2571
|
-
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
2572
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
2573
|
-
rowRest.oTop = offsetTop;
|
|
2574
|
-
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
2575
|
-
// 是否展开行
|
|
2576
|
-
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
2577
|
-
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
2765
|
_xeUtils.default.arrayEach(rowExpandEl.children, reEl => {
|
|
2582
2766
|
const expandEl = reEl;
|
|
2583
2767
|
const rowid = expandEl.getAttribute('rowid') || '';
|
|
2584
2768
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2585
2769
|
if (rowRest) {
|
|
2586
2770
|
const expandHeight = expandEl.offsetHeight + 1;
|
|
2771
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
2772
|
+
let offsetTop = 0;
|
|
2587
2773
|
if (scrollYLoad) {
|
|
2588
|
-
|
|
2774
|
+
if (isScrollYBig && trEl) {
|
|
2775
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight;
|
|
2776
|
+
} else {
|
|
2777
|
+
offsetTop = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
2778
|
+
}
|
|
2589
2779
|
} else {
|
|
2590
|
-
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
2591
2780
|
if (trEl) {
|
|
2592
|
-
|
|
2781
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight;
|
|
2593
2782
|
}
|
|
2594
2783
|
}
|
|
2784
|
+
if (isScrollYBig) {
|
|
2785
|
+
offsetTop += scrollYTop;
|
|
2786
|
+
}
|
|
2787
|
+
expandEl.style.top = (0, _dom.toCssUnit)(offsetTop);
|
|
2595
2788
|
if (!isUpdateHeight) {
|
|
2596
2789
|
if (rowRest.expandHeight !== expandHeight) {
|
|
2597
2790
|
isUpdateHeight = true;
|
|
@@ -2602,6 +2795,9 @@ function updateRowExpandStyle($xeTable) {
|
|
|
2602
2795
|
});
|
|
2603
2796
|
if (isUpdateHeight) {
|
|
2604
2797
|
reactData.rowExpandHeightFlag++;
|
|
2798
|
+
$xeTable.$nextTick(() => {
|
|
2799
|
+
updateRowOffsetTop($xeTable);
|
|
2800
|
+
});
|
|
2605
2801
|
}
|
|
2606
2802
|
}
|
|
2607
2803
|
}
|
|
@@ -2619,12 +2815,11 @@ function handleRowExpandScroll($xeTable) {
|
|
|
2619
2815
|
}
|
|
2620
2816
|
const Methods = {
|
|
2621
2817
|
callSlot(slotFunc, params, h, vNodes) {
|
|
2818
|
+
const $xeTable = this;
|
|
2819
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
2622
2820
|
if (slotFunc) {
|
|
2623
|
-
|
|
2624
|
-
$
|
|
2625
|
-
} = this;
|
|
2626
|
-
if ($xegrid) {
|
|
2627
|
-
return $xegrid.callSlot(slotFunc, params, h, vNodes);
|
|
2821
|
+
if ($xeGrid) {
|
|
2822
|
+
return $xeGrid.callSlot(slotFunc, params, h, vNodes);
|
|
2628
2823
|
}
|
|
2629
2824
|
if (_xeUtils.default.isFunction(slotFunc)) {
|
|
2630
2825
|
return (0, _vn.getSlotVNs)(slotFunc.call(this, params, h, vNodes));
|
|
@@ -2640,11 +2835,12 @@ const Methods = {
|
|
|
2640
2835
|
* 获取父容器元素
|
|
2641
2836
|
*/
|
|
2642
2837
|
getParentElem() {
|
|
2838
|
+
const $xeTable = this;
|
|
2839
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
2643
2840
|
const {
|
|
2644
|
-
$el
|
|
2645
|
-
$xegrid
|
|
2841
|
+
$el
|
|
2646
2842
|
} = this;
|
|
2647
|
-
return $
|
|
2843
|
+
return $xeGrid ? $xeGrid.$el.parentNode : $el.parentNode;
|
|
2648
2844
|
},
|
|
2649
2845
|
/**
|
|
2650
2846
|
* 获取父容器的高度
|
|
@@ -2678,10 +2874,9 @@ const Methods = {
|
|
|
2678
2874
|
* 如果存在表尾合计滚动条,则需要排除滚动条高度
|
|
2679
2875
|
*/
|
|
2680
2876
|
getExcludeHeight() {
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
return $xegrid ? $xegrid.getExcludeHeight() : 0;
|
|
2877
|
+
const $xeTable = this;
|
|
2878
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
2879
|
+
return $xeGrid ? $xeGrid.getExcludeHeight() : 0;
|
|
2685
2880
|
},
|
|
2686
2881
|
/**
|
|
2687
2882
|
* 重置表格的一切数据状态
|
|
@@ -2780,6 +2975,9 @@ const Methods = {
|
|
|
2780
2975
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2781
2976
|
let treeData = [];
|
|
2782
2977
|
let fullData = datas ? datas.slice(0) : [];
|
|
2978
|
+
if (fullData.length > supportMaxRow) {
|
|
2979
|
+
(0, _log.errLog)('vxe.error.errMaxRow', [supportMaxRow]);
|
|
2980
|
+
}
|
|
2783
2981
|
if (treeConfig) {
|
|
2784
2982
|
// 树结构自动转换
|
|
2785
2983
|
if (treeOpts.transform) {
|
|
@@ -3022,13 +3220,11 @@ const Methods = {
|
|
|
3022
3220
|
const {
|
|
3023
3221
|
treeConfig
|
|
3024
3222
|
} = props;
|
|
3025
|
-
const {
|
|
3026
|
-
treeExpandedMaps
|
|
3027
|
-
} = reactData;
|
|
3028
3223
|
const {
|
|
3029
3224
|
fullAllDataRowIdData,
|
|
3030
3225
|
tableFullData,
|
|
3031
|
-
tableFullTreeData
|
|
3226
|
+
tableFullTreeData,
|
|
3227
|
+
treeExpandedMaps
|
|
3032
3228
|
} = internalData;
|
|
3033
3229
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3034
3230
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -3036,12 +3232,11 @@ const Methods = {
|
|
|
3036
3232
|
const {
|
|
3037
3233
|
lazy
|
|
3038
3234
|
} = treeOpts;
|
|
3039
|
-
const rowkey = (0, _util.getRowkey)($xeTable);
|
|
3040
|
-
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
3041
3235
|
const fullAllDataRowIdMaps = Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
|
|
3042
3236
|
const fullDataRowIdMaps = {};
|
|
3043
|
-
const
|
|
3044
|
-
|
|
3237
|
+
const {
|
|
3238
|
+
handleUpdateRowId
|
|
3239
|
+
} = (0, _util.createHandleUpdateRowId)($xeTable);
|
|
3045
3240
|
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
3046
3241
|
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
3047
3242
|
if (!rowRest) {
|
|
@@ -3075,15 +3270,14 @@ const Methods = {
|
|
|
3075
3270
|
};
|
|
3076
3271
|
if (treeConfig) {
|
|
3077
3272
|
_xeUtils.default.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
3078
|
-
const rowid =
|
|
3273
|
+
const rowid = handleUpdateRowId(row);
|
|
3079
3274
|
if (treeConfig && lazy) {
|
|
3080
|
-
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
3081
3275
|
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
3082
3276
|
row[childrenField] = null;
|
|
3083
3277
|
}
|
|
3084
|
-
if (
|
|
3278
|
+
if (treeExpandedMaps[rowid]) {
|
|
3085
3279
|
if (!row[childrenField] || !row[childrenField].length) {
|
|
3086
|
-
delete
|
|
3280
|
+
delete treeExpandedMaps[rowid];
|
|
3087
3281
|
}
|
|
3088
3282
|
}
|
|
3089
3283
|
}
|
|
@@ -3093,12 +3287,12 @@ const Methods = {
|
|
|
3093
3287
|
});
|
|
3094
3288
|
} else {
|
|
3095
3289
|
tableFullData.forEach((row, index, items) => {
|
|
3096
|
-
handleRowCache(row, index, items, index, null,
|
|
3290
|
+
handleRowCache(row, index, items, index, null, handleUpdateRowId(row), 0, index + 1);
|
|
3097
3291
|
});
|
|
3098
3292
|
}
|
|
3099
3293
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
3100
3294
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
3101
|
-
reactData.
|
|
3295
|
+
reactData.treeExpandedFlag++;
|
|
3102
3296
|
},
|
|
3103
3297
|
cacheSourceMap(fullData) {
|
|
3104
3298
|
const $xeTable = this;
|
|
@@ -3108,19 +3302,14 @@ const Methods = {
|
|
|
3108
3302
|
treeConfig
|
|
3109
3303
|
} = props;
|
|
3110
3304
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3111
|
-
let {
|
|
3112
|
-
sourceDataRowIdData
|
|
3113
|
-
} = internalData;
|
|
3114
3305
|
const sourceData = _xeUtils.default.clone(fullData, true);
|
|
3115
|
-
const
|
|
3116
|
-
|
|
3306
|
+
const {
|
|
3307
|
+
handleUpdateRowId
|
|
3308
|
+
} = (0, _util.createHandleUpdateRowId)($xeTable);
|
|
3309
|
+
const sourceRowIdData = {};
|
|
3117
3310
|
const handleSourceRow = row => {
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
rowid = (0, _util.getRowUniqueId)();
|
|
3121
|
-
_xeUtils.default.set(row, rowkey, rowid);
|
|
3122
|
-
}
|
|
3123
|
-
sourceDataRowIdData[rowid] = row;
|
|
3311
|
+
const rowid = handleUpdateRowId(row);
|
|
3312
|
+
sourceRowIdData[rowid] = row;
|
|
3124
3313
|
};
|
|
3125
3314
|
// 源数据缓存
|
|
3126
3315
|
if (treeConfig) {
|
|
@@ -3131,6 +3320,7 @@ const Methods = {
|
|
|
3131
3320
|
} else {
|
|
3132
3321
|
sourceData.forEach(handleSourceRow);
|
|
3133
3322
|
}
|
|
3323
|
+
internalData.sourceDataRowIdData = sourceRowIdData;
|
|
3134
3324
|
internalData.tableSourceData = sourceData;
|
|
3135
3325
|
},
|
|
3136
3326
|
getParams() {
|
|
@@ -3251,76 +3441,28 @@ const Methods = {
|
|
|
3251
3441
|
* 根据 row 获取序号
|
|
3252
3442
|
* @param {Row} row 行对象
|
|
3253
3443
|
*/
|
|
3254
|
-
getRowSeq(
|
|
3255
|
-
const {
|
|
3256
|
-
fullAllDataRowIdData
|
|
3257
|
-
} = this;
|
|
3258
|
-
if (row) {
|
|
3259
|
-
const rowid = (0, _util.getRowid)(this, row);
|
|
3260
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
3261
|
-
if (rest) {
|
|
3262
|
-
return rest.seq;
|
|
3263
|
-
}
|
|
3264
|
-
}
|
|
3265
|
-
return -1;
|
|
3266
|
-
},
|
|
3444
|
+
getRowSeq: createGetRowCacheProp('seq'),
|
|
3267
3445
|
/**
|
|
3268
3446
|
* 根据 row 获取相对于 data 中的索引
|
|
3269
3447
|
* @param {Row} row 行对象
|
|
3270
3448
|
*/
|
|
3271
|
-
getRowIndex(
|
|
3272
|
-
const {
|
|
3273
|
-
fullAllDataRowIdData
|
|
3274
|
-
} = this;
|
|
3275
|
-
if (row) {
|
|
3276
|
-
const rowid = (0, _util.getRowid)(this, row);
|
|
3277
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
3278
|
-
if (rest) {
|
|
3279
|
-
return rest.index;
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
return -1;
|
|
3283
|
-
},
|
|
3449
|
+
getRowIndex: createGetRowCacheProp('index'),
|
|
3284
3450
|
/**
|
|
3285
3451
|
* 根据 row 获取相对于当前数据中的索引
|
|
3286
|
-
* @param {Row} row 行对象
|
|
3287
|
-
*/
|
|
3288
|
-
getVTRowIndex(
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
}
|
|
3299
|
-
return -1;
|
|
3300
|
-
},
|
|
3301
|
-
// 在 v3 中废弃
|
|
3302
|
-
_getRowIndex(row) {
|
|
3303
|
-
if (process.env.NODE_ENV === 'development') {
|
|
3304
|
-
(0, _log.warnLog)('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
|
|
3305
|
-
}
|
|
3306
|
-
return this.getVTRowIndex(row);
|
|
3307
|
-
},
|
|
3308
|
-
/**
|
|
3309
|
-
* 根据 row 获取渲染中的虚拟索引
|
|
3310
|
-
* @param {Row} row 行对象
|
|
3311
|
-
*/
|
|
3312
|
-
getVMRowIndex(row) {
|
|
3313
|
-
const {
|
|
3314
|
-
fullAllDataRowIdData
|
|
3315
|
-
} = this;
|
|
3316
|
-
if (row) {
|
|
3317
|
-
const rowid = (0, _util.getRowid)(this, row);
|
|
3318
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
3319
|
-
if (rest) {
|
|
3320
|
-
return rest.$index;
|
|
3321
|
-
}
|
|
3452
|
+
* @param {Row} row 行对象
|
|
3453
|
+
*/
|
|
3454
|
+
getVTRowIndex: createGetRowCacheProp('_index'),
|
|
3455
|
+
/**
|
|
3456
|
+
* 根据 row 获取渲染中的虚拟索引
|
|
3457
|
+
* @param {Row} row 行对象
|
|
3458
|
+
*/
|
|
3459
|
+
getVMRowIndex: createGetRowCacheProp('$index'),
|
|
3460
|
+
// 在 v3 中废弃
|
|
3461
|
+
_getRowIndex(row) {
|
|
3462
|
+
if (process.env.NODE_ENV === 'development') {
|
|
3463
|
+
(0, _log.warnLog)('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
|
|
3322
3464
|
}
|
|
3323
|
-
return
|
|
3465
|
+
return this.getVTRowIndex(row);
|
|
3324
3466
|
},
|
|
3325
3467
|
// 在 v3 中废弃
|
|
3326
3468
|
$getRowIndex(row) {
|
|
@@ -3333,34 +3475,17 @@ const Methods = {
|
|
|
3333
3475
|
* 根据 column 获取相对于 columns 中的索引
|
|
3334
3476
|
* @param {ColumnInfo} column 列配置
|
|
3335
3477
|
*/
|
|
3336
|
-
getColumnIndex(
|
|
3337
|
-
const {
|
|
3338
|
-
fullColumnIdData
|
|
3339
|
-
} = this;
|
|
3340
|
-
if (column) {
|
|
3341
|
-
const rest = fullColumnIdData[column.id];
|
|
3342
|
-
if (rest) {
|
|
3343
|
-
return rest.index;
|
|
3344
|
-
}
|
|
3345
|
-
}
|
|
3346
|
-
return -1;
|
|
3347
|
-
},
|
|
3478
|
+
getColumnIndex: createGetColumnCacheProp('index'),
|
|
3348
3479
|
/**
|
|
3349
3480
|
* 根据 column 获取相对于当前表格列中的索引
|
|
3350
3481
|
* @param {ColumnInfo} column 列配置
|
|
3351
3482
|
*/
|
|
3352
|
-
getVTColumnIndex(
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
if (rest) {
|
|
3359
|
-
return rest._index;
|
|
3360
|
-
}
|
|
3361
|
-
}
|
|
3362
|
-
return -1;
|
|
3363
|
-
},
|
|
3483
|
+
getVTColumnIndex: createGetColumnCacheProp('_index'),
|
|
3484
|
+
/**
|
|
3485
|
+
* 根据 column 获取渲染中的虚拟索引
|
|
3486
|
+
* @param {ColumnInfo} column 列配置
|
|
3487
|
+
*/
|
|
3488
|
+
getVMColumnIndex: createGetColumnCacheProp('$index'),
|
|
3364
3489
|
// 在 v3 中废弃
|
|
3365
3490
|
_getColumnIndex(column) {
|
|
3366
3491
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -3368,22 +3493,6 @@ const Methods = {
|
|
|
3368
3493
|
}
|
|
3369
3494
|
return this.getVTColumnIndex(column);
|
|
3370
3495
|
},
|
|
3371
|
-
/**
|
|
3372
|
-
* 根据 column 获取渲染中的虚拟索引
|
|
3373
|
-
* @param {ColumnInfo} column 列配置
|
|
3374
|
-
*/
|
|
3375
|
-
getVMColumnIndex(column) {
|
|
3376
|
-
const {
|
|
3377
|
-
fullColumnIdData
|
|
3378
|
-
} = this;
|
|
3379
|
-
if (column) {
|
|
3380
|
-
const rest = fullColumnIdData[column.id];
|
|
3381
|
-
if (rest) {
|
|
3382
|
-
return rest.$index;
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
return -1;
|
|
3386
|
-
},
|
|
3387
3496
|
// 在 v3 中废弃
|
|
3388
3497
|
$getColumnIndex(column) {
|
|
3389
3498
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -3508,6 +3617,9 @@ const Methods = {
|
|
|
3508
3617
|
const {
|
|
3509
3618
|
transform
|
|
3510
3619
|
} = treeOpts;
|
|
3620
|
+
const {
|
|
3621
|
+
handleGetRowId
|
|
3622
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
3511
3623
|
if (!keepSource) {
|
|
3512
3624
|
if (process.env.NODE_ENV === 'development') {
|
|
3513
3625
|
(0, _log.errLog)('vxe.error.reqProp', ['keep-source']);
|
|
@@ -3525,7 +3637,7 @@ const Methods = {
|
|
|
3525
3637
|
let reDelFlag = false;
|
|
3526
3638
|
if (targetRows.length) {
|
|
3527
3639
|
targetRows.forEach(item => {
|
|
3528
|
-
const rowid = (
|
|
3640
|
+
const rowid = handleGetRowId(item);
|
|
3529
3641
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
3530
3642
|
if (rowRest) {
|
|
3531
3643
|
const row = rowRest.row;
|
|
@@ -3947,21 +4059,18 @@ const Methods = {
|
|
|
3947
4059
|
getCheckboxRecords(isFull) {
|
|
3948
4060
|
const $xeTable = this;
|
|
3949
4061
|
const props = $xeTable;
|
|
3950
|
-
const reactData = $xeTable;
|
|
3951
4062
|
const internalData = $xeTable;
|
|
3952
4063
|
const {
|
|
3953
4064
|
treeConfig
|
|
3954
4065
|
} = props;
|
|
3955
|
-
const {
|
|
3956
|
-
selectCheckboxMaps
|
|
3957
|
-
} = reactData;
|
|
3958
4066
|
const {
|
|
3959
4067
|
tableFullData,
|
|
3960
4068
|
afterFullData,
|
|
3961
4069
|
afterTreeFullData,
|
|
3962
4070
|
tableFullTreeData,
|
|
3963
4071
|
fullDataRowIdData,
|
|
3964
|
-
afterFullRowMaps
|
|
4072
|
+
afterFullRowMaps,
|
|
4073
|
+
selectCheckboxMaps
|
|
3965
4074
|
} = internalData;
|
|
3966
4075
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3967
4076
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
@@ -4026,6 +4135,7 @@ const Methods = {
|
|
|
4026
4135
|
mapChildrenField
|
|
4027
4136
|
} = treeOpts;
|
|
4028
4137
|
const {
|
|
4138
|
+
isEvery,
|
|
4029
4139
|
remote: allRemoteFilter,
|
|
4030
4140
|
filterMethod: allFilterMethod
|
|
4031
4141
|
} = filterOpts;
|
|
@@ -4138,7 +4248,7 @@ const Methods = {
|
|
|
4138
4248
|
// 筛选虚拟树
|
|
4139
4249
|
tableTree = _xeUtils.default.searchTree(tableFullTreeData, handleFilter, {
|
|
4140
4250
|
original: true,
|
|
4141
|
-
isEvery
|
|
4251
|
+
isEvery,
|
|
4142
4252
|
children: mapChildrenField,
|
|
4143
4253
|
mapChildren: childrenField
|
|
4144
4254
|
});
|
|
@@ -4152,7 +4262,7 @@ const Methods = {
|
|
|
4152
4262
|
// 还原虚拟树
|
|
4153
4263
|
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
4154
4264
|
original: true,
|
|
4155
|
-
isEvery
|
|
4265
|
+
isEvery,
|
|
4156
4266
|
children: mapChildrenField,
|
|
4157
4267
|
mapChildren: childrenField
|
|
4158
4268
|
});
|
|
@@ -4229,7 +4339,7 @@ const Methods = {
|
|
|
4229
4339
|
// 还原虚拟树
|
|
4230
4340
|
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
4231
4341
|
original: true,
|
|
4232
|
-
isEvery
|
|
4342
|
+
isEvery,
|
|
4233
4343
|
children: treeOpts.mapChildrenField,
|
|
4234
4344
|
mapChildren: childrenField
|
|
4235
4345
|
});
|
|
@@ -4403,6 +4513,7 @@ const Methods = {
|
|
|
4403
4513
|
* 默认执行一次,除非被重置
|
|
4404
4514
|
*/
|
|
4405
4515
|
handleLoadDefaults() {
|
|
4516
|
+
const $xeTable = this;
|
|
4406
4517
|
if (this.checkboxConfig) {
|
|
4407
4518
|
this.handleDefaultSelectionChecked();
|
|
4408
4519
|
}
|
|
@@ -4413,7 +4524,7 @@ const Methods = {
|
|
|
4413
4524
|
this.handleDefaultRowExpand();
|
|
4414
4525
|
}
|
|
4415
4526
|
if (this.treeConfig) {
|
|
4416
|
-
|
|
4527
|
+
handleDefaultTreeExpand($xeTable);
|
|
4417
4528
|
}
|
|
4418
4529
|
if (this.mergeCells) {
|
|
4419
4530
|
this.handleDefaultMergeCells();
|
|
@@ -4611,9 +4722,9 @@ const Methods = {
|
|
|
4611
4722
|
return this.refreshColumn(true);
|
|
4612
4723
|
},
|
|
4613
4724
|
handleCustomRestore(storeData) {
|
|
4614
|
-
const $
|
|
4615
|
-
const reactData = $
|
|
4616
|
-
const internalData = $
|
|
4725
|
+
const $xeTable = this;
|
|
4726
|
+
const reactData = $xeTable;
|
|
4727
|
+
const internalData = $xeTable;
|
|
4617
4728
|
let {
|
|
4618
4729
|
collectColumn
|
|
4619
4730
|
} = internalData;
|
|
@@ -4698,14 +4809,26 @@ const Methods = {
|
|
|
4698
4809
|
}
|
|
4699
4810
|
},
|
|
4700
4811
|
getCustomStoreData() {
|
|
4812
|
+
const $xeTable = this;
|
|
4813
|
+
const props = $xeTable;
|
|
4814
|
+
const internalData = $xeTable;
|
|
4815
|
+
const {
|
|
4816
|
+
id
|
|
4817
|
+
} = props;
|
|
4818
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
4701
4819
|
const {
|
|
4702
|
-
id,
|
|
4703
|
-
customOpts,
|
|
4704
4820
|
collectColumn
|
|
4705
|
-
} =
|
|
4821
|
+
} = internalData;
|
|
4706
4822
|
const {
|
|
4823
|
+
storage,
|
|
4707
4824
|
checkMethod
|
|
4708
4825
|
} = customOpts;
|
|
4826
|
+
const isAllCustom = storage === true;
|
|
4827
|
+
const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
|
|
4828
|
+
const isCustomResizable = isAllCustom || storageOpts.resizable;
|
|
4829
|
+
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
4830
|
+
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
4831
|
+
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
4709
4832
|
const resizableData = {};
|
|
4710
4833
|
const sortData = {};
|
|
4711
4834
|
const visibleData = {};
|
|
@@ -4722,48 +4845,38 @@ const Methods = {
|
|
|
4722
4845
|
}
|
|
4723
4846
|
let hasResizable = 0;
|
|
4724
4847
|
let hasSort = 0;
|
|
4725
|
-
let
|
|
4848
|
+
let hasFixed = 0;
|
|
4726
4849
|
let hasVisible = 0;
|
|
4727
4850
|
_xeUtils.default.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
4851
|
+
const colKey = column.getKey();
|
|
4852
|
+
if (!colKey) {
|
|
4853
|
+
(0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
|
|
4854
|
+
return;
|
|
4855
|
+
}
|
|
4728
4856
|
// 只支持一级
|
|
4729
4857
|
if (!parentColumn) {
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
hasSort = 1;
|
|
4734
|
-
sortData[colKey] = column.renderSortNumber;
|
|
4735
|
-
}
|
|
4736
|
-
});
|
|
4737
|
-
if (column.fixed !== column.defaultFixed) {
|
|
4738
|
-
const colKey = column.getKey();
|
|
4739
|
-
if (colKey) {
|
|
4740
|
-
hasFixedt = 1;
|
|
4741
|
-
fixedData[colKey] = column.fixed;
|
|
4742
|
-
}
|
|
4858
|
+
if (isCustomSort) {
|
|
4859
|
+
hasSort = 1;
|
|
4860
|
+
sortData[colKey] = column.renderSortNumber;
|
|
4743
4861
|
}
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
if (colKey) {
|
|
4748
|
-
hasResizable = 1;
|
|
4749
|
-
resizableData[colKey] = column.renderWidth;
|
|
4862
|
+
if (isCustomFixed && column.fixed !== column.defaultFixed) {
|
|
4863
|
+
hasFixed = 1;
|
|
4864
|
+
fixedData[colKey] = column.fixed;
|
|
4750
4865
|
}
|
|
4751
4866
|
}
|
|
4752
|
-
if (
|
|
4867
|
+
if (isCustomResizable && column.resizeWidth) {
|
|
4868
|
+
hasResizable = 1;
|
|
4869
|
+
resizableData[colKey] = column.renderWidth;
|
|
4870
|
+
}
|
|
4871
|
+
if (isCustomVisible && (!checkMethod || checkMethod({
|
|
4753
4872
|
column
|
|
4754
|
-
})) {
|
|
4873
|
+
}))) {
|
|
4755
4874
|
if (!column.visible && column.defaultVisible) {
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
hasVisible = 1;
|
|
4759
|
-
visibleData[colKey] = false;
|
|
4760
|
-
}
|
|
4875
|
+
hasVisible = 1;
|
|
4876
|
+
visibleData[colKey] = false;
|
|
4761
4877
|
} else if (column.visible && !column.defaultVisible) {
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
hasVisible = 1;
|
|
4765
|
-
visibleData[colKey] = true;
|
|
4766
|
-
}
|
|
4878
|
+
hasVisible = 1;
|
|
4879
|
+
visibleData[colKey] = true;
|
|
4767
4880
|
}
|
|
4768
4881
|
}
|
|
4769
4882
|
});
|
|
@@ -4773,7 +4886,7 @@ const Methods = {
|
|
|
4773
4886
|
if (hasSort) {
|
|
4774
4887
|
storeData.sortData = sortData;
|
|
4775
4888
|
}
|
|
4776
|
-
if (
|
|
4889
|
+
if (hasFixed) {
|
|
4777
4890
|
storeData.fixedData = fixedData;
|
|
4778
4891
|
}
|
|
4779
4892
|
if (hasVisible) {
|
|
@@ -5321,12 +5434,15 @@ const Methods = {
|
|
|
5321
5434
|
fullAllDataRowIdData,
|
|
5322
5435
|
afterFullData
|
|
5323
5436
|
} = internalData;
|
|
5437
|
+
const {
|
|
5438
|
+
handleGetRowId
|
|
5439
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
5324
5440
|
const rowOpts = $xeTable.computeRowOpts;
|
|
5325
5441
|
const cellOpts = $xeTable.computeCellOpts;
|
|
5326
5442
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
5327
5443
|
const rest = {};
|
|
5328
5444
|
afterFullData.forEach(row => {
|
|
5329
|
-
const rowid = (
|
|
5445
|
+
const rowid = handleGetRowId(row);
|
|
5330
5446
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5331
5447
|
if (rowRest) {
|
|
5332
5448
|
const resizeHeight = rowRest.resizeHeight;
|
|
@@ -5355,8 +5471,11 @@ const Methods = {
|
|
|
5355
5471
|
rHeight = Math.floor(rHeight * bodyHeight);
|
|
5356
5472
|
}
|
|
5357
5473
|
if (rHeight) {
|
|
5474
|
+
const {
|
|
5475
|
+
handleGetRowId
|
|
5476
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
5358
5477
|
rows.forEach(row => {
|
|
5359
|
-
const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : (
|
|
5478
|
+
const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : handleGetRowId(row);
|
|
5360
5479
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5361
5480
|
if (rowRest) {
|
|
5362
5481
|
rowRest.resizeHeight = rHeight;
|
|
@@ -5504,6 +5623,8 @@ const Methods = {
|
|
|
5504
5623
|
}
|
|
5505
5624
|
},
|
|
5506
5625
|
preventEvent(evnt, type, args, next, end) {
|
|
5626
|
+
const $xeTable = this;
|
|
5627
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
5507
5628
|
let evntList = interceptor.get(type);
|
|
5508
5629
|
// 兼容老版本
|
|
5509
5630
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
@@ -5515,12 +5636,25 @@ const Methods = {
|
|
|
5515
5636
|
}
|
|
5516
5637
|
}
|
|
5517
5638
|
// 兼容老版本
|
|
5518
|
-
let rest;
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5639
|
+
let rest = null;
|
|
5640
|
+
let isStop = false;
|
|
5641
|
+
for (let i = 0; i < evntList.length; i++) {
|
|
5642
|
+
const func = evntList[i];
|
|
5643
|
+
const fnRest = func(Object.assign({
|
|
5644
|
+
$grid: $xeGrid,
|
|
5645
|
+
$table: $xeTable,
|
|
5646
|
+
$event: evnt
|
|
5647
|
+
}, args));
|
|
5648
|
+
if (fnRest === false) {
|
|
5649
|
+
isStop = true;
|
|
5650
|
+
break;
|
|
5651
|
+
} else if (fnRest && fnRest.status === false) {
|
|
5652
|
+
rest = fnRest.result;
|
|
5653
|
+
isStop = true;
|
|
5654
|
+
break;
|
|
5655
|
+
}
|
|
5656
|
+
}
|
|
5657
|
+
if (!isStop) {
|
|
5524
5658
|
if (next) {
|
|
5525
5659
|
rest = next();
|
|
5526
5660
|
}
|
|
@@ -5534,10 +5668,11 @@ const Methods = {
|
|
|
5534
5668
|
* 全局按下事件处理
|
|
5535
5669
|
*/
|
|
5536
5670
|
handleGlobalMousedownEvent(evnt) {
|
|
5671
|
+
const $xeTable = this;
|
|
5672
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
5537
5673
|
const {
|
|
5538
5674
|
$el,
|
|
5539
5675
|
$refs,
|
|
5540
|
-
$xegrid,
|
|
5541
5676
|
$toolbar,
|
|
5542
5677
|
mouseConfig,
|
|
5543
5678
|
editStore,
|
|
@@ -5637,7 +5772,7 @@ const Methods = {
|
|
|
5637
5772
|
}
|
|
5638
5773
|
}
|
|
5639
5774
|
} else if (mouseConfig) {
|
|
5640
|
-
if (!(0, _dom.getEventTargetNode)(evnt, $el).flag && !($
|
|
5775
|
+
if (!(0, _dom.getEventTargetNode)(evnt, $el).flag && !($xeGrid && (0, _dom.getEventTargetNode)(evnt, $xeGrid.$el).flag) && !(tableMenu && (0, _dom.getEventTargetNode)(evnt, tableMenu.$el).flag) && !($toolbar && (0, _dom.getEventTargetNode)(evnt, $toolbar.$el).flag)) {
|
|
5641
5776
|
if (this.clearSelected) {
|
|
5642
5777
|
this.clearSelected();
|
|
5643
5778
|
}
|
|
@@ -5661,7 +5796,7 @@ const Methods = {
|
|
|
5661
5796
|
if (ctxMenuStore.visible && tableMenu && !(0, _dom.getEventTargetNode)(evnt, tableMenu.$el).flag) {
|
|
5662
5797
|
this.closeMenu();
|
|
5663
5798
|
}
|
|
5664
|
-
const isActivated = (0, _dom.getEventTargetNode)(evnt, ($
|
|
5799
|
+
const isActivated = (0, _dom.getEventTargetNode)(evnt, ($xeGrid || this).$el).flag;
|
|
5665
5800
|
// 如果存在校验,点击了表格之外则清除
|
|
5666
5801
|
if (!isActivated && editRules && validOpts.autoClear) {
|
|
5667
5802
|
this.validErrorMaps = {};
|
|
@@ -5736,6 +5871,7 @@ const Methods = {
|
|
|
5736
5871
|
handleGlobalKeydownEvent(evnt) {
|
|
5737
5872
|
const $xeTable = this;
|
|
5738
5873
|
const internalData = $xeTable;
|
|
5874
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
5739
5875
|
// 该行为只对当前激活的表格有效
|
|
5740
5876
|
if (this.isActivated) {
|
|
5741
5877
|
this.preventEvent(evnt, 'event.keydown', null, () => {
|
|
@@ -5853,7 +5989,7 @@ const Methods = {
|
|
|
5853
5989
|
if (keyboardOpts.enterToTab) {
|
|
5854
5990
|
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
5855
5991
|
} else {
|
|
5856
|
-
this.
|
|
5992
|
+
this.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
5857
5993
|
}
|
|
5858
5994
|
} else {
|
|
5859
5995
|
if (keyboardOpts.enterToTab) {
|
|
@@ -5889,7 +6025,7 @@ const Methods = {
|
|
|
5889
6025
|
return;
|
|
5890
6026
|
}
|
|
5891
6027
|
}
|
|
5892
|
-
this.
|
|
6028
|
+
this.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
5893
6029
|
if (enterMethod) {
|
|
5894
6030
|
enterMethod(etrParams);
|
|
5895
6031
|
}
|
|
@@ -5914,10 +6050,7 @@ const Methods = {
|
|
|
5914
6050
|
if (!isEditStatus) {
|
|
5915
6051
|
// 如果按下了方向键
|
|
5916
6052
|
if (selected.row && selected.column) {
|
|
5917
|
-
|
|
5918
|
-
} else if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
5919
|
-
// 当前行按键上下移动
|
|
5920
|
-
this.moveCurrentRow(isUpArrow, isDwArrow, evnt);
|
|
6053
|
+
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
5921
6054
|
}
|
|
5922
6055
|
}
|
|
5923
6056
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
@@ -5939,7 +6072,7 @@ const Methods = {
|
|
|
5939
6072
|
column: selected.column,
|
|
5940
6073
|
columnIndex: this.getColumnIndex(selected.column),
|
|
5941
6074
|
$table: this,
|
|
5942
|
-
$grid:
|
|
6075
|
+
$grid: $xeGrid
|
|
5943
6076
|
};
|
|
5944
6077
|
// 是否被禁用
|
|
5945
6078
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -5967,7 +6100,7 @@ const Methods = {
|
|
|
5967
6100
|
column: selected.column,
|
|
5968
6101
|
columnIndex: this.getColumnIndex(selected.column),
|
|
5969
6102
|
$table: this,
|
|
5970
|
-
$grid:
|
|
6103
|
+
$grid: $xeGrid
|
|
5971
6104
|
};
|
|
5972
6105
|
// 是否被禁用
|
|
5973
6106
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
@@ -5998,7 +6131,7 @@ const Methods = {
|
|
|
5998
6131
|
rowIndex: this.getRowIndex(parentRow),
|
|
5999
6132
|
$rowIndex: this.getVMRowIndex(parentRow),
|
|
6000
6133
|
$table: this,
|
|
6001
|
-
$grid:
|
|
6134
|
+
$grid: $xeGrid
|
|
6002
6135
|
};
|
|
6003
6136
|
this.setTreeExpand(parentRow, false).then(() => this.scrollToRow(parentRow)).then(() => this.triggerCurrentRowEvent(evnt, params));
|
|
6004
6137
|
}
|
|
@@ -6019,7 +6152,7 @@ const Methods = {
|
|
|
6019
6152
|
column: selected.column,
|
|
6020
6153
|
columnIndex: this.getColumnIndex(selected.column),
|
|
6021
6154
|
$table: this,
|
|
6022
|
-
$grid:
|
|
6155
|
+
$grid: $xeGrid
|
|
6023
6156
|
};
|
|
6024
6157
|
if (!beforeEditMethod || beforeEditMethod(params)) {
|
|
6025
6158
|
if (editMethod) {
|
|
@@ -6176,7 +6309,7 @@ const Methods = {
|
|
|
6176
6309
|
return;
|
|
6177
6310
|
}
|
|
6178
6311
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
6179
|
-
handleTooltip($xeTable, evnt, thEl, cellEl,
|
|
6312
|
+
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
6180
6313
|
}
|
|
6181
6314
|
},
|
|
6182
6315
|
/**
|
|
@@ -6217,7 +6350,7 @@ const Methods = {
|
|
|
6217
6350
|
}
|
|
6218
6351
|
}
|
|
6219
6352
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
6220
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'),
|
|
6353
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
6221
6354
|
}
|
|
6222
6355
|
},
|
|
6223
6356
|
/**
|
|
@@ -6232,10 +6365,10 @@ const Methods = {
|
|
|
6232
6365
|
const {
|
|
6233
6366
|
tooltipStore
|
|
6234
6367
|
} = reactData;
|
|
6235
|
-
const
|
|
6368
|
+
const tdEl = evnt.currentTarget;
|
|
6236
6369
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
6237
6370
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
6238
|
-
handleTooltip($xeTable, evnt,
|
|
6371
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
6239
6372
|
}
|
|
6240
6373
|
},
|
|
6241
6374
|
openTooltip(target, content) {
|
|
@@ -6296,15 +6429,20 @@ const Methods = {
|
|
|
6296
6429
|
* 获取复选框半选状态的行数据
|
|
6297
6430
|
*/
|
|
6298
6431
|
getCheckboxIndeterminateRecords(isFull) {
|
|
6432
|
+
const $xeTable = this;
|
|
6433
|
+
const props = $xeTable;
|
|
6434
|
+
const internalData = $xeTable;
|
|
6299
6435
|
const {
|
|
6300
|
-
treeConfig
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6436
|
+
treeConfig
|
|
6437
|
+
} = props;
|
|
6438
|
+
const {
|
|
6439
|
+
fullDataRowIdData,
|
|
6440
|
+
treeIndeterminateRowMaps
|
|
6441
|
+
} = internalData;
|
|
6304
6442
|
if (treeConfig) {
|
|
6305
6443
|
const fullRest = [];
|
|
6306
6444
|
const defRest = [];
|
|
6307
|
-
_xeUtils.default.each(
|
|
6445
|
+
_xeUtils.default.each(treeIndeterminateRowMaps, (item, rowid) => {
|
|
6308
6446
|
if (item) {
|
|
6309
6447
|
fullRest.push(item);
|
|
6310
6448
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -6381,9 +6519,13 @@ const Methods = {
|
|
|
6381
6519
|
isCheckedByCheckboxRow(row) {
|
|
6382
6520
|
const $xeTable = this;
|
|
6383
6521
|
const reactData = $xeTable;
|
|
6522
|
+
const internalData = $xeTable;
|
|
6384
6523
|
const {
|
|
6385
|
-
|
|
6524
|
+
updateCheckboxFlag
|
|
6386
6525
|
} = reactData;
|
|
6526
|
+
const {
|
|
6527
|
+
selectCheckboxMaps
|
|
6528
|
+
} = internalData;
|
|
6387
6529
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6388
6530
|
const {
|
|
6389
6531
|
checkField
|
|
@@ -6391,17 +6533,18 @@ const Methods = {
|
|
|
6391
6533
|
if (checkField) {
|
|
6392
6534
|
return _xeUtils.default.get(row, checkField);
|
|
6393
6535
|
}
|
|
6394
|
-
return !!selectCheckboxMaps[(0, _util.getRowid)($xeTable, row)];
|
|
6536
|
+
return !!updateCheckboxFlag && !!selectCheckboxMaps[(0, _util.getRowid)($xeTable, row)];
|
|
6395
6537
|
},
|
|
6396
6538
|
isCheckedByCheckboxRowKey(rowid) {
|
|
6397
6539
|
const $xeTable = this;
|
|
6398
6540
|
const reactData = $xeTable;
|
|
6399
6541
|
const internalData = $xeTable;
|
|
6400
6542
|
const {
|
|
6401
|
-
|
|
6543
|
+
updateCheckboxFlag
|
|
6402
6544
|
} = reactData;
|
|
6403
6545
|
const {
|
|
6404
|
-
fullAllDataRowIdData
|
|
6546
|
+
fullAllDataRowIdData,
|
|
6547
|
+
selectCheckboxMaps
|
|
6405
6548
|
} = internalData;
|
|
6406
6549
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6407
6550
|
const {
|
|
@@ -6414,23 +6557,23 @@ const Methods = {
|
|
|
6414
6557
|
}
|
|
6415
6558
|
return false;
|
|
6416
6559
|
}
|
|
6417
|
-
return !!selectCheckboxMaps[rowid];
|
|
6560
|
+
return !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
6418
6561
|
},
|
|
6419
6562
|
isIndeterminateByCheckboxRow(row) {
|
|
6420
6563
|
const $xeTable = this;
|
|
6421
|
-
const
|
|
6564
|
+
const internalData = $xeTable;
|
|
6422
6565
|
const {
|
|
6423
|
-
|
|
6424
|
-
} =
|
|
6425
|
-
return !!
|
|
6566
|
+
treeIndeterminateRowMaps
|
|
6567
|
+
} = internalData;
|
|
6568
|
+
return !!treeIndeterminateRowMaps[(0, _util.getRowid)($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row);
|
|
6426
6569
|
},
|
|
6427
6570
|
isIndeterminateByCheckboxRowKey(rowid) {
|
|
6428
6571
|
const $xeTable = this;
|
|
6429
|
-
const
|
|
6572
|
+
const internalData = $xeTable;
|
|
6430
6573
|
const {
|
|
6431
|
-
|
|
6432
|
-
} =
|
|
6433
|
-
return !!
|
|
6574
|
+
treeIndeterminateRowMaps
|
|
6575
|
+
} = internalData;
|
|
6576
|
+
return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid);
|
|
6434
6577
|
},
|
|
6435
6578
|
/**
|
|
6436
6579
|
* 切换选中
|
|
@@ -6440,13 +6583,13 @@ const Methods = {
|
|
|
6440
6583
|
const $xeTable = this;
|
|
6441
6584
|
const props = $xeTable;
|
|
6442
6585
|
const reactData = $xeTable;
|
|
6586
|
+
const internalData = $xeTable;
|
|
6443
6587
|
const {
|
|
6444
6588
|
treeConfig
|
|
6445
6589
|
} = props;
|
|
6446
6590
|
const {
|
|
6447
6591
|
selectCheckboxMaps
|
|
6448
|
-
} =
|
|
6449
|
-
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
6592
|
+
} = internalData;
|
|
6450
6593
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6451
6594
|
const {
|
|
6452
6595
|
transform,
|
|
@@ -6459,6 +6602,9 @@ const Methods = {
|
|
|
6459
6602
|
checkStrictly,
|
|
6460
6603
|
checkMethod
|
|
6461
6604
|
} = checkboxOpts;
|
|
6605
|
+
const {
|
|
6606
|
+
handleGetRowId
|
|
6607
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
6462
6608
|
// indeterminateField 仅支持读取
|
|
6463
6609
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
6464
6610
|
if (checkField) {
|
|
@@ -6478,35 +6624,34 @@ const Methods = {
|
|
|
6478
6624
|
}, {
|
|
6479
6625
|
children: transform ? mapChildrenField : childrenField
|
|
6480
6626
|
});
|
|
6481
|
-
reactData.
|
|
6627
|
+
reactData.updateCheckboxFlag++;
|
|
6482
6628
|
return;
|
|
6483
|
-
} else {
|
|
6484
|
-
// 列表
|
|
6485
|
-
rows.forEach(row => {
|
|
6486
|
-
if (isForce || !checkMethod || checkMethod({
|
|
6487
|
-
row
|
|
6488
|
-
})) {
|
|
6489
|
-
_xeUtils.default.set(row, checkField, checked);
|
|
6490
|
-
handleCheckboxReserveRow($xeTable, row, checked);
|
|
6491
|
-
}
|
|
6492
|
-
});
|
|
6493
6629
|
}
|
|
6494
|
-
|
|
6630
|
+
// 列表
|
|
6631
|
+
rows.forEach(row => {
|
|
6632
|
+
if (isForce || !checkMethod || checkMethod({
|
|
6633
|
+
row
|
|
6634
|
+
})) {
|
|
6635
|
+
_xeUtils.default.set(row, checkField, checked);
|
|
6636
|
+
handleCheckboxReserveRow($xeTable, row, checked);
|
|
6637
|
+
}
|
|
6638
|
+
});
|
|
6639
|
+
reactData.updateCheckboxFlag++;
|
|
6495
6640
|
return;
|
|
6496
6641
|
}
|
|
6497
6642
|
// 树结构
|
|
6498
6643
|
if (treeConfig && !checkStrictly) {
|
|
6499
6644
|
// 更新子节点状态
|
|
6500
6645
|
_xeUtils.default.eachTree(rows, row => {
|
|
6501
|
-
const rowid = (
|
|
6646
|
+
const rowid = handleGetRowId(row);
|
|
6502
6647
|
if (isForce || !checkMethod || checkMethod({
|
|
6503
6648
|
row
|
|
6504
6649
|
})) {
|
|
6505
6650
|
if (checked) {
|
|
6506
|
-
|
|
6651
|
+
selectCheckboxMaps[rowid] = row;
|
|
6507
6652
|
} else {
|
|
6508
|
-
if (
|
|
6509
|
-
delete
|
|
6653
|
+
if (selectCheckboxMaps[rowid]) {
|
|
6654
|
+
delete selectCheckboxMaps[rowid];
|
|
6510
6655
|
}
|
|
6511
6656
|
}
|
|
6512
6657
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
@@ -6514,28 +6659,28 @@ const Methods = {
|
|
|
6514
6659
|
}, {
|
|
6515
6660
|
children: transform ? mapChildrenField : childrenField
|
|
6516
6661
|
});
|
|
6517
|
-
reactData.
|
|
6662
|
+
reactData.updateCheckboxFlag++;
|
|
6518
6663
|
return;
|
|
6519
6664
|
}
|
|
6520
6665
|
// 列表
|
|
6521
6666
|
rows.forEach(row => {
|
|
6522
|
-
const rowid = (
|
|
6667
|
+
const rowid = handleGetRowId(row);
|
|
6523
6668
|
if (isForce || !checkMethod || checkMethod({
|
|
6524
6669
|
row
|
|
6525
6670
|
})) {
|
|
6526
6671
|
if (checked) {
|
|
6527
|
-
if (!
|
|
6528
|
-
|
|
6672
|
+
if (!selectCheckboxMaps[rowid]) {
|
|
6673
|
+
selectCheckboxMaps[rowid] = row;
|
|
6529
6674
|
}
|
|
6530
6675
|
} else {
|
|
6531
|
-
if (
|
|
6532
|
-
delete
|
|
6676
|
+
if (selectCheckboxMaps[rowid]) {
|
|
6677
|
+
delete selectCheckboxMaps[rowid];
|
|
6533
6678
|
}
|
|
6534
6679
|
}
|
|
6535
6680
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
6681
|
+
reactData.updateCheckboxFlag++;
|
|
6536
6682
|
}
|
|
6537
6683
|
});
|
|
6538
|
-
reactData.selectCheckboxMaps = selectRowMaps;
|
|
6539
6684
|
},
|
|
6540
6685
|
/**
|
|
6541
6686
|
* 即将移除
|
|
@@ -6548,10 +6693,12 @@ const Methods = {
|
|
|
6548
6693
|
$xeTable.handleBatchSelectRows([row], checked, isForce);
|
|
6549
6694
|
},
|
|
6550
6695
|
handleToggleCheckRowEvent(evnt, params) {
|
|
6696
|
+
const $xeTable = this;
|
|
6697
|
+
const internalData = $xeTable;
|
|
6551
6698
|
const {
|
|
6552
|
-
selectCheckboxMaps
|
|
6553
|
-
|
|
6554
|
-
|
|
6699
|
+
selectCheckboxMaps
|
|
6700
|
+
} = internalData;
|
|
6701
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6555
6702
|
const {
|
|
6556
6703
|
checkField,
|
|
6557
6704
|
trigger
|
|
@@ -6566,43 +6713,47 @@ const Methods = {
|
|
|
6566
6713
|
if (checkField) {
|
|
6567
6714
|
checked = !_xeUtils.default.get(row, checkField);
|
|
6568
6715
|
} else {
|
|
6569
|
-
checked = !selectCheckboxMaps[(0, _util.getRowid)(
|
|
6716
|
+
checked = !selectCheckboxMaps[(0, _util.getRowid)($xeTable, row)];
|
|
6570
6717
|
}
|
|
6571
6718
|
if (evnt) {
|
|
6572
|
-
|
|
6719
|
+
$xeTable.triggerCheckRowEvent(evnt, params, checked);
|
|
6573
6720
|
} else {
|
|
6574
|
-
|
|
6575
|
-
|
|
6721
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
6722
|
+
$xeTable.checkSelectionStatus();
|
|
6576
6723
|
}
|
|
6577
6724
|
},
|
|
6578
6725
|
triggerCheckRowEvent(evnt, params, checked) {
|
|
6579
6726
|
const $xeTable = this;
|
|
6727
|
+
const props = $xeTable;
|
|
6728
|
+
const internalData = $xeTable;
|
|
6729
|
+
const {
|
|
6730
|
+
row
|
|
6731
|
+
} = params;
|
|
6580
6732
|
const {
|
|
6581
|
-
checkboxOpts,
|
|
6582
6733
|
afterFullData
|
|
6583
|
-
} =
|
|
6734
|
+
} = internalData;
|
|
6735
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6584
6736
|
const {
|
|
6585
6737
|
checkMethod,
|
|
6586
6738
|
trigger
|
|
6587
6739
|
} = checkboxOpts;
|
|
6588
|
-
const {
|
|
6589
|
-
row
|
|
6590
|
-
} = params;
|
|
6591
6740
|
if (trigger === 'manual') {
|
|
6592
6741
|
return;
|
|
6593
6742
|
}
|
|
6594
6743
|
evnt.stopPropagation();
|
|
6595
|
-
if (checkboxOpts.isShiftKey && evnt.shiftKey && !
|
|
6596
|
-
const checkboxRecords =
|
|
6744
|
+
if (checkboxOpts.isShiftKey && evnt.shiftKey && !props.treeConfig) {
|
|
6745
|
+
const checkboxRecords = $xeTable.getCheckboxRecords();
|
|
6597
6746
|
if (checkboxRecords.length) {
|
|
6598
6747
|
const firstRow = checkboxRecords[0];
|
|
6599
|
-
const _rowIndex =
|
|
6600
|
-
const _firstRowIndex =
|
|
6748
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
6749
|
+
const _firstRowIndex = $xeTable.getVTRowIndex(firstRow);
|
|
6601
6750
|
if (_rowIndex !== _firstRowIndex) {
|
|
6602
|
-
|
|
6751
|
+
$xeTable.setAllCheckboxRow(false);
|
|
6603
6752
|
const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
|
|
6604
|
-
|
|
6605
|
-
|
|
6753
|
+
$xeTable.$nextTick(() => {
|
|
6754
|
+
handleCheckedCheckboxRow($xeTable, rangeRows, true, false);
|
|
6755
|
+
});
|
|
6756
|
+
$xeTable.dispatchEvent('checkbox-range-select', Object.assign({
|
|
6606
6757
|
rangeRecords: rangeRows
|
|
6607
6758
|
}, params), evnt);
|
|
6608
6759
|
return;
|
|
@@ -6612,12 +6763,12 @@ const Methods = {
|
|
|
6612
6763
|
if (!checkMethod || checkMethod({
|
|
6613
6764
|
row
|
|
6614
6765
|
})) {
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
records:
|
|
6619
|
-
reserves:
|
|
6620
|
-
indeterminates:
|
|
6766
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
6767
|
+
$xeTable.checkSelectionStatus();
|
|
6768
|
+
$xeTable.dispatchEvent('checkbox-change', Object.assign({
|
|
6769
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
6770
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
6771
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
6621
6772
|
checked
|
|
6622
6773
|
}, params), evnt);
|
|
6623
6774
|
}
|
|
@@ -6627,10 +6778,11 @@ const Methods = {
|
|
|
6627
6778
|
*/
|
|
6628
6779
|
toggleCheckboxRow(row) {
|
|
6629
6780
|
const $xeTable = this;
|
|
6781
|
+
const internalData = $xeTable;
|
|
6630
6782
|
const {
|
|
6631
|
-
selectCheckboxMaps
|
|
6632
|
-
|
|
6633
|
-
|
|
6783
|
+
selectCheckboxMaps
|
|
6784
|
+
} = internalData;
|
|
6785
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6634
6786
|
const {
|
|
6635
6787
|
checkField
|
|
6636
6788
|
} = checkboxOpts;
|
|
@@ -6657,10 +6809,8 @@ const Methods = {
|
|
|
6657
6809
|
} = props;
|
|
6658
6810
|
const {
|
|
6659
6811
|
selectCheckboxMaps,
|
|
6660
|
-
|
|
6661
|
-
} =
|
|
6662
|
-
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
6663
|
-
const halfRowMaps = Object.assign({}, treeIndeterminateMaps);
|
|
6812
|
+
treeIndeterminateRowMaps
|
|
6813
|
+
} = internalData;
|
|
6664
6814
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6665
6815
|
const {
|
|
6666
6816
|
transform,
|
|
@@ -6681,10 +6831,13 @@ const Methods = {
|
|
|
6681
6831
|
}
|
|
6682
6832
|
// 树结构
|
|
6683
6833
|
if (treeConfig) {
|
|
6834
|
+
const {
|
|
6835
|
+
handleGetRowId
|
|
6836
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
6684
6837
|
const childRowMaps = {};
|
|
6685
6838
|
const childRowList = [];
|
|
6686
6839
|
_xeUtils.default.eachTree(afterTreeFullData, row => {
|
|
6687
|
-
const rowid = (
|
|
6840
|
+
const rowid = handleGetRowId(row);
|
|
6688
6841
|
const childList = row[transform ? mapChildrenField : childrenField];
|
|
6689
6842
|
if (childList && childList.length && !childRowMaps[rowid]) {
|
|
6690
6843
|
childRowMaps[rowid] = 1;
|
|
@@ -6701,30 +6854,30 @@ const Methods = {
|
|
|
6701
6854
|
let hLen = 0; // 半选
|
|
6702
6855
|
let vLen = 0; // 有效行
|
|
6703
6856
|
childList.forEach(checkMethod ? item => {
|
|
6704
|
-
const childRowid = (
|
|
6705
|
-
const isSelect = checkField ? _xeUtils.default.get(item, checkField) :
|
|
6857
|
+
const childRowid = handleGetRowId(item);
|
|
6858
|
+
const isSelect = checkField ? _xeUtils.default.get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
6706
6859
|
if (checkMethod({
|
|
6707
6860
|
row: item
|
|
6708
6861
|
})) {
|
|
6709
6862
|
if (isSelect) {
|
|
6710
6863
|
sLen++;
|
|
6711
|
-
} else if (
|
|
6864
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
6712
6865
|
hLen++;
|
|
6713
6866
|
}
|
|
6714
6867
|
vLen++;
|
|
6715
6868
|
} else {
|
|
6716
6869
|
if (isSelect) {
|
|
6717
6870
|
sLen++;
|
|
6718
|
-
} else if (
|
|
6871
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
6719
6872
|
hLen++;
|
|
6720
6873
|
}
|
|
6721
6874
|
}
|
|
6722
6875
|
} : item => {
|
|
6723
|
-
const childRowid = (
|
|
6724
|
-
const isSelect = checkField ? _xeUtils.default.get(item, checkField) :
|
|
6876
|
+
const childRowid = handleGetRowId(item);
|
|
6877
|
+
const isSelect = checkField ? _xeUtils.default.get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
6725
6878
|
if (isSelect) {
|
|
6726
6879
|
sLen++;
|
|
6727
|
-
} else if (
|
|
6880
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
6728
6881
|
hLen++;
|
|
6729
6882
|
}
|
|
6730
6883
|
vLen++;
|
|
@@ -6736,29 +6889,28 @@ const Methods = {
|
|
|
6736
6889
|
}
|
|
6737
6890
|
if (isSelected) {
|
|
6738
6891
|
if (!checkField) {
|
|
6739
|
-
|
|
6892
|
+
selectCheckboxMaps[rowid] = row;
|
|
6740
6893
|
}
|
|
6741
|
-
if (
|
|
6742
|
-
delete
|
|
6894
|
+
if (treeIndeterminateRowMaps[rowid]) {
|
|
6895
|
+
delete treeIndeterminateRowMaps[rowid];
|
|
6743
6896
|
}
|
|
6744
6897
|
} else {
|
|
6745
6898
|
if (!checkField) {
|
|
6746
|
-
if (
|
|
6747
|
-
delete
|
|
6899
|
+
if (selectCheckboxMaps[rowid]) {
|
|
6900
|
+
delete selectCheckboxMaps[rowid];
|
|
6748
6901
|
}
|
|
6749
6902
|
}
|
|
6750
6903
|
if (halfSelect) {
|
|
6751
|
-
|
|
6904
|
+
treeIndeterminateRowMaps[rowid] = row;
|
|
6752
6905
|
} else {
|
|
6753
|
-
if (
|
|
6754
|
-
delete
|
|
6906
|
+
if (treeIndeterminateRowMaps[rowid]) {
|
|
6907
|
+
delete treeIndeterminateRowMaps[rowid];
|
|
6755
6908
|
}
|
|
6756
6909
|
}
|
|
6757
6910
|
}
|
|
6758
6911
|
});
|
|
6759
6912
|
}
|
|
6760
|
-
reactData.
|
|
6761
|
-
reactData.treeIndeterminateMaps = halfRowMaps;
|
|
6913
|
+
reactData.updateCheckboxFlag++;
|
|
6762
6914
|
},
|
|
6763
6915
|
updateAllCheckboxStatus() {
|
|
6764
6916
|
const $xeTable = this;
|
|
@@ -6769,9 +6921,12 @@ const Methods = {
|
|
|
6769
6921
|
treeConfig
|
|
6770
6922
|
} = props;
|
|
6771
6923
|
const {
|
|
6924
|
+
afterFullData,
|
|
6925
|
+
afterTreeFullData,
|
|
6926
|
+
checkboxReserveRowMap,
|
|
6772
6927
|
selectCheckboxMaps,
|
|
6773
|
-
|
|
6774
|
-
} =
|
|
6928
|
+
treeIndeterminateRowMaps
|
|
6929
|
+
} = internalData;
|
|
6775
6930
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6776
6931
|
const {
|
|
6777
6932
|
checkField,
|
|
@@ -6779,39 +6934,37 @@ const Methods = {
|
|
|
6779
6934
|
showReserveStatus
|
|
6780
6935
|
} = checkboxOpts;
|
|
6781
6936
|
const {
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
checkboxReserveRowMap
|
|
6785
|
-
} = internalData;
|
|
6937
|
+
handleGetRowId
|
|
6938
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
6786
6939
|
let sLen = 0; // 已选
|
|
6787
6940
|
let hLen = 0; // 半选
|
|
6788
6941
|
let vLen = 0; // 有效行
|
|
6789
6942
|
const rootList = treeConfig ? afterTreeFullData : afterFullData;
|
|
6790
6943
|
rootList.forEach(checkMethod ? row => {
|
|
6791
|
-
const childRowid = (
|
|
6944
|
+
const childRowid = handleGetRowId(row);
|
|
6792
6945
|
const selected = checkField ? _xeUtils.default.get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
6793
6946
|
if (checkMethod({
|
|
6794
6947
|
row
|
|
6795
6948
|
})) {
|
|
6796
6949
|
if (selected) {
|
|
6797
6950
|
sLen++;
|
|
6798
|
-
} else if (
|
|
6951
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
6799
6952
|
hLen++;
|
|
6800
6953
|
}
|
|
6801
6954
|
vLen++;
|
|
6802
6955
|
} else {
|
|
6803
6956
|
if (selected) {
|
|
6804
6957
|
sLen++;
|
|
6805
|
-
} else if (
|
|
6958
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
6806
6959
|
hLen++;
|
|
6807
6960
|
}
|
|
6808
6961
|
}
|
|
6809
6962
|
} : row => {
|
|
6810
|
-
const childRowid = (
|
|
6963
|
+
const childRowid = handleGetRowId(row);
|
|
6811
6964
|
const selected = checkField ? _xeUtils.default.get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
6812
6965
|
if (selected) {
|
|
6813
6966
|
sLen++;
|
|
6814
|
-
} else if (
|
|
6967
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
6815
6968
|
hLen++;
|
|
6816
6969
|
}
|
|
6817
6970
|
vLen++;
|
|
@@ -6875,27 +7028,35 @@ const Methods = {
|
|
|
6875
7028
|
* 获取复选框保留选中的行
|
|
6876
7029
|
*/
|
|
6877
7030
|
getCheckboxReserveRecords(isFull) {
|
|
7031
|
+
const $xeTable = this;
|
|
7032
|
+
const props = $xeTable;
|
|
7033
|
+
const internalData = $xeTable;
|
|
7034
|
+
const {
|
|
7035
|
+
treeConfig
|
|
7036
|
+
} = props;
|
|
6878
7037
|
const {
|
|
6879
|
-
fullDataRowIdData,
|
|
6880
7038
|
afterFullData,
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
7039
|
+
fullDataRowIdData,
|
|
7040
|
+
checkboxReserveRowMap
|
|
7041
|
+
} = internalData;
|
|
7042
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
7043
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6886
7044
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6887
7045
|
const reserveSelection = [];
|
|
6888
7046
|
if (checkboxOpts.reserve) {
|
|
7047
|
+
const {
|
|
7048
|
+
handleGetRowId
|
|
7049
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
6889
7050
|
const afterFullIdMaps = {};
|
|
6890
7051
|
if (treeConfig) {
|
|
6891
7052
|
_xeUtils.default.eachTree(afterFullData, row => {
|
|
6892
|
-
afterFullIdMaps[(
|
|
7053
|
+
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
6893
7054
|
}, {
|
|
6894
7055
|
children: childrenField
|
|
6895
7056
|
});
|
|
6896
7057
|
} else {
|
|
6897
7058
|
afterFullData.forEach(row => {
|
|
6898
|
-
afterFullIdMaps[(
|
|
7059
|
+
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
6899
7060
|
});
|
|
6900
7061
|
}
|
|
6901
7062
|
_xeUtils.default.each(checkboxReserveRowMap, (oldRow, oldRowid) => {
|
|
@@ -6937,9 +7098,9 @@ const Methods = {
|
|
|
6937
7098
|
handleCheckedAllCheckboxRow($xeTable, value);
|
|
6938
7099
|
if (evnt) {
|
|
6939
7100
|
$xeTable.dispatchEvent('checkbox-all', {
|
|
6940
|
-
records: $xeTable.getCheckboxRecords(),
|
|
6941
|
-
reserves: $xeTable.getCheckboxReserveRecords(),
|
|
6942
|
-
indeterminates: $xeTable.getCheckboxIndeterminateRecords(),
|
|
7101
|
+
records: () => $xeTable.getCheckboxRecords(),
|
|
7102
|
+
reserves: () => $xeTable.getCheckboxReserveRecords(),
|
|
7103
|
+
indeterminates: () => $xeTable.getCheckboxIndeterminateRecords(),
|
|
6943
7104
|
checked: value
|
|
6944
7105
|
}, evnt);
|
|
6945
7106
|
}
|
|
@@ -6975,17 +7136,23 @@ const Methods = {
|
|
|
6975
7136
|
* 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
|
|
6976
7137
|
*/
|
|
6977
7138
|
clearCheckboxRow() {
|
|
7139
|
+
const $xeTable = this;
|
|
7140
|
+
const props = $xeTable;
|
|
7141
|
+
const reactData = $xeTable;
|
|
7142
|
+
const internalData = $xeTable;
|
|
6978
7143
|
const {
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
} =
|
|
7144
|
+
treeConfig
|
|
7145
|
+
} = props;
|
|
7146
|
+
const {
|
|
7147
|
+
tableFullData
|
|
7148
|
+
} = internalData;
|
|
7149
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
7150
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7151
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6984
7152
|
const {
|
|
6985
7153
|
checkField,
|
|
6986
7154
|
reserve
|
|
6987
7155
|
} = checkboxOpts;
|
|
6988
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6989
7156
|
// indeterminateField 仅支持读取
|
|
6990
7157
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
6991
7158
|
if (checkField) {
|
|
@@ -7006,10 +7173,11 @@ const Methods = {
|
|
|
7006
7173
|
if (reserve) {
|
|
7007
7174
|
tableFullData.forEach(row => this.handleCheckboxReserveRow(row, false));
|
|
7008
7175
|
}
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7176
|
+
reactData.isAllSelected = false;
|
|
7177
|
+
reactData.isIndeterminate = false;
|
|
7178
|
+
internalData.selectCheckboxMaps = {};
|
|
7179
|
+
internalData.treeIndeterminateRowMaps = {};
|
|
7180
|
+
reactData.updateCheckboxFlag++;
|
|
7013
7181
|
return this.$nextTick();
|
|
7014
7182
|
},
|
|
7015
7183
|
/**
|
|
@@ -7260,12 +7428,14 @@ const Methods = {
|
|
|
7260
7428
|
},
|
|
7261
7429
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
7262
7430
|
const $xeTable = this;
|
|
7431
|
+
const props = $xeTable;
|
|
7263
7432
|
const internalData = $xeTable;
|
|
7264
7433
|
const {
|
|
7265
7434
|
_lastResizeTime
|
|
7266
7435
|
} = internalData;
|
|
7267
7436
|
const sortOpts = $xeTable.computeSortOpts;
|
|
7268
7437
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
7438
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
7269
7439
|
const {
|
|
7270
7440
|
column
|
|
7271
7441
|
} = params;
|
|
@@ -7282,7 +7452,7 @@ const Methods = {
|
|
|
7282
7452
|
triggerFilter,
|
|
7283
7453
|
cell
|
|
7284
7454
|
}, params), evnt);
|
|
7285
|
-
if (columnOpts.isCurrent ||
|
|
7455
|
+
if ((columnOpts.isCurrent || props.highlightCurrentColumn) && (!currentColumnOpts.trigger || ['header', 'default'].includes(currentColumnOpts.trigger))) {
|
|
7286
7456
|
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
7287
7457
|
}
|
|
7288
7458
|
return $xeTable.$nextTick();
|
|
@@ -7300,35 +7470,32 @@ const Methods = {
|
|
|
7300
7470
|
* @param {ColumnInfo} fieldOrColumn 列配置
|
|
7301
7471
|
*/
|
|
7302
7472
|
setCurrentColumn(fieldOrColumn) {
|
|
7303
|
-
const
|
|
7473
|
+
const $xeTable = this;
|
|
7474
|
+
const props = $xeTable;
|
|
7475
|
+
const reactData = $xeTable;
|
|
7476
|
+
const {
|
|
7477
|
+
mouseConfig
|
|
7478
|
+
} = props;
|
|
7479
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
7480
|
+
const isMouseSelected = mouseConfig && mouseOpts.selected;
|
|
7481
|
+
const column = (0, _util.handleFieldOrColumn)($xeTable, fieldOrColumn);
|
|
7304
7482
|
if (column) {
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
this.currentColumn = column;
|
|
7483
|
+
$xeTable.clearCurrentColumn();
|
|
7484
|
+
reactData.currentColumn = column;
|
|
7308
7485
|
}
|
|
7309
|
-
return
|
|
7486
|
+
return $xeTable.$nextTick().then(() => {
|
|
7487
|
+
// 更新状选中态
|
|
7488
|
+
if (isMouseSelected) {
|
|
7489
|
+
$xeTable.addCellSelectedClass();
|
|
7490
|
+
}
|
|
7491
|
+
});
|
|
7310
7492
|
},
|
|
7311
7493
|
/**
|
|
7312
7494
|
* 用于当前列,手动清空当前高亮的状态
|
|
7313
7495
|
*/
|
|
7314
|
-
clearCurrentColumn() {
|
|
7315
|
-
this.currentColumn = null;
|
|
7316
|
-
return this.$nextTick();
|
|
7317
|
-
},
|
|
7318
|
-
checkValidate(type) {
|
|
7319
|
-
if (this.triggerValidate) {
|
|
7320
|
-
return this.triggerValidate(type);
|
|
7321
|
-
}
|
|
7322
|
-
return this.$nextTick();
|
|
7323
|
-
},
|
|
7324
|
-
/**
|
|
7325
|
-
* 当单元格发生改变时
|
|
7326
|
-
* 如果存在规则,则校验
|
|
7327
|
-
*/
|
|
7328
|
-
handleChangeCell(evnt, params) {
|
|
7329
|
-
this.checkValidate('blur').catch(e => e).then(() => {
|
|
7330
|
-
this.handleEdit(params, evnt).then(() => this.checkValidate('change')).catch(e => e);
|
|
7331
|
-
});
|
|
7496
|
+
clearCurrentColumn() {
|
|
7497
|
+
this.currentColumn = null;
|
|
7498
|
+
return this.$nextTick();
|
|
7332
7499
|
},
|
|
7333
7500
|
/**
|
|
7334
7501
|
* 列点击事件
|
|
@@ -7341,6 +7508,7 @@ const Methods = {
|
|
|
7341
7508
|
const reactData = $xeTable;
|
|
7342
7509
|
const {
|
|
7343
7510
|
highlightCurrentRow,
|
|
7511
|
+
highlightCurrentColumn,
|
|
7344
7512
|
editConfig
|
|
7345
7513
|
} = props;
|
|
7346
7514
|
const {
|
|
@@ -7357,6 +7525,8 @@ const Methods = {
|
|
|
7357
7525
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
7358
7526
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
7359
7527
|
const rowOpts = $xeTable.computeRowOpts;
|
|
7528
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
7529
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
7360
7530
|
const {
|
|
7361
7531
|
actived,
|
|
7362
7532
|
focused
|
|
@@ -7387,11 +7557,11 @@ const Methods = {
|
|
|
7387
7557
|
if (!triggerCheckbox && !triggerRadio) {
|
|
7388
7558
|
// 如果是展开行
|
|
7389
7559
|
if (!triggerExpandNode && (expandOpts.trigger === 'row' || isExpandType && expandOpts.trigger === 'cell')) {
|
|
7390
|
-
|
|
7560
|
+
$xeTable.triggerRowExpandEvent(evnt, params);
|
|
7391
7561
|
}
|
|
7392
7562
|
// 如果是树形表格
|
|
7393
7563
|
if (treeOpts.trigger === 'row' || treeNode && treeOpts.trigger === 'cell') {
|
|
7394
|
-
|
|
7564
|
+
$xeTable.triggerTreeExpandEvent(evnt, params);
|
|
7395
7565
|
}
|
|
7396
7566
|
}
|
|
7397
7567
|
// 如果点击了树节点
|
|
@@ -7400,16 +7570,22 @@ const Methods = {
|
|
|
7400
7570
|
// 如果是高亮行
|
|
7401
7571
|
if (rowOpts.isCurrent || highlightCurrentRow) {
|
|
7402
7572
|
if (!triggerCheckbox && !triggerRadio) {
|
|
7403
|
-
|
|
7573
|
+
$xeTable.triggerCurrentRowEvent(evnt, params);
|
|
7574
|
+
}
|
|
7575
|
+
}
|
|
7576
|
+
// 如果是当前列
|
|
7577
|
+
if ((columnOpts.isCurrent || highlightCurrentColumn) && (!currentColumnOpts.trigger || ['cell', 'default'].includes(currentColumnOpts.trigger))) {
|
|
7578
|
+
if (!triggerCheckbox && !triggerRadio) {
|
|
7579
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
7404
7580
|
}
|
|
7405
7581
|
}
|
|
7406
7582
|
// 如果是单选框
|
|
7407
7583
|
if (!triggerRadio && (radioOpts.trigger === 'row' || isRadioType && radioOpts.trigger === 'cell')) {
|
|
7408
|
-
|
|
7584
|
+
$xeTable.triggerRadioRowEvent(evnt, params);
|
|
7409
7585
|
}
|
|
7410
7586
|
// 如果是复选框
|
|
7411
7587
|
if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || isCheckboxType && checkboxOpts.trigger === 'cell')) {
|
|
7412
|
-
|
|
7588
|
+
$xeTable.handleToggleCheckRowEvent(evnt, params);
|
|
7413
7589
|
}
|
|
7414
7590
|
}
|
|
7415
7591
|
// 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
|
|
@@ -7421,14 +7597,14 @@ const Methods = {
|
|
|
7421
7597
|
}
|
|
7422
7598
|
if (editOpts.trigger === 'manual') {
|
|
7423
7599
|
if (actived.args && actived.row === row && column !== actived.column) {
|
|
7424
|
-
|
|
7600
|
+
handleChangeCell($xeTable, evnt, params);
|
|
7425
7601
|
}
|
|
7426
7602
|
} else if (!actived.args || row !== actived.row || column !== actived.column) {
|
|
7427
7603
|
if (editOpts.trigger === 'click') {
|
|
7428
|
-
|
|
7604
|
+
handleChangeCell($xeTable, evnt, params);
|
|
7429
7605
|
} else if (editOpts.trigger === 'dblclick') {
|
|
7430
7606
|
if (editOpts.mode === 'row' && actived.row === row) {
|
|
7431
|
-
|
|
7607
|
+
handleChangeCell($xeTable, evnt, params);
|
|
7432
7608
|
}
|
|
7433
7609
|
}
|
|
7434
7610
|
}
|
|
@@ -7448,7 +7624,7 @@ const Methods = {
|
|
|
7448
7624
|
}
|
|
7449
7625
|
}
|
|
7450
7626
|
}
|
|
7451
|
-
|
|
7627
|
+
$xeTable.dispatchEvent('cell-click', params, evnt);
|
|
7452
7628
|
},
|
|
7453
7629
|
/**
|
|
7454
7630
|
* 列双击点击事件
|
|
@@ -7479,11 +7655,11 @@ const Methods = {
|
|
|
7479
7655
|
if ((0, _utils.isEnableConf)(editConfig) && editOpts.trigger === 'dblclick') {
|
|
7480
7656
|
if (!actived.args || evnt.currentTarget !== actived.args.cell) {
|
|
7481
7657
|
if (editOpts.mode === 'row') {
|
|
7482
|
-
|
|
7483
|
-
this.handleEdit(params, evnt).then(() =>
|
|
7658
|
+
checkValidate($xeTable, 'blur').catch(e => e).then(() => {
|
|
7659
|
+
this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
7484
7660
|
});
|
|
7485
7661
|
} else if (editOpts.mode === 'cell') {
|
|
7486
|
-
this.handleEdit(params, evnt).then(() =>
|
|
7662
|
+
this.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
7487
7663
|
}
|
|
7488
7664
|
}
|
|
7489
7665
|
}
|
|
@@ -7735,6 +7911,8 @@ const Methods = {
|
|
|
7735
7911
|
} = props;
|
|
7736
7912
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
7737
7913
|
const {
|
|
7914
|
+
afterFullData,
|
|
7915
|
+
tableFullData,
|
|
7738
7916
|
fullAllDataRowIdData
|
|
7739
7917
|
} = internalData;
|
|
7740
7918
|
const {
|
|
@@ -7752,10 +7930,6 @@ const Methods = {
|
|
|
7752
7930
|
parentField
|
|
7753
7931
|
} = treeOpts;
|
|
7754
7932
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7755
|
-
const {
|
|
7756
|
-
afterFullData,
|
|
7757
|
-
tableFullData
|
|
7758
|
-
} = internalData;
|
|
7759
7933
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
7760
7934
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
7761
7935
|
const errRest = {
|
|
@@ -8423,46 +8597,58 @@ const Methods = {
|
|
|
8423
8597
|
setPendingRow(rows, status) {
|
|
8424
8598
|
const $xeTable = this;
|
|
8425
8599
|
const reactData = $xeTable;
|
|
8426
|
-
const
|
|
8600
|
+
const internalData = $xeTable;
|
|
8601
|
+
const {
|
|
8602
|
+
handleGetRowId
|
|
8603
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
8604
|
+
const {
|
|
8605
|
+
pendingRowMaps
|
|
8606
|
+
} = internalData;
|
|
8427
8607
|
if (rows && !_xeUtils.default.isArray(rows)) {
|
|
8428
8608
|
rows = [rows];
|
|
8429
8609
|
}
|
|
8430
8610
|
if (status) {
|
|
8431
8611
|
rows.forEach(row => {
|
|
8432
|
-
const rowid = (
|
|
8433
|
-
if (rowid && !
|
|
8434
|
-
|
|
8612
|
+
const rowid = handleGetRowId(row);
|
|
8613
|
+
if (rowid && !pendingRowMaps[rowid]) {
|
|
8614
|
+
pendingRowMaps[rowid] = row;
|
|
8435
8615
|
}
|
|
8436
8616
|
});
|
|
8437
8617
|
} else {
|
|
8438
8618
|
rows.forEach(row => {
|
|
8439
|
-
const rowid = (
|
|
8440
|
-
if (rowid &&
|
|
8441
|
-
delete
|
|
8619
|
+
const rowid = handleGetRowId(row);
|
|
8620
|
+
if (rowid && pendingRowMaps[rowid]) {
|
|
8621
|
+
delete pendingRowMaps[rowid];
|
|
8442
8622
|
}
|
|
8443
8623
|
});
|
|
8444
8624
|
}
|
|
8445
|
-
reactData.
|
|
8625
|
+
reactData.pendingRowFlag++;
|
|
8446
8626
|
return $xeTable.$nextTick();
|
|
8447
8627
|
},
|
|
8448
8628
|
togglePendingRow(rows) {
|
|
8449
8629
|
const $xeTable = this;
|
|
8450
8630
|
const reactData = $xeTable;
|
|
8451
|
-
const
|
|
8631
|
+
const internalData = $xeTable;
|
|
8632
|
+
const {
|
|
8633
|
+
handleGetRowId
|
|
8634
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
8635
|
+
const {
|
|
8636
|
+
pendingRowMaps
|
|
8637
|
+
} = internalData;
|
|
8452
8638
|
if (rows && !_xeUtils.default.isArray(rows)) {
|
|
8453
8639
|
rows = [rows];
|
|
8454
8640
|
}
|
|
8455
8641
|
rows.forEach(row => {
|
|
8456
|
-
const rowid = (
|
|
8642
|
+
const rowid = handleGetRowId(row);
|
|
8457
8643
|
if (rowid) {
|
|
8458
|
-
if (
|
|
8459
|
-
delete
|
|
8644
|
+
if (pendingRowMaps[rowid]) {
|
|
8645
|
+
delete pendingRowMaps[rowid];
|
|
8460
8646
|
} else {
|
|
8461
|
-
|
|
8647
|
+
pendingRowMaps[rowid] = row;
|
|
8462
8648
|
}
|
|
8463
8649
|
}
|
|
8464
8650
|
});
|
|
8465
|
-
reactData.
|
|
8651
|
+
reactData.pendingRowFlag++;
|
|
8466
8652
|
return $xeTable.$nextTick();
|
|
8467
8653
|
},
|
|
8468
8654
|
hasPendingByRow(row) {
|
|
@@ -8480,13 +8666,10 @@ const Methods = {
|
|
|
8480
8666
|
},
|
|
8481
8667
|
getPendingRecords() {
|
|
8482
8668
|
const $xeTable = this;
|
|
8483
|
-
const reactData = $xeTable;
|
|
8484
8669
|
const internalData = $xeTable;
|
|
8485
8670
|
const {
|
|
8671
|
+
fullAllDataRowIdData,
|
|
8486
8672
|
pendingRowMaps
|
|
8487
|
-
} = reactData;
|
|
8488
|
-
const {
|
|
8489
|
-
fullAllDataRowIdData
|
|
8490
8673
|
} = internalData;
|
|
8491
8674
|
const insertRecords = [];
|
|
8492
8675
|
_xeUtils.default.each(pendingRowMaps, (row, rowid) => {
|
|
@@ -8497,8 +8680,12 @@ const Methods = {
|
|
|
8497
8680
|
return insertRecords;
|
|
8498
8681
|
},
|
|
8499
8682
|
clearPendingRow() {
|
|
8500
|
-
|
|
8501
|
-
|
|
8683
|
+
const $xeTable = this;
|
|
8684
|
+
const reactData = $xeTable;
|
|
8685
|
+
const internalData = $xeTable;
|
|
8686
|
+
internalData.pendingRowMaps = {};
|
|
8687
|
+
reactData.pendingRowFlag++;
|
|
8688
|
+
return $xeTable.$nextTick();
|
|
8502
8689
|
},
|
|
8503
8690
|
sort(sortConfs, sortOrder) {
|
|
8504
8691
|
const $xeTable = this;
|
|
@@ -8679,9 +8866,11 @@ const Methods = {
|
|
|
8679
8866
|
* @param {Event} evnt 事件
|
|
8680
8867
|
*/
|
|
8681
8868
|
closeFilter() {
|
|
8869
|
+
const $xeTable = this;
|
|
8870
|
+
const reactData = $xeTable;
|
|
8682
8871
|
const {
|
|
8683
8872
|
filterStore
|
|
8684
|
-
} =
|
|
8873
|
+
} = reactData;
|
|
8685
8874
|
const {
|
|
8686
8875
|
column,
|
|
8687
8876
|
visible
|
|
@@ -8693,15 +8882,15 @@ const Methods = {
|
|
|
8693
8882
|
visible: false
|
|
8694
8883
|
});
|
|
8695
8884
|
if (visible) {
|
|
8696
|
-
|
|
8885
|
+
$xeTable.dispatchEvent('filter-visible', {
|
|
8697
8886
|
column,
|
|
8698
8887
|
field: column.field,
|
|
8699
8888
|
property: column.field,
|
|
8700
|
-
filterList:
|
|
8889
|
+
filterList: () => $xeTable.getCheckedFilters(),
|
|
8701
8890
|
visible: false
|
|
8702
8891
|
}, null);
|
|
8703
8892
|
}
|
|
8704
|
-
return
|
|
8893
|
+
return $xeTable.$nextTick();
|
|
8705
8894
|
},
|
|
8706
8895
|
/**
|
|
8707
8896
|
* 判断指定列是否为筛选状态,如果为空则判断所有列
|
|
@@ -8734,9 +8923,9 @@ const Methods = {
|
|
|
8734
8923
|
const $xeTable = this;
|
|
8735
8924
|
const reactData = $xeTable;
|
|
8736
8925
|
const internalData = $xeTable;
|
|
8737
|
-
const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
|
|
8738
8926
|
const {
|
|
8739
|
-
fullAllDataRowIdData
|
|
8927
|
+
fullAllDataRowIdData,
|
|
8928
|
+
rowExpandLazyLoadedMaps
|
|
8740
8929
|
} = internalData;
|
|
8741
8930
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
8742
8931
|
const {
|
|
@@ -8746,9 +8935,9 @@ const Methods = {
|
|
|
8746
8935
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
8747
8936
|
if (lazy && rowRest) {
|
|
8748
8937
|
rowRest.expandLoaded = false;
|
|
8749
|
-
delete
|
|
8938
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
8750
8939
|
}
|
|
8751
|
-
reactData.
|
|
8940
|
+
reactData.rowExpandedFlag++;
|
|
8752
8941
|
return $xeTable.$nextTick();
|
|
8753
8942
|
},
|
|
8754
8943
|
/**
|
|
@@ -8756,18 +8945,20 @@ const Methods = {
|
|
|
8756
8945
|
* @param {Row} row 行对象
|
|
8757
8946
|
*/
|
|
8758
8947
|
reloadRowExpand(row) {
|
|
8948
|
+
const $xeTable = this;
|
|
8949
|
+
const internalData = $xeTable;
|
|
8759
8950
|
const {
|
|
8760
|
-
expandOpts,
|
|
8761
8951
|
rowExpandLazyLoadedMaps
|
|
8762
|
-
} =
|
|
8952
|
+
} = internalData;
|
|
8953
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
8763
8954
|
const {
|
|
8764
8955
|
lazy
|
|
8765
8956
|
} = expandOpts;
|
|
8766
8957
|
const rowid = (0, _util.getRowid)(this, row);
|
|
8767
8958
|
if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
|
|
8768
|
-
|
|
8959
|
+
$xeTable.clearRowExpandLoaded(row).then(() => handleAsyncRowExpand($xeTable, row));
|
|
8769
8960
|
}
|
|
8770
|
-
return
|
|
8961
|
+
return $xeTable.$nextTick();
|
|
8771
8962
|
},
|
|
8772
8963
|
reloadExpandContent(row) {
|
|
8773
8964
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -8780,11 +8971,16 @@ const Methods = {
|
|
|
8780
8971
|
* 展开行事件
|
|
8781
8972
|
*/
|
|
8782
8973
|
triggerRowExpandEvent(evnt, params) {
|
|
8974
|
+
const $xeTable = this;
|
|
8975
|
+
const reactData = $xeTable;
|
|
8976
|
+
const internalData = $xeTable;
|
|
8783
8977
|
const {
|
|
8784
|
-
expandOpts,
|
|
8785
|
-
rowExpandLazyLoadedMaps,
|
|
8786
8978
|
expandColumn: column
|
|
8787
|
-
} =
|
|
8979
|
+
} = reactData;
|
|
8980
|
+
const {
|
|
8981
|
+
rowExpandLazyLoadedMaps
|
|
8982
|
+
} = internalData;
|
|
8983
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
8788
8984
|
const {
|
|
8789
8985
|
row
|
|
8790
8986
|
} = params;
|
|
@@ -8796,20 +8992,20 @@ const Methods = {
|
|
|
8796
8992
|
return;
|
|
8797
8993
|
}
|
|
8798
8994
|
evnt.stopPropagation();
|
|
8799
|
-
const rowid = (0, _util.getRowid)(
|
|
8995
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
8800
8996
|
if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
|
|
8801
|
-
const expanded =
|
|
8802
|
-
const columnIndex =
|
|
8803
|
-
const $columnIndex =
|
|
8804
|
-
|
|
8805
|
-
|
|
8997
|
+
const expanded = !$xeTable.isRowExpandByRow(row);
|
|
8998
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
8999
|
+
const $columnIndex = $xeTable.getVMColumnIndex(column);
|
|
9000
|
+
$xeTable.setRowExpand(row, expanded);
|
|
9001
|
+
$xeTable.dispatchEvent('toggle-row-expand', {
|
|
8806
9002
|
expanded,
|
|
8807
9003
|
column,
|
|
8808
9004
|
columnIndex,
|
|
8809
9005
|
$columnIndex,
|
|
8810
9006
|
row,
|
|
8811
|
-
rowIndex:
|
|
8812
|
-
$rowIndex:
|
|
9007
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
9008
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
8813
9009
|
}, evnt);
|
|
8814
9010
|
}
|
|
8815
9011
|
},
|
|
@@ -8867,55 +9063,6 @@ const Methods = {
|
|
|
8867
9063
|
}
|
|
8868
9064
|
return this.setRowExpand(expandedRows, expanded);
|
|
8869
9065
|
},
|
|
8870
|
-
handleAsyncRowExpand(row) {
|
|
8871
|
-
const $xeTable = this;
|
|
8872
|
-
const reactData = $xeTable;
|
|
8873
|
-
const internalData = $xeTable;
|
|
8874
|
-
return new Promise(resolve => {
|
|
8875
|
-
const {
|
|
8876
|
-
expandOpts
|
|
8877
|
-
} = this;
|
|
8878
|
-
const {
|
|
8879
|
-
loadMethod
|
|
8880
|
-
} = expandOpts;
|
|
8881
|
-
if (loadMethod) {
|
|
8882
|
-
const {
|
|
8883
|
-
fullAllDataRowIdData
|
|
8884
|
-
} = internalData;
|
|
8885
|
-
const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
|
|
8886
|
-
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
8887
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
8888
|
-
rExpandLazyLoadedMaps[rowid] = row;
|
|
8889
|
-
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
|
|
8890
|
-
loadMethod({
|
|
8891
|
-
$table: $xeTable,
|
|
8892
|
-
row,
|
|
8893
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
8894
|
-
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
8895
|
-
}).then(() => {
|
|
8896
|
-
const rExpandedMaps = Object.assign({}, reactData.rowExpandedMaps);
|
|
8897
|
-
if (rowRest) {
|
|
8898
|
-
rowRest.expandLoaded = true;
|
|
8899
|
-
}
|
|
8900
|
-
rExpandedMaps[rowid] = row;
|
|
8901
|
-
reactData.rowExpandedMaps = rExpandedMaps;
|
|
8902
|
-
}).catch(() => {
|
|
8903
|
-
if (rowRest) {
|
|
8904
|
-
rowRest.expandLoaded = false;
|
|
8905
|
-
}
|
|
8906
|
-
}).finally(() => {
|
|
8907
|
-
const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
|
|
8908
|
-
if (rExpandLazyLoadedMaps[rowid]) {
|
|
8909
|
-
delete rExpandLazyLoadedMaps[rowid];
|
|
8910
|
-
}
|
|
8911
|
-
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
|
|
8912
|
-
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
|
|
8913
|
-
});
|
|
8914
|
-
} else {
|
|
8915
|
-
resolve();
|
|
8916
|
-
}
|
|
8917
|
-
});
|
|
8918
|
-
},
|
|
8919
9066
|
/**
|
|
8920
9067
|
* 设置展开行,二个参数设置这一行展开与否
|
|
8921
9068
|
* 支持单行
|
|
@@ -8925,14 +9072,20 @@ const Methods = {
|
|
|
8925
9072
|
*/
|
|
8926
9073
|
setRowExpand(rows, expanded) {
|
|
8927
9074
|
const $xeTable = this;
|
|
9075
|
+
const reactData = $xeTable;
|
|
9076
|
+
const internalData = $xeTable;
|
|
8928
9077
|
const {
|
|
8929
|
-
rowExpandedMaps,
|
|
8930
|
-
fullAllDataRowIdData,
|
|
8931
|
-
rowExpandLazyLoadedMaps,
|
|
8932
|
-
expandOpts,
|
|
8933
9078
|
expandColumn
|
|
8934
|
-
} =
|
|
8935
|
-
let
|
|
9079
|
+
} = reactData;
|
|
9080
|
+
let {
|
|
9081
|
+
fullAllDataRowIdData,
|
|
9082
|
+
rowExpandedMaps,
|
|
9083
|
+
rowExpandLazyLoadedMaps
|
|
9084
|
+
} = internalData;
|
|
9085
|
+
const {
|
|
9086
|
+
handleGetRowId
|
|
9087
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
9088
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
8936
9089
|
const {
|
|
8937
9090
|
reserve,
|
|
8938
9091
|
lazy,
|
|
@@ -8948,10 +9101,12 @@ const Methods = {
|
|
|
8948
9101
|
}
|
|
8949
9102
|
if (accordion) {
|
|
8950
9103
|
// 只能同时展开一个
|
|
8951
|
-
|
|
9104
|
+
rowExpandedMaps = {};
|
|
9105
|
+
internalData.rowExpandedMaps = rowExpandedMaps;
|
|
8952
9106
|
rows = rows.slice(rows.length - 1, rows.length);
|
|
8953
9107
|
}
|
|
8954
9108
|
const validRows = toggleMethod ? rows.filter(row => toggleMethod({
|
|
9109
|
+
$table: $xeTable,
|
|
8955
9110
|
expanded,
|
|
8956
9111
|
column: expandColumn,
|
|
8957
9112
|
columnIndex,
|
|
@@ -8962,22 +9117,22 @@ const Methods = {
|
|
|
8962
9117
|
})) : rows;
|
|
8963
9118
|
if (expanded) {
|
|
8964
9119
|
validRows.forEach(row => {
|
|
8965
|
-
const rowid = (
|
|
8966
|
-
if (!
|
|
9120
|
+
const rowid = handleGetRowId(row);
|
|
9121
|
+
if (!rowExpandedMaps[rowid]) {
|
|
8967
9122
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
8968
9123
|
const isLoad = lazy && !rowRest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
|
|
8969
9124
|
if (isLoad) {
|
|
8970
|
-
lazyRests.push(
|
|
9125
|
+
lazyRests.push(handleAsyncRowExpand($xeTable, row));
|
|
8971
9126
|
} else {
|
|
8972
|
-
|
|
9127
|
+
rowExpandedMaps[rowid] = row;
|
|
8973
9128
|
}
|
|
8974
9129
|
}
|
|
8975
9130
|
});
|
|
8976
9131
|
} else {
|
|
8977
9132
|
validRows.forEach(item => {
|
|
8978
|
-
const rowid = (
|
|
8979
|
-
if (
|
|
8980
|
-
delete
|
|
9133
|
+
const rowid = handleGetRowId(item);
|
|
9134
|
+
if (rowExpandedMaps[rowid]) {
|
|
9135
|
+
delete rowExpandedMaps[rowid];
|
|
8981
9136
|
}
|
|
8982
9137
|
});
|
|
8983
9138
|
}
|
|
@@ -8985,7 +9140,7 @@ const Methods = {
|
|
|
8985
9140
|
validRows.forEach(row => handleRowExpandReserve($xeTable, row, expanded));
|
|
8986
9141
|
}
|
|
8987
9142
|
}
|
|
8988
|
-
|
|
9143
|
+
reactData.rowExpandedFlag++;
|
|
8989
9144
|
return Promise.all(lazyRests).then(() => $xeTable.$nextTick()).then(() => $xeTable.recalculate(true)).then(() => {
|
|
8990
9145
|
updateRowOffsetTop($xeTable);
|
|
8991
9146
|
updateRowExpandStyle($xeTable);
|
|
@@ -8998,11 +9153,17 @@ const Methods = {
|
|
|
8998
9153
|
* @param {Row} row 行对象
|
|
8999
9154
|
*/
|
|
9000
9155
|
isRowExpandByRow(row) {
|
|
9156
|
+
const $xeTable = this;
|
|
9157
|
+
const reactData = $xeTable;
|
|
9158
|
+
const internalData = $xeTable;
|
|
9159
|
+
const {
|
|
9160
|
+
rowExpandedFlag
|
|
9161
|
+
} = reactData;
|
|
9001
9162
|
const {
|
|
9002
9163
|
rowExpandedMaps
|
|
9003
|
-
} =
|
|
9164
|
+
} = internalData;
|
|
9004
9165
|
const rowid = (0, _util.getRowid)(this, row);
|
|
9005
|
-
return !!rowExpandedMaps[rowid];
|
|
9166
|
+
return !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
9006
9167
|
},
|
|
9007
9168
|
isExpandByRow(row) {
|
|
9008
9169
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -9026,7 +9187,8 @@ const Methods = {
|
|
|
9026
9187
|
reserve
|
|
9027
9188
|
} = expandOpts;
|
|
9028
9189
|
const expList = $xeTable.getRowExpandRecords();
|
|
9029
|
-
|
|
9190
|
+
internalData.rowExpandedMaps = {};
|
|
9191
|
+
reactData.rowExpandedFlag++;
|
|
9030
9192
|
if (reserve) {
|
|
9031
9193
|
tableFullData.forEach(row => handleRowExpandReserve($xeTable, row, false));
|
|
9032
9194
|
}
|
|
@@ -9046,8 +9208,10 @@ const Methods = {
|
|
|
9046
9208
|
return this.$nextTick();
|
|
9047
9209
|
},
|
|
9048
9210
|
getRowExpandRecords() {
|
|
9211
|
+
const $xeTable = this;
|
|
9212
|
+
const internalData = $xeTable;
|
|
9049
9213
|
const rest = [];
|
|
9050
|
-
_xeUtils.default.each(
|
|
9214
|
+
_xeUtils.default.each(internalData.rowExpandedMaps, item => {
|
|
9051
9215
|
if (item) {
|
|
9052
9216
|
rest.push(item);
|
|
9053
9217
|
}
|
|
@@ -9055,8 +9219,10 @@ const Methods = {
|
|
|
9055
9219
|
return rest;
|
|
9056
9220
|
},
|
|
9057
9221
|
getTreeExpandRecords() {
|
|
9222
|
+
const $xeTable = this;
|
|
9223
|
+
const internalData = $xeTable;
|
|
9058
9224
|
const rest = [];
|
|
9059
|
-
_xeUtils.default.each(
|
|
9225
|
+
_xeUtils.default.each(internalData.treeExpandedMaps, item => {
|
|
9060
9226
|
if (item) {
|
|
9061
9227
|
rest.push(item);
|
|
9062
9228
|
}
|
|
@@ -9092,15 +9258,14 @@ const Methods = {
|
|
|
9092
9258
|
const reactData = $xeTable;
|
|
9093
9259
|
const internalData = $xeTable;
|
|
9094
9260
|
const {
|
|
9095
|
-
fullAllDataRowIdData
|
|
9261
|
+
fullAllDataRowIdData,
|
|
9262
|
+
treeExpandedMaps
|
|
9096
9263
|
} = internalData;
|
|
9097
9264
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
9098
9265
|
const {
|
|
9099
9266
|
transform
|
|
9100
9267
|
} = treeOpts;
|
|
9101
|
-
let tExpandedMaps = {};
|
|
9102
9268
|
if (rows) {
|
|
9103
|
-
tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
|
|
9104
9269
|
if (!_xeUtils.default.isArray(rows)) {
|
|
9105
9270
|
rows = [rows];
|
|
9106
9271
|
}
|
|
@@ -9109,8 +9274,8 @@ const Methods = {
|
|
|
9109
9274
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
9110
9275
|
if (rowRest) {
|
|
9111
9276
|
rowRest.treeLoaded = false;
|
|
9112
|
-
if (
|
|
9113
|
-
delete
|
|
9277
|
+
if (treeExpandedMaps[rowid]) {
|
|
9278
|
+
delete treeExpandedMaps[rowid];
|
|
9114
9279
|
}
|
|
9115
9280
|
}
|
|
9116
9281
|
});
|
|
@@ -9119,7 +9284,8 @@ const Methods = {
|
|
|
9119
9284
|
rowRest.treeLoaded = false;
|
|
9120
9285
|
});
|
|
9121
9286
|
}
|
|
9122
|
-
|
|
9287
|
+
internalData.treeExpandedMaps = {};
|
|
9288
|
+
reactData.treeExpandedFlag++;
|
|
9123
9289
|
if (transform) {
|
|
9124
9290
|
handleVirtualTreeToList($xeTable);
|
|
9125
9291
|
return $xeTable.handleTableData();
|
|
@@ -9132,45 +9298,49 @@ const Methods = {
|
|
|
9132
9298
|
*/
|
|
9133
9299
|
reloadTreeExpand(row) {
|
|
9134
9300
|
const $xeTable = this;
|
|
9301
|
+
const internalData = $xeTable;
|
|
9135
9302
|
const {
|
|
9136
|
-
treeOpts,
|
|
9137
9303
|
treeExpandLazyLoadedMaps
|
|
9138
|
-
} =
|
|
9304
|
+
} = internalData;
|
|
9305
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9139
9306
|
const {
|
|
9140
9307
|
transform,
|
|
9141
9308
|
lazy
|
|
9142
9309
|
} = treeOpts;
|
|
9143
9310
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
9144
|
-
const rowid = (0, _util.getRowid)(
|
|
9311
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
9145
9312
|
if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
|
|
9146
|
-
return
|
|
9147
|
-
return
|
|
9313
|
+
return $xeTable.clearTreeExpandLoaded(row).then(() => {
|
|
9314
|
+
return handleAsyncTreeExpandChilds($xeTable, row);
|
|
9148
9315
|
}).then(() => {
|
|
9149
9316
|
if (transform) {
|
|
9150
9317
|
handleVirtualTreeToList($xeTable);
|
|
9151
|
-
return
|
|
9318
|
+
return $xeTable.handleTableData();
|
|
9152
9319
|
}
|
|
9153
9320
|
}).then(() => {
|
|
9154
|
-
return
|
|
9321
|
+
return $xeTable.recalculate();
|
|
9155
9322
|
});
|
|
9156
9323
|
}
|
|
9157
|
-
return
|
|
9324
|
+
return $xeTable.$nextTick();
|
|
9158
9325
|
},
|
|
9159
9326
|
reloadTreeChilds(row) {
|
|
9327
|
+
const $xeTable = this;
|
|
9160
9328
|
if (process.env.NODE_ENV === 'development') {
|
|
9161
9329
|
(0, _log.warnLog)('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
9162
9330
|
}
|
|
9163
9331
|
// 即将废弃
|
|
9164
|
-
return
|
|
9332
|
+
return $xeTable.reloadTreeExpand(row);
|
|
9165
9333
|
},
|
|
9166
9334
|
/**
|
|
9167
9335
|
* 展开树节点事件
|
|
9168
9336
|
*/
|
|
9169
9337
|
triggerTreeExpandEvent(evnt, params) {
|
|
9338
|
+
const $xeTable = this;
|
|
9339
|
+
const internalData = $xeTable;
|
|
9170
9340
|
const {
|
|
9171
|
-
treeOpts,
|
|
9172
9341
|
treeExpandLazyLoadedMaps
|
|
9173
|
-
} =
|
|
9342
|
+
} = internalData;
|
|
9343
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9174
9344
|
const {
|
|
9175
9345
|
row,
|
|
9176
9346
|
column
|
|
@@ -9185,11 +9355,11 @@ const Methods = {
|
|
|
9185
9355
|
evnt.stopPropagation();
|
|
9186
9356
|
const rowid = (0, _util.getRowid)(this, row);
|
|
9187
9357
|
if (!lazy || !treeExpandLazyLoadedMaps[rowid]) {
|
|
9188
|
-
const expanded =
|
|
9189
|
-
const columnIndex =
|
|
9190
|
-
const $columnIndex =
|
|
9191
|
-
|
|
9192
|
-
|
|
9358
|
+
const expanded = !$xeTable.isTreeExpandByRow(row);
|
|
9359
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
9360
|
+
const $columnIndex = $xeTable.getVMColumnIndex(column);
|
|
9361
|
+
$xeTable.setTreeExpand(row, expanded);
|
|
9362
|
+
$xeTable.dispatchEvent('toggle-tree-expand', {
|
|
9193
9363
|
expanded,
|
|
9194
9364
|
column,
|
|
9195
9365
|
columnIndex,
|
|
@@ -9204,112 +9374,6 @@ const Methods = {
|
|
|
9204
9374
|
toggleTreeExpand(row) {
|
|
9205
9375
|
return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
|
|
9206
9376
|
},
|
|
9207
|
-
/**
|
|
9208
|
-
* 处理默认展开树节点
|
|
9209
|
-
*/
|
|
9210
|
-
handleDefaultTreeExpand() {
|
|
9211
|
-
const {
|
|
9212
|
-
treeConfig,
|
|
9213
|
-
treeOpts,
|
|
9214
|
-
tableFullData
|
|
9215
|
-
} = this;
|
|
9216
|
-
if (treeConfig) {
|
|
9217
|
-
const {
|
|
9218
|
-
expandAll,
|
|
9219
|
-
expandRowKeys
|
|
9220
|
-
} = treeOpts;
|
|
9221
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9222
|
-
if (expandAll) {
|
|
9223
|
-
this.setAllTreeExpand(true);
|
|
9224
|
-
} else if (expandRowKeys) {
|
|
9225
|
-
const defExpandeds = [];
|
|
9226
|
-
const rowkey = (0, _util.getRowkey)(this);
|
|
9227
|
-
expandRowKeys.forEach(rowid => {
|
|
9228
|
-
const matchObj = _xeUtils.default.findTree(tableFullData, item => rowid === _xeUtils.default.get(item, rowkey), {
|
|
9229
|
-
children: childrenField
|
|
9230
|
-
});
|
|
9231
|
-
if (matchObj) {
|
|
9232
|
-
defExpandeds.push(matchObj.item);
|
|
9233
|
-
}
|
|
9234
|
-
});
|
|
9235
|
-
this.setTreeExpand(defExpandeds, true);
|
|
9236
|
-
}
|
|
9237
|
-
}
|
|
9238
|
-
},
|
|
9239
|
-
handleAsyncTreeExpandChilds(row) {
|
|
9240
|
-
const $xeTable = this;
|
|
9241
|
-
const {
|
|
9242
|
-
treeOpts,
|
|
9243
|
-
checkboxOpts
|
|
9244
|
-
} = this;
|
|
9245
|
-
const {
|
|
9246
|
-
transform,
|
|
9247
|
-
loadMethod
|
|
9248
|
-
} = treeOpts;
|
|
9249
|
-
const {
|
|
9250
|
-
checkStrictly
|
|
9251
|
-
} = checkboxOpts;
|
|
9252
|
-
return new Promise(resolve => {
|
|
9253
|
-
if (loadMethod) {
|
|
9254
|
-
const {
|
|
9255
|
-
treeExpandLazyLoadedMaps,
|
|
9256
|
-
fullAllDataRowIdData
|
|
9257
|
-
} = this;
|
|
9258
|
-
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
9259
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
9260
|
-
treeExpandLazyLoadedMaps[rowid] = row;
|
|
9261
|
-
Promise.resolve(loadMethod({
|
|
9262
|
-
$table: $xeTable,
|
|
9263
|
-
row
|
|
9264
|
-
})).then(childRecords => {
|
|
9265
|
-
if (rowRest) {
|
|
9266
|
-
rowRest.treeLoaded = true;
|
|
9267
|
-
}
|
|
9268
|
-
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
9269
|
-
delete treeExpandLazyLoadedMaps[rowid];
|
|
9270
|
-
}
|
|
9271
|
-
if (!_xeUtils.default.isArray(childRecords)) {
|
|
9272
|
-
childRecords = [];
|
|
9273
|
-
}
|
|
9274
|
-
if (childRecords) {
|
|
9275
|
-
return this.loadTreeChildren(row, childRecords).then(childRows => {
|
|
9276
|
-
const {
|
|
9277
|
-
treeExpandedMaps
|
|
9278
|
-
} = this;
|
|
9279
|
-
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
9280
|
-
treeExpandedMaps[rowid] = row;
|
|
9281
|
-
}
|
|
9282
|
-
// 如果当前节点已选中,则展开后子节点也被选中
|
|
9283
|
-
if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
|
|
9284
|
-
handleCheckedCheckboxRow($xeTable, childRows, true);
|
|
9285
|
-
}
|
|
9286
|
-
return this.$nextTick().then(() => {
|
|
9287
|
-
if (transform) {
|
|
9288
|
-
this.handleTableData();
|
|
9289
|
-
updateAfterDataIndex($xeTable);
|
|
9290
|
-
return this.$nextTick();
|
|
9291
|
-
}
|
|
9292
|
-
});
|
|
9293
|
-
});
|
|
9294
|
-
}
|
|
9295
|
-
}).catch(() => {
|
|
9296
|
-
const {
|
|
9297
|
-
treeExpandLazyLoadedMaps
|
|
9298
|
-
} = this;
|
|
9299
|
-
if (rowRest) {
|
|
9300
|
-
rowRest.treeLoaded = false;
|
|
9301
|
-
}
|
|
9302
|
-
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
9303
|
-
delete treeExpandLazyLoadedMaps[rowid];
|
|
9304
|
-
}
|
|
9305
|
-
}).finally(() => {
|
|
9306
|
-
this.$nextTick().then(() => this.recalculate()).then(() => resolve());
|
|
9307
|
-
});
|
|
9308
|
-
} else {
|
|
9309
|
-
resolve();
|
|
9310
|
-
}
|
|
9311
|
-
});
|
|
9312
|
-
},
|
|
9313
9377
|
/**
|
|
9314
9378
|
* 设置所有树节点的展开与否
|
|
9315
9379
|
* @param {Boolean} expanded 是否展开
|
|
@@ -9341,27 +9405,35 @@ const Methods = {
|
|
|
9341
9405
|
* @returns
|
|
9342
9406
|
*/
|
|
9343
9407
|
handleBaseTreeExpand(rows, expanded) {
|
|
9408
|
+
const $xeTable = this;
|
|
9409
|
+
const reactData = $xeTable;
|
|
9410
|
+
const internalData = $xeTable;
|
|
9411
|
+
const {
|
|
9412
|
+
treeNodeColumn
|
|
9413
|
+
} = reactData;
|
|
9344
9414
|
const {
|
|
9345
9415
|
fullAllDataRowIdData,
|
|
9346
9416
|
tableFullData,
|
|
9347
9417
|
treeExpandedMaps,
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
} = this;
|
|
9418
|
+
treeExpandLazyLoadedMaps
|
|
9419
|
+
} = internalData;
|
|
9420
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9352
9421
|
const {
|
|
9353
9422
|
reserve,
|
|
9354
9423
|
lazy,
|
|
9355
9424
|
accordion,
|
|
9356
9425
|
toggleMethod
|
|
9357
9426
|
} = treeOpts;
|
|
9358
|
-
const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
|
|
9359
9427
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9360
9428
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
9361
9429
|
const result = [];
|
|
9362
|
-
const columnIndex =
|
|
9363
|
-
const $columnIndex =
|
|
9430
|
+
const columnIndex = $xeTable.getColumnIndex(treeNodeColumn);
|
|
9431
|
+
const $columnIndex = $xeTable.getVMColumnIndex(treeNodeColumn);
|
|
9432
|
+
const {
|
|
9433
|
+
handleGetRowId
|
|
9434
|
+
} = (0, _util.createHandleGetRowId)($xeTable);
|
|
9364
9435
|
let validRows = toggleMethod ? rows.filter(row => toggleMethod({
|
|
9436
|
+
$table: $xeTable,
|
|
9365
9437
|
expanded,
|
|
9366
9438
|
column: treeNodeColumn,
|
|
9367
9439
|
columnIndex,
|
|
@@ -9376,26 +9448,26 @@ const Methods = {
|
|
|
9376
9448
|
});
|
|
9377
9449
|
if (matchObj) {
|
|
9378
9450
|
matchObj.items.forEach(item => {
|
|
9379
|
-
const rowid = (
|
|
9380
|
-
if (
|
|
9381
|
-
delete
|
|
9451
|
+
const rowid = handleGetRowId(item);
|
|
9452
|
+
if (treeExpandedMaps[rowid]) {
|
|
9453
|
+
delete treeExpandedMaps[rowid];
|
|
9382
9454
|
}
|
|
9383
9455
|
});
|
|
9384
9456
|
}
|
|
9385
9457
|
}
|
|
9386
9458
|
if (expanded) {
|
|
9387
9459
|
validRows.forEach(row => {
|
|
9388
|
-
const rowid = (
|
|
9389
|
-
if (!
|
|
9460
|
+
const rowid = handleGetRowId(row);
|
|
9461
|
+
if (!treeExpandedMaps[rowid]) {
|
|
9390
9462
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
9391
9463
|
if (rowRest) {
|
|
9392
9464
|
const isLoad = lazy && row[hasChildField] && !rowRest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
|
|
9393
9465
|
// 是否使用懒加载
|
|
9394
9466
|
if (isLoad) {
|
|
9395
|
-
result.push(
|
|
9467
|
+
result.push(handleAsyncTreeExpandChilds($xeTable, row));
|
|
9396
9468
|
} else {
|
|
9397
9469
|
if (row[childrenField] && row[childrenField].length) {
|
|
9398
|
-
|
|
9470
|
+
treeExpandedMaps[rowid] = row;
|
|
9399
9471
|
}
|
|
9400
9472
|
}
|
|
9401
9473
|
}
|
|
@@ -9403,18 +9475,18 @@ const Methods = {
|
|
|
9403
9475
|
});
|
|
9404
9476
|
} else {
|
|
9405
9477
|
validRows.forEach(item => {
|
|
9406
|
-
const rowid = (
|
|
9407
|
-
if (
|
|
9408
|
-
delete
|
|
9478
|
+
const rowid = handleGetRowId(item);
|
|
9479
|
+
if (treeExpandedMaps[rowid]) {
|
|
9480
|
+
delete treeExpandedMaps[rowid];
|
|
9409
9481
|
}
|
|
9410
9482
|
});
|
|
9411
9483
|
}
|
|
9412
9484
|
if (reserve) {
|
|
9413
|
-
validRows.forEach(row =>
|
|
9485
|
+
validRows.forEach(row => handleTreeExpandReserve($xeTable, row, expanded));
|
|
9414
9486
|
}
|
|
9415
|
-
|
|
9487
|
+
reactData.treeExpandedFlag++;
|
|
9416
9488
|
return Promise.all(result).then(() => {
|
|
9417
|
-
return
|
|
9489
|
+
return $xeTable.recalculate();
|
|
9418
9490
|
});
|
|
9419
9491
|
},
|
|
9420
9492
|
/**
|
|
@@ -9471,40 +9543,49 @@ const Methods = {
|
|
|
9471
9543
|
* @param {Row} row 行对象
|
|
9472
9544
|
*/
|
|
9473
9545
|
isTreeExpandByRow(row) {
|
|
9546
|
+
const $xeTable = this;
|
|
9547
|
+
const reactData = $xeTable;
|
|
9548
|
+
const internalData = $xeTable;
|
|
9549
|
+
const {
|
|
9550
|
+
treeExpandedFlag
|
|
9551
|
+
} = reactData;
|
|
9474
9552
|
const {
|
|
9475
9553
|
treeExpandedMaps
|
|
9476
|
-
} =
|
|
9477
|
-
return !!treeExpandedMaps[(0, _util.getRowid)(
|
|
9554
|
+
} = internalData;
|
|
9555
|
+
return !!treeExpandedFlag && !!treeExpandedMaps[(0, _util.getRowid)($xeTable, row)];
|
|
9478
9556
|
},
|
|
9479
9557
|
/**
|
|
9480
9558
|
* 手动清空树形节点的展开状态,数据会恢复成未展开的状态
|
|
9481
9559
|
*/
|
|
9482
9560
|
clearTreeExpand() {
|
|
9483
9561
|
const $xeTable = this;
|
|
9562
|
+
const reactData = $xeTable;
|
|
9563
|
+
const internalData = $xeTable;
|
|
9484
9564
|
const {
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9565
|
+
tableFullTreeData
|
|
9566
|
+
} = internalData;
|
|
9567
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9568
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9488
9569
|
const {
|
|
9489
9570
|
transform,
|
|
9490
9571
|
reserve
|
|
9491
9572
|
} = treeOpts;
|
|
9492
|
-
const
|
|
9493
|
-
|
|
9494
|
-
|
|
9573
|
+
const expList = $xeTable.getTreeExpandRecords();
|
|
9574
|
+
internalData.treeExpandedMaps = {};
|
|
9575
|
+
reactData.treeExpandedFlag++;
|
|
9495
9576
|
if (reserve) {
|
|
9496
|
-
_xeUtils.default.eachTree(
|
|
9577
|
+
_xeUtils.default.eachTree(tableFullTreeData, row => handleTreeExpandReserve($xeTable, row, false), {
|
|
9497
9578
|
children: childrenField
|
|
9498
9579
|
});
|
|
9499
9580
|
}
|
|
9500
|
-
return
|
|
9581
|
+
return $xeTable.handleTableData().then(() => {
|
|
9501
9582
|
if (transform) {
|
|
9502
9583
|
handleVirtualTreeToList($xeTable);
|
|
9503
|
-
return
|
|
9584
|
+
return $xeTable.handleTableData();
|
|
9504
9585
|
}
|
|
9505
9586
|
}).then(() => {
|
|
9506
9587
|
if (expList.length) {
|
|
9507
|
-
|
|
9588
|
+
$xeTable.recalculate();
|
|
9508
9589
|
}
|
|
9509
9590
|
});
|
|
9510
9591
|
},
|
|
@@ -9512,20 +9593,6 @@ const Methods = {
|
|
|
9512
9593
|
this.treeExpandedReserveRowMap = {};
|
|
9513
9594
|
return this.$nextTick();
|
|
9514
9595
|
},
|
|
9515
|
-
handleTreeExpandReserve(row, expanded) {
|
|
9516
|
-
const {
|
|
9517
|
-
treeExpandedReserveRowMap,
|
|
9518
|
-
treeOpts
|
|
9519
|
-
} = this;
|
|
9520
|
-
if (treeOpts.reserve) {
|
|
9521
|
-
const rowid = (0, _util.getRowid)(this, row);
|
|
9522
|
-
if (expanded) {
|
|
9523
|
-
treeExpandedReserveRowMap[rowid] = row;
|
|
9524
|
-
} else if (treeExpandedReserveRowMap[rowid]) {
|
|
9525
|
-
delete treeExpandedReserveRowMap[rowid];
|
|
9526
|
-
}
|
|
9527
|
-
}
|
|
9528
|
-
},
|
|
9529
9596
|
/**
|
|
9530
9597
|
* 获取表格的滚动状态
|
|
9531
9598
|
*/
|
|
@@ -9891,11 +9958,12 @@ const Methods = {
|
|
|
9891
9958
|
} = tableProps;
|
|
9892
9959
|
const {
|
|
9893
9960
|
scrollXLoad,
|
|
9894
|
-
scrollYLoad
|
|
9961
|
+
scrollYLoad,
|
|
9962
|
+
expandColumn
|
|
9895
9963
|
} = reactData;
|
|
9896
9964
|
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
9897
9965
|
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
9898
|
-
if (!(
|
|
9966
|
+
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
9899
9967
|
return;
|
|
9900
9968
|
}
|
|
9901
9969
|
const {
|
|
@@ -10187,15 +10255,15 @@ const Methods = {
|
|
|
10187
10255
|
const {
|
|
10188
10256
|
isAllOverflow,
|
|
10189
10257
|
scrollYLoad,
|
|
10190
|
-
expandColumn
|
|
10191
|
-
rowExpandedMaps
|
|
10258
|
+
expandColumn
|
|
10192
10259
|
} = reactData;
|
|
10193
10260
|
const {
|
|
10194
10261
|
scrollYStore,
|
|
10195
10262
|
elemStore,
|
|
10196
10263
|
isResizeCellHeight,
|
|
10197
10264
|
afterFullData,
|
|
10198
|
-
fullAllDataRowIdData
|
|
10265
|
+
fullAllDataRowIdData,
|
|
10266
|
+
rowExpandedMaps
|
|
10199
10267
|
} = internalData;
|
|
10200
10268
|
const {
|
|
10201
10269
|
startIndex
|
|
@@ -10457,6 +10525,8 @@ const Methods = {
|
|
|
10457
10525
|
* 更新表尾合计
|
|
10458
10526
|
*/
|
|
10459
10527
|
updateFooter() {
|
|
10528
|
+
const $xeTable = this;
|
|
10529
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
10460
10530
|
const {
|
|
10461
10531
|
showFooter,
|
|
10462
10532
|
visibleColumn,
|
|
@@ -10470,8 +10540,8 @@ const Methods = {
|
|
|
10470
10540
|
footData = visibleColumn.length ? footerMethod({
|
|
10471
10541
|
columns: visibleColumn,
|
|
10472
10542
|
data: this.afterFullData,
|
|
10473
|
-
$table:
|
|
10474
|
-
$grid:
|
|
10543
|
+
$table: $xeTable,
|
|
10544
|
+
$grid: $xeGrid
|
|
10475
10545
|
}) : [];
|
|
10476
10546
|
}
|
|
10477
10547
|
this.footerTableData = footData;
|
|
@@ -10552,7 +10622,7 @@ const Methods = {
|
|
|
10552
10622
|
if (this.footerSpanMethod) {
|
|
10553
10623
|
(0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
10554
10624
|
}
|
|
10555
|
-
setMerges(this, merges, this.mergeFooterList
|
|
10625
|
+
setMerges(this, merges, this.mergeFooterList);
|
|
10556
10626
|
return this.$nextTick().then(() => {
|
|
10557
10627
|
this.updateCellAreas();
|
|
10558
10628
|
return updateStyle($xeTable);
|
|
@@ -10607,16 +10677,19 @@ const Methods = {
|
|
|
10607
10677
|
},
|
|
10608
10678
|
dispatchEvent(type, params, evnt) {
|
|
10609
10679
|
const $xeTable = this;
|
|
10680
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
10610
10681
|
$xeTable.$emit(type, createEvent(evnt, {
|
|
10611
10682
|
$table: $xeTable,
|
|
10612
|
-
$grid: $
|
|
10683
|
+
$grid: $xeGrid
|
|
10613
10684
|
}, params));
|
|
10614
10685
|
},
|
|
10615
10686
|
// 已废弃,使用 dispatchEvent
|
|
10616
10687
|
emitEvent(type, params, evnt) {
|
|
10688
|
+
const $xeTable = this;
|
|
10689
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
10617
10690
|
this.$emit(type, Object.assign({
|
|
10618
|
-
$table:
|
|
10619
|
-
$grid:
|
|
10691
|
+
$table: $xeTable,
|
|
10692
|
+
$grid: $xeGrid,
|
|
10620
10693
|
$event: evnt
|
|
10621
10694
|
}, params));
|
|
10622
10695
|
},
|