vxe-table 3.14.5 → 3.15.0-beta.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/style.css +1 -1
- package/es/table/module/edit/mixin.js +10 -9
- package/es/table/module/export/mixin.js +14 -11
- package/es/table/src/body.js +11 -13
- package/es/table/src/footer.js +3 -16
- package/es/table/src/methods.js +202 -67
- package/es/table/src/table.js +40 -23
- package/es/table/src/util.js +0 -13
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +318 -183
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +9 -9
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +15 -11
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/body.js +14 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -27
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +231 -71
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +42 -23
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +0 -25
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +10 -9
- package/packages/table/module/export/mixin.ts +14 -11
- package/packages/table/src/body.ts +11 -13
- package/packages/table/src/footer.ts +3 -17
- package/packages/table/src/methods.ts +218 -78
- package/packages/table/src/table.ts +40 -23
- package/packages/table/src/util.ts +0 -14
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1743479120369.ttf → iconfont.1743578536739.ttf} +0 -0
- /package/es/{iconfont.1743479120369.woff → iconfont.1743578536739.woff} +0 -0
- /package/es/{iconfont.1743479120369.woff2 → iconfont.1743578536739.woff2} +0 -0
- /package/lib/{iconfont.1743479120369.ttf → iconfont.1743578536739.ttf} +0 -0
- /package/lib/{iconfont.1743479120369.woff → iconfont.1743578536739.woff} +0 -0
- /package/lib/{iconfont.1743479120369.woff2 → iconfont.1743578536739.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.
|
|
2223
|
+
const version = "3.15.0-beta.0";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2412,7 +2412,7 @@ core_.VxeUI.setConfig({
|
|
|
2412
2412
|
},
|
|
2413
2413
|
virtualXConfig: {
|
|
2414
2414
|
enabled: true,
|
|
2415
|
-
gt:
|
|
2415
|
+
gt: 28,
|
|
2416
2416
|
preSize: 0,
|
|
2417
2417
|
oSize: 1
|
|
2418
2418
|
},
|
|
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
|
|
|
2843
2843
|
const {
|
|
2844
2844
|
log: log_log
|
|
2845
2845
|
} = core_.VxeUI;
|
|
2846
|
-
const log_version = `table v${"3.
|
|
2846
|
+
const log_version = `table v${"3.15.0-beta.0"}`;
|
|
2847
2847
|
const warnLog = log_log.create('warn', log_version);
|
|
2848
2848
|
const errLog = log_log.create('error', log_version);
|
|
2849
2849
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3424,30 +3424,6 @@ function calcTreeLine(params, prevRow) {
|
|
|
3424
3424
|
}
|
|
3425
3425
|
return cellHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
|
|
3426
3426
|
}
|
|
3427
|
-
function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
3428
|
-
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
3429
|
-
const {
|
|
3430
|
-
row: mergeRowIndex,
|
|
3431
|
-
col: mergeColIndex,
|
|
3432
|
-
rowspan: mergeRowspan,
|
|
3433
|
-
colspan: mergeColspan
|
|
3434
|
-
} = mergeList[mIndex];
|
|
3435
|
-
if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
|
|
3436
|
-
if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
|
|
3437
|
-
return {
|
|
3438
|
-
rowspan: mergeRowspan,
|
|
3439
|
-
colspan: mergeColspan
|
|
3440
|
-
};
|
|
3441
|
-
}
|
|
3442
|
-
if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
|
|
3443
|
-
return {
|
|
3444
|
-
rowspan: 0,
|
|
3445
|
-
colspan: 0
|
|
3446
|
-
};
|
|
3447
|
-
}
|
|
3448
|
-
}
|
|
3449
|
-
}
|
|
3450
|
-
}
|
|
3451
3427
|
function getCellValue(row, column) {
|
|
3452
3428
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
3453
3429
|
}
|
|
@@ -6672,20 +6648,48 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
|
|
|
6672
6648
|
}
|
|
6673
6649
|
}
|
|
6674
6650
|
}
|
|
6675
|
-
function
|
|
6676
|
-
|
|
6651
|
+
function buildMergeData(mergeConfigs) {
|
|
6652
|
+
const mergeMaps = {};
|
|
6653
|
+
if (mergeConfigs && mergeConfigs.length) {
|
|
6654
|
+
for (let mIndex = 0; mIndex < mergeConfigs.length; mIndex++) {
|
|
6655
|
+
const {
|
|
6656
|
+
row: _rowIndex,
|
|
6657
|
+
col: _columnIndex,
|
|
6658
|
+
rowspan: mergeRowspan,
|
|
6659
|
+
colspan: mergeColspan
|
|
6660
|
+
} = mergeConfigs[mIndex];
|
|
6661
|
+
for (let i = 0; i < mergeRowspan; i++) {
|
|
6662
|
+
for (let j = 0; j < mergeColspan; j++) {
|
|
6663
|
+
mergeMaps[`${_rowIndex + i}:${_columnIndex + j}`] = !i && !j ? {
|
|
6664
|
+
rowspan: mergeRowspan,
|
|
6665
|
+
colspan: mergeColspan
|
|
6666
|
+
} : {
|
|
6667
|
+
rowspan: 0,
|
|
6668
|
+
colspan: 0
|
|
6669
|
+
};
|
|
6670
|
+
}
|
|
6671
|
+
}
|
|
6672
|
+
}
|
|
6673
|
+
}
|
|
6674
|
+
return mergeMaps;
|
|
6675
|
+
}
|
|
6676
|
+
const handleBodyMerge = ($xeTable, merges) => {
|
|
6677
6677
|
const internalData = $xeTable;
|
|
6678
|
+
const {
|
|
6679
|
+
fullAllDataRowIdData,
|
|
6680
|
+
fullColumnIdData,
|
|
6681
|
+
visibleColumn,
|
|
6682
|
+
afterFullData,
|
|
6683
|
+
mergeBodyList,
|
|
6684
|
+
mergeBodyMaps
|
|
6685
|
+
} = internalData;
|
|
6678
6686
|
if (merges) {
|
|
6679
|
-
// const { treeConfig } = props
|
|
6680
6687
|
const {
|
|
6681
|
-
|
|
6682
|
-
} =
|
|
6688
|
+
handleGetRowId
|
|
6689
|
+
} = createHandleGetRowId($xeTable);
|
|
6683
6690
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6684
6691
|
merges = [merges];
|
|
6685
6692
|
}
|
|
6686
|
-
// if (treeConfig && merges.length) {
|
|
6687
|
-
// errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
|
|
6688
|
-
// }
|
|
6689
6693
|
merges.forEach(item => {
|
|
6690
6694
|
let {
|
|
6691
6695
|
row,
|
|
@@ -6693,42 +6697,117 @@ function setMerges($xeTable, merges, mList, rowList) {
|
|
|
6693
6697
|
rowspan,
|
|
6694
6698
|
colspan
|
|
6695
6699
|
} = item;
|
|
6696
|
-
|
|
6697
|
-
|
|
6700
|
+
let mergeRowIndex = -1;
|
|
6701
|
+
let mergeColumnIndex = -1;
|
|
6702
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)) {
|
|
6703
|
+
mergeRowIndex = row;
|
|
6704
|
+
} else {
|
|
6705
|
+
const rowid = row ? handleGetRowId(row) : null;
|
|
6706
|
+
const rowRest = rowid ? fullAllDataRowIdData[rowid] : null;
|
|
6707
|
+
if (rowRest) {
|
|
6708
|
+
mergeRowIndex = rowRest._index;
|
|
6709
|
+
}
|
|
6698
6710
|
}
|
|
6699
6711
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(col)) {
|
|
6700
|
-
|
|
6712
|
+
mergeColumnIndex = col;
|
|
6713
|
+
} else {
|
|
6714
|
+
const colid = col ? col.id : null;
|
|
6715
|
+
const colRest = colid ? fullColumnIdData[colid] : null;
|
|
6716
|
+
if (colRest) {
|
|
6717
|
+
mergeColumnIndex = colRest._index;
|
|
6718
|
+
}
|
|
6701
6719
|
}
|
|
6702
|
-
if (
|
|
6720
|
+
if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
|
|
6703
6721
|
rowspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan) || 1;
|
|
6704
6722
|
colspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan) || 1;
|
|
6705
6723
|
if (rowspan > 1 || colspan > 1) {
|
|
6706
|
-
const
|
|
6707
|
-
const
|
|
6724
|
+
const row = afterFullData[mergeRowIndex];
|
|
6725
|
+
const column = visibleColumn[mergeColumnIndex];
|
|
6726
|
+
let mergeItem = mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`];
|
|
6708
6727
|
if (mergeItem) {
|
|
6709
6728
|
mergeItem.rowspan = rowspan;
|
|
6710
6729
|
mergeItem.colspan = colspan;
|
|
6711
6730
|
mergeItem._rowspan = rowspan;
|
|
6712
6731
|
mergeItem._colspan = colspan;
|
|
6713
6732
|
} else {
|
|
6714
|
-
|
|
6715
|
-
const mergeColIndex = visibleColumn.indexOf(col);
|
|
6716
|
-
mList.push({
|
|
6733
|
+
mergeItem = {
|
|
6717
6734
|
row: mergeRowIndex,
|
|
6718
|
-
col:
|
|
6735
|
+
col: mergeColumnIndex,
|
|
6719
6736
|
rowspan,
|
|
6720
6737
|
colspan,
|
|
6721
6738
|
_row: row,
|
|
6722
|
-
_col:
|
|
6739
|
+
_col: column,
|
|
6723
6740
|
_rowspan: rowspan,
|
|
6724
6741
|
_colspan: colspan
|
|
6725
|
-
}
|
|
6742
|
+
};
|
|
6743
|
+
mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`] = mergeItem;
|
|
6744
|
+
mergeBodyList.push(mergeItem);
|
|
6726
6745
|
}
|
|
6727
6746
|
}
|
|
6728
6747
|
}
|
|
6729
6748
|
});
|
|
6730
6749
|
}
|
|
6731
|
-
}
|
|
6750
|
+
};
|
|
6751
|
+
const handleFooterMerge = ($xeTable, merges) => {
|
|
6752
|
+
const reactData = $xeTable;
|
|
6753
|
+
const internalData = $xeTable;
|
|
6754
|
+
const {
|
|
6755
|
+
footerTableData
|
|
6756
|
+
} = reactData;
|
|
6757
|
+
const {
|
|
6758
|
+
mergeFooterList,
|
|
6759
|
+
mergeFooterMaps
|
|
6760
|
+
} = internalData;
|
|
6761
|
+
if (merges) {
|
|
6762
|
+
const {
|
|
6763
|
+
visibleColumn
|
|
6764
|
+
} = internalData;
|
|
6765
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6766
|
+
merges = [merges];
|
|
6767
|
+
}
|
|
6768
|
+
merges.forEach(item => {
|
|
6769
|
+
let {
|
|
6770
|
+
row: margeRow,
|
|
6771
|
+
col: margeCol,
|
|
6772
|
+
rowspan,
|
|
6773
|
+
colspan
|
|
6774
|
+
} = item;
|
|
6775
|
+
const mergeRowIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow) ? margeRow : -1;
|
|
6776
|
+
let mergeColumnIndex = -1;
|
|
6777
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)) {
|
|
6778
|
+
mergeColumnIndex = margeCol;
|
|
6779
|
+
}
|
|
6780
|
+
if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
|
|
6781
|
+
rowspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan) || 1;
|
|
6782
|
+
colspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan) || 1;
|
|
6783
|
+
if (rowspan > 1 || colspan > 1) {
|
|
6784
|
+
const row = footerTableData[mergeRowIndex];
|
|
6785
|
+
const column = visibleColumn[mergeColumnIndex];
|
|
6786
|
+
let mergeItem = mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`];
|
|
6787
|
+
if (mergeItem) {
|
|
6788
|
+
mergeItem.rowspan = rowspan;
|
|
6789
|
+
mergeItem.colspan = colspan;
|
|
6790
|
+
mergeItem._rowspan = rowspan;
|
|
6791
|
+
mergeItem._colspan = colspan;
|
|
6792
|
+
} else {
|
|
6793
|
+
mergeItem = {
|
|
6794
|
+
row: mergeRowIndex,
|
|
6795
|
+
col: mergeColumnIndex,
|
|
6796
|
+
rowspan,
|
|
6797
|
+
colspan,
|
|
6798
|
+
_row: row,
|
|
6799
|
+
_col: column,
|
|
6800
|
+
_rowspan: rowspan,
|
|
6801
|
+
_colspan: colspan
|
|
6802
|
+
};
|
|
6803
|
+
mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`] = mergeItem;
|
|
6804
|
+
mergeFooterList.push(mergeItem);
|
|
6805
|
+
}
|
|
6806
|
+
}
|
|
6807
|
+
}
|
|
6808
|
+
});
|
|
6809
|
+
}
|
|
6810
|
+
};
|
|
6732
6811
|
function removeMerges($xeTable, merges, mList, rowList) {
|
|
6733
6812
|
// const props = $xeTable
|
|
6734
6813
|
const internalData = $xeTable;
|
|
@@ -7463,11 +7542,11 @@ function loadScrollXData($xeTable) {
|
|
|
7463
7542
|
const reactData = $xeTable;
|
|
7464
7543
|
const internalData = $xeTable;
|
|
7465
7544
|
const {
|
|
7466
|
-
mergeList,
|
|
7467
|
-
mergeFooterList,
|
|
7468
7545
|
isScrollXBig
|
|
7469
7546
|
} = reactData;
|
|
7470
7547
|
const {
|
|
7548
|
+
mergeBodyList,
|
|
7549
|
+
mergeFooterList,
|
|
7471
7550
|
scrollXStore
|
|
7472
7551
|
} = internalData;
|
|
7473
7552
|
const {
|
|
@@ -7486,7 +7565,7 @@ function loadScrollXData($xeTable) {
|
|
|
7486
7565
|
};
|
|
7487
7566
|
scrollXStore.visibleStartIndex = toVisibleIndex - 1;
|
|
7488
7567
|
scrollXStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
7489
|
-
calculateMergerOffsetIndex(
|
|
7568
|
+
calculateMergerOffsetIndex(mergeBodyList.concat(mergeFooterList), offsetItem, 'col');
|
|
7490
7569
|
const {
|
|
7491
7570
|
startIndex: offsetStartIndex,
|
|
7492
7571
|
endIndex: offsetEndIndex
|
|
@@ -7711,11 +7790,11 @@ function loadScrollYData($xeTable) {
|
|
|
7711
7790
|
const reactData = $xeTable;
|
|
7712
7791
|
const internalData = $xeTable;
|
|
7713
7792
|
const {
|
|
7714
|
-
mergeList,
|
|
7715
7793
|
isAllOverflow,
|
|
7716
7794
|
isScrollYBig
|
|
7717
7795
|
} = reactData;
|
|
7718
7796
|
const {
|
|
7797
|
+
mergeBodyList,
|
|
7719
7798
|
scrollYStore
|
|
7720
7799
|
} = internalData;
|
|
7721
7800
|
const {
|
|
@@ -7735,7 +7814,7 @@ function loadScrollYData($xeTable) {
|
|
|
7735
7814
|
};
|
|
7736
7815
|
scrollYStore.visibleStartIndex = toVisibleIndex - 1;
|
|
7737
7816
|
scrollYStore.visibleEndIndex = toVisibleIndex + visibleSize + 1;
|
|
7738
|
-
calculateMergerOffsetIndex(
|
|
7817
|
+
calculateMergerOffsetIndex(mergeBodyList, offsetItem, 'row');
|
|
7739
7818
|
const {
|
|
7740
7819
|
startIndex: offsetStartIndex,
|
|
7741
7820
|
endIndex: offsetEndIndex
|
|
@@ -8169,7 +8248,7 @@ const Methods = {
|
|
|
8169
8248
|
* 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
|
|
8170
8249
|
*/
|
|
8171
8250
|
syncData() {
|
|
8172
|
-
|
|
8251
|
+
errLog('vxe.error.delFunc', ['syncData', 'getData']);
|
|
8173
8252
|
return this.$nextTick().then(() => {
|
|
8174
8253
|
this.tableData = [];
|
|
8175
8254
|
return this.$nextTick().then(() => this.loadTableData(this.tableFullData, true));
|
|
@@ -8180,38 +8259,43 @@ const Methods = {
|
|
|
8180
8259
|
* 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
|
|
8181
8260
|
*/
|
|
8182
8261
|
updateData() {
|
|
8262
|
+
const $xeTable = this;
|
|
8263
|
+
const reactData = $xeTable;
|
|
8183
8264
|
const {
|
|
8184
8265
|
scrollXLoad,
|
|
8185
8266
|
scrollYLoad
|
|
8186
|
-
} =
|
|
8187
|
-
return
|
|
8188
|
-
|
|
8267
|
+
} = reactData;
|
|
8268
|
+
return $xeTable.handleTableData(true).then(() => {
|
|
8269
|
+
$xeTable.updateFooter();
|
|
8189
8270
|
if (scrollXLoad || scrollYLoad) {
|
|
8190
8271
|
if (scrollXLoad) {
|
|
8191
|
-
|
|
8272
|
+
$xeTable.updateScrollXSpace();
|
|
8192
8273
|
}
|
|
8193
8274
|
if (scrollYLoad) {
|
|
8194
|
-
|
|
8275
|
+
$xeTable.updateScrollYSpace();
|
|
8195
8276
|
}
|
|
8196
|
-
return
|
|
8277
|
+
return $xeTable.refreshScroll();
|
|
8197
8278
|
}
|
|
8198
8279
|
}).then(() => {
|
|
8199
|
-
|
|
8200
|
-
return
|
|
8280
|
+
$xeTable.updateCellAreas();
|
|
8281
|
+
return $xeTable.recalculate(true);
|
|
8201
8282
|
}).then(() => {
|
|
8202
8283
|
// 存在滚动行为未结束情况
|
|
8203
|
-
setTimeout(() =>
|
|
8284
|
+
setTimeout(() => $xeTable.recalculate(), 50);
|
|
8204
8285
|
});
|
|
8205
8286
|
},
|
|
8206
8287
|
handleTableData(force) {
|
|
8207
8288
|
const $xeTable = this;
|
|
8289
|
+
const reactData = $xeTable;
|
|
8290
|
+
const internalData = $xeTable;
|
|
8291
|
+
const {
|
|
8292
|
+
scrollYLoad
|
|
8293
|
+
} = reactData;
|
|
8208
8294
|
const {
|
|
8209
|
-
scrollYLoad,
|
|
8210
8295
|
scrollYStore,
|
|
8211
|
-
fullDataRowIdData
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
let fullList = afterFullData;
|
|
8296
|
+
fullDataRowIdData
|
|
8297
|
+
} = internalData;
|
|
8298
|
+
let fullList = internalData.afterFullData;
|
|
8215
8299
|
// 是否进行数据处理
|
|
8216
8300
|
if (force) {
|
|
8217
8301
|
// 更新数据,处理筛选和排序
|
|
@@ -8220,14 +8304,17 @@ const Methods = {
|
|
|
8220
8304
|
fullList = handleVirtualTreeToList($xeTable);
|
|
8221
8305
|
}
|
|
8222
8306
|
const tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
|
|
8307
|
+
const visibleDataRowIdMaps = {};
|
|
8223
8308
|
tableData.forEach((row, $index) => {
|
|
8224
8309
|
const rowid = getRowid(this, row);
|
|
8225
8310
|
const rest = fullDataRowIdData[rowid];
|
|
8226
8311
|
if (rest) {
|
|
8227
8312
|
rest.$index = $index;
|
|
8228
8313
|
}
|
|
8314
|
+
visibleDataRowIdMaps[rowid] = row;
|
|
8229
8315
|
});
|
|
8230
8316
|
this.tableData = tableData;
|
|
8317
|
+
internalData.visibleDataRowIdData = visibleDataRowIdMaps;
|
|
8231
8318
|
return this.$nextTick();
|
|
8232
8319
|
},
|
|
8233
8320
|
/**
|
|
@@ -8312,7 +8399,7 @@ const Methods = {
|
|
|
8312
8399
|
internalData.tableFullData = fullData;
|
|
8313
8400
|
internalData.tableFullTreeData = treeData;
|
|
8314
8401
|
// 缓存数据
|
|
8315
|
-
$xeTable.cacheRowMap(
|
|
8402
|
+
$xeTable.cacheRowMap(isReset);
|
|
8316
8403
|
// 原始数据
|
|
8317
8404
|
internalData.tableSynchData = datas;
|
|
8318
8405
|
if (isReset) {
|
|
@@ -8330,6 +8417,7 @@ const Methods = {
|
|
|
8330
8417
|
$xeTable.clearMergeFooterItems();
|
|
8331
8418
|
$xeTable.handleTableData(true);
|
|
8332
8419
|
$xeTable.updateFooter();
|
|
8420
|
+
$xeTable.handleUpdateBodyMerge();
|
|
8333
8421
|
return $xeTable.$nextTick().then(() => {
|
|
8334
8422
|
updateHeight($xeTable);
|
|
8335
8423
|
updateStyle($xeTable);
|
|
@@ -8506,7 +8594,7 @@ const Methods = {
|
|
|
8506
8594
|
/**
|
|
8507
8595
|
* 更新数据行的 Map
|
|
8508
8596
|
*/
|
|
8509
|
-
cacheRowMap() {
|
|
8597
|
+
cacheRowMap(isReset) {
|
|
8510
8598
|
const $xeTable = this;
|
|
8511
8599
|
const props = $xeTable;
|
|
8512
8600
|
const reactData = $xeTable;
|
|
@@ -8526,7 +8614,7 @@ const Methods = {
|
|
|
8526
8614
|
const {
|
|
8527
8615
|
lazy
|
|
8528
8616
|
} = treeOpts;
|
|
8529
|
-
const fullAllDataRowIdMaps = {
|
|
8617
|
+
const fullAllDataRowIdMaps = isReset ? {} : {
|
|
8530
8618
|
...fullAllDataRowIdData
|
|
8531
8619
|
}; // 存在已删除数据
|
|
8532
8620
|
const fullDataRowIdMaps = {};
|
|
@@ -11542,6 +11630,29 @@ const Methods = {
|
|
|
11542
11630
|
this.updateCellAreas();
|
|
11543
11631
|
this.recalculate(true);
|
|
11544
11632
|
},
|
|
11633
|
+
/**
|
|
11634
|
+
* 处理合并
|
|
11635
|
+
*/
|
|
11636
|
+
handleUpdateBodyMerge() {
|
|
11637
|
+
const $xeTable = this;
|
|
11638
|
+
const reactData = $xeTable;
|
|
11639
|
+
const internalData = $xeTable;
|
|
11640
|
+
const {
|
|
11641
|
+
mergeBodyList
|
|
11642
|
+
} = internalData;
|
|
11643
|
+
internalData.mergeBodyCellMaps = buildMergeData(mergeBodyList);
|
|
11644
|
+
reactData.mergeBodyFlag++;
|
|
11645
|
+
},
|
|
11646
|
+
handleUpdateFooterMerge() {
|
|
11647
|
+
const $xeTable = this;
|
|
11648
|
+
const reactData = $xeTable;
|
|
11649
|
+
const internalData = $xeTable;
|
|
11650
|
+
const {
|
|
11651
|
+
mergeFooterList
|
|
11652
|
+
} = internalData;
|
|
11653
|
+
internalData.mergeFooterCellMaps = buildMergeData(mergeFooterList);
|
|
11654
|
+
reactData.mergeFootFlag++;
|
|
11655
|
+
},
|
|
11545
11656
|
handleTargetLeaveEvent() {
|
|
11546
11657
|
const $xeTable = this;
|
|
11547
11658
|
const internalData = $xeTable;
|
|
@@ -15731,26 +15842,33 @@ const Methods = {
|
|
|
15731
15842
|
*/
|
|
15732
15843
|
updateFooter() {
|
|
15733
15844
|
const $xeTable = this;
|
|
15845
|
+
const props = $xeTable;
|
|
15846
|
+
const reactData = $xeTable;
|
|
15847
|
+
const internalData = $xeTable;
|
|
15734
15848
|
const $xeGrid = $xeTable.$xeGrid;
|
|
15735
15849
|
const {
|
|
15736
15850
|
showFooter,
|
|
15737
|
-
visibleColumn,
|
|
15738
15851
|
footerData,
|
|
15739
15852
|
footerMethod
|
|
15740
|
-
} =
|
|
15853
|
+
} = props;
|
|
15854
|
+
const {
|
|
15855
|
+
visibleColumn,
|
|
15856
|
+
afterFullData
|
|
15857
|
+
} = internalData;
|
|
15741
15858
|
let footData = [];
|
|
15742
15859
|
if (showFooter && footerData && footerData.length) {
|
|
15743
15860
|
footData = footerData.slice(0);
|
|
15744
15861
|
} else if (showFooter && footerMethod) {
|
|
15745
15862
|
footData = visibleColumn.length ? footerMethod({
|
|
15746
15863
|
columns: visibleColumn,
|
|
15747
|
-
data:
|
|
15864
|
+
data: afterFullData,
|
|
15748
15865
|
$table: $xeTable,
|
|
15749
15866
|
$grid: $xeGrid
|
|
15750
15867
|
}) : [];
|
|
15751
15868
|
}
|
|
15752
|
-
|
|
15753
|
-
|
|
15869
|
+
reactData.footerTableData = footData;
|
|
15870
|
+
$xeTable.handleUpdateFooterMerge();
|
|
15871
|
+
return $xeTable.$nextTick();
|
|
15754
15872
|
},
|
|
15755
15873
|
/**
|
|
15756
15874
|
* 更新列状态 updateStatus({ row, column }, cellValue)
|
|
@@ -15775,12 +15893,14 @@ const Methods = {
|
|
|
15775
15893
|
*/
|
|
15776
15894
|
setMergeCells(merges) {
|
|
15777
15895
|
const $xeTable = this;
|
|
15778
|
-
|
|
15896
|
+
const props = $xeTable;
|
|
15897
|
+
if (props.spanMethod) {
|
|
15779
15898
|
errLog('vxe.error.errConflicts', ['merge-cells', 'span-method']);
|
|
15780
15899
|
}
|
|
15781
|
-
|
|
15782
|
-
|
|
15783
|
-
|
|
15900
|
+
handleBodyMerge($xeTable, merges);
|
|
15901
|
+
$xeTable.handleUpdateBodyMerge();
|
|
15902
|
+
return $xeTable.$nextTick().then(() => {
|
|
15903
|
+
$xeTable.updateCellAreas();
|
|
15784
15904
|
return updateStyle($xeTable);
|
|
15785
15905
|
});
|
|
15786
15906
|
},
|
|
@@ -15790,12 +15910,14 @@ const Methods = {
|
|
|
15790
15910
|
*/
|
|
15791
15911
|
removeMergeCells(merges) {
|
|
15792
15912
|
const $xeTable = this;
|
|
15793
|
-
|
|
15913
|
+
const props = $xeTable;
|
|
15914
|
+
const internalData = $xeTable;
|
|
15915
|
+
if (props.spanMethod) {
|
|
15794
15916
|
errLog('vxe.error.errConflicts', ['merge-cells', 'span-method']);
|
|
15795
15917
|
}
|
|
15796
|
-
const rest = removeMerges(
|
|
15797
|
-
return
|
|
15798
|
-
|
|
15918
|
+
const rest = removeMerges($xeTable, merges, internalData.mergeBodyList, internalData.afterFullData);
|
|
15919
|
+
return $xeTable.$nextTick().then(() => {
|
|
15920
|
+
$xeTable.updateCellAreas();
|
|
15799
15921
|
updateStyle($xeTable);
|
|
15800
15922
|
return rest;
|
|
15801
15923
|
});
|
|
@@ -15804,37 +15926,46 @@ const Methods = {
|
|
|
15804
15926
|
* 获取所有被合并的单元格
|
|
15805
15927
|
*/
|
|
15806
15928
|
getMergeCells() {
|
|
15807
|
-
|
|
15929
|
+
const $xeTable = this;
|
|
15930
|
+
const internalData = $xeTable;
|
|
15931
|
+
return internalData.mergeBodyList.slice(0);
|
|
15808
15932
|
},
|
|
15809
15933
|
/**
|
|
15810
15934
|
* 清除所有单元格合并
|
|
15811
15935
|
*/
|
|
15812
15936
|
clearMergeCells() {
|
|
15813
15937
|
const $xeTable = this;
|
|
15814
|
-
|
|
15815
|
-
|
|
15938
|
+
const internalData = $xeTable;
|
|
15939
|
+
internalData.mergeBodyList = [];
|
|
15940
|
+
internalData.mergeBodyMaps = {};
|
|
15941
|
+
internalData.mergeBodyCellMaps = {};
|
|
15942
|
+
return $xeTable.$nextTick().then(() => {
|
|
15816
15943
|
return updateStyle($xeTable);
|
|
15817
15944
|
});
|
|
15818
15945
|
},
|
|
15819
15946
|
setMergeFooterItems(merges) {
|
|
15820
15947
|
const $xeTable = this;
|
|
15821
|
-
|
|
15948
|
+
const props = $xeTable;
|
|
15949
|
+
if (props.footerSpanMethod) {
|
|
15822
15950
|
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
15823
15951
|
}
|
|
15824
|
-
|
|
15825
|
-
|
|
15826
|
-
|
|
15952
|
+
handleFooterMerge($xeTable, merges);
|
|
15953
|
+
$xeTable.handleUpdateFooterMerge();
|
|
15954
|
+
return $xeTable.$nextTick().then(() => {
|
|
15955
|
+
$xeTable.updateCellAreas();
|
|
15827
15956
|
return updateStyle($xeTable);
|
|
15828
15957
|
});
|
|
15829
15958
|
},
|
|
15830
15959
|
removeMergeFooterItems(merges) {
|
|
15831
15960
|
const $xeTable = this;
|
|
15832
|
-
|
|
15961
|
+
const props = $xeTable;
|
|
15962
|
+
const internalData = $xeTable;
|
|
15963
|
+
if (props.footerSpanMethod) {
|
|
15833
15964
|
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
15834
15965
|
}
|
|
15835
|
-
const rest = removeMerges(
|
|
15836
|
-
return
|
|
15837
|
-
|
|
15966
|
+
const rest = removeMerges($xeTable, merges, internalData.mergeFooterList);
|
|
15967
|
+
return $xeTable.$nextTick().then(() => {
|
|
15968
|
+
$xeTable.updateCellAreas();
|
|
15838
15969
|
updateStyle($xeTable);
|
|
15839
15970
|
return rest;
|
|
15840
15971
|
});
|
|
@@ -15843,15 +15974,20 @@ const Methods = {
|
|
|
15843
15974
|
* 获取所有被合并的表尾
|
|
15844
15975
|
*/
|
|
15845
15976
|
getMergeFooterItems() {
|
|
15846
|
-
|
|
15977
|
+
const $xeTable = this;
|
|
15978
|
+
const internalData = $xeTable;
|
|
15979
|
+
return internalData.mergeFooterList.slice(0);
|
|
15847
15980
|
},
|
|
15848
15981
|
/**
|
|
15849
15982
|
* 清除所有表尾合并
|
|
15850
15983
|
*/
|
|
15851
15984
|
clearMergeFooterItems() {
|
|
15852
15985
|
const $xeTable = this;
|
|
15853
|
-
|
|
15854
|
-
|
|
15986
|
+
const internalData = $xeTable;
|
|
15987
|
+
internalData.mergeFooterList = [];
|
|
15988
|
+
internalData.mergeFooterMaps = {};
|
|
15989
|
+
internalData.mergeFooterCellMaps = {};
|
|
15990
|
+
return $xeTable.$nextTick().then(() => {
|
|
15855
15991
|
return updateStyle($xeTable);
|
|
15856
15992
|
});
|
|
15857
15993
|
},
|
|
@@ -16015,14 +16151,13 @@ function renderLine(h, _vm, rowid, params, cellHeight) {
|
|
|
16015
16151
|
if (slots && slots.line) {
|
|
16016
16152
|
return $xeTable.callSlot(slots.line, params, h);
|
|
16017
16153
|
}
|
|
16018
|
-
const
|
|
16154
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
16019
16155
|
let rLevel = 0;
|
|
16020
16156
|
let prevRow = null;
|
|
16021
|
-
if (
|
|
16022
|
-
rLevel =
|
|
16023
|
-
prevRow =
|
|
16157
|
+
if (rowRest) {
|
|
16158
|
+
rLevel = rowRest.level;
|
|
16159
|
+
prevRow = rowRest.items[rowRest.treeIndex - 1];
|
|
16024
16160
|
}
|
|
16025
|
-
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
16026
16161
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
16027
16162
|
return [h('div', {
|
|
16028
16163
|
key: 'tl',
|
|
@@ -16030,7 +16165,7 @@ function renderLine(h, _vm, rowid, params, cellHeight) {
|
|
|
16030
16165
|
}, [h('div', {
|
|
16031
16166
|
class: 'vxe-tree--line',
|
|
16032
16167
|
style: {
|
|
16033
|
-
height: `${
|
|
16168
|
+
height: `${$xeTable.eqRow(afterFullData[0], row) ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
16034
16169
|
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
16035
16170
|
left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
16036
16171
|
}
|
|
@@ -16047,11 +16182,6 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16047
16182
|
const tableReactData = $xeTable;
|
|
16048
16183
|
const tableInternalData = $xeTable;
|
|
16049
16184
|
const $xeGrid = $xeTable.$xeGrid;
|
|
16050
|
-
const {
|
|
16051
|
-
fullAllDataRowIdData,
|
|
16052
|
-
fullColumnIdData,
|
|
16053
|
-
visibleColumn
|
|
16054
|
-
} = tableInternalData;
|
|
16055
16185
|
const {
|
|
16056
16186
|
columnKey,
|
|
16057
16187
|
resizable: allResizable,
|
|
@@ -16075,16 +16205,21 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16075
16205
|
currentColumn,
|
|
16076
16206
|
scrollXLoad,
|
|
16077
16207
|
scrollYLoad,
|
|
16208
|
+
mergeBodyFlag,
|
|
16078
16209
|
calcCellHeightFlag,
|
|
16079
16210
|
resizeHeightFlag,
|
|
16080
16211
|
resizeWidthFlag,
|
|
16081
|
-
mergeList,
|
|
16082
16212
|
editStore,
|
|
16083
16213
|
isAllOverflow,
|
|
16084
16214
|
validErrorMaps
|
|
16085
16215
|
} = tableReactData;
|
|
16086
16216
|
const {
|
|
16217
|
+
fullAllDataRowIdData,
|
|
16218
|
+
fullColumnIdData,
|
|
16219
|
+
mergeBodyCellMaps,
|
|
16220
|
+
visibleColumn,
|
|
16087
16221
|
afterFullData,
|
|
16222
|
+
mergeBodyList,
|
|
16088
16223
|
scrollXStore,
|
|
16089
16224
|
scrollYStore
|
|
16090
16225
|
} = tableInternalData;
|
|
@@ -16244,8 +16379,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16244
16379
|
};
|
|
16245
16380
|
let isMergeCell = false;
|
|
16246
16381
|
// 合并行或列
|
|
16247
|
-
if (
|
|
16248
|
-
const spanRest =
|
|
16382
|
+
if (mergeBodyFlag && mergeBodyList.length) {
|
|
16383
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
16249
16384
|
if (spanRest) {
|
|
16250
16385
|
const {
|
|
16251
16386
|
rowspan,
|
|
@@ -16280,7 +16415,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16280
16415
|
}
|
|
16281
16416
|
}
|
|
16282
16417
|
// 如果被合并不可隐藏
|
|
16283
|
-
if (fixedHiddenColumn &&
|
|
16418
|
+
if (fixedHiddenColumn && isMergeCell) {
|
|
16284
16419
|
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
16285
16420
|
fixedHiddenColumn = false;
|
|
16286
16421
|
}
|
|
@@ -17404,30 +17539,6 @@ const {
|
|
|
17404
17539
|
renderer: footer_renderer,
|
|
17405
17540
|
renderEmptyElement: footer_renderEmptyElement
|
|
17406
17541
|
} = core_.VxeUI;
|
|
17407
|
-
function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
17408
|
-
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
17409
|
-
const {
|
|
17410
|
-
row: mergeRowIndex,
|
|
17411
|
-
col: mergeColIndex,
|
|
17412
|
-
rowspan: mergeRowspan,
|
|
17413
|
-
colspan: mergeColspan
|
|
17414
|
-
} = mergeFooterList[mIndex];
|
|
17415
|
-
if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
|
|
17416
|
-
if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
|
|
17417
|
-
return {
|
|
17418
|
-
rowspan: mergeRowspan,
|
|
17419
|
-
colspan: mergeColspan
|
|
17420
|
-
};
|
|
17421
|
-
}
|
|
17422
|
-
if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
|
|
17423
|
-
return {
|
|
17424
|
-
rowspan: 0,
|
|
17425
|
-
colspan: 0
|
|
17426
|
-
};
|
|
17427
|
-
}
|
|
17428
|
-
}
|
|
17429
|
-
}
|
|
17430
|
-
}
|
|
17431
17542
|
function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex) {
|
|
17432
17543
|
const props = _vm;
|
|
17433
17544
|
const $xeTable = _vm.$parent;
|
|
@@ -17453,11 +17564,12 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17453
17564
|
scrollXLoad,
|
|
17454
17565
|
scrollYLoad,
|
|
17455
17566
|
overflowX,
|
|
17456
|
-
currentColumn
|
|
17457
|
-
mergeFooterList
|
|
17567
|
+
currentColumn
|
|
17458
17568
|
} = tableReactData;
|
|
17459
17569
|
const {
|
|
17460
17570
|
fullColumnIdData,
|
|
17571
|
+
mergeFooterList,
|
|
17572
|
+
mergeFooterCellMaps,
|
|
17461
17573
|
scrollXStore
|
|
17462
17574
|
} = tableInternalData;
|
|
17463
17575
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
@@ -17551,7 +17663,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17551
17663
|
let isMergeCell = false;
|
|
17552
17664
|
// 合并行或列
|
|
17553
17665
|
if (mergeFooterList.length) {
|
|
17554
|
-
const spanRest =
|
|
17666
|
+
const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
17555
17667
|
if (spanRest) {
|
|
17556
17668
|
const {
|
|
17557
17669
|
rowspan,
|
|
@@ -21320,12 +21432,10 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21320
21432
|
const {
|
|
21321
21433
|
treeConfig
|
|
21322
21434
|
} = props;
|
|
21323
|
-
const {
|
|
21324
|
-
mergeList
|
|
21325
|
-
} = reactData;
|
|
21326
21435
|
const {
|
|
21327
21436
|
tableFullTreeData,
|
|
21328
21437
|
afterFullData,
|
|
21438
|
+
mergeBodyList,
|
|
21329
21439
|
tableFullData,
|
|
21330
21440
|
fullDataRowIdData,
|
|
21331
21441
|
fullAllDataRowIdData,
|
|
@@ -21374,7 +21484,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21374
21484
|
tableFullData.unshift(item);
|
|
21375
21485
|
});
|
|
21376
21486
|
// 刷新单元格合并
|
|
21377
|
-
|
|
21487
|
+
mergeBodyList.forEach(mergeItem => {
|
|
21378
21488
|
const {
|
|
21379
21489
|
row: mergeRowIndex
|
|
21380
21490
|
} = mergeItem;
|
|
@@ -21413,7 +21523,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21413
21523
|
tableFullData.push(item);
|
|
21414
21524
|
});
|
|
21415
21525
|
// 刷新单元格合并
|
|
21416
|
-
|
|
21526
|
+
mergeBodyList.forEach(mergeItem => {
|
|
21417
21527
|
const {
|
|
21418
21528
|
row: mergeRowIndex,
|
|
21419
21529
|
rowspan: mergeRowspan
|
|
@@ -21520,7 +21630,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21520
21630
|
tableFullData.push(...newRecords);
|
|
21521
21631
|
}
|
|
21522
21632
|
// 刷新单元格合并
|
|
21523
|
-
|
|
21633
|
+
mergeBodyList.forEach(mergeItem => {
|
|
21524
21634
|
const {
|
|
21525
21635
|
row: mergeRowIndex,
|
|
21526
21636
|
rowspan: mergeRowspan
|
|
@@ -21546,6 +21656,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21546
21656
|
$xeTable.updateAfterDataIndex();
|
|
21547
21657
|
}
|
|
21548
21658
|
$xeTable.updateFooter();
|
|
21659
|
+
$xeTable.handleUpdateBodyMerge();
|
|
21549
21660
|
$xeTable.checkSelectionStatus();
|
|
21550
21661
|
if (reactData.scrollYLoad) {
|
|
21551
21662
|
$xeTable.updateScrollYSpace();
|
|
@@ -21837,13 +21948,13 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21837
21948
|
treeConfig
|
|
21838
21949
|
} = props;
|
|
21839
21950
|
const {
|
|
21840
|
-
mergeList,
|
|
21841
21951
|
editStore
|
|
21842
21952
|
} = reactData;
|
|
21843
21953
|
const {
|
|
21844
21954
|
tableFullTreeData,
|
|
21845
21955
|
selectCheckboxMaps,
|
|
21846
21956
|
afterFullData,
|
|
21957
|
+
mergeBodyList,
|
|
21847
21958
|
tableFullData,
|
|
21848
21959
|
pendingRowMaps,
|
|
21849
21960
|
insertRowMaps,
|
|
@@ -21924,7 +22035,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21924
22035
|
const afIndex = this.findRowIndexOf(afterFullData, row);
|
|
21925
22036
|
if (afIndex > -1) {
|
|
21926
22037
|
// 刷新单元格合并
|
|
21927
|
-
|
|
22038
|
+
mergeBodyList.forEach(mergeItem => {
|
|
21928
22039
|
const {
|
|
21929
22040
|
row: mergeRowIndex,
|
|
21930
22041
|
rowspan: mergeRowspan
|
|
@@ -21957,9 +22068,10 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21957
22068
|
reactData.removeRowFlag++;
|
|
21958
22069
|
reactData.insertRowFlag++;
|
|
21959
22070
|
reactData.pendingRowFlag++;
|
|
21960
|
-
$xeTable.updateFooter();
|
|
21961
22071
|
$xeTable.cacheRowMap(false);
|
|
21962
22072
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22073
|
+
$xeTable.updateFooter();
|
|
22074
|
+
$xeTable.handleUpdateBodyMerge();
|
|
21963
22075
|
if (!(treeConfig && transform)) {
|
|
21964
22076
|
$xeTable.updateAfterDataIndex();
|
|
21965
22077
|
}
|
|
@@ -22817,6 +22929,7 @@ function hasEllipsis($xeTable, column, property, allColumnOverflow) {
|
|
|
22817
22929
|
function toHtml($xeTable, opts, columns, datas) {
|
|
22818
22930
|
const props = $xeTable;
|
|
22819
22931
|
const reactData = $xeTable;
|
|
22932
|
+
const internalData = $xeTable;
|
|
22820
22933
|
const {
|
|
22821
22934
|
id,
|
|
22822
22935
|
border,
|
|
@@ -22829,9 +22942,11 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
22829
22942
|
} = props;
|
|
22830
22943
|
const {
|
|
22831
22944
|
isAllSelected,
|
|
22832
|
-
isIndeterminate
|
|
22833
|
-
mergeList
|
|
22945
|
+
isIndeterminate
|
|
22834
22946
|
} = reactData;
|
|
22947
|
+
const {
|
|
22948
|
+
mergeBodyCellMaps
|
|
22949
|
+
} = internalData;
|
|
22835
22950
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
22836
22951
|
const {
|
|
22837
22952
|
print: isPrint,
|
|
@@ -22924,15 +23039,16 @@ function toHtml($xeTable, opts, columns, datas) {
|
|
|
22924
23039
|
} else {
|
|
22925
23040
|
datas.forEach(item => {
|
|
22926
23041
|
tables.push('<tr>' + columns.map(column => {
|
|
23042
|
+
const colid = column.id;
|
|
22927
23043
|
const cellAlign = column.align || allAlign;
|
|
22928
23044
|
const classNames = hasEllipsis($xeTable, column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
|
|
22929
|
-
const cellValue = item[
|
|
23045
|
+
const cellValue = item[colid];
|
|
22930
23046
|
let rowSpan = 1;
|
|
22931
23047
|
let colSpan = 1;
|
|
22932
|
-
if (isMerge
|
|
23048
|
+
if (isMerge) {
|
|
22933
23049
|
const _rowIndex = $xeTable.getVTRowIndex(item._row);
|
|
22934
23050
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
22935
|
-
const spanRest =
|
|
23051
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
22936
23052
|
if (spanRest) {
|
|
22937
23053
|
const {
|
|
22938
23054
|
rowspan,
|
|
@@ -23632,15 +23748,15 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
23632
23748
|
} = props;
|
|
23633
23749
|
const {
|
|
23634
23750
|
initStore,
|
|
23635
|
-
mergeList,
|
|
23636
|
-
mergeFooterList,
|
|
23637
23751
|
isGroup,
|
|
23638
23752
|
footerTableData,
|
|
23639
23753
|
exportStore,
|
|
23640
23754
|
exportParams
|
|
23641
23755
|
} = reactData;
|
|
23642
23756
|
const {
|
|
23643
|
-
collectColumn
|
|
23757
|
+
collectColumn,
|
|
23758
|
+
mergeBodyList,
|
|
23759
|
+
mergeFooterList
|
|
23644
23760
|
} = internalData;
|
|
23645
23761
|
const exportOpts = $xeTable.computeExportOpts;
|
|
23646
23762
|
const hasTree = treeConfig;
|
|
@@ -23648,7 +23764,7 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
23648
23764
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
23649
23765
|
const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {};
|
|
23650
23766
|
const hasFooter = !!footerTableData.length;
|
|
23651
|
-
const hasMerge = !!(
|
|
23767
|
+
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
|
|
23652
23768
|
const defOpts = Object.assign({
|
|
23653
23769
|
message: true,
|
|
23654
23770
|
isHeader: showHeader,
|
|
@@ -23829,19 +23945,19 @@ const convertToRows = originColumns => {
|
|
|
23829
23945
|
showFooter
|
|
23830
23946
|
} = props;
|
|
23831
23947
|
const {
|
|
23832
|
-
mergeList,
|
|
23833
23948
|
mergeFooterList,
|
|
23834
23949
|
isGroup
|
|
23835
23950
|
} = reactData;
|
|
23836
23951
|
const {
|
|
23837
23952
|
tableFullColumn,
|
|
23838
23953
|
afterFullData,
|
|
23954
|
+
mergeBodyList,
|
|
23839
23955
|
collectColumn
|
|
23840
23956
|
} = internalData;
|
|
23841
23957
|
const exportOpts = $xeTable.computeExportOpts;
|
|
23842
23958
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
23843
23959
|
const proxyOpts = $xeGrid ? $xeGrid.computeProxyOpts : {};
|
|
23844
|
-
const hasMerge = !!(
|
|
23960
|
+
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
|
|
23845
23961
|
const opts = Object.assign({
|
|
23846
23962
|
message: true,
|
|
23847
23963
|
isHeader: showHeader,
|
|
@@ -26097,20 +26213,22 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
26097
26213
|
} = treeOpts;
|
|
26098
26214
|
const cellStyle = {};
|
|
26099
26215
|
const rowid = handleGetRowId(row);
|
|
26100
|
-
const
|
|
26216
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
26101
26217
|
let rowLevel = 0;
|
|
26102
26218
|
let seq = -1;
|
|
26103
|
-
let _rowIndex =
|
|
26104
|
-
|
|
26105
|
-
|
|
26106
|
-
if (
|
|
26107
|
-
rowLevel =
|
|
26219
|
+
let _rowIndex = -1;
|
|
26220
|
+
let rowIndex = -1;
|
|
26221
|
+
let $rowIndex = -1;
|
|
26222
|
+
if (rowRest) {
|
|
26223
|
+
rowLevel = rowRest.level;
|
|
26108
26224
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
26109
|
-
seq =
|
|
26225
|
+
seq = rowRest._index + 1;
|
|
26110
26226
|
} else {
|
|
26111
|
-
seq =
|
|
26227
|
+
seq = rowRest.seq;
|
|
26112
26228
|
}
|
|
26113
|
-
|
|
26229
|
+
rowIndex = rowRest.index;
|
|
26230
|
+
$rowIndex = rowRest.$index;
|
|
26231
|
+
_rowIndex = rowRest._index;
|
|
26114
26232
|
}
|
|
26115
26233
|
if (expandHeight) {
|
|
26116
26234
|
cellStyle.height = `${expandHeight}px`;
|
|
@@ -26329,10 +26447,6 @@ function renderBody(h, $xeTable) {
|
|
|
26329
26447
|
hasFixedColumn: false,
|
|
26330
26448
|
// 树节点列信息
|
|
26331
26449
|
treeNodeColumn: null,
|
|
26332
|
-
// 合并单元格的对象集
|
|
26333
|
-
mergeList: [],
|
|
26334
|
-
// 合并表尾数据的对象集
|
|
26335
|
-
mergeFooterList: [],
|
|
26336
26450
|
// 初始化标识
|
|
26337
26451
|
initStore: {
|
|
26338
26452
|
filter: false,
|
|
@@ -26482,6 +26596,10 @@ function renderBody(h, $xeTable) {
|
|
|
26482
26596
|
treeExpandedFlag: 1,
|
|
26483
26597
|
updateCheckboxFlag: 1,
|
|
26484
26598
|
pendingRowFlag: 1,
|
|
26599
|
+
insertRowFlag: 1,
|
|
26600
|
+
removeRowFlag: 1,
|
|
26601
|
+
mergeBodyFlag: 1,
|
|
26602
|
+
mergeFootFlag: 1,
|
|
26485
26603
|
rowHeightStore: {
|
|
26486
26604
|
default: 48,
|
|
26487
26605
|
medium: 44,
|
|
@@ -26939,27 +27057,31 @@ function renderBody(h, $xeTable) {
|
|
|
26939
27057
|
},
|
|
26940
27058
|
computeTableRowExpandedList() {
|
|
26941
27059
|
const $xeTable = this;
|
|
27060
|
+
const props = $xeTable;
|
|
26942
27061
|
const reactData = $xeTable;
|
|
26943
27062
|
const internalData = $xeTable;
|
|
27063
|
+
const {
|
|
27064
|
+
treeConfig
|
|
27065
|
+
} = props;
|
|
26944
27066
|
const {
|
|
26945
27067
|
rowExpandedFlag,
|
|
26946
|
-
tableData,
|
|
26947
27068
|
expandColumn
|
|
26948
27069
|
} = reactData;
|
|
26949
27070
|
const {
|
|
27071
|
+
visibleDataRowIdData,
|
|
26950
27072
|
rowExpandedMaps
|
|
26951
27073
|
} = internalData;
|
|
27074
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
26952
27075
|
const {
|
|
26953
|
-
|
|
26954
|
-
} =
|
|
27076
|
+
transform
|
|
27077
|
+
} = treeOpts;
|
|
26955
27078
|
const expandList = [];
|
|
26956
27079
|
if (expandColumn && rowExpandedFlag) {
|
|
26957
|
-
|
|
26958
|
-
|
|
26959
|
-
|
|
26960
|
-
});
|
|
27080
|
+
if (treeConfig && !transform) {
|
|
27081
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().values(rowExpandedMaps);
|
|
27082
|
+
}
|
|
26961
27083
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps, (row, rowid) => {
|
|
26962
|
-
if (
|
|
27084
|
+
if (visibleDataRowIdData[rowid]) {
|
|
26963
27085
|
expandList.push(row);
|
|
26964
27086
|
}
|
|
26965
27087
|
});
|
|
@@ -27251,13 +27373,26 @@ function renderBody(h, $xeTable) {
|
|
|
27251
27373
|
tableFullColumn: [],
|
|
27252
27374
|
// 渲染所有列
|
|
27253
27375
|
visibleColumn: [],
|
|
27254
|
-
//
|
|
27376
|
+
// 全量数据集(包括当前和已删除)
|
|
27255
27377
|
fullAllDataRowIdData: {},
|
|
27378
|
+
// 数据集(仅当前)
|
|
27379
|
+
fullDataRowIdData: {},
|
|
27380
|
+
// 数据集(仅可视)
|
|
27381
|
+
visibleDataRowIdData: {},
|
|
27256
27382
|
// 渲染中缓存数据
|
|
27257
27383
|
sourceDataRowIdData: {},
|
|
27258
|
-
fullDataRowIdData: {},
|
|
27259
27384
|
fullColumnIdData: {},
|
|
27260
27385
|
fullColumnFieldData: {},
|
|
27386
|
+
// 合并单元格的数据
|
|
27387
|
+
mergeBodyList: [],
|
|
27388
|
+
mergeBodyMaps: {},
|
|
27389
|
+
// 合并表尾的数据
|
|
27390
|
+
mergeFooterList: [],
|
|
27391
|
+
mergeFooterMaps: {},
|
|
27392
|
+
// 已合并单元格数据集合
|
|
27393
|
+
mergeBodyCellMaps: {},
|
|
27394
|
+
// 已合并表尾数据集合
|
|
27395
|
+
mergeFooterCellMaps: {},
|
|
27261
27396
|
// 已展开的行集合
|
|
27262
27397
|
rowExpandedMaps: {},
|
|
27263
27398
|
// 懒加载中的展开行的集合
|