vxe-table 3.9.9 → 3.9.11
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/render/index.js +3 -0
- package/es/table/src/methods.js +123 -66
- package/es/table/src/table.js +0 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +151 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +3 -0
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +145 -76
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +0 -1
- package/lib/table/src/table.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 +3 -3
- package/packages/table/render/index.ts +3 -0
- package/packages/table/src/methods.ts +133 -67
- package/packages/table/src/table.ts +0 -1
- /package/es/{iconfont.1729060343798.ttf → iconfont.1729162486747.ttf} +0 -0
- /package/es/{iconfont.1729060343798.woff → iconfont.1729162486747.woff} +0 -0
- /package/es/{iconfont.1729060343798.woff2 → iconfont.1729162486747.woff2} +0 -0
- /package/lib/{iconfont.1729060343798.ttf → iconfont.1729162486747.ttf} +0 -0
- /package/lib/{iconfont.1729060343798.woff → iconfont.1729162486747.woff} +0 -0
- /package/lib/{iconfont.1729060343798.woff2 → iconfont.1729162486747.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,9 +2220,9 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.9.
|
|
2223
|
+
const version = "3.9.11";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
|
-
core_.VxeUI.tableVersion = "3.9.
|
|
2225
|
+
core_.VxeUI.tableVersion = "3.9.11";
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
2227
2227
|
emptyCell: ' ',
|
|
2228
2228
|
table: {
|
|
@@ -2764,7 +2764,7 @@ function isNodeElement(elem) {
|
|
|
2764
2764
|
const {
|
|
2765
2765
|
log: log_log
|
|
2766
2766
|
} = core_.VxeUI;
|
|
2767
|
-
const log_version = `table v${"3.9.
|
|
2767
|
+
const log_version = `table v${"3.9.11"}`;
|
|
2768
2768
|
const warnLog = log_log.create('warn', log_version);
|
|
2769
2769
|
const errLog = log_log.create('error', log_version);
|
|
2770
2770
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -5058,7 +5058,6 @@ const Methods = {
|
|
|
5058
5058
|
} = this;
|
|
5059
5059
|
return this.handleTableData(true).then(() => {
|
|
5060
5060
|
this.updateFooter();
|
|
5061
|
-
this.checkSelectionStatus();
|
|
5062
5061
|
if (scrollXLoad || scrollYLoad) {
|
|
5063
5062
|
if (scrollXLoad) {
|
|
5064
5063
|
this.updateScrollXSpace();
|
|
@@ -5413,7 +5412,6 @@ const Methods = {
|
|
|
5413
5412
|
treeOpts,
|
|
5414
5413
|
tableFullData,
|
|
5415
5414
|
fullAllDataRowIdData,
|
|
5416
|
-
fullAllDataRowMap,
|
|
5417
5415
|
tableFullTreeData
|
|
5418
5416
|
} = this;
|
|
5419
5417
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -5457,7 +5455,6 @@ const Methods = {
|
|
|
5457
5455
|
this.fullDataRowIdData = fullDataRowIdMaps;
|
|
5458
5456
|
}
|
|
5459
5457
|
this.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
5460
|
-
fullAllDataRowMap.clear();
|
|
5461
5458
|
if (treeConfig) {
|
|
5462
5459
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, handleCache, {
|
|
5463
5460
|
children: childrenField
|
|
@@ -5501,13 +5498,12 @@ const Methods = {
|
|
|
5501
5498
|
return this.params;
|
|
5502
5499
|
},
|
|
5503
5500
|
loadTreeChildren(row, childRecords) {
|
|
5501
|
+
const $xeTable = this;
|
|
5504
5502
|
const {
|
|
5505
5503
|
keepSource,
|
|
5506
5504
|
tableSourceData,
|
|
5507
5505
|
treeOpts,
|
|
5508
5506
|
fullDataRowIdData,
|
|
5509
|
-
fullDataRowMap,
|
|
5510
|
-
fullAllDataRowMap,
|
|
5511
5507
|
fullAllDataRowIdData,
|
|
5512
5508
|
sourceDataRowIdData
|
|
5513
5509
|
} = this;
|
|
@@ -5516,8 +5512,8 @@ const Methods = {
|
|
|
5516
5512
|
mapChildrenField
|
|
5517
5513
|
} = treeOpts;
|
|
5518
5514
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5519
|
-
const
|
|
5520
|
-
const parentLevel =
|
|
5515
|
+
const parentRest = fullAllDataRowIdData[getRowid($xeTable, row)];
|
|
5516
|
+
const parentLevel = parentRest ? parentRest.level : 0;
|
|
5521
5517
|
return this.createData(childRecords).then(rows => {
|
|
5522
5518
|
if (keepSource) {
|
|
5523
5519
|
const rowid = getRowid(this, row);
|
|
@@ -5533,8 +5529,8 @@ const Methods = {
|
|
|
5533
5529
|
});
|
|
5534
5530
|
}
|
|
5535
5531
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows, (childRow, index, items, path, parent, nodes) => {
|
|
5536
|
-
const rowid = getRowid(
|
|
5537
|
-
const parentRow = parent || row;
|
|
5532
|
+
const rowid = getRowid($xeTable, childRow);
|
|
5533
|
+
const parentRow = parent || parentRest.row;
|
|
5538
5534
|
const rest = {
|
|
5539
5535
|
row: childRow,
|
|
5540
5536
|
rowid,
|
|
@@ -5547,9 +5543,7 @@ const Methods = {
|
|
|
5547
5543
|
level: parentLevel + nodes.length
|
|
5548
5544
|
};
|
|
5549
5545
|
fullDataRowIdData[rowid] = rest;
|
|
5550
|
-
fullDataRowMap.set(childRow, rest);
|
|
5551
5546
|
fullAllDataRowIdData[rowid] = rest;
|
|
5552
|
-
fullAllDataRowMap.set(childRow, rest);
|
|
5553
5547
|
}, {
|
|
5554
5548
|
children: childrenField
|
|
5555
5549
|
});
|
|
@@ -6074,6 +6068,7 @@ const Methods = {
|
|
|
6074
6068
|
return null;
|
|
6075
6069
|
},
|
|
6076
6070
|
getCellLabel(row, fieldOrColumn) {
|
|
6071
|
+
const $xeTable = this;
|
|
6077
6072
|
const column = handleFieldOrColumn(this, fieldOrColumn);
|
|
6078
6073
|
if (!column) {
|
|
6079
6074
|
return null;
|
|
@@ -6082,17 +6077,17 @@ const Methods = {
|
|
|
6082
6077
|
const cellValue = getCellValue(row, column);
|
|
6083
6078
|
let cellLabel = cellValue;
|
|
6084
6079
|
if (formatter) {
|
|
6085
|
-
let
|
|
6080
|
+
let formatData;
|
|
6086
6081
|
const {
|
|
6087
|
-
|
|
6088
|
-
} =
|
|
6082
|
+
fullAllDataRowIdData
|
|
6083
|
+
} = $xeTable;
|
|
6084
|
+
const rowid = getRowid($xeTable, row);
|
|
6089
6085
|
const colid = column.id;
|
|
6090
|
-
const
|
|
6091
|
-
if (
|
|
6092
|
-
rest = fullAllDataRowMap.get(row);
|
|
6086
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
6087
|
+
if (rest) {
|
|
6093
6088
|
formatData = rest.formatData;
|
|
6094
6089
|
if (!formatData) {
|
|
6095
|
-
formatData =
|
|
6090
|
+
formatData = fullAllDataRowIdData[rowid].formatData = {};
|
|
6096
6091
|
}
|
|
6097
6092
|
if (rest && formatData[colid]) {
|
|
6098
6093
|
if (formatData[colid].value === cellValue) {
|
|
@@ -6634,8 +6629,9 @@ const Methods = {
|
|
|
6634
6629
|
* @param {Row} row 行对象
|
|
6635
6630
|
*/
|
|
6636
6631
|
getRowid(row) {
|
|
6637
|
-
const
|
|
6638
|
-
|
|
6632
|
+
const $xeTable = this;
|
|
6633
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($xeTable));
|
|
6634
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowid) ? '' : encodeURIComponent(rowid);
|
|
6639
6635
|
},
|
|
6640
6636
|
/**
|
|
6641
6637
|
* 获取处理后的表格数据
|
|
@@ -8643,9 +8639,8 @@ const Methods = {
|
|
|
8643
8639
|
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
8644
8640
|
rows = [rows];
|
|
8645
8641
|
}
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
}, !!value, isForce));
|
|
8642
|
+
this.handleBatchSelectRows(rows, !!value, isForce);
|
|
8643
|
+
this.checkSelectionStatus();
|
|
8649
8644
|
return this.$nextTick();
|
|
8650
8645
|
},
|
|
8651
8646
|
/**
|
|
@@ -8654,6 +8649,9 @@ const Methods = {
|
|
|
8654
8649
|
* @param {Boolean} value 是否选中
|
|
8655
8650
|
*/
|
|
8656
8651
|
setCheckboxRow(rows, value) {
|
|
8652
|
+
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
8653
|
+
rows = [rows];
|
|
8654
|
+
}
|
|
8657
8655
|
return this.handleCheckedCheckboxRow(rows, value, true);
|
|
8658
8656
|
},
|
|
8659
8657
|
isCheckedByCheckboxRow(row) {
|
|
@@ -8674,6 +8672,72 @@ const Methods = {
|
|
|
8674
8672
|
} = this;
|
|
8675
8673
|
return !!treeIndeterminateMaps[getRowid(this, row)] && !this.isCheckedByCheckboxRow(row);
|
|
8676
8674
|
},
|
|
8675
|
+
/**
|
|
8676
|
+
* 多行
|
|
8677
|
+
* 多选,行选中事件
|
|
8678
|
+
* value 选中true 不选false 半选-1
|
|
8679
|
+
*/
|
|
8680
|
+
handleBatchSelectRows(rows, value, isForce) {
|
|
8681
|
+
const $xeTable = this;
|
|
8682
|
+
const {
|
|
8683
|
+
treeConfig
|
|
8684
|
+
} = $xeTable;
|
|
8685
|
+
const {
|
|
8686
|
+
selectCheckboxMaps,
|
|
8687
|
+
checkboxOpts
|
|
8688
|
+
} = this;
|
|
8689
|
+
const {
|
|
8690
|
+
checkField,
|
|
8691
|
+
checkStrictly,
|
|
8692
|
+
checkMethod
|
|
8693
|
+
} = checkboxOpts;
|
|
8694
|
+
if (checkField) {
|
|
8695
|
+
if (treeConfig && !checkStrictly) {
|
|
8696
|
+
rows.forEach(row => {
|
|
8697
|
+
this.handleSelectRow({
|
|
8698
|
+
row
|
|
8699
|
+
}, value, isForce);
|
|
8700
|
+
});
|
|
8701
|
+
} else {
|
|
8702
|
+
rows.forEach(row => {
|
|
8703
|
+
if (isForce || !checkMethod || checkMethod({
|
|
8704
|
+
row
|
|
8705
|
+
})) {
|
|
8706
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, value);
|
|
8707
|
+
this.handleCheckboxReserveRow(row, value);
|
|
8708
|
+
}
|
|
8709
|
+
});
|
|
8710
|
+
}
|
|
8711
|
+
} else {
|
|
8712
|
+
if (treeConfig && !checkStrictly) {
|
|
8713
|
+
rows.forEach(row => {
|
|
8714
|
+
this.handleSelectRow({
|
|
8715
|
+
row
|
|
8716
|
+
}, value, isForce);
|
|
8717
|
+
});
|
|
8718
|
+
} else {
|
|
8719
|
+
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
8720
|
+
rows.forEach(row => {
|
|
8721
|
+
const rowid = getRowid($xeTable, row);
|
|
8722
|
+
if (isForce || !checkMethod || checkMethod({
|
|
8723
|
+
row
|
|
8724
|
+
})) {
|
|
8725
|
+
if (value) {
|
|
8726
|
+
if (!selectRowMaps[rowid]) {
|
|
8727
|
+
selectRowMaps[rowid] = row;
|
|
8728
|
+
}
|
|
8729
|
+
} else {
|
|
8730
|
+
if (selectRowMaps[rowid]) {
|
|
8731
|
+
delete selectRowMaps[rowid];
|
|
8732
|
+
}
|
|
8733
|
+
}
|
|
8734
|
+
this.handleCheckboxReserveRow(row, value);
|
|
8735
|
+
}
|
|
8736
|
+
});
|
|
8737
|
+
this.selectCheckboxMaps = selectRowMaps;
|
|
8738
|
+
}
|
|
8739
|
+
}
|
|
8740
|
+
},
|
|
8677
8741
|
/**
|
|
8678
8742
|
* 多选,行选中事件
|
|
8679
8743
|
* value 选中true 不选false 半选-1
|
|
@@ -8874,7 +8938,6 @@ const Methods = {
|
|
|
8874
8938
|
}
|
|
8875
8939
|
}
|
|
8876
8940
|
this.selectCheckboxMaps = selectRowMaps;
|
|
8877
|
-
this.checkSelectionStatus();
|
|
8878
8941
|
},
|
|
8879
8942
|
handleToggleCheckRowEvent(evnt, params) {
|
|
8880
8943
|
const {
|
|
@@ -8901,6 +8964,7 @@ const Methods = {
|
|
|
8901
8964
|
this.triggerCheckRowEvent(evnt, params, value);
|
|
8902
8965
|
} else {
|
|
8903
8966
|
this.handleSelectRow(params, value);
|
|
8967
|
+
this.checkSelectionStatus();
|
|
8904
8968
|
}
|
|
8905
8969
|
},
|
|
8906
8970
|
triggerCheckRowEvent(evnt, params, value) {
|
|
@@ -8940,6 +9004,7 @@ const Methods = {
|
|
|
8940
9004
|
row
|
|
8941
9005
|
})) {
|
|
8942
9006
|
this.handleSelectRow(params, value);
|
|
9007
|
+
this.checkSelectionStatus();
|
|
8943
9008
|
this.emitEvent('checkbox-change', Object.assign({
|
|
8944
9009
|
records: this.getCheckboxRecords(),
|
|
8945
9010
|
reserves: this.getCheckboxReserveRecords(),
|
|
@@ -8963,6 +9028,7 @@ const Methods = {
|
|
|
8963
9028
|
this.handleSelectRow({
|
|
8964
9029
|
row
|
|
8965
9030
|
}, value, true);
|
|
9031
|
+
this.checkSelectionStatus();
|
|
8966
9032
|
return this.$nextTick();
|
|
8967
9033
|
},
|
|
8968
9034
|
handleCheckedAllCheckboxRow(value, isForce) {
|
|
@@ -9202,12 +9268,13 @@ const Methods = {
|
|
|
9202
9268
|
},
|
|
9203
9269
|
// 还原展开、选中等相关状态
|
|
9204
9270
|
handleReserveStatus() {
|
|
9271
|
+
const $xeTable = this;
|
|
9205
9272
|
const {
|
|
9206
9273
|
expandColumn,
|
|
9207
9274
|
treeOpts,
|
|
9208
9275
|
treeConfig,
|
|
9209
9276
|
fullDataRowIdData,
|
|
9210
|
-
|
|
9277
|
+
fullAllDataRowIdData,
|
|
9211
9278
|
currentRow,
|
|
9212
9279
|
selectRadioRow,
|
|
9213
9280
|
radioReserveRow,
|
|
@@ -9219,7 +9286,7 @@ const Methods = {
|
|
|
9219
9286
|
expandOpts
|
|
9220
9287
|
} = this;
|
|
9221
9288
|
// 单选框
|
|
9222
|
-
if (selectRadioRow && !
|
|
9289
|
+
if (selectRadioRow && !fullAllDataRowIdData[getRowid($xeTable, selectRadioRow)]) {
|
|
9223
9290
|
this.selectRadioRow = null; // 刷新单选行状态
|
|
9224
9291
|
}
|
|
9225
9292
|
// 还原保留选中状态
|
|
@@ -9235,7 +9302,7 @@ const Methods = {
|
|
|
9235
9302
|
if (checkboxOpts.reserve) {
|
|
9236
9303
|
this.handleCheckedCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true, true);
|
|
9237
9304
|
}
|
|
9238
|
-
if (currentRow && !
|
|
9305
|
+
if (currentRow && !this.fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
|
|
9239
9306
|
this.currentRow = null; // 刷新当前行状态
|
|
9240
9307
|
}
|
|
9241
9308
|
// 行展开
|
|
@@ -10143,20 +10210,25 @@ const Methods = {
|
|
|
10143
10210
|
* @param {Row} row 行对象
|
|
10144
10211
|
*/
|
|
10145
10212
|
isRowExpandLoaded(row) {
|
|
10146
|
-
const
|
|
10147
|
-
|
|
10213
|
+
const $xeTable = this;
|
|
10214
|
+
const {
|
|
10215
|
+
fullAllDataRowIdData
|
|
10216
|
+
} = this;
|
|
10217
|
+
const rest = fullAllDataRowIdData[getRowid($xeTable, row)];
|
|
10218
|
+
return rest && !!rest.expandLoaded;
|
|
10148
10219
|
},
|
|
10149
10220
|
clearRowExpandLoaded(row) {
|
|
10221
|
+
const $xeTable = this;
|
|
10150
10222
|
const {
|
|
10151
10223
|
expandOpts,
|
|
10152
10224
|
rowExpandLazyLoadedMaps,
|
|
10153
|
-
|
|
10225
|
+
fullAllDataRowIdData
|
|
10154
10226
|
} = this;
|
|
10155
10227
|
const {
|
|
10156
10228
|
lazy
|
|
10157
10229
|
} = expandOpts;
|
|
10158
|
-
const rowid = getRowid(
|
|
10159
|
-
const rest =
|
|
10230
|
+
const rowid = getRowid($xeTable, row);
|
|
10231
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
10160
10232
|
if (lazy && rest) {
|
|
10161
10233
|
rest.expandLoaded = false;
|
|
10162
10234
|
const rowTempExpandLazyLoadedMaps = {
|
|
@@ -10286,54 +10358,43 @@ const Methods = {
|
|
|
10286
10358
|
return this.setRowExpand(expandedRows, expanded);
|
|
10287
10359
|
},
|
|
10288
10360
|
handleAsyncRowExpand(row) {
|
|
10289
|
-
const
|
|
10290
|
-
fullAllDataRowMap,
|
|
10291
|
-
expandOpts
|
|
10292
|
-
} = this;
|
|
10293
|
-
const rest = fullAllDataRowMap.get(row);
|
|
10361
|
+
const $xeTable = this;
|
|
10294
10362
|
return new Promise(resolve => {
|
|
10363
|
+
const {
|
|
10364
|
+
expandOpts
|
|
10365
|
+
} = this;
|
|
10295
10366
|
const {
|
|
10296
10367
|
loadMethod
|
|
10297
10368
|
} = expandOpts;
|
|
10298
10369
|
if (loadMethod) {
|
|
10299
10370
|
const {
|
|
10300
|
-
rowExpandLazyLoadedMaps
|
|
10371
|
+
rowExpandLazyLoadedMaps,
|
|
10372
|
+
fullAllDataRowIdData
|
|
10301
10373
|
} = this;
|
|
10302
|
-
const
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
const rowid = getRowid(this, row);
|
|
10306
|
-
rowTempExpandLazyLoadedMaps[rowid] = row;
|
|
10307
|
-
this.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
|
|
10374
|
+
const rowid = getRowid($xeTable, row);
|
|
10375
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
10376
|
+
rowExpandLazyLoadedMaps[rowid] = row;
|
|
10308
10377
|
loadMethod({
|
|
10309
|
-
$table:
|
|
10378
|
+
$table: $xeTable,
|
|
10310
10379
|
row,
|
|
10311
10380
|
rowIndex: this.getRowIndex(row),
|
|
10312
10381
|
$rowIndex: this.getVMRowIndex(row)
|
|
10313
10382
|
}).then(() => {
|
|
10314
|
-
rest.expandLoaded = true;
|
|
10315
10383
|
const {
|
|
10316
10384
|
rowExpandedMaps
|
|
10317
10385
|
} = this;
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
};
|
|
10321
|
-
rowTempExpandedMaps[rowid] = row;
|
|
10322
|
-
this.rowExpandedMaps = rowTempExpandedMaps;
|
|
10386
|
+
rest.expandLoaded = true;
|
|
10387
|
+
rowExpandedMaps[rowid] = row;
|
|
10323
10388
|
}).catch(() => {
|
|
10324
10389
|
rest.expandLoaded = false;
|
|
10325
10390
|
}).finally(() => {
|
|
10326
10391
|
const {
|
|
10327
10392
|
rowExpandLazyLoadedMaps
|
|
10328
10393
|
} = this;
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
};
|
|
10332
|
-
if (rowTempExpandLazyLoadedMaps[rowid]) {
|
|
10333
|
-
delete rowTempExpandLazyLoadedMaps[rowid];
|
|
10394
|
+
if (rowExpandLazyLoadedMaps[rowid]) {
|
|
10395
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
10334
10396
|
}
|
|
10335
|
-
this.
|
|
10336
|
-
resolve(this.$nextTick().then(this.recalculate));
|
|
10397
|
+
this.$nextTick().then(() => this.recalculate()).then(() => resolve());
|
|
10337
10398
|
});
|
|
10338
10399
|
} else {
|
|
10339
10400
|
resolve();
|
|
@@ -10506,21 +10567,26 @@ const Methods = {
|
|
|
10506
10567
|
* @param {Row} row 行对象
|
|
10507
10568
|
*/
|
|
10508
10569
|
isTreeExpandLoaded(row) {
|
|
10509
|
-
const
|
|
10510
|
-
|
|
10570
|
+
const $xeTable = this;
|
|
10571
|
+
const {
|
|
10572
|
+
fullAllDataRowIdData
|
|
10573
|
+
} = this;
|
|
10574
|
+
const rest = fullAllDataRowIdData[getRowid($xeTable, row)];
|
|
10575
|
+
return rest && !!rest.treeLoaded;
|
|
10511
10576
|
},
|
|
10512
10577
|
clearTreeExpandLoaded(row) {
|
|
10578
|
+
const $xeTable = this;
|
|
10513
10579
|
const {
|
|
10514
10580
|
treeOpts,
|
|
10515
10581
|
treeExpandedMaps,
|
|
10516
|
-
|
|
10582
|
+
fullAllDataRowIdData
|
|
10517
10583
|
} = this;
|
|
10518
10584
|
const {
|
|
10519
10585
|
transform,
|
|
10520
10586
|
lazy
|
|
10521
10587
|
} = treeOpts;
|
|
10522
|
-
const rowid = getRowid(
|
|
10523
|
-
const rest =
|
|
10588
|
+
const rowid = getRowid($xeTable, row);
|
|
10589
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
10524
10590
|
if (lazy && rest) {
|
|
10525
10591
|
rest.treeLoaded = false;
|
|
10526
10592
|
if (treeExpandedMaps[rowid]) {
|
|
@@ -10643,6 +10709,7 @@ const Methods = {
|
|
|
10643
10709
|
}
|
|
10644
10710
|
},
|
|
10645
10711
|
handleAsyncTreeExpandChilds(row) {
|
|
10712
|
+
const $xeTable = this;
|
|
10646
10713
|
const {
|
|
10647
10714
|
treeOpts,
|
|
10648
10715
|
checkboxOpts
|
|
@@ -10657,20 +10724,19 @@ const Methods = {
|
|
|
10657
10724
|
return new Promise(resolve => {
|
|
10658
10725
|
if (loadMethod) {
|
|
10659
10726
|
const {
|
|
10660
|
-
|
|
10661
|
-
|
|
10727
|
+
treeExpandLazyLoadedMaps,
|
|
10728
|
+
fullAllDataRowIdData
|
|
10662
10729
|
} = this;
|
|
10663
|
-
const rowid = getRowid(
|
|
10664
|
-
const rest =
|
|
10730
|
+
const rowid = getRowid($xeTable, row);
|
|
10731
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
10665
10732
|
treeExpandLazyLoadedMaps[rowid] = row;
|
|
10666
|
-
loadMethod({
|
|
10667
|
-
$table:
|
|
10733
|
+
Promise.resolve(loadMethod({
|
|
10734
|
+
$table: $xeTable,
|
|
10668
10735
|
row
|
|
10669
|
-
}).then(childRecords => {
|
|
10670
|
-
// 响应成功后则展开行,并将子节点挂载到该节点下
|
|
10736
|
+
})).then(childRecords => {
|
|
10671
10737
|
rest.treeLoaded = true;
|
|
10672
10738
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
10673
|
-
treeExpandLazyLoadedMaps[rowid]
|
|
10739
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
10674
10740
|
}
|
|
10675
10741
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(childRecords)) {
|
|
10676
10742
|
childRecords = [];
|
|
@@ -10680,16 +10746,12 @@ const Methods = {
|
|
|
10680
10746
|
const {
|
|
10681
10747
|
treeExpandedMaps
|
|
10682
10748
|
} = this;
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
};
|
|
10686
|
-
if (childRows.length && !treeTempExpandedMaps[rowid]) {
|
|
10687
|
-
treeTempExpandedMaps[rowid] = row;
|
|
10688
|
-
this.treeExpandedMaps = treeTempExpandedMaps;
|
|
10749
|
+
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
10750
|
+
treeExpandedMaps[rowid] = row;
|
|
10689
10751
|
}
|
|
10690
10752
|
// 如果当前节点已选中,则展开后子节点也被选中
|
|
10691
10753
|
if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
|
|
10692
|
-
this.handleCheckedCheckboxRow(childRows, true
|
|
10754
|
+
this.handleCheckedCheckboxRow(childRows, true);
|
|
10693
10755
|
}
|
|
10694
10756
|
return this.$nextTick().then(() => {
|
|
10695
10757
|
if (transform) {
|
|
@@ -10699,13 +10761,12 @@ const Methods = {
|
|
|
10699
10761
|
});
|
|
10700
10762
|
}
|
|
10701
10763
|
}).catch(() => {
|
|
10702
|
-
// 如果响应异常,则不展开,再次点击后将重新触发懒加载
|
|
10703
|
-
rest.treeLoaded = false;
|
|
10704
10764
|
const {
|
|
10705
10765
|
treeExpandLazyLoadedMaps
|
|
10706
10766
|
} = this;
|
|
10767
|
+
rest.treeLoaded = false;
|
|
10707
10768
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
10708
|
-
treeExpandLazyLoadedMaps[rowid]
|
|
10769
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
10709
10770
|
}
|
|
10710
10771
|
}).finally(() => {
|
|
10711
10772
|
this.$nextTick().then(() => this.recalculate()).then(() => resolve());
|
|
@@ -10747,7 +10808,7 @@ const Methods = {
|
|
|
10747
10808
|
*/
|
|
10748
10809
|
handleBaseTreeExpand(rows, expanded) {
|
|
10749
10810
|
const {
|
|
10750
|
-
|
|
10811
|
+
fullAllDataRowIdData,
|
|
10751
10812
|
tableFullData,
|
|
10752
10813
|
treeExpandedMaps,
|
|
10753
10814
|
treeOpts,
|
|
@@ -10794,7 +10855,7 @@ const Methods = {
|
|
|
10794
10855
|
validRows.forEach(row => {
|
|
10795
10856
|
const rowid = getRowid(this, row);
|
|
10796
10857
|
if (!treeTempExpandedMaps[rowid]) {
|
|
10797
|
-
const rest =
|
|
10858
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
10798
10859
|
const isLoad = lazy && row[hasChildField] && !rest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
|
|
10799
10860
|
// 是否使用懒加载
|
|
10800
10861
|
if (isLoad) {
|
|
@@ -20822,7 +20883,6 @@ function handleUupdateResize(_vm) {
|
|
|
20822
20883
|
// 渲染所有列
|
|
20823
20884
|
visibleColumn: [],
|
|
20824
20885
|
// 缓存数据集
|
|
20825
|
-
fullAllDataRowMap: new Map(),
|
|
20826
20886
|
fullAllDataRowIdData: {},
|
|
20827
20887
|
fullDataRowMap: new Map(),
|
|
20828
20888
|
fullDataRowIdData: {},
|
|
@@ -24517,6 +24577,9 @@ render_renderer.mixin({
|
|
|
24517
24577
|
})];
|
|
24518
24578
|
}
|
|
24519
24579
|
},
|
|
24580
|
+
VxeRate: {
|
|
24581
|
+
renderTableDefault: defaultEditRender
|
|
24582
|
+
},
|
|
24520
24583
|
// 以下已废弃
|
|
24521
24584
|
$input: {
|
|
24522
24585
|
tableAutoFocus: '.vxe-input--inner',
|