vxe-table 3.14.0-beta.20 → 3.14.0-beta.21
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 +14 -9
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/src/body.js +10 -10
- package/es/table/src/cell.js +15 -11
- package/es/table/src/methods.js +509 -458
- package/es/table/src/table.js +46 -26
- package/es/table/src/util.js +2 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +761 -670
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +16 -11
- package/lib/table/module/edit/mixin.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/src/body.js +16 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +22 -13
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +623 -559
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +51 -25
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +2 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +17 -12
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/src/body.ts +10 -10
- package/packages/table/src/cell.ts +15 -11
- package/packages/table/src/methods.ts +559 -481
- package/packages/table/src/table.ts +53 -31
- package/packages/table/src/util.ts +2 -2
- /package/es/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/es/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
- /package/es/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
- /package/lib/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
- /package/lib/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
- /package/lib/{iconfont.1742353673989.woff2 → iconfont.1742437924038.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.14.0-beta.
|
|
2223
|
+
const version = "3.14.0-beta.21";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -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.14.0-beta.
|
|
2846
|
+
const log_version = `table v${"3.14.0-beta.21"}`;
|
|
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
|
|
@@ -3129,7 +3129,7 @@ function createHandleUpdateRowId($xeTable) {
|
|
|
3129
3129
|
return {
|
|
3130
3130
|
rowKey,
|
|
3131
3131
|
handleUpdateRowId(row) {
|
|
3132
|
-
return updateRId(row, rowKey);
|
|
3132
|
+
return row ? updateRId(row, rowKey) : null;
|
|
3133
3133
|
}
|
|
3134
3134
|
};
|
|
3135
3135
|
}
|
|
@@ -3140,7 +3140,7 @@ function createHandleGetRowId($xeTable) {
|
|
|
3140
3140
|
return {
|
|
3141
3141
|
rowKey,
|
|
3142
3142
|
handleGetRowId(row) {
|
|
3143
|
-
return getRId(row, rowKey);
|
|
3143
|
+
return row ? getRId(row, rowKey) : null;
|
|
3144
3144
|
}
|
|
3145
3145
|
};
|
|
3146
3146
|
}
|
|
@@ -4111,11 +4111,12 @@ const Cell = {
|
|
|
4111
4111
|
const tableReactData = $table;
|
|
4112
4112
|
const tableInternalData = $table;
|
|
4113
4113
|
const {
|
|
4114
|
-
|
|
4115
|
-
treeExpandLazyLoadedMaps
|
|
4114
|
+
treeExpandedFlag
|
|
4116
4115
|
} = tableReactData;
|
|
4117
4116
|
const {
|
|
4118
|
-
fullAllDataRowIdData
|
|
4117
|
+
fullAllDataRowIdData,
|
|
4118
|
+
treeExpandedMaps,
|
|
4119
|
+
treeExpandLazyLoadedMaps
|
|
4119
4120
|
} = tableInternalData;
|
|
4120
4121
|
const treeOpts = $table.computeTreeOpts;
|
|
4121
4122
|
const {
|
|
@@ -4150,7 +4151,7 @@ const Cell = {
|
|
|
4150
4151
|
}
|
|
4151
4152
|
if (!isHidden) {
|
|
4152
4153
|
const rowid = getRowid($table, row);
|
|
4153
|
-
isActive = !!treeExpandedMaps[rowid];
|
|
4154
|
+
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid];
|
|
4154
4155
|
if (lazy) {
|
|
4155
4156
|
const rest = fullAllDataRowIdData[rowid];
|
|
4156
4157
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
|
|
@@ -4383,13 +4384,17 @@ const Cell = {
|
|
|
4383
4384
|
} = params;
|
|
4384
4385
|
const tableProps = $table;
|
|
4385
4386
|
const tableReactData = $table;
|
|
4387
|
+
const tableInternalData = $table;
|
|
4386
4388
|
const {
|
|
4387
4389
|
treeConfig
|
|
4388
4390
|
} = tableProps;
|
|
4389
4391
|
const {
|
|
4390
|
-
|
|
4391
|
-
treeIndeterminateMaps
|
|
4392
|
+
updateCheckboxFlag
|
|
4392
4393
|
} = tableReactData;
|
|
4394
|
+
const {
|
|
4395
|
+
selectCheckboxMaps,
|
|
4396
|
+
treeIndeterminateRowMaps
|
|
4397
|
+
} = tableInternalData;
|
|
4393
4398
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
4394
4399
|
const {
|
|
4395
4400
|
labelField,
|
|
@@ -4410,7 +4415,7 @@ const Cell = {
|
|
|
4410
4415
|
const ons = {};
|
|
4411
4416
|
if (!isHidden) {
|
|
4412
4417
|
const rowid = getRowid($table, row);
|
|
4413
|
-
isChecked = !!selectCheckboxMaps[rowid];
|
|
4418
|
+
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
4414
4419
|
ons.click = evnt => {
|
|
4415
4420
|
if (!isDisabled && isVisible) {
|
|
4416
4421
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
@@ -4422,7 +4427,7 @@ const Cell = {
|
|
|
4422
4427
|
});
|
|
4423
4428
|
}
|
|
4424
4429
|
if (treeConfig) {
|
|
4425
|
-
indeterminate = !!
|
|
4430
|
+
indeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
4426
4431
|
}
|
|
4427
4432
|
}
|
|
4428
4433
|
const checkboxParams = {
|
|
@@ -4468,12 +4473,16 @@ const Cell = {
|
|
|
4468
4473
|
} = params;
|
|
4469
4474
|
const tableProps = $table;
|
|
4470
4475
|
const tableReactData = $table;
|
|
4476
|
+
const tableInternalData = $table;
|
|
4471
4477
|
const {
|
|
4472
4478
|
treeConfig
|
|
4473
4479
|
} = tableProps;
|
|
4474
4480
|
const {
|
|
4475
|
-
|
|
4481
|
+
updateCheckboxFlag
|
|
4476
4482
|
} = tableReactData;
|
|
4483
|
+
const {
|
|
4484
|
+
treeIndeterminateRowMaps
|
|
4485
|
+
} = tableInternalData;
|
|
4477
4486
|
const checkboxOpts = $table.computeCheckboxOpts;
|
|
4478
4487
|
const {
|
|
4479
4488
|
labelField,
|
|
@@ -4496,7 +4505,7 @@ const Cell = {
|
|
|
4496
4505
|
const ons = {};
|
|
4497
4506
|
if (!isHidden) {
|
|
4498
4507
|
const rowid = getRowid($table, row);
|
|
4499
|
-
isChecked = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
4508
|
+
isChecked = !!updateCheckboxFlag && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
4500
4509
|
ons.click = evnt => {
|
|
4501
4510
|
if (!isDisabled && isVisible) {
|
|
4502
4511
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
@@ -4508,7 +4517,7 @@ const Cell = {
|
|
|
4508
4517
|
});
|
|
4509
4518
|
}
|
|
4510
4519
|
if (treeConfig) {
|
|
4511
|
-
isIndeterminate = !!
|
|
4520
|
+
isIndeterminate = !!treeIndeterminateRowMaps[rowid];
|
|
4512
4521
|
}
|
|
4513
4522
|
}
|
|
4514
4523
|
const checkboxParams = {
|
|
@@ -4555,11 +4564,11 @@ const Cell = {
|
|
|
4555
4564
|
row,
|
|
4556
4565
|
column
|
|
4557
4566
|
} = params;
|
|
4558
|
-
const
|
|
4567
|
+
const tableInternalData = $table;
|
|
4559
4568
|
const {
|
|
4560
4569
|
rowExpandedMaps,
|
|
4561
4570
|
rowExpandLazyLoadedMaps
|
|
4562
|
-
} =
|
|
4571
|
+
} = tableInternalData;
|
|
4563
4572
|
const expandOpts = $table.computeExpandOpts;
|
|
4564
4573
|
const {
|
|
4565
4574
|
lazy,
|
|
@@ -5523,9 +5532,12 @@ function updateAfterListIndex($xeTable) {
|
|
|
5523
5532
|
fullDataRowIdData,
|
|
5524
5533
|
fullAllDataRowIdData
|
|
5525
5534
|
} = internalData;
|
|
5535
|
+
const {
|
|
5536
|
+
handleGetRowId
|
|
5537
|
+
} = createHandleGetRowId($xeTable);
|
|
5526
5538
|
const fullMaps = {};
|
|
5527
5539
|
afterFullData.forEach((row, index) => {
|
|
5528
|
-
const rowid =
|
|
5540
|
+
const rowid = handleGetRowId(row);
|
|
5529
5541
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5530
5542
|
const seq = index + 1;
|
|
5531
5543
|
if (rowRest) {
|
|
@@ -5579,8 +5591,11 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5579
5591
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5580
5592
|
const fullMaps = {};
|
|
5581
5593
|
if (treeConfig) {
|
|
5594
|
+
const {
|
|
5595
|
+
handleGetRowId
|
|
5596
|
+
} = createHandleGetRowId($xeTable);
|
|
5582
5597
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
5583
|
-
const rowid =
|
|
5598
|
+
const rowid = handleGetRowId(row);
|
|
5584
5599
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5585
5600
|
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
5586
5601
|
if (rowRest) {
|
|
@@ -5622,25 +5637,25 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5622
5637
|
*/
|
|
5623
5638
|
function handleVirtualTreeToList($xeTable) {
|
|
5624
5639
|
const props = $xeTable;
|
|
5625
|
-
const reactData = $xeTable;
|
|
5626
5640
|
const internalData = $xeTable;
|
|
5627
5641
|
const {
|
|
5628
5642
|
treeConfig
|
|
5629
5643
|
} = props;
|
|
5630
5644
|
const {
|
|
5645
|
+
fullAllDataRowIdData,
|
|
5631
5646
|
treeExpandedMaps
|
|
5632
|
-
} = reactData;
|
|
5633
|
-
const {
|
|
5634
|
-
fullAllDataRowIdData
|
|
5635
5647
|
} = internalData;
|
|
5636
5648
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
5637
5649
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5638
5650
|
if (treeConfig && treeOpts.transform) {
|
|
5651
|
+
const {
|
|
5652
|
+
handleGetRowId
|
|
5653
|
+
} = createHandleGetRowId($xeTable);
|
|
5639
5654
|
const fullData = [];
|
|
5640
5655
|
const expandMaps = {};
|
|
5641
5656
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
|
|
5642
|
-
const rowid =
|
|
5643
|
-
const parentRowid =
|
|
5657
|
+
const rowid = handleGetRowId(row);
|
|
5658
|
+
const parentRowid = handleGetRowId(parentRow);
|
|
5644
5659
|
if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
|
|
5645
5660
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5646
5661
|
if (rowRest) {
|
|
@@ -6095,12 +6110,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6095
6110
|
const {
|
|
6096
6111
|
treeConfig
|
|
6097
6112
|
} = props;
|
|
6098
|
-
const {
|
|
6099
|
-
selectCheckboxMaps
|
|
6100
|
-
} = reactData;
|
|
6101
6113
|
const {
|
|
6102
6114
|
afterFullData,
|
|
6103
|
-
checkboxReserveRowMap
|
|
6115
|
+
checkboxReserveRowMap,
|
|
6116
|
+
selectCheckboxMaps
|
|
6104
6117
|
} = internalData;
|
|
6105
6118
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
6106
6119
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -6126,7 +6139,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6126
6139
|
row
|
|
6127
6140
|
})) {
|
|
6128
6141
|
if (checked) {
|
|
6129
|
-
selectRowMaps[
|
|
6142
|
+
selectRowMaps[handleGetRowId(row)] = row;
|
|
6130
6143
|
}
|
|
6131
6144
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, checked);
|
|
6132
6145
|
}
|
|
@@ -6232,10 +6245,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6232
6245
|
afterFullData.forEach(row => handleCheckboxReserveRow($xeTable, row, false));
|
|
6233
6246
|
}
|
|
6234
6247
|
}
|
|
6235
|
-
reactData.
|
|
6248
|
+
reactData.updateCheckboxFlag++;
|
|
6249
|
+
internalData.selectCheckboxMaps = checkField ? {} : selectRowMaps;
|
|
6236
6250
|
reactData.isAllSelected = checked;
|
|
6237
6251
|
reactData.isIndeterminate = false;
|
|
6238
|
-
reactData.treeIndeterminateMaps = {};
|
|
6239
6252
|
internalData.treeIndeterminateRowMaps = {};
|
|
6240
6253
|
$xeTable.checkSelectionStatus();
|
|
6241
6254
|
return $xeTable.$nextTick();
|
|
@@ -6251,15 +6264,15 @@ function handleReserveStatus($xeTable) {
|
|
|
6251
6264
|
const {
|
|
6252
6265
|
expandColumn,
|
|
6253
6266
|
currentRow,
|
|
6254
|
-
|
|
6255
|
-
selectRadioRow,
|
|
6256
|
-
rowExpandedMaps,
|
|
6257
|
-
treeExpandedMaps
|
|
6267
|
+
selectRadioRow
|
|
6258
6268
|
} = reactData;
|
|
6259
6269
|
const {
|
|
6260
6270
|
fullDataRowIdData,
|
|
6261
6271
|
fullAllDataRowIdData,
|
|
6262
|
-
radioReserveRow
|
|
6272
|
+
radioReserveRow,
|
|
6273
|
+
selectCheckboxMaps,
|
|
6274
|
+
treeExpandedMaps,
|
|
6275
|
+
rowExpandedMaps
|
|
6263
6276
|
} = internalData;
|
|
6264
6277
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
6265
6278
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -6277,7 +6290,8 @@ function handleReserveStatus($xeTable) {
|
|
|
6277
6290
|
}
|
|
6278
6291
|
}
|
|
6279
6292
|
// 复选框
|
|
6280
|
-
|
|
6293
|
+
internalData.selectCheckboxMaps = getRecoverRowMaps($xeTable, selectCheckboxMaps); // 刷新多选行状态
|
|
6294
|
+
reactData.updateCheckboxFlag++;
|
|
6281
6295
|
// 还原保留选中状态
|
|
6282
6296
|
if (checkboxOpts.reserve) {
|
|
6283
6297
|
handleCheckedCheckboxRow($xeTable, handleReserveRow($xeTable, internalData.checkboxReserveRowMap), true, true);
|
|
@@ -6286,17 +6300,194 @@ function handleReserveStatus($xeTable) {
|
|
|
6286
6300
|
reactData.currentRow = null; // 刷新当前行状态
|
|
6287
6301
|
}
|
|
6288
6302
|
// 行展开
|
|
6289
|
-
|
|
6303
|
+
internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {}; // 刷新行展开状态
|
|
6304
|
+
reactData.rowExpandedFlag++;
|
|
6290
6305
|
// 还原保留状态
|
|
6291
6306
|
if (expandColumn && expandOpts.reserve) {
|
|
6292
6307
|
$xeTable.setRowExpand(handleReserveRow($xeTable, internalData.rowExpandedReserveRowMap), true);
|
|
6293
6308
|
}
|
|
6294
6309
|
// 树展开
|
|
6295
|
-
|
|
6310
|
+
internalData.treeExpandedMaps = treeConfig ? getRecoverRowMaps($xeTable, treeExpandedMaps) : {}; // 刷新树展开状态
|
|
6311
|
+
reactData.treeExpandedFlag++;
|
|
6296
6312
|
if (treeConfig && treeOpts.reserve) {
|
|
6297
6313
|
$xeTable.setTreeExpand(handleReserveRow($xeTable, internalData.treeExpandedReserveRowMap), true);
|
|
6298
6314
|
}
|
|
6299
6315
|
}
|
|
6316
|
+
/**
|
|
6317
|
+
* 处理默认展开树节点
|
|
6318
|
+
*/
|
|
6319
|
+
const handleDefaultTreeExpand = $xeTable => {
|
|
6320
|
+
const props = $xeTable;
|
|
6321
|
+
const internalData = $xeTable;
|
|
6322
|
+
const {
|
|
6323
|
+
treeConfig
|
|
6324
|
+
} = props;
|
|
6325
|
+
if (treeConfig) {
|
|
6326
|
+
const {
|
|
6327
|
+
tableFullData
|
|
6328
|
+
} = internalData;
|
|
6329
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6330
|
+
const {
|
|
6331
|
+
expandAll,
|
|
6332
|
+
expandRowKeys
|
|
6333
|
+
} = treeOpts;
|
|
6334
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6335
|
+
if (expandAll) {
|
|
6336
|
+
$xeTable.setAllTreeExpand(true);
|
|
6337
|
+
} else if (expandRowKeys) {
|
|
6338
|
+
const defExpandeds = [];
|
|
6339
|
+
const rowkey = getRowkey($xeTable);
|
|
6340
|
+
expandRowKeys.forEach(rowid => {
|
|
6341
|
+
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData, item => rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, rowkey), {
|
|
6342
|
+
children: childrenField
|
|
6343
|
+
});
|
|
6344
|
+
if (matchObj) {
|
|
6345
|
+
defExpandeds.push(matchObj.item);
|
|
6346
|
+
}
|
|
6347
|
+
});
|
|
6348
|
+
$xeTable.setTreeExpand(defExpandeds, true);
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
};
|
|
6352
|
+
const handleAsyncTreeExpandChilds = ($xeTable, row) => {
|
|
6353
|
+
const reactData = $xeTable;
|
|
6354
|
+
const internalData = $xeTable;
|
|
6355
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6356
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6357
|
+
const {
|
|
6358
|
+
transform,
|
|
6359
|
+
loadMethod
|
|
6360
|
+
} = treeOpts;
|
|
6361
|
+
const {
|
|
6362
|
+
checkStrictly
|
|
6363
|
+
} = checkboxOpts;
|
|
6364
|
+
return new Promise(resolve => {
|
|
6365
|
+
if (loadMethod) {
|
|
6366
|
+
const {
|
|
6367
|
+
fullAllDataRowIdData,
|
|
6368
|
+
treeExpandLazyLoadedMaps
|
|
6369
|
+
} = internalData;
|
|
6370
|
+
const rowid = getRowid($xeTable, row);
|
|
6371
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6372
|
+
treeExpandLazyLoadedMaps[rowid] = row;
|
|
6373
|
+
Promise.resolve(loadMethod({
|
|
6374
|
+
$table: $xeTable,
|
|
6375
|
+
row
|
|
6376
|
+
})).then(childRecords => {
|
|
6377
|
+
if (rowRest) {
|
|
6378
|
+
rowRest.treeLoaded = true;
|
|
6379
|
+
}
|
|
6380
|
+
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
6381
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
6382
|
+
}
|
|
6383
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(childRecords)) {
|
|
6384
|
+
childRecords = [];
|
|
6385
|
+
}
|
|
6386
|
+
if (childRecords) {
|
|
6387
|
+
return $xeTable.loadTreeChildren(row, childRecords).then(childRows => {
|
|
6388
|
+
const {
|
|
6389
|
+
treeExpandedMaps
|
|
6390
|
+
} = internalData;
|
|
6391
|
+
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
6392
|
+
treeExpandedMaps[rowid] = row;
|
|
6393
|
+
}
|
|
6394
|
+
reactData.treeExpandedFlag++;
|
|
6395
|
+
// 如果当前节点已选中,则展开后子节点也被选中
|
|
6396
|
+
if (!checkStrictly && $xeTable.isCheckedByCheckboxRow(row)) {
|
|
6397
|
+
handleCheckedCheckboxRow($xeTable, childRows, true);
|
|
6398
|
+
}
|
|
6399
|
+
return $xeTable.$nextTick().then(() => {
|
|
6400
|
+
if (transform) {
|
|
6401
|
+
$xeTable.handleTableData();
|
|
6402
|
+
updateAfterDataIndex($xeTable);
|
|
6403
|
+
return $xeTable.$nextTick();
|
|
6404
|
+
}
|
|
6405
|
+
});
|
|
6406
|
+
});
|
|
6407
|
+
}
|
|
6408
|
+
}).catch(() => {
|
|
6409
|
+
const {
|
|
6410
|
+
treeExpandLazyLoadedMaps
|
|
6411
|
+
} = internalData;
|
|
6412
|
+
if (rowRest) {
|
|
6413
|
+
rowRest.treeLoaded = false;
|
|
6414
|
+
}
|
|
6415
|
+
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
6416
|
+
delete treeExpandLazyLoadedMaps[rowid];
|
|
6417
|
+
}
|
|
6418
|
+
}).finally(() => {
|
|
6419
|
+
reactData.treeExpandedFlag++;
|
|
6420
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve());
|
|
6421
|
+
});
|
|
6422
|
+
} else {
|
|
6423
|
+
resolve();
|
|
6424
|
+
}
|
|
6425
|
+
});
|
|
6426
|
+
};
|
|
6427
|
+
const handleTreeExpandReserve = ($xeTable, row, expanded) => {
|
|
6428
|
+
const internalData = $xeTable;
|
|
6429
|
+
const {
|
|
6430
|
+
treeExpandedReserveRowMap
|
|
6431
|
+
} = internalData;
|
|
6432
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
6433
|
+
if (treeOpts.reserve) {
|
|
6434
|
+
const rowid = getRowid($xeTable, row);
|
|
6435
|
+
if (expanded) {
|
|
6436
|
+
treeExpandedReserveRowMap[rowid] = row;
|
|
6437
|
+
} else if (treeExpandedReserveRowMap[rowid]) {
|
|
6438
|
+
delete treeExpandedReserveRowMap[rowid];
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
};
|
|
6442
|
+
const handleAsyncRowExpand = ($xeTable, row) => {
|
|
6443
|
+
const reactData = $xeTable;
|
|
6444
|
+
const internalData = $xeTable;
|
|
6445
|
+
return new Promise(resolve => {
|
|
6446
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
6447
|
+
const {
|
|
6448
|
+
loadMethod
|
|
6449
|
+
} = expandOpts;
|
|
6450
|
+
if (loadMethod) {
|
|
6451
|
+
const {
|
|
6452
|
+
fullAllDataRowIdData,
|
|
6453
|
+
rowExpandLazyLoadedMaps
|
|
6454
|
+
} = internalData;
|
|
6455
|
+
const rowid = getRowid($xeTable, row);
|
|
6456
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6457
|
+
rowExpandLazyLoadedMaps[rowid] = row;
|
|
6458
|
+
loadMethod({
|
|
6459
|
+
$table: $xeTable,
|
|
6460
|
+
row,
|
|
6461
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
6462
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
6463
|
+
}).then(() => {
|
|
6464
|
+
const {
|
|
6465
|
+
rowExpandedMaps
|
|
6466
|
+
} = internalData;
|
|
6467
|
+
if (rowRest) {
|
|
6468
|
+
rowRest.expandLoaded = true;
|
|
6469
|
+
}
|
|
6470
|
+
rowExpandedMaps[rowid] = row;
|
|
6471
|
+
reactData.rowExpandedFlag++;
|
|
6472
|
+
}).catch(() => {
|
|
6473
|
+
if (rowRest) {
|
|
6474
|
+
rowRest.expandLoaded = false;
|
|
6475
|
+
}
|
|
6476
|
+
}).finally(() => {
|
|
6477
|
+
const {
|
|
6478
|
+
rowExpandLazyLoadedMaps
|
|
6479
|
+
} = internalData;
|
|
6480
|
+
if (rowExpandLazyLoadedMaps[rowid]) {
|
|
6481
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
6482
|
+
}
|
|
6483
|
+
reactData.rowExpandedFlag++;
|
|
6484
|
+
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
|
|
6485
|
+
});
|
|
6486
|
+
} else {
|
|
6487
|
+
resolve();
|
|
6488
|
+
}
|
|
6489
|
+
});
|
|
6490
|
+
};
|
|
6300
6491
|
function calcVarRowHeightConfig($xeTable, sizeKey, sizeEl) {
|
|
6301
6492
|
const reactData = $xeTable;
|
|
6302
6493
|
const {
|
|
@@ -6371,12 +6562,15 @@ function handleVirtualYVisible($xeTable) {
|
|
|
6371
6562
|
toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1;
|
|
6372
6563
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
6373
6564
|
} else {
|
|
6565
|
+
const {
|
|
6566
|
+
handleGetRowId
|
|
6567
|
+
} = createHandleGetRowId($xeTable);
|
|
6374
6568
|
let leftIndex = 0;
|
|
6375
6569
|
let rightIndex = afterFullData.length;
|
|
6376
6570
|
while (leftIndex < rightIndex) {
|
|
6377
6571
|
const rIndex = Math.floor((leftIndex + rightIndex) / 2);
|
|
6378
6572
|
const row = afterFullData[rIndex];
|
|
6379
|
-
const rowid =
|
|
6573
|
+
const rowid = handleGetRowId(row);
|
|
6380
6574
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
6381
6575
|
if (rowRest.oTop <= startTop) {
|
|
6382
6576
|
leftIndex = rIndex + 1;
|
|
@@ -6387,7 +6581,7 @@ function handleVirtualYVisible($xeTable) {
|
|
|
6387
6581
|
toVisibleIndex = Math.max(0, leftIndex < afterFullData.length ? leftIndex - 2 : 0);
|
|
6388
6582
|
for (let rIndex = toVisibleIndex, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
6389
6583
|
const row = afterFullData[rIndex];
|
|
6390
|
-
const rowid =
|
|
6584
|
+
const rowid = handleGetRowId(row);
|
|
6391
6585
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
6392
6586
|
visibleSize++;
|
|
6393
6587
|
if (rowRest.oTop > endTop || visibleSize >= 100) {
|
|
@@ -6426,12 +6620,16 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
|
|
|
6426
6620
|
}
|
|
6427
6621
|
}
|
|
6428
6622
|
}
|
|
6429
|
-
function setMerges(
|
|
6623
|
+
function setMerges($xeTable, merges, mList, rowList) {
|
|
6624
|
+
const props = $xeTable;
|
|
6625
|
+
const internalData = $xeTable;
|
|
6430
6626
|
if (merges) {
|
|
6431
6627
|
const {
|
|
6432
|
-
treeConfig
|
|
6628
|
+
treeConfig
|
|
6629
|
+
} = props;
|
|
6630
|
+
const {
|
|
6433
6631
|
visibleColumn
|
|
6434
|
-
} =
|
|
6632
|
+
} = internalData;
|
|
6435
6633
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6436
6634
|
merges = [merges];
|
|
6437
6635
|
}
|
|
@@ -6481,13 +6679,17 @@ function setMerges(_vm, merges, mList, rowList) {
|
|
|
6481
6679
|
});
|
|
6482
6680
|
}
|
|
6483
6681
|
}
|
|
6484
|
-
function removeMerges(
|
|
6682
|
+
function removeMerges($xeTable, merges, mList, rowList) {
|
|
6683
|
+
const props = $xeTable;
|
|
6684
|
+
const internalData = $xeTable;
|
|
6485
6685
|
const rest = [];
|
|
6486
6686
|
if (merges) {
|
|
6487
6687
|
const {
|
|
6488
|
-
treeConfig
|
|
6688
|
+
treeConfig
|
|
6689
|
+
} = props;
|
|
6690
|
+
const {
|
|
6489
6691
|
visibleColumn
|
|
6490
|
-
} =
|
|
6692
|
+
} = internalData;
|
|
6491
6693
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6492
6694
|
merges = [merges];
|
|
6493
6695
|
}
|
|
@@ -6718,8 +6920,11 @@ const calcCellHeight = $xeTable => {
|
|
|
6718
6920
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
6719
6921
|
const el = $xeTable.$refs.refElem;
|
|
6720
6922
|
if (!isAllOverflow && scrollYLoad && el) {
|
|
6923
|
+
const {
|
|
6924
|
+
handleGetRowId
|
|
6925
|
+
} = createHandleGetRowId($xeTable);
|
|
6721
6926
|
tableData.forEach(row => {
|
|
6722
|
-
const rowid =
|
|
6927
|
+
const rowid = handleGetRowId(row);
|
|
6723
6928
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6724
6929
|
if (rowRest) {
|
|
6725
6930
|
const height = calcCellAutoHeight(rowRest, el);
|
|
@@ -7457,6 +7662,39 @@ function loadScrollYData($xeTable) {
|
|
|
7457
7662
|
}
|
|
7458
7663
|
}
|
|
7459
7664
|
}
|
|
7665
|
+
const createGetRowCacheProp = prop => {
|
|
7666
|
+
return function (row) {
|
|
7667
|
+
const $xeTable = this;
|
|
7668
|
+
const internalData = $xeTable;
|
|
7669
|
+
const {
|
|
7670
|
+
fullAllDataRowIdData
|
|
7671
|
+
} = internalData;
|
|
7672
|
+
if (row) {
|
|
7673
|
+
const rowid = getRowid($xeTable, row);
|
|
7674
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
7675
|
+
if (rowRest) {
|
|
7676
|
+
return rowRest[prop];
|
|
7677
|
+
}
|
|
7678
|
+
}
|
|
7679
|
+
return -1;
|
|
7680
|
+
};
|
|
7681
|
+
};
|
|
7682
|
+
const createGetColumnCacheProp = prop => {
|
|
7683
|
+
return function (column) {
|
|
7684
|
+
const $xeTable = this;
|
|
7685
|
+
const internalData = $xeTable;
|
|
7686
|
+
const {
|
|
7687
|
+
fullColumnIdData
|
|
7688
|
+
} = internalData;
|
|
7689
|
+
if (column) {
|
|
7690
|
+
const colRest = fullColumnIdData[column.id];
|
|
7691
|
+
if (colRest) {
|
|
7692
|
+
return colRest[prop];
|
|
7693
|
+
}
|
|
7694
|
+
}
|
|
7695
|
+
return -1;
|
|
7696
|
+
};
|
|
7697
|
+
};
|
|
7460
7698
|
function lazyScrollXData($xeTable) {
|
|
7461
7699
|
const internalData = $xeTable;
|
|
7462
7700
|
const {
|
|
@@ -7628,7 +7866,7 @@ function calcCellWidth($xeTable) {
|
|
|
7628
7866
|
}
|
|
7629
7867
|
function handleUpdateColResize($xeTable, evnt, params) {
|
|
7630
7868
|
$xeTable.analyColumnWidth();
|
|
7631
|
-
$xeTable.recalculate(
|
|
7869
|
+
$xeTable.recalculate().then(() => {
|
|
7632
7870
|
$xeTable.saveCustomStore('update:width');
|
|
7633
7871
|
$xeTable.updateCellAreas();
|
|
7634
7872
|
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
@@ -7640,7 +7878,7 @@ function handleUpdateColResize($xeTable, evnt, params) {
|
|
|
7640
7878
|
function handleUpdateRowResize($xeTable, evnt, params) {
|
|
7641
7879
|
const reactData = $xeTable;
|
|
7642
7880
|
reactData.resizeHeightFlag++;
|
|
7643
|
-
$xeTable.recalculate(
|
|
7881
|
+
$xeTable.recalculate().then(() => {
|
|
7644
7882
|
$xeTable.updateCellAreas();
|
|
7645
7883
|
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
7646
7884
|
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
@@ -7665,21 +7903,24 @@ function updateRowOffsetTop($xeTable) {
|
|
|
7665
7903
|
const reactData = $xeTable;
|
|
7666
7904
|
const internalData = $xeTable;
|
|
7667
7905
|
const {
|
|
7668
|
-
expandColumn
|
|
7669
|
-
rowExpandedMaps
|
|
7906
|
+
expandColumn
|
|
7670
7907
|
} = reactData;
|
|
7671
7908
|
const {
|
|
7672
7909
|
afterFullData,
|
|
7673
|
-
fullAllDataRowIdData
|
|
7910
|
+
fullAllDataRowIdData,
|
|
7911
|
+
rowExpandedMaps
|
|
7674
7912
|
} = internalData;
|
|
7675
7913
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
7676
7914
|
const rowOpts = $xeTable.computeRowOpts;
|
|
7677
7915
|
const cellOpts = $xeTable.computeCellOpts;
|
|
7678
7916
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
7917
|
+
const {
|
|
7918
|
+
handleGetRowId
|
|
7919
|
+
} = createHandleGetRowId($xeTable);
|
|
7679
7920
|
let offsetTop = 0;
|
|
7680
7921
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
7681
7922
|
const row = afterFullData[rIndex];
|
|
7682
|
-
const rowid =
|
|
7923
|
+
const rowid = handleGetRowId(row);
|
|
7683
7924
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
7684
7925
|
rowRest.oTop = offsetTop;
|
|
7685
7926
|
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
@@ -7695,7 +7936,8 @@ function updateRowExpandStyle($xeTable) {
|
|
|
7695
7936
|
const {
|
|
7696
7937
|
expandColumn,
|
|
7697
7938
|
scrollYLoad,
|
|
7698
|
-
|
|
7939
|
+
scrollYTop,
|
|
7940
|
+
isScrollYBig
|
|
7699
7941
|
} = reactData;
|
|
7700
7942
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
7701
7943
|
const rowOpts = $xeTable.computeRowOpts;
|
|
@@ -7707,41 +7949,35 @@ function updateRowExpandStyle($xeTable) {
|
|
|
7707
7949
|
if (expandColumn && mode === 'fixed') {
|
|
7708
7950
|
const {
|
|
7709
7951
|
elemStore,
|
|
7710
|
-
afterFullData,
|
|
7711
7952
|
fullAllDataRowIdData
|
|
7712
7953
|
} = internalData;
|
|
7713
7954
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
7714
7955
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
7715
7956
|
if (rowExpandEl && bodyScrollElem) {
|
|
7716
7957
|
let isUpdateHeight = false;
|
|
7717
|
-
if (scrollYLoad) {
|
|
7718
|
-
let offsetTop = 0;
|
|
7719
|
-
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
7720
|
-
const row = afterFullData[rIndex];
|
|
7721
|
-
const rowid = getRowid($xeTable, row);
|
|
7722
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
7723
|
-
rowRest.oTop = offsetTop;
|
|
7724
|
-
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
7725
|
-
// 是否展开行
|
|
7726
|
-
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
7727
|
-
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
7728
|
-
}
|
|
7729
|
-
}
|
|
7730
|
-
}
|
|
7731
7958
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowExpandEl.children, reEl => {
|
|
7732
7959
|
const expandEl = reEl;
|
|
7733
7960
|
const rowid = expandEl.getAttribute('rowid') || '';
|
|
7734
7961
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
7735
7962
|
if (rowRest) {
|
|
7736
7963
|
const expandHeight = expandEl.offsetHeight + 1;
|
|
7964
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
7965
|
+
let offsetTop = 0;
|
|
7737
7966
|
if (scrollYLoad) {
|
|
7738
|
-
|
|
7967
|
+
if (isScrollYBig && trEl) {
|
|
7968
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight;
|
|
7969
|
+
} else {
|
|
7970
|
+
offsetTop = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
7971
|
+
}
|
|
7739
7972
|
} else {
|
|
7740
|
-
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
7741
7973
|
if (trEl) {
|
|
7742
|
-
|
|
7974
|
+
offsetTop = trEl.offsetTop + trEl.offsetHeight;
|
|
7743
7975
|
}
|
|
7744
7976
|
}
|
|
7977
|
+
if (isScrollYBig) {
|
|
7978
|
+
offsetTop += scrollYTop;
|
|
7979
|
+
}
|
|
7980
|
+
expandEl.style.top = toCssUnit(offsetTop);
|
|
7745
7981
|
if (!isUpdateHeight) {
|
|
7746
7982
|
if (rowRest.expandHeight !== expandHeight) {
|
|
7747
7983
|
isUpdateHeight = true;
|
|
@@ -7752,6 +7988,9 @@ function updateRowExpandStyle($xeTable) {
|
|
|
7752
7988
|
});
|
|
7753
7989
|
if (isUpdateHeight) {
|
|
7754
7990
|
reactData.rowExpandHeightFlag++;
|
|
7991
|
+
$xeTable.$nextTick(() => {
|
|
7992
|
+
updateRowOffsetTop($xeTable);
|
|
7993
|
+
});
|
|
7755
7994
|
}
|
|
7756
7995
|
}
|
|
7757
7996
|
}
|
|
@@ -8177,13 +8416,11 @@ const Methods = {
|
|
|
8177
8416
|
const {
|
|
8178
8417
|
treeConfig
|
|
8179
8418
|
} = props;
|
|
8180
|
-
const {
|
|
8181
|
-
treeExpandedMaps
|
|
8182
|
-
} = reactData;
|
|
8183
8419
|
const {
|
|
8184
8420
|
fullAllDataRowIdData,
|
|
8185
8421
|
tableFullData,
|
|
8186
|
-
tableFullTreeData
|
|
8422
|
+
tableFullTreeData,
|
|
8423
|
+
treeExpandedMaps
|
|
8187
8424
|
} = internalData;
|
|
8188
8425
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8189
8426
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -8195,9 +8432,6 @@ const Methods = {
|
|
|
8195
8432
|
...fullAllDataRowIdData
|
|
8196
8433
|
}; // 存在已删除数据
|
|
8197
8434
|
const fullDataRowIdMaps = {};
|
|
8198
|
-
const treeTempExpandedMaps = {
|
|
8199
|
-
...treeExpandedMaps
|
|
8200
|
-
};
|
|
8201
8435
|
const {
|
|
8202
8436
|
handleUpdateRowId
|
|
8203
8437
|
} = createHandleUpdateRowId($xeTable);
|
|
@@ -8236,13 +8470,12 @@ const Methods = {
|
|
|
8236
8470
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
8237
8471
|
const rowid = handleUpdateRowId(row);
|
|
8238
8472
|
if (treeConfig && lazy) {
|
|
8239
|
-
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
8240
8473
|
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
8241
8474
|
row[childrenField] = null;
|
|
8242
8475
|
}
|
|
8243
|
-
if (
|
|
8476
|
+
if (treeExpandedMaps[rowid]) {
|
|
8244
8477
|
if (!row[childrenField] || !row[childrenField].length) {
|
|
8245
|
-
delete
|
|
8478
|
+
delete treeExpandedMaps[rowid];
|
|
8246
8479
|
}
|
|
8247
8480
|
}
|
|
8248
8481
|
}
|
|
@@ -8257,7 +8490,7 @@ const Methods = {
|
|
|
8257
8490
|
}
|
|
8258
8491
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
8259
8492
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
8260
|
-
reactData.
|
|
8493
|
+
reactData.treeExpandedFlag++;
|
|
8261
8494
|
},
|
|
8262
8495
|
cacheSourceMap(fullData) {
|
|
8263
8496
|
const $xeTable = this;
|
|
@@ -8406,53 +8639,22 @@ const Methods = {
|
|
|
8406
8639
|
* 根据 row 获取序号
|
|
8407
8640
|
* @param {Row} row 行对象
|
|
8408
8641
|
*/
|
|
8409
|
-
getRowSeq(
|
|
8410
|
-
const {
|
|
8411
|
-
fullAllDataRowIdData
|
|
8412
|
-
} = this;
|
|
8413
|
-
if (row) {
|
|
8414
|
-
const rowid = getRowid(this, row);
|
|
8415
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8416
|
-
if (rest) {
|
|
8417
|
-
return rest.seq;
|
|
8418
|
-
}
|
|
8419
|
-
}
|
|
8420
|
-
return -1;
|
|
8421
|
-
},
|
|
8642
|
+
getRowSeq: createGetRowCacheProp('seq'),
|
|
8422
8643
|
/**
|
|
8423
8644
|
* 根据 row 获取相对于 data 中的索引
|
|
8424
8645
|
* @param {Row} row 行对象
|
|
8425
8646
|
*/
|
|
8426
|
-
getRowIndex(
|
|
8427
|
-
const {
|
|
8428
|
-
fullAllDataRowIdData
|
|
8429
|
-
} = this;
|
|
8430
|
-
if (row) {
|
|
8431
|
-
const rowid = getRowid(this, row);
|
|
8432
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8433
|
-
if (rest) {
|
|
8434
|
-
return rest.index;
|
|
8435
|
-
}
|
|
8436
|
-
}
|
|
8437
|
-
return -1;
|
|
8438
|
-
},
|
|
8647
|
+
getRowIndex: createGetRowCacheProp('index'),
|
|
8439
8648
|
/**
|
|
8440
8649
|
* 根据 row 获取相对于当前数据中的索引
|
|
8441
8650
|
* @param {Row} row 行对象
|
|
8442
8651
|
*/
|
|
8443
|
-
getVTRowIndex(
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8450
|
-
if (rest) {
|
|
8451
|
-
return rest._index;
|
|
8452
|
-
}
|
|
8453
|
-
}
|
|
8454
|
-
return -1;
|
|
8455
|
-
},
|
|
8652
|
+
getVTRowIndex: createGetRowCacheProp('_index'),
|
|
8653
|
+
/**
|
|
8654
|
+
* 根据 row 获取渲染中的虚拟索引
|
|
8655
|
+
* @param {Row} row 行对象
|
|
8656
|
+
*/
|
|
8657
|
+
getVMRowIndex: createGetRowCacheProp('$index'),
|
|
8456
8658
|
// 在 v3 中废弃
|
|
8457
8659
|
_getRowIndex(row) {
|
|
8458
8660
|
if (true) {
|
|
@@ -8460,23 +8662,6 @@ const Methods = {
|
|
|
8460
8662
|
}
|
|
8461
8663
|
return this.getVTRowIndex(row);
|
|
8462
8664
|
},
|
|
8463
|
-
/**
|
|
8464
|
-
* 根据 row 获取渲染中的虚拟索引
|
|
8465
|
-
* @param {Row} row 行对象
|
|
8466
|
-
*/
|
|
8467
|
-
getVMRowIndex(row) {
|
|
8468
|
-
const {
|
|
8469
|
-
fullAllDataRowIdData
|
|
8470
|
-
} = this;
|
|
8471
|
-
if (row) {
|
|
8472
|
-
const rowid = getRowid(this, row);
|
|
8473
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
8474
|
-
if (rest) {
|
|
8475
|
-
return rest.$index;
|
|
8476
|
-
}
|
|
8477
|
-
}
|
|
8478
|
-
return -1;
|
|
8479
|
-
},
|
|
8480
8665
|
// 在 v3 中废弃
|
|
8481
8666
|
$getRowIndex(row) {
|
|
8482
8667
|
if (true) {
|
|
@@ -8488,56 +8673,23 @@ const Methods = {
|
|
|
8488
8673
|
* 根据 column 获取相对于 columns 中的索引
|
|
8489
8674
|
* @param {ColumnInfo} column 列配置
|
|
8490
8675
|
*/
|
|
8491
|
-
getColumnIndex(
|
|
8492
|
-
const {
|
|
8493
|
-
fullColumnIdData
|
|
8494
|
-
} = this;
|
|
8495
|
-
if (column) {
|
|
8496
|
-
const rest = fullColumnIdData[column.id];
|
|
8497
|
-
if (rest) {
|
|
8498
|
-
return rest.index;
|
|
8499
|
-
}
|
|
8500
|
-
}
|
|
8501
|
-
return -1;
|
|
8502
|
-
},
|
|
8676
|
+
getColumnIndex: createGetColumnCacheProp('index'),
|
|
8503
8677
|
/**
|
|
8504
8678
|
* 根据 column 获取相对于当前表格列中的索引
|
|
8505
8679
|
* @param {ColumnInfo} column 列配置
|
|
8506
8680
|
*/
|
|
8507
|
-
getVTColumnIndex(
|
|
8508
|
-
const {
|
|
8509
|
-
fullColumnIdData
|
|
8510
|
-
} = this;
|
|
8511
|
-
if (column) {
|
|
8512
|
-
const rest = fullColumnIdData[column.id];
|
|
8513
|
-
if (rest) {
|
|
8514
|
-
return rest._index;
|
|
8515
|
-
}
|
|
8516
|
-
}
|
|
8517
|
-
return -1;
|
|
8518
|
-
},
|
|
8519
|
-
// 在 v3 中废弃
|
|
8520
|
-
_getColumnIndex(column) {
|
|
8521
|
-
if (true) {
|
|
8522
|
-
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
|
|
8523
|
-
}
|
|
8524
|
-
return this.getVTColumnIndex(column);
|
|
8525
|
-
},
|
|
8681
|
+
getVTColumnIndex: createGetColumnCacheProp('_index'),
|
|
8526
8682
|
/**
|
|
8527
8683
|
* 根据 column 获取渲染中的虚拟索引
|
|
8528
8684
|
* @param {ColumnInfo} column 列配置
|
|
8529
8685
|
*/
|
|
8530
|
-
getVMColumnIndex(
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
const rest = fullColumnIdData[column.id];
|
|
8536
|
-
if (rest) {
|
|
8537
|
-
return rest.$index;
|
|
8538
|
-
}
|
|
8686
|
+
getVMColumnIndex: createGetColumnCacheProp('$index'),
|
|
8687
|
+
// 在 v3 中废弃
|
|
8688
|
+
_getColumnIndex(column) {
|
|
8689
|
+
if (true) {
|
|
8690
|
+
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
|
|
8539
8691
|
}
|
|
8540
|
-
return
|
|
8692
|
+
return this.getVTColumnIndex(column);
|
|
8541
8693
|
},
|
|
8542
8694
|
// 在 v3 中废弃
|
|
8543
8695
|
$getColumnIndex(column) {
|
|
@@ -8665,6 +8817,9 @@ const Methods = {
|
|
|
8665
8817
|
const {
|
|
8666
8818
|
transform
|
|
8667
8819
|
} = treeOpts;
|
|
8820
|
+
const {
|
|
8821
|
+
handleGetRowId
|
|
8822
|
+
} = createHandleGetRowId($xeTable);
|
|
8668
8823
|
if (!keepSource) {
|
|
8669
8824
|
if (true) {
|
|
8670
8825
|
errLog('vxe.error.reqProp', ['keep-source']);
|
|
@@ -8682,7 +8837,7 @@ const Methods = {
|
|
|
8682
8837
|
let reDelFlag = false;
|
|
8683
8838
|
if (targetRows.length) {
|
|
8684
8839
|
targetRows.forEach(item => {
|
|
8685
|
-
const rowid =
|
|
8840
|
+
const rowid = handleGetRowId(item);
|
|
8686
8841
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
8687
8842
|
if (rowRest) {
|
|
8688
8843
|
const row = rowRest.row;
|
|
@@ -9104,21 +9259,18 @@ const Methods = {
|
|
|
9104
9259
|
getCheckboxRecords(isFull) {
|
|
9105
9260
|
const $xeTable = this;
|
|
9106
9261
|
const props = $xeTable;
|
|
9107
|
-
const reactData = $xeTable;
|
|
9108
9262
|
const internalData = $xeTable;
|
|
9109
9263
|
const {
|
|
9110
9264
|
treeConfig
|
|
9111
9265
|
} = props;
|
|
9112
|
-
const {
|
|
9113
|
-
selectCheckboxMaps
|
|
9114
|
-
} = reactData;
|
|
9115
9266
|
const {
|
|
9116
9267
|
tableFullData,
|
|
9117
9268
|
afterFullData,
|
|
9118
9269
|
afterTreeFullData,
|
|
9119
9270
|
tableFullTreeData,
|
|
9120
9271
|
fullDataRowIdData,
|
|
9121
|
-
afterFullRowMaps
|
|
9272
|
+
afterFullRowMaps,
|
|
9273
|
+
selectCheckboxMaps
|
|
9122
9274
|
} = internalData;
|
|
9123
9275
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
9124
9276
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
@@ -9560,6 +9712,7 @@ const Methods = {
|
|
|
9560
9712
|
* 默认执行一次,除非被重置
|
|
9561
9713
|
*/
|
|
9562
9714
|
handleLoadDefaults() {
|
|
9715
|
+
const $xeTable = this;
|
|
9563
9716
|
if (this.checkboxConfig) {
|
|
9564
9717
|
this.handleDefaultSelectionChecked();
|
|
9565
9718
|
}
|
|
@@ -9570,7 +9723,7 @@ const Methods = {
|
|
|
9570
9723
|
this.handleDefaultRowExpand();
|
|
9571
9724
|
}
|
|
9572
9725
|
if (this.treeConfig) {
|
|
9573
|
-
|
|
9726
|
+
handleDefaultTreeExpand($xeTable);
|
|
9574
9727
|
}
|
|
9575
9728
|
if (this.mergeCells) {
|
|
9576
9729
|
this.handleDefaultMergeCells();
|
|
@@ -10484,12 +10637,15 @@ const Methods = {
|
|
|
10484
10637
|
fullAllDataRowIdData,
|
|
10485
10638
|
afterFullData
|
|
10486
10639
|
} = internalData;
|
|
10640
|
+
const {
|
|
10641
|
+
handleGetRowId
|
|
10642
|
+
} = createHandleGetRowId($xeTable);
|
|
10487
10643
|
const rowOpts = $xeTable.computeRowOpts;
|
|
10488
10644
|
const cellOpts = $xeTable.computeCellOpts;
|
|
10489
10645
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
10490
10646
|
const rest = {};
|
|
10491
10647
|
afterFullData.forEach(row => {
|
|
10492
|
-
const rowid =
|
|
10648
|
+
const rowid = handleGetRowId(row);
|
|
10493
10649
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
10494
10650
|
if (rowRest) {
|
|
10495
10651
|
const resizeHeight = rowRest.resizeHeight;
|
|
@@ -10518,8 +10674,11 @@ const Methods = {
|
|
|
10518
10674
|
rHeight = Math.floor(rHeight * bodyHeight);
|
|
10519
10675
|
}
|
|
10520
10676
|
if (rHeight) {
|
|
10677
|
+
const {
|
|
10678
|
+
handleGetRowId
|
|
10679
|
+
} = createHandleGetRowId($xeTable);
|
|
10521
10680
|
rows.forEach(row => {
|
|
10522
|
-
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row :
|
|
10681
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row : handleGetRowId(row);
|
|
10523
10682
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
10524
10683
|
if (rowRest) {
|
|
10525
10684
|
rowRest.resizeHeight = rHeight;
|
|
@@ -11480,15 +11639,20 @@ const Methods = {
|
|
|
11480
11639
|
* 获取复选框半选状态的行数据
|
|
11481
11640
|
*/
|
|
11482
11641
|
getCheckboxIndeterminateRecords(isFull) {
|
|
11642
|
+
const $xeTable = this;
|
|
11643
|
+
const props = $xeTable;
|
|
11644
|
+
const internalData = $xeTable;
|
|
11483
11645
|
const {
|
|
11484
|
-
treeConfig
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11646
|
+
treeConfig
|
|
11647
|
+
} = props;
|
|
11648
|
+
const {
|
|
11649
|
+
fullDataRowIdData,
|
|
11650
|
+
treeIndeterminateRowMaps
|
|
11651
|
+
} = internalData;
|
|
11488
11652
|
if (treeConfig) {
|
|
11489
11653
|
const fullRest = [];
|
|
11490
11654
|
const defRest = [];
|
|
11491
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
11655
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(treeIndeterminateRowMaps, (item, rowid) => {
|
|
11492
11656
|
if (item) {
|
|
11493
11657
|
fullRest.push(item);
|
|
11494
11658
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -11565,9 +11729,13 @@ const Methods = {
|
|
|
11565
11729
|
isCheckedByCheckboxRow(row) {
|
|
11566
11730
|
const $xeTable = this;
|
|
11567
11731
|
const reactData = $xeTable;
|
|
11732
|
+
const internalData = $xeTable;
|
|
11568
11733
|
const {
|
|
11569
|
-
|
|
11734
|
+
updateCheckboxFlag
|
|
11570
11735
|
} = reactData;
|
|
11736
|
+
const {
|
|
11737
|
+
selectCheckboxMaps
|
|
11738
|
+
} = internalData;
|
|
11571
11739
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11572
11740
|
const {
|
|
11573
11741
|
checkField
|
|
@@ -11575,17 +11743,18 @@ const Methods = {
|
|
|
11575
11743
|
if (checkField) {
|
|
11576
11744
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
11577
11745
|
}
|
|
11578
|
-
return !!selectCheckboxMaps[getRowid($xeTable, row)];
|
|
11746
|
+
return !!updateCheckboxFlag && !!selectCheckboxMaps[getRowid($xeTable, row)];
|
|
11579
11747
|
},
|
|
11580
11748
|
isCheckedByCheckboxRowKey(rowid) {
|
|
11581
11749
|
const $xeTable = this;
|
|
11582
11750
|
const reactData = $xeTable;
|
|
11583
11751
|
const internalData = $xeTable;
|
|
11584
11752
|
const {
|
|
11585
|
-
|
|
11753
|
+
updateCheckboxFlag
|
|
11586
11754
|
} = reactData;
|
|
11587
11755
|
const {
|
|
11588
|
-
fullAllDataRowIdData
|
|
11756
|
+
fullAllDataRowIdData,
|
|
11757
|
+
selectCheckboxMaps
|
|
11589
11758
|
} = internalData;
|
|
11590
11759
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11591
11760
|
const {
|
|
@@ -11598,23 +11767,23 @@ const Methods = {
|
|
|
11598
11767
|
}
|
|
11599
11768
|
return false;
|
|
11600
11769
|
}
|
|
11601
|
-
return !!selectCheckboxMaps[rowid];
|
|
11770
|
+
return !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
|
|
11602
11771
|
},
|
|
11603
11772
|
isIndeterminateByCheckboxRow(row) {
|
|
11604
11773
|
const $xeTable = this;
|
|
11605
|
-
const
|
|
11774
|
+
const internalData = $xeTable;
|
|
11606
11775
|
const {
|
|
11607
|
-
|
|
11608
|
-
} =
|
|
11609
|
-
return !!
|
|
11776
|
+
treeIndeterminateRowMaps
|
|
11777
|
+
} = internalData;
|
|
11778
|
+
return !!treeIndeterminateRowMaps[getRowid($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row);
|
|
11610
11779
|
},
|
|
11611
11780
|
isIndeterminateByCheckboxRowKey(rowid) {
|
|
11612
11781
|
const $xeTable = this;
|
|
11613
|
-
const
|
|
11782
|
+
const internalData = $xeTable;
|
|
11614
11783
|
const {
|
|
11615
|
-
|
|
11616
|
-
} =
|
|
11617
|
-
return !!
|
|
11784
|
+
treeIndeterminateRowMaps
|
|
11785
|
+
} = internalData;
|
|
11786
|
+
return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid);
|
|
11618
11787
|
},
|
|
11619
11788
|
/**
|
|
11620
11789
|
* 切换选中
|
|
@@ -11624,13 +11793,13 @@ const Methods = {
|
|
|
11624
11793
|
const $xeTable = this;
|
|
11625
11794
|
const props = $xeTable;
|
|
11626
11795
|
const reactData = $xeTable;
|
|
11796
|
+
const internalData = $xeTable;
|
|
11627
11797
|
const {
|
|
11628
11798
|
treeConfig
|
|
11629
11799
|
} = props;
|
|
11630
11800
|
const {
|
|
11631
11801
|
selectCheckboxMaps
|
|
11632
|
-
} =
|
|
11633
|
-
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
11802
|
+
} = internalData;
|
|
11634
11803
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
11635
11804
|
const {
|
|
11636
11805
|
transform,
|
|
@@ -11665,20 +11834,19 @@ const Methods = {
|
|
|
11665
11834
|
}, {
|
|
11666
11835
|
children: transform ? mapChildrenField : childrenField
|
|
11667
11836
|
});
|
|
11668
|
-
reactData.
|
|
11837
|
+
reactData.updateCheckboxFlag++;
|
|
11669
11838
|
return;
|
|
11670
|
-
} else {
|
|
11671
|
-
// 列表
|
|
11672
|
-
rows.forEach(row => {
|
|
11673
|
-
if (isForce || !checkMethod || checkMethod({
|
|
11674
|
-
row
|
|
11675
|
-
})) {
|
|
11676
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, checked);
|
|
11677
|
-
handleCheckboxReserveRow($xeTable, row, checked);
|
|
11678
|
-
}
|
|
11679
|
-
});
|
|
11680
11839
|
}
|
|
11681
|
-
|
|
11840
|
+
// 列表
|
|
11841
|
+
rows.forEach(row => {
|
|
11842
|
+
if (isForce || !checkMethod || checkMethod({
|
|
11843
|
+
row
|
|
11844
|
+
})) {
|
|
11845
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, checked);
|
|
11846
|
+
handleCheckboxReserveRow($xeTable, row, checked);
|
|
11847
|
+
}
|
|
11848
|
+
});
|
|
11849
|
+
reactData.updateCheckboxFlag++;
|
|
11682
11850
|
return;
|
|
11683
11851
|
}
|
|
11684
11852
|
// 树结构
|
|
@@ -11690,10 +11858,10 @@ const Methods = {
|
|
|
11690
11858
|
row
|
|
11691
11859
|
})) {
|
|
11692
11860
|
if (checked) {
|
|
11693
|
-
|
|
11861
|
+
selectCheckboxMaps[rowid] = row;
|
|
11694
11862
|
} else {
|
|
11695
|
-
if (
|
|
11696
|
-
delete
|
|
11863
|
+
if (selectCheckboxMaps[rowid]) {
|
|
11864
|
+
delete selectCheckboxMaps[rowid];
|
|
11697
11865
|
}
|
|
11698
11866
|
}
|
|
11699
11867
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
@@ -11701,7 +11869,7 @@ const Methods = {
|
|
|
11701
11869
|
}, {
|
|
11702
11870
|
children: transform ? mapChildrenField : childrenField
|
|
11703
11871
|
});
|
|
11704
|
-
reactData.
|
|
11872
|
+
reactData.updateCheckboxFlag++;
|
|
11705
11873
|
return;
|
|
11706
11874
|
}
|
|
11707
11875
|
// 列表
|
|
@@ -11711,18 +11879,18 @@ const Methods = {
|
|
|
11711
11879
|
row
|
|
11712
11880
|
})) {
|
|
11713
11881
|
if (checked) {
|
|
11714
|
-
if (!
|
|
11715
|
-
|
|
11882
|
+
if (!selectCheckboxMaps[rowid]) {
|
|
11883
|
+
selectCheckboxMaps[rowid] = row;
|
|
11716
11884
|
}
|
|
11717
11885
|
} else {
|
|
11718
|
-
if (
|
|
11719
|
-
delete
|
|
11886
|
+
if (selectCheckboxMaps[rowid]) {
|
|
11887
|
+
delete selectCheckboxMaps[rowid];
|
|
11720
11888
|
}
|
|
11721
11889
|
}
|
|
11722
11890
|
handleCheckboxReserveRow($xeTable, row, checked);
|
|
11891
|
+
reactData.updateCheckboxFlag++;
|
|
11723
11892
|
}
|
|
11724
11893
|
});
|
|
11725
|
-
reactData.selectCheckboxMaps = selectRowMaps;
|
|
11726
11894
|
},
|
|
11727
11895
|
/**
|
|
11728
11896
|
* 即将移除
|
|
@@ -11736,10 +11904,10 @@ const Methods = {
|
|
|
11736
11904
|
},
|
|
11737
11905
|
handleToggleCheckRowEvent(evnt, params) {
|
|
11738
11906
|
const $xeTable = this;
|
|
11739
|
-
const
|
|
11907
|
+
const internalData = $xeTable;
|
|
11740
11908
|
const {
|
|
11741
11909
|
selectCheckboxMaps
|
|
11742
|
-
} =
|
|
11910
|
+
} = internalData;
|
|
11743
11911
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11744
11912
|
const {
|
|
11745
11913
|
checkField,
|
|
@@ -11755,17 +11923,18 @@ const Methods = {
|
|
|
11755
11923
|
if (checkField) {
|
|
11756
11924
|
checked = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField);
|
|
11757
11925
|
} else {
|
|
11758
|
-
checked = !selectCheckboxMaps[getRowid(
|
|
11926
|
+
checked = !selectCheckboxMaps[getRowid($xeTable, row)];
|
|
11759
11927
|
}
|
|
11760
11928
|
if (evnt) {
|
|
11761
11929
|
$xeTable.triggerCheckRowEvent(evnt, params, checked);
|
|
11762
11930
|
} else {
|
|
11763
|
-
$xeTable.handleBatchSelectRows(
|
|
11931
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
11764
11932
|
$xeTable.checkSelectionStatus();
|
|
11765
11933
|
}
|
|
11766
11934
|
},
|
|
11767
11935
|
triggerCheckRowEvent(evnt, params, checked) {
|
|
11768
11936
|
const $xeTable = this;
|
|
11937
|
+
const props = $xeTable;
|
|
11769
11938
|
const internalData = $xeTable;
|
|
11770
11939
|
const {
|
|
11771
11940
|
row
|
|
@@ -11782,7 +11951,7 @@ const Methods = {
|
|
|
11782
11951
|
return;
|
|
11783
11952
|
}
|
|
11784
11953
|
evnt.stopPropagation();
|
|
11785
|
-
if (checkboxOpts.isShiftKey && evnt.shiftKey && !
|
|
11954
|
+
if (checkboxOpts.isShiftKey && evnt.shiftKey && !props.treeConfig) {
|
|
11786
11955
|
const checkboxRecords = $xeTable.getCheckboxRecords();
|
|
11787
11956
|
if (checkboxRecords.length) {
|
|
11788
11957
|
const firstRow = checkboxRecords[0];
|
|
@@ -11791,7 +11960,9 @@ const Methods = {
|
|
|
11791
11960
|
if (_rowIndex !== _firstRowIndex) {
|
|
11792
11961
|
$xeTable.setAllCheckboxRow(false);
|
|
11793
11962
|
const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
|
|
11794
|
-
|
|
11963
|
+
$xeTable.$nextTick(() => {
|
|
11964
|
+
handleCheckedCheckboxRow($xeTable, rangeRows, true, false);
|
|
11965
|
+
});
|
|
11795
11966
|
$xeTable.dispatchEvent('checkbox-range-select', Object.assign({
|
|
11796
11967
|
rangeRecords: rangeRows
|
|
11797
11968
|
}, params), evnt);
|
|
@@ -11802,7 +11973,7 @@ const Methods = {
|
|
|
11802
11973
|
if (!checkMethod || checkMethod({
|
|
11803
11974
|
row
|
|
11804
11975
|
})) {
|
|
11805
|
-
$xeTable.handleBatchSelectRows(
|
|
11976
|
+
$xeTable.handleBatchSelectRows([row], checked);
|
|
11806
11977
|
$xeTable.checkSelectionStatus();
|
|
11807
11978
|
$xeTable.dispatchEvent('checkbox-change', Object.assign({
|
|
11808
11979
|
records: () => $xeTable.getCheckboxRecords(),
|
|
@@ -11817,10 +11988,11 @@ const Methods = {
|
|
|
11817
11988
|
*/
|
|
11818
11989
|
toggleCheckboxRow(row) {
|
|
11819
11990
|
const $xeTable = this;
|
|
11991
|
+
const internalData = $xeTable;
|
|
11820
11992
|
const {
|
|
11821
|
-
selectCheckboxMaps
|
|
11822
|
-
|
|
11823
|
-
|
|
11993
|
+
selectCheckboxMaps
|
|
11994
|
+
} = internalData;
|
|
11995
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11824
11996
|
const {
|
|
11825
11997
|
checkField
|
|
11826
11998
|
} = checkboxOpts;
|
|
@@ -11847,10 +12019,8 @@ const Methods = {
|
|
|
11847
12019
|
} = props;
|
|
11848
12020
|
const {
|
|
11849
12021
|
selectCheckboxMaps,
|
|
11850
|
-
|
|
11851
|
-
} =
|
|
11852
|
-
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
11853
|
-
const halfRowMaps = Object.assign({}, treeIndeterminateMaps);
|
|
12022
|
+
treeIndeterminateRowMaps
|
|
12023
|
+
} = internalData;
|
|
11854
12024
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
11855
12025
|
const {
|
|
11856
12026
|
transform,
|
|
@@ -11895,29 +12065,29 @@ const Methods = {
|
|
|
11895
12065
|
let vLen = 0; // 有效行
|
|
11896
12066
|
childList.forEach(checkMethod ? item => {
|
|
11897
12067
|
const childRowid = handleGetRowId(item);
|
|
11898
|
-
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) :
|
|
12068
|
+
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
11899
12069
|
if (checkMethod({
|
|
11900
12070
|
row: item
|
|
11901
12071
|
})) {
|
|
11902
12072
|
if (isSelect) {
|
|
11903
12073
|
sLen++;
|
|
11904
|
-
} else if (
|
|
12074
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11905
12075
|
hLen++;
|
|
11906
12076
|
}
|
|
11907
12077
|
vLen++;
|
|
11908
12078
|
} else {
|
|
11909
12079
|
if (isSelect) {
|
|
11910
12080
|
sLen++;
|
|
11911
|
-
} else if (
|
|
12081
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11912
12082
|
hLen++;
|
|
11913
12083
|
}
|
|
11914
12084
|
}
|
|
11915
12085
|
} : item => {
|
|
11916
12086
|
const childRowid = handleGetRowId(item);
|
|
11917
|
-
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) :
|
|
12087
|
+
const isSelect = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, checkField) : selectCheckboxMaps[childRowid];
|
|
11918
12088
|
if (isSelect) {
|
|
11919
12089
|
sLen++;
|
|
11920
|
-
} else if (
|
|
12090
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11921
12091
|
hLen++;
|
|
11922
12092
|
}
|
|
11923
12093
|
vLen++;
|
|
@@ -11929,29 +12099,28 @@ const Methods = {
|
|
|
11929
12099
|
}
|
|
11930
12100
|
if (isSelected) {
|
|
11931
12101
|
if (!checkField) {
|
|
11932
|
-
|
|
12102
|
+
selectCheckboxMaps[rowid] = row;
|
|
11933
12103
|
}
|
|
11934
|
-
if (
|
|
11935
|
-
delete
|
|
12104
|
+
if (treeIndeterminateRowMaps[rowid]) {
|
|
12105
|
+
delete treeIndeterminateRowMaps[rowid];
|
|
11936
12106
|
}
|
|
11937
12107
|
} else {
|
|
11938
12108
|
if (!checkField) {
|
|
11939
|
-
if (
|
|
11940
|
-
delete
|
|
12109
|
+
if (selectCheckboxMaps[rowid]) {
|
|
12110
|
+
delete selectCheckboxMaps[rowid];
|
|
11941
12111
|
}
|
|
11942
12112
|
}
|
|
11943
12113
|
if (halfSelect) {
|
|
11944
|
-
|
|
12114
|
+
treeIndeterminateRowMaps[rowid] = row;
|
|
11945
12115
|
} else {
|
|
11946
|
-
if (
|
|
11947
|
-
delete
|
|
12116
|
+
if (treeIndeterminateRowMaps[rowid]) {
|
|
12117
|
+
delete treeIndeterminateRowMaps[rowid];
|
|
11948
12118
|
}
|
|
11949
12119
|
}
|
|
11950
12120
|
}
|
|
11951
12121
|
});
|
|
11952
12122
|
}
|
|
11953
|
-
reactData.
|
|
11954
|
-
reactData.treeIndeterminateMaps = halfRowMaps;
|
|
12123
|
+
reactData.updateCheckboxFlag++;
|
|
11955
12124
|
},
|
|
11956
12125
|
updateAllCheckboxStatus() {
|
|
11957
12126
|
const $xeTable = this;
|
|
@@ -11962,20 +12131,18 @@ const Methods = {
|
|
|
11962
12131
|
treeConfig
|
|
11963
12132
|
} = props;
|
|
11964
12133
|
const {
|
|
12134
|
+
afterFullData,
|
|
12135
|
+
afterTreeFullData,
|
|
12136
|
+
checkboxReserveRowMap,
|
|
11965
12137
|
selectCheckboxMaps,
|
|
11966
|
-
|
|
11967
|
-
} =
|
|
12138
|
+
treeIndeterminateRowMaps
|
|
12139
|
+
} = internalData;
|
|
11968
12140
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11969
12141
|
const {
|
|
11970
12142
|
checkField,
|
|
11971
12143
|
checkMethod,
|
|
11972
12144
|
showReserveStatus
|
|
11973
12145
|
} = checkboxOpts;
|
|
11974
|
-
const {
|
|
11975
|
-
afterFullData,
|
|
11976
|
-
afterTreeFullData,
|
|
11977
|
-
checkboxReserveRowMap
|
|
11978
|
-
} = internalData;
|
|
11979
12146
|
const {
|
|
11980
12147
|
handleGetRowId
|
|
11981
12148
|
} = createHandleGetRowId($xeTable);
|
|
@@ -11991,14 +12158,14 @@ const Methods = {
|
|
|
11991
12158
|
})) {
|
|
11992
12159
|
if (selected) {
|
|
11993
12160
|
sLen++;
|
|
11994
|
-
} else if (
|
|
12161
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
11995
12162
|
hLen++;
|
|
11996
12163
|
}
|
|
11997
12164
|
vLen++;
|
|
11998
12165
|
} else {
|
|
11999
12166
|
if (selected) {
|
|
12000
12167
|
sLen++;
|
|
12001
|
-
} else if (
|
|
12168
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
12002
12169
|
hLen++;
|
|
12003
12170
|
}
|
|
12004
12171
|
}
|
|
@@ -12007,7 +12174,7 @@ const Methods = {
|
|
|
12007
12174
|
const selected = checkField ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) : selectCheckboxMaps[childRowid];
|
|
12008
12175
|
if (selected) {
|
|
12009
12176
|
sLen++;
|
|
12010
|
-
} else if (
|
|
12177
|
+
} else if (treeIndeterminateRowMaps[childRowid]) {
|
|
12011
12178
|
hLen++;
|
|
12012
12179
|
}
|
|
12013
12180
|
vLen++;
|
|
@@ -12071,27 +12238,35 @@ const Methods = {
|
|
|
12071
12238
|
* 获取复选框保留选中的行
|
|
12072
12239
|
*/
|
|
12073
12240
|
getCheckboxReserveRecords(isFull) {
|
|
12241
|
+
const $xeTable = this;
|
|
12242
|
+
const props = $xeTable;
|
|
12243
|
+
const internalData = $xeTable;
|
|
12244
|
+
const {
|
|
12245
|
+
treeConfig
|
|
12246
|
+
} = props;
|
|
12074
12247
|
const {
|
|
12075
|
-
fullDataRowIdData,
|
|
12076
12248
|
afterFullData,
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12249
|
+
fullDataRowIdData,
|
|
12250
|
+
checkboxReserveRowMap
|
|
12251
|
+
} = internalData;
|
|
12252
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
12253
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
12082
12254
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12083
12255
|
const reserveSelection = [];
|
|
12084
12256
|
if (checkboxOpts.reserve) {
|
|
12257
|
+
const {
|
|
12258
|
+
handleGetRowId
|
|
12259
|
+
} = createHandleGetRowId($xeTable);
|
|
12085
12260
|
const afterFullIdMaps = {};
|
|
12086
12261
|
if (treeConfig) {
|
|
12087
12262
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterFullData, row => {
|
|
12088
|
-
afterFullIdMaps[
|
|
12263
|
+
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
12089
12264
|
}, {
|
|
12090
12265
|
children: childrenField
|
|
12091
12266
|
});
|
|
12092
12267
|
} else {
|
|
12093
12268
|
afterFullData.forEach(row => {
|
|
12094
|
-
afterFullIdMaps[
|
|
12269
|
+
afterFullIdMaps[handleGetRowId(row)] = 1;
|
|
12095
12270
|
});
|
|
12096
12271
|
}
|
|
12097
12272
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(checkboxReserveRowMap, (oldRow, oldRowid) => {
|
|
@@ -12171,17 +12346,23 @@ const Methods = {
|
|
|
12171
12346
|
* 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
|
|
12172
12347
|
*/
|
|
12173
12348
|
clearCheckboxRow() {
|
|
12349
|
+
const $xeTable = this;
|
|
12350
|
+
const props = $xeTable;
|
|
12351
|
+
const reactData = $xeTable;
|
|
12352
|
+
const internalData = $xeTable;
|
|
12174
12353
|
const {
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
|
|
12179
|
-
} =
|
|
12354
|
+
treeConfig
|
|
12355
|
+
} = props;
|
|
12356
|
+
const {
|
|
12357
|
+
tableFullData
|
|
12358
|
+
} = internalData;
|
|
12359
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
12360
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12361
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
12180
12362
|
const {
|
|
12181
12363
|
checkField,
|
|
12182
12364
|
reserve
|
|
12183
12365
|
} = checkboxOpts;
|
|
12184
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12185
12366
|
// indeterminateField 仅支持读取
|
|
12186
12367
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
12187
12368
|
if (checkField) {
|
|
@@ -12202,10 +12383,11 @@ const Methods = {
|
|
|
12202
12383
|
if (reserve) {
|
|
12203
12384
|
tableFullData.forEach(row => this.handleCheckboxReserveRow(row, false));
|
|
12204
12385
|
}
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
|
|
12208
|
-
|
|
12386
|
+
reactData.isAllSelected = false;
|
|
12387
|
+
reactData.isIndeterminate = false;
|
|
12388
|
+
internalData.selectCheckboxMaps = {};
|
|
12389
|
+
internalData.treeIndeterminateRowMaps = {};
|
|
12390
|
+
reactData.updateCheckboxFlag++;
|
|
12209
12391
|
return this.$nextTick();
|
|
12210
12392
|
},
|
|
12211
12393
|
/**
|
|
@@ -12941,6 +13123,8 @@ const Methods = {
|
|
|
12941
13123
|
} = props;
|
|
12942
13124
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
12943
13125
|
const {
|
|
13126
|
+
afterFullData,
|
|
13127
|
+
tableFullData,
|
|
12944
13128
|
fullAllDataRowIdData
|
|
12945
13129
|
} = internalData;
|
|
12946
13130
|
const {
|
|
@@ -12958,10 +13142,6 @@ const Methods = {
|
|
|
12958
13142
|
parentField
|
|
12959
13143
|
} = treeOpts;
|
|
12960
13144
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12961
|
-
const {
|
|
12962
|
-
afterFullData,
|
|
12963
|
-
tableFullData
|
|
12964
|
-
} = internalData;
|
|
12965
13145
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
12966
13146
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
12967
13147
|
const errRest = {
|
|
@@ -13627,46 +13807,58 @@ const Methods = {
|
|
|
13627
13807
|
setPendingRow(rows, status) {
|
|
13628
13808
|
const $xeTable = this;
|
|
13629
13809
|
const reactData = $xeTable;
|
|
13630
|
-
const
|
|
13810
|
+
const internalData = $xeTable;
|
|
13811
|
+
const {
|
|
13812
|
+
handleGetRowId
|
|
13813
|
+
} = createHandleGetRowId($xeTable);
|
|
13814
|
+
const {
|
|
13815
|
+
pendingRowMaps
|
|
13816
|
+
} = internalData;
|
|
13631
13817
|
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
13632
13818
|
rows = [rows];
|
|
13633
13819
|
}
|
|
13634
13820
|
if (status) {
|
|
13635
13821
|
rows.forEach(row => {
|
|
13636
|
-
const rowid =
|
|
13637
|
-
if (rowid && !
|
|
13638
|
-
|
|
13822
|
+
const rowid = handleGetRowId(row);
|
|
13823
|
+
if (rowid && !pendingRowMaps[rowid]) {
|
|
13824
|
+
pendingRowMaps[rowid] = row;
|
|
13639
13825
|
}
|
|
13640
13826
|
});
|
|
13641
13827
|
} else {
|
|
13642
13828
|
rows.forEach(row => {
|
|
13643
|
-
const rowid =
|
|
13644
|
-
if (rowid &&
|
|
13645
|
-
delete
|
|
13829
|
+
const rowid = handleGetRowId(row);
|
|
13830
|
+
if (rowid && pendingRowMaps[rowid]) {
|
|
13831
|
+
delete pendingRowMaps[rowid];
|
|
13646
13832
|
}
|
|
13647
13833
|
});
|
|
13648
13834
|
}
|
|
13649
|
-
reactData.
|
|
13835
|
+
reactData.pendingRowFlag++;
|
|
13650
13836
|
return $xeTable.$nextTick();
|
|
13651
13837
|
},
|
|
13652
13838
|
togglePendingRow(rows) {
|
|
13653
13839
|
const $xeTable = this;
|
|
13654
13840
|
const reactData = $xeTable;
|
|
13655
|
-
const
|
|
13841
|
+
const internalData = $xeTable;
|
|
13842
|
+
const {
|
|
13843
|
+
handleGetRowId
|
|
13844
|
+
} = createHandleGetRowId($xeTable);
|
|
13845
|
+
const {
|
|
13846
|
+
pendingRowMaps
|
|
13847
|
+
} = internalData;
|
|
13656
13848
|
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
13657
13849
|
rows = [rows];
|
|
13658
13850
|
}
|
|
13659
13851
|
rows.forEach(row => {
|
|
13660
|
-
const rowid =
|
|
13852
|
+
const rowid = handleGetRowId(row);
|
|
13661
13853
|
if (rowid) {
|
|
13662
|
-
if (
|
|
13663
|
-
delete
|
|
13854
|
+
if (pendingRowMaps[rowid]) {
|
|
13855
|
+
delete pendingRowMaps[rowid];
|
|
13664
13856
|
} else {
|
|
13665
|
-
|
|
13857
|
+
pendingRowMaps[rowid] = row;
|
|
13666
13858
|
}
|
|
13667
13859
|
}
|
|
13668
13860
|
});
|
|
13669
|
-
reactData.
|
|
13861
|
+
reactData.pendingRowFlag++;
|
|
13670
13862
|
return $xeTable.$nextTick();
|
|
13671
13863
|
},
|
|
13672
13864
|
hasPendingByRow(row) {
|
|
@@ -13684,13 +13876,10 @@ const Methods = {
|
|
|
13684
13876
|
},
|
|
13685
13877
|
getPendingRecords() {
|
|
13686
13878
|
const $xeTable = this;
|
|
13687
|
-
const reactData = $xeTable;
|
|
13688
13879
|
const internalData = $xeTable;
|
|
13689
13880
|
const {
|
|
13881
|
+
fullAllDataRowIdData,
|
|
13690
13882
|
pendingRowMaps
|
|
13691
|
-
} = reactData;
|
|
13692
|
-
const {
|
|
13693
|
-
fullAllDataRowIdData
|
|
13694
13883
|
} = internalData;
|
|
13695
13884
|
const insertRecords = [];
|
|
13696
13885
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(pendingRowMaps, (row, rowid) => {
|
|
@@ -13701,8 +13890,12 @@ const Methods = {
|
|
|
13701
13890
|
return insertRecords;
|
|
13702
13891
|
},
|
|
13703
13892
|
clearPendingRow() {
|
|
13704
|
-
|
|
13705
|
-
|
|
13893
|
+
const $xeTable = this;
|
|
13894
|
+
const reactData = $xeTable;
|
|
13895
|
+
const internalData = $xeTable;
|
|
13896
|
+
internalData.pendingRowMaps = {};
|
|
13897
|
+
reactData.pendingRowFlag++;
|
|
13898
|
+
return $xeTable.$nextTick();
|
|
13706
13899
|
},
|
|
13707
13900
|
sort(sortConfs, sortOrder) {
|
|
13708
13901
|
const $xeTable = this;
|
|
@@ -13940,11 +14133,9 @@ const Methods = {
|
|
|
13940
14133
|
const $xeTable = this;
|
|
13941
14134
|
const reactData = $xeTable;
|
|
13942
14135
|
const internalData = $xeTable;
|
|
13943
|
-
const rExpandLazyLoadedMaps = {
|
|
13944
|
-
...reactData.rowExpandLazyLoadedMaps
|
|
13945
|
-
};
|
|
13946
14136
|
const {
|
|
13947
|
-
fullAllDataRowIdData
|
|
14137
|
+
fullAllDataRowIdData,
|
|
14138
|
+
rowExpandLazyLoadedMaps
|
|
13948
14139
|
} = internalData;
|
|
13949
14140
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
13950
14141
|
const {
|
|
@@ -13954,9 +14145,9 @@ const Methods = {
|
|
|
13954
14145
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
13955
14146
|
if (lazy && rowRest) {
|
|
13956
14147
|
rowRest.expandLoaded = false;
|
|
13957
|
-
delete
|
|
14148
|
+
delete rowExpandLazyLoadedMaps[rowid];
|
|
13958
14149
|
}
|
|
13959
|
-
reactData.
|
|
14150
|
+
reactData.rowExpandedFlag++;
|
|
13960
14151
|
return $xeTable.$nextTick();
|
|
13961
14152
|
},
|
|
13962
14153
|
/**
|
|
@@ -13964,18 +14155,20 @@ const Methods = {
|
|
|
13964
14155
|
* @param {Row} row 行对象
|
|
13965
14156
|
*/
|
|
13966
14157
|
reloadRowExpand(row) {
|
|
14158
|
+
const $xeTable = this;
|
|
14159
|
+
const internalData = $xeTable;
|
|
13967
14160
|
const {
|
|
13968
|
-
expandOpts,
|
|
13969
14161
|
rowExpandLazyLoadedMaps
|
|
13970
|
-
} =
|
|
14162
|
+
} = internalData;
|
|
14163
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
13971
14164
|
const {
|
|
13972
14165
|
lazy
|
|
13973
14166
|
} = expandOpts;
|
|
13974
14167
|
const rowid = getRowid(this, row);
|
|
13975
14168
|
if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
|
|
13976
|
-
|
|
14169
|
+
$xeTable.clearRowExpandLoaded(row).then(() => handleAsyncRowExpand($xeTable, row));
|
|
13977
14170
|
}
|
|
13978
|
-
return
|
|
14171
|
+
return $xeTable.$nextTick();
|
|
13979
14172
|
},
|
|
13980
14173
|
reloadExpandContent(row) {
|
|
13981
14174
|
if (true) {
|
|
@@ -13988,11 +14181,16 @@ const Methods = {
|
|
|
13988
14181
|
* 展开行事件
|
|
13989
14182
|
*/
|
|
13990
14183
|
triggerRowExpandEvent(evnt, params) {
|
|
14184
|
+
const $xeTable = this;
|
|
14185
|
+
const reactData = $xeTable;
|
|
14186
|
+
const internalData = $xeTable;
|
|
13991
14187
|
const {
|
|
13992
|
-
expandOpts,
|
|
13993
|
-
rowExpandLazyLoadedMaps,
|
|
13994
14188
|
expandColumn: column
|
|
13995
|
-
} =
|
|
14189
|
+
} = reactData;
|
|
14190
|
+
const {
|
|
14191
|
+
rowExpandLazyLoadedMaps
|
|
14192
|
+
} = internalData;
|
|
14193
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
13996
14194
|
const {
|
|
13997
14195
|
row
|
|
13998
14196
|
} = params;
|
|
@@ -14004,20 +14202,20 @@ const Methods = {
|
|
|
14004
14202
|
return;
|
|
14005
14203
|
}
|
|
14006
14204
|
evnt.stopPropagation();
|
|
14007
|
-
const rowid = getRowid(
|
|
14205
|
+
const rowid = getRowid($xeTable, row);
|
|
14008
14206
|
if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
|
|
14009
|
-
const expanded =
|
|
14010
|
-
const columnIndex =
|
|
14011
|
-
const $columnIndex =
|
|
14012
|
-
|
|
14013
|
-
|
|
14207
|
+
const expanded = !$xeTable.isRowExpandByRow(row);
|
|
14208
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14209
|
+
const $columnIndex = $xeTable.getVMColumnIndex(column);
|
|
14210
|
+
$xeTable.setRowExpand(row, expanded);
|
|
14211
|
+
$xeTable.dispatchEvent('toggle-row-expand', {
|
|
14014
14212
|
expanded,
|
|
14015
14213
|
column,
|
|
14016
14214
|
columnIndex,
|
|
14017
14215
|
$columnIndex,
|
|
14018
14216
|
row,
|
|
14019
|
-
rowIndex:
|
|
14020
|
-
$rowIndex:
|
|
14217
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
14218
|
+
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
14021
14219
|
}, evnt);
|
|
14022
14220
|
}
|
|
14023
14221
|
},
|
|
@@ -14049,86 +14247,31 @@ const Methods = {
|
|
|
14049
14247
|
}
|
|
14050
14248
|
});
|
|
14051
14249
|
this.setRowExpand(defExpandeds, true);
|
|
14052
|
-
}
|
|
14053
|
-
},
|
|
14054
|
-
/**
|
|
14055
|
-
* 设置所有行的展开与否
|
|
14056
|
-
* @param {Boolean} expanded 是否展开
|
|
14057
|
-
*/
|
|
14058
|
-
setAllRowExpand(expanded) {
|
|
14059
|
-
const {
|
|
14060
|
-
treeConfig,
|
|
14061
|
-
treeOpts,
|
|
14062
|
-
tableFullData,
|
|
14063
|
-
tableFullTreeData
|
|
14064
|
-
} = this;
|
|
14065
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14066
|
-
let expandedRows = [];
|
|
14067
|
-
if (treeConfig) {
|
|
14068
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, row => {
|
|
14069
|
-
expandedRows.push(row);
|
|
14070
|
-
}, {
|
|
14071
|
-
children: childrenField
|
|
14072
|
-
});
|
|
14073
|
-
} else {
|
|
14074
|
-
expandedRows = tableFullData;
|
|
14075
|
-
}
|
|
14076
|
-
return this.setRowExpand(expandedRows, expanded);
|
|
14077
|
-
},
|
|
14078
|
-
handleAsyncRowExpand(row) {
|
|
14079
|
-
const $xeTable = this;
|
|
14080
|
-
const reactData = $xeTable;
|
|
14081
|
-
const internalData = $xeTable;
|
|
14082
|
-
return new Promise(resolve => {
|
|
14083
|
-
const {
|
|
14084
|
-
expandOpts
|
|
14085
|
-
} = this;
|
|
14086
|
-
const {
|
|
14087
|
-
loadMethod
|
|
14088
|
-
} = expandOpts;
|
|
14089
|
-
if (loadMethod) {
|
|
14090
|
-
const {
|
|
14091
|
-
fullAllDataRowIdData
|
|
14092
|
-
} = internalData;
|
|
14093
|
-
const rExpandLazyLoadedMaps = {
|
|
14094
|
-
...reactData.rowExpandLazyLoadedMaps
|
|
14095
|
-
};
|
|
14096
|
-
const rowid = getRowid($xeTable, row);
|
|
14097
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
14098
|
-
rExpandLazyLoadedMaps[rowid] = row;
|
|
14099
|
-
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
|
|
14100
|
-
loadMethod({
|
|
14101
|
-
$table: $xeTable,
|
|
14102
|
-
row,
|
|
14103
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
14104
|
-
$rowIndex: $xeTable.getVMRowIndex(row)
|
|
14105
|
-
}).then(() => {
|
|
14106
|
-
const rExpandedMaps = {
|
|
14107
|
-
...reactData.rowExpandedMaps
|
|
14108
|
-
};
|
|
14109
|
-
if (rowRest) {
|
|
14110
|
-
rowRest.expandLoaded = true;
|
|
14111
|
-
}
|
|
14112
|
-
rExpandedMaps[rowid] = row;
|
|
14113
|
-
reactData.rowExpandedMaps = rExpandedMaps;
|
|
14114
|
-
}).catch(() => {
|
|
14115
|
-
if (rowRest) {
|
|
14116
|
-
rowRest.expandLoaded = false;
|
|
14117
|
-
}
|
|
14118
|
-
}).finally(() => {
|
|
14119
|
-
const rExpandLazyLoadedMaps = {
|
|
14120
|
-
...reactData.rowExpandLazyLoadedMaps
|
|
14121
|
-
};
|
|
14122
|
-
if (rExpandLazyLoadedMaps[rowid]) {
|
|
14123
|
-
delete rExpandLazyLoadedMaps[rowid];
|
|
14124
|
-
}
|
|
14125
|
-
reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
|
|
14126
|
-
$xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
|
|
14127
|
-
});
|
|
14128
|
-
} else {
|
|
14129
|
-
resolve();
|
|
14130
|
-
}
|
|
14131
|
-
});
|
|
14250
|
+
}
|
|
14251
|
+
},
|
|
14252
|
+
/**
|
|
14253
|
+
* 设置所有行的展开与否
|
|
14254
|
+
* @param {Boolean} expanded 是否展开
|
|
14255
|
+
*/
|
|
14256
|
+
setAllRowExpand(expanded) {
|
|
14257
|
+
const {
|
|
14258
|
+
treeConfig,
|
|
14259
|
+
treeOpts,
|
|
14260
|
+
tableFullData,
|
|
14261
|
+
tableFullTreeData
|
|
14262
|
+
} = this;
|
|
14263
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14264
|
+
let expandedRows = [];
|
|
14265
|
+
if (treeConfig) {
|
|
14266
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, row => {
|
|
14267
|
+
expandedRows.push(row);
|
|
14268
|
+
}, {
|
|
14269
|
+
children: childrenField
|
|
14270
|
+
});
|
|
14271
|
+
} else {
|
|
14272
|
+
expandedRows = tableFullData;
|
|
14273
|
+
}
|
|
14274
|
+
return this.setRowExpand(expandedRows, expanded);
|
|
14132
14275
|
},
|
|
14133
14276
|
/**
|
|
14134
14277
|
* 设置展开行,二个参数设置这一行展开与否
|
|
@@ -14139,16 +14282,20 @@ const Methods = {
|
|
|
14139
14282
|
*/
|
|
14140
14283
|
setRowExpand(rows, expanded) {
|
|
14141
14284
|
const $xeTable = this;
|
|
14285
|
+
const reactData = $xeTable;
|
|
14286
|
+
const internalData = $xeTable;
|
|
14142
14287
|
const {
|
|
14143
|
-
rowExpandedMaps,
|
|
14144
|
-
fullAllDataRowIdData,
|
|
14145
|
-
rowExpandLazyLoadedMaps,
|
|
14146
|
-
expandOpts,
|
|
14147
14288
|
expandColumn
|
|
14148
|
-
} =
|
|
14149
|
-
let
|
|
14150
|
-
|
|
14151
|
-
|
|
14289
|
+
} = reactData;
|
|
14290
|
+
let {
|
|
14291
|
+
fullAllDataRowIdData,
|
|
14292
|
+
rowExpandedMaps,
|
|
14293
|
+
rowExpandLazyLoadedMaps
|
|
14294
|
+
} = internalData;
|
|
14295
|
+
const {
|
|
14296
|
+
handleGetRowId
|
|
14297
|
+
} = createHandleGetRowId($xeTable);
|
|
14298
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
14152
14299
|
const {
|
|
14153
14300
|
reserve,
|
|
14154
14301
|
lazy,
|
|
@@ -14164,10 +14311,12 @@ const Methods = {
|
|
|
14164
14311
|
}
|
|
14165
14312
|
if (accordion) {
|
|
14166
14313
|
// 只能同时展开一个
|
|
14167
|
-
|
|
14314
|
+
rowExpandedMaps = {};
|
|
14315
|
+
internalData.rowExpandedMaps = rowExpandedMaps;
|
|
14168
14316
|
rows = rows.slice(rows.length - 1, rows.length);
|
|
14169
14317
|
}
|
|
14170
14318
|
const validRows = toggleMethod ? rows.filter(row => toggleMethod({
|
|
14319
|
+
$table: $xeTable,
|
|
14171
14320
|
expanded,
|
|
14172
14321
|
column: expandColumn,
|
|
14173
14322
|
columnIndex,
|
|
@@ -14178,22 +14327,22 @@ const Methods = {
|
|
|
14178
14327
|
})) : rows;
|
|
14179
14328
|
if (expanded) {
|
|
14180
14329
|
validRows.forEach(row => {
|
|
14181
|
-
const rowid =
|
|
14182
|
-
if (!
|
|
14330
|
+
const rowid = handleGetRowId(row);
|
|
14331
|
+
if (!rowExpandedMaps[rowid]) {
|
|
14183
14332
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14184
14333
|
const isLoad = lazy && !rowRest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
|
|
14185
14334
|
if (isLoad) {
|
|
14186
|
-
lazyRests.push(
|
|
14335
|
+
lazyRests.push(handleAsyncRowExpand($xeTable, row));
|
|
14187
14336
|
} else {
|
|
14188
|
-
|
|
14337
|
+
rowExpandedMaps[rowid] = row;
|
|
14189
14338
|
}
|
|
14190
14339
|
}
|
|
14191
14340
|
});
|
|
14192
14341
|
} else {
|
|
14193
14342
|
validRows.forEach(item => {
|
|
14194
|
-
const rowid =
|
|
14195
|
-
if (
|
|
14196
|
-
delete
|
|
14343
|
+
const rowid = handleGetRowId(item);
|
|
14344
|
+
if (rowExpandedMaps[rowid]) {
|
|
14345
|
+
delete rowExpandedMaps[rowid];
|
|
14197
14346
|
}
|
|
14198
14347
|
});
|
|
14199
14348
|
}
|
|
@@ -14201,7 +14350,7 @@ const Methods = {
|
|
|
14201
14350
|
validRows.forEach(row => handleRowExpandReserve($xeTable, row, expanded));
|
|
14202
14351
|
}
|
|
14203
14352
|
}
|
|
14204
|
-
|
|
14353
|
+
reactData.rowExpandedFlag++;
|
|
14205
14354
|
return Promise.all(lazyRests).then(() => $xeTable.$nextTick()).then(() => $xeTable.recalculate(true)).then(() => {
|
|
14206
14355
|
updateRowOffsetTop($xeTable);
|
|
14207
14356
|
updateRowExpandStyle($xeTable);
|
|
@@ -14214,11 +14363,17 @@ const Methods = {
|
|
|
14214
14363
|
* @param {Row} row 行对象
|
|
14215
14364
|
*/
|
|
14216
14365
|
isRowExpandByRow(row) {
|
|
14366
|
+
const $xeTable = this;
|
|
14367
|
+
const reactData = $xeTable;
|
|
14368
|
+
const internalData = $xeTable;
|
|
14369
|
+
const {
|
|
14370
|
+
rowExpandedFlag
|
|
14371
|
+
} = reactData;
|
|
14217
14372
|
const {
|
|
14218
14373
|
rowExpandedMaps
|
|
14219
|
-
} =
|
|
14374
|
+
} = internalData;
|
|
14220
14375
|
const rowid = getRowid(this, row);
|
|
14221
|
-
return !!rowExpandedMaps[rowid];
|
|
14376
|
+
return !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
14222
14377
|
},
|
|
14223
14378
|
isExpandByRow(row) {
|
|
14224
14379
|
if (true) {
|
|
@@ -14242,7 +14397,8 @@ const Methods = {
|
|
|
14242
14397
|
reserve
|
|
14243
14398
|
} = expandOpts;
|
|
14244
14399
|
const expList = $xeTable.getRowExpandRecords();
|
|
14245
|
-
|
|
14400
|
+
internalData.rowExpandedMaps = {};
|
|
14401
|
+
reactData.rowExpandedFlag++;
|
|
14246
14402
|
if (reserve) {
|
|
14247
14403
|
tableFullData.forEach(row => handleRowExpandReserve($xeTable, row, false));
|
|
14248
14404
|
}
|
|
@@ -14262,8 +14418,10 @@ const Methods = {
|
|
|
14262
14418
|
return this.$nextTick();
|
|
14263
14419
|
},
|
|
14264
14420
|
getRowExpandRecords() {
|
|
14421
|
+
const $xeTable = this;
|
|
14422
|
+
const internalData = $xeTable;
|
|
14265
14423
|
const rest = [];
|
|
14266
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
14424
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.rowExpandedMaps, item => {
|
|
14267
14425
|
if (item) {
|
|
14268
14426
|
rest.push(item);
|
|
14269
14427
|
}
|
|
@@ -14271,8 +14429,10 @@ const Methods = {
|
|
|
14271
14429
|
return rest;
|
|
14272
14430
|
},
|
|
14273
14431
|
getTreeExpandRecords() {
|
|
14432
|
+
const $xeTable = this;
|
|
14433
|
+
const internalData = $xeTable;
|
|
14274
14434
|
const rest = [];
|
|
14275
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
14435
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.treeExpandedMaps, item => {
|
|
14276
14436
|
if (item) {
|
|
14277
14437
|
rest.push(item);
|
|
14278
14438
|
}
|
|
@@ -14308,17 +14468,14 @@ const Methods = {
|
|
|
14308
14468
|
const reactData = $xeTable;
|
|
14309
14469
|
const internalData = $xeTable;
|
|
14310
14470
|
const {
|
|
14311
|
-
fullAllDataRowIdData
|
|
14471
|
+
fullAllDataRowIdData,
|
|
14472
|
+
treeExpandedMaps
|
|
14312
14473
|
} = internalData;
|
|
14313
14474
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
14314
14475
|
const {
|
|
14315
14476
|
transform
|
|
14316
14477
|
} = treeOpts;
|
|
14317
|
-
let tExpandedMaps = {};
|
|
14318
14478
|
if (rows) {
|
|
14319
|
-
tExpandedMaps = {
|
|
14320
|
-
...reactData.treeExpandedMaps
|
|
14321
|
-
};
|
|
14322
14479
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
14323
14480
|
rows = [rows];
|
|
14324
14481
|
}
|
|
@@ -14327,8 +14484,8 @@ const Methods = {
|
|
|
14327
14484
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14328
14485
|
if (rowRest) {
|
|
14329
14486
|
rowRest.treeLoaded = false;
|
|
14330
|
-
if (
|
|
14331
|
-
delete
|
|
14487
|
+
if (treeExpandedMaps[rowid]) {
|
|
14488
|
+
delete treeExpandedMaps[rowid];
|
|
14332
14489
|
}
|
|
14333
14490
|
}
|
|
14334
14491
|
});
|
|
@@ -14337,7 +14494,8 @@ const Methods = {
|
|
|
14337
14494
|
rowRest.treeLoaded = false;
|
|
14338
14495
|
});
|
|
14339
14496
|
}
|
|
14340
|
-
|
|
14497
|
+
internalData.treeExpandedMaps = {};
|
|
14498
|
+
reactData.treeExpandedFlag++;
|
|
14341
14499
|
if (transform) {
|
|
14342
14500
|
handleVirtualTreeToList($xeTable);
|
|
14343
14501
|
return $xeTable.handleTableData();
|
|
@@ -14350,45 +14508,49 @@ const Methods = {
|
|
|
14350
14508
|
*/
|
|
14351
14509
|
reloadTreeExpand(row) {
|
|
14352
14510
|
const $xeTable = this;
|
|
14511
|
+
const internalData = $xeTable;
|
|
14353
14512
|
const {
|
|
14354
|
-
treeOpts,
|
|
14355
14513
|
treeExpandLazyLoadedMaps
|
|
14356
|
-
} =
|
|
14514
|
+
} = internalData;
|
|
14515
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14357
14516
|
const {
|
|
14358
14517
|
transform,
|
|
14359
14518
|
lazy
|
|
14360
14519
|
} = treeOpts;
|
|
14361
14520
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
14362
|
-
const rowid = getRowid(
|
|
14521
|
+
const rowid = getRowid($xeTable, row);
|
|
14363
14522
|
if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
|
|
14364
|
-
return
|
|
14365
|
-
return
|
|
14523
|
+
return $xeTable.clearTreeExpandLoaded(row).then(() => {
|
|
14524
|
+
return handleAsyncTreeExpandChilds($xeTable, row);
|
|
14366
14525
|
}).then(() => {
|
|
14367
14526
|
if (transform) {
|
|
14368
14527
|
handleVirtualTreeToList($xeTable);
|
|
14369
|
-
return
|
|
14528
|
+
return $xeTable.handleTableData();
|
|
14370
14529
|
}
|
|
14371
14530
|
}).then(() => {
|
|
14372
|
-
return
|
|
14531
|
+
return $xeTable.recalculate();
|
|
14373
14532
|
});
|
|
14374
14533
|
}
|
|
14375
|
-
return
|
|
14534
|
+
return $xeTable.$nextTick();
|
|
14376
14535
|
},
|
|
14377
14536
|
reloadTreeChilds(row) {
|
|
14537
|
+
const $xeTable = this;
|
|
14378
14538
|
if (true) {
|
|
14379
14539
|
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
14380
14540
|
}
|
|
14381
14541
|
// 即将废弃
|
|
14382
|
-
return
|
|
14542
|
+
return $xeTable.reloadTreeExpand(row);
|
|
14383
14543
|
},
|
|
14384
14544
|
/**
|
|
14385
14545
|
* 展开树节点事件
|
|
14386
14546
|
*/
|
|
14387
14547
|
triggerTreeExpandEvent(evnt, params) {
|
|
14548
|
+
const $xeTable = this;
|
|
14549
|
+
const internalData = $xeTable;
|
|
14388
14550
|
const {
|
|
14389
|
-
treeOpts,
|
|
14390
14551
|
treeExpandLazyLoadedMaps
|
|
14391
|
-
} =
|
|
14552
|
+
} = internalData;
|
|
14553
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14392
14554
|
const {
|
|
14393
14555
|
row,
|
|
14394
14556
|
column
|
|
@@ -14403,11 +14565,11 @@ const Methods = {
|
|
|
14403
14565
|
evnt.stopPropagation();
|
|
14404
14566
|
const rowid = getRowid(this, row);
|
|
14405
14567
|
if (!lazy || !treeExpandLazyLoadedMaps[rowid]) {
|
|
14406
|
-
const expanded =
|
|
14407
|
-
const columnIndex =
|
|
14408
|
-
const $columnIndex =
|
|
14409
|
-
|
|
14410
|
-
|
|
14568
|
+
const expanded = !$xeTable.isTreeExpandByRow(row);
|
|
14569
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14570
|
+
const $columnIndex = $xeTable.getVMColumnIndex(column);
|
|
14571
|
+
$xeTable.setTreeExpand(row, expanded);
|
|
14572
|
+
$xeTable.dispatchEvent('toggle-tree-expand', {
|
|
14411
14573
|
expanded,
|
|
14412
14574
|
column,
|
|
14413
14575
|
columnIndex,
|
|
@@ -14422,112 +14584,6 @@ const Methods = {
|
|
|
14422
14584
|
toggleTreeExpand(row) {
|
|
14423
14585
|
return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
|
|
14424
14586
|
},
|
|
14425
|
-
/**
|
|
14426
|
-
* 处理默认展开树节点
|
|
14427
|
-
*/
|
|
14428
|
-
handleDefaultTreeExpand() {
|
|
14429
|
-
const {
|
|
14430
|
-
treeConfig,
|
|
14431
|
-
treeOpts,
|
|
14432
|
-
tableFullData
|
|
14433
|
-
} = this;
|
|
14434
|
-
if (treeConfig) {
|
|
14435
|
-
const {
|
|
14436
|
-
expandAll,
|
|
14437
|
-
expandRowKeys
|
|
14438
|
-
} = treeOpts;
|
|
14439
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14440
|
-
if (expandAll) {
|
|
14441
|
-
this.setAllTreeExpand(true);
|
|
14442
|
-
} else if (expandRowKeys) {
|
|
14443
|
-
const defExpandeds = [];
|
|
14444
|
-
const rowkey = getRowkey(this);
|
|
14445
|
-
expandRowKeys.forEach(rowid => {
|
|
14446
|
-
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData, item => rowid === external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item, rowkey), {
|
|
14447
|
-
children: childrenField
|
|
14448
|
-
});
|
|
14449
|
-
if (matchObj) {
|
|
14450
|
-
defExpandeds.push(matchObj.item);
|
|
14451
|
-
}
|
|
14452
|
-
});
|
|
14453
|
-
this.setTreeExpand(defExpandeds, true);
|
|
14454
|
-
}
|
|
14455
|
-
}
|
|
14456
|
-
},
|
|
14457
|
-
handleAsyncTreeExpandChilds(row) {
|
|
14458
|
-
const $xeTable = this;
|
|
14459
|
-
const {
|
|
14460
|
-
treeOpts,
|
|
14461
|
-
checkboxOpts
|
|
14462
|
-
} = this;
|
|
14463
|
-
const {
|
|
14464
|
-
transform,
|
|
14465
|
-
loadMethod
|
|
14466
|
-
} = treeOpts;
|
|
14467
|
-
const {
|
|
14468
|
-
checkStrictly
|
|
14469
|
-
} = checkboxOpts;
|
|
14470
|
-
return new Promise(resolve => {
|
|
14471
|
-
if (loadMethod) {
|
|
14472
|
-
const {
|
|
14473
|
-
treeExpandLazyLoadedMaps,
|
|
14474
|
-
fullAllDataRowIdData
|
|
14475
|
-
} = this;
|
|
14476
|
-
const rowid = getRowid($xeTable, row);
|
|
14477
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
14478
|
-
treeExpandLazyLoadedMaps[rowid] = row;
|
|
14479
|
-
Promise.resolve(loadMethod({
|
|
14480
|
-
$table: $xeTable,
|
|
14481
|
-
row
|
|
14482
|
-
})).then(childRecords => {
|
|
14483
|
-
if (rowRest) {
|
|
14484
|
-
rowRest.treeLoaded = true;
|
|
14485
|
-
}
|
|
14486
|
-
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
14487
|
-
delete treeExpandLazyLoadedMaps[rowid];
|
|
14488
|
-
}
|
|
14489
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(childRecords)) {
|
|
14490
|
-
childRecords = [];
|
|
14491
|
-
}
|
|
14492
|
-
if (childRecords) {
|
|
14493
|
-
return this.loadTreeChildren(row, childRecords).then(childRows => {
|
|
14494
|
-
const {
|
|
14495
|
-
treeExpandedMaps
|
|
14496
|
-
} = this;
|
|
14497
|
-
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
14498
|
-
treeExpandedMaps[rowid] = row;
|
|
14499
|
-
}
|
|
14500
|
-
// 如果当前节点已选中,则展开后子节点也被选中
|
|
14501
|
-
if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
|
|
14502
|
-
handleCheckedCheckboxRow($xeTable, childRows, true);
|
|
14503
|
-
}
|
|
14504
|
-
return this.$nextTick().then(() => {
|
|
14505
|
-
if (transform) {
|
|
14506
|
-
this.handleTableData();
|
|
14507
|
-
updateAfterDataIndex($xeTable);
|
|
14508
|
-
return this.$nextTick();
|
|
14509
|
-
}
|
|
14510
|
-
});
|
|
14511
|
-
});
|
|
14512
|
-
}
|
|
14513
|
-
}).catch(() => {
|
|
14514
|
-
const {
|
|
14515
|
-
treeExpandLazyLoadedMaps
|
|
14516
|
-
} = this;
|
|
14517
|
-
if (rowRest) {
|
|
14518
|
-
rowRest.treeLoaded = false;
|
|
14519
|
-
}
|
|
14520
|
-
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
14521
|
-
delete treeExpandLazyLoadedMaps[rowid];
|
|
14522
|
-
}
|
|
14523
|
-
}).finally(() => {
|
|
14524
|
-
this.$nextTick().then(() => this.recalculate()).then(() => resolve());
|
|
14525
|
-
});
|
|
14526
|
-
} else {
|
|
14527
|
-
resolve();
|
|
14528
|
-
}
|
|
14529
|
-
});
|
|
14530
|
-
},
|
|
14531
14587
|
/**
|
|
14532
14588
|
* 设置所有树节点的展开与否
|
|
14533
14589
|
* @param {Boolean} expanded 是否展开
|
|
@@ -14559,29 +14615,35 @@ const Methods = {
|
|
|
14559
14615
|
* @returns
|
|
14560
14616
|
*/
|
|
14561
14617
|
handleBaseTreeExpand(rows, expanded) {
|
|
14618
|
+
const $xeTable = this;
|
|
14619
|
+
const reactData = $xeTable;
|
|
14620
|
+
const internalData = $xeTable;
|
|
14621
|
+
const {
|
|
14622
|
+
treeNodeColumn
|
|
14623
|
+
} = reactData;
|
|
14562
14624
|
const {
|
|
14563
14625
|
fullAllDataRowIdData,
|
|
14564
14626
|
tableFullData,
|
|
14565
14627
|
treeExpandedMaps,
|
|
14566
|
-
|
|
14567
|
-
|
|
14568
|
-
|
|
14569
|
-
} = this;
|
|
14628
|
+
treeExpandLazyLoadedMaps
|
|
14629
|
+
} = internalData;
|
|
14630
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14570
14631
|
const {
|
|
14571
14632
|
reserve,
|
|
14572
14633
|
lazy,
|
|
14573
14634
|
accordion,
|
|
14574
14635
|
toggleMethod
|
|
14575
14636
|
} = treeOpts;
|
|
14576
|
-
const treeTempExpandedMaps = {
|
|
14577
|
-
...treeExpandedMaps
|
|
14578
|
-
};
|
|
14579
14637
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14580
14638
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
14581
14639
|
const result = [];
|
|
14582
|
-
const columnIndex =
|
|
14583
|
-
const $columnIndex =
|
|
14640
|
+
const columnIndex = $xeTable.getColumnIndex(treeNodeColumn);
|
|
14641
|
+
const $columnIndex = $xeTable.getVMColumnIndex(treeNodeColumn);
|
|
14642
|
+
const {
|
|
14643
|
+
handleGetRowId
|
|
14644
|
+
} = createHandleGetRowId($xeTable);
|
|
14584
14645
|
let validRows = toggleMethod ? rows.filter(row => toggleMethod({
|
|
14646
|
+
$table: $xeTable,
|
|
14585
14647
|
expanded,
|
|
14586
14648
|
column: treeNodeColumn,
|
|
14587
14649
|
columnIndex,
|
|
@@ -14596,26 +14658,26 @@ const Methods = {
|
|
|
14596
14658
|
});
|
|
14597
14659
|
if (matchObj) {
|
|
14598
14660
|
matchObj.items.forEach(item => {
|
|
14599
|
-
const rowid =
|
|
14600
|
-
if (
|
|
14601
|
-
delete
|
|
14661
|
+
const rowid = handleGetRowId(item);
|
|
14662
|
+
if (treeExpandedMaps[rowid]) {
|
|
14663
|
+
delete treeExpandedMaps[rowid];
|
|
14602
14664
|
}
|
|
14603
14665
|
});
|
|
14604
14666
|
}
|
|
14605
14667
|
}
|
|
14606
14668
|
if (expanded) {
|
|
14607
14669
|
validRows.forEach(row => {
|
|
14608
|
-
const rowid =
|
|
14609
|
-
if (!
|
|
14670
|
+
const rowid = handleGetRowId(row);
|
|
14671
|
+
if (!treeExpandedMaps[rowid]) {
|
|
14610
14672
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14611
14673
|
if (rowRest) {
|
|
14612
14674
|
const isLoad = lazy && row[hasChildField] && !rowRest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
|
|
14613
14675
|
// 是否使用懒加载
|
|
14614
14676
|
if (isLoad) {
|
|
14615
|
-
result.push(
|
|
14677
|
+
result.push(handleAsyncTreeExpandChilds($xeTable, row));
|
|
14616
14678
|
} else {
|
|
14617
14679
|
if (row[childrenField] && row[childrenField].length) {
|
|
14618
|
-
|
|
14680
|
+
treeExpandedMaps[rowid] = row;
|
|
14619
14681
|
}
|
|
14620
14682
|
}
|
|
14621
14683
|
}
|
|
@@ -14623,18 +14685,18 @@ const Methods = {
|
|
|
14623
14685
|
});
|
|
14624
14686
|
} else {
|
|
14625
14687
|
validRows.forEach(item => {
|
|
14626
|
-
const rowid =
|
|
14627
|
-
if (
|
|
14628
|
-
delete
|
|
14688
|
+
const rowid = handleGetRowId(item);
|
|
14689
|
+
if (treeExpandedMaps[rowid]) {
|
|
14690
|
+
delete treeExpandedMaps[rowid];
|
|
14629
14691
|
}
|
|
14630
14692
|
});
|
|
14631
14693
|
}
|
|
14632
14694
|
if (reserve) {
|
|
14633
|
-
validRows.forEach(row =>
|
|
14695
|
+
validRows.forEach(row => handleTreeExpandReserve($xeTable, row, expanded));
|
|
14634
14696
|
}
|
|
14635
|
-
|
|
14697
|
+
reactData.treeExpandedFlag++;
|
|
14636
14698
|
return Promise.all(result).then(() => {
|
|
14637
|
-
return
|
|
14699
|
+
return $xeTable.recalculate();
|
|
14638
14700
|
});
|
|
14639
14701
|
},
|
|
14640
14702
|
/**
|
|
@@ -14691,40 +14753,49 @@ const Methods = {
|
|
|
14691
14753
|
* @param {Row} row 行对象
|
|
14692
14754
|
*/
|
|
14693
14755
|
isTreeExpandByRow(row) {
|
|
14756
|
+
const $xeTable = this;
|
|
14757
|
+
const reactData = $xeTable;
|
|
14758
|
+
const internalData = $xeTable;
|
|
14759
|
+
const {
|
|
14760
|
+
treeExpandedFlag
|
|
14761
|
+
} = reactData;
|
|
14694
14762
|
const {
|
|
14695
14763
|
treeExpandedMaps
|
|
14696
|
-
} =
|
|
14697
|
-
return !!treeExpandedMaps[getRowid(
|
|
14764
|
+
} = internalData;
|
|
14765
|
+
return !!treeExpandedFlag && !!treeExpandedMaps[getRowid($xeTable, row)];
|
|
14698
14766
|
},
|
|
14699
14767
|
/**
|
|
14700
14768
|
* 手动清空树形节点的展开状态,数据会恢复成未展开的状态
|
|
14701
14769
|
*/
|
|
14702
14770
|
clearTreeExpand() {
|
|
14703
14771
|
const $xeTable = this;
|
|
14772
|
+
const reactData = $xeTable;
|
|
14773
|
+
const internalData = $xeTable;
|
|
14704
14774
|
const {
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14775
|
+
tableFullTreeData
|
|
14776
|
+
} = internalData;
|
|
14777
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
14778
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
14708
14779
|
const {
|
|
14709
14780
|
transform,
|
|
14710
14781
|
reserve
|
|
14711
14782
|
} = treeOpts;
|
|
14712
|
-
const
|
|
14713
|
-
|
|
14714
|
-
|
|
14783
|
+
const expList = $xeTable.getTreeExpandRecords();
|
|
14784
|
+
internalData.treeExpandedMaps = {};
|
|
14785
|
+
reactData.treeExpandedFlag++;
|
|
14715
14786
|
if (reserve) {
|
|
14716
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(
|
|
14787
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, row => handleTreeExpandReserve($xeTable, row, false), {
|
|
14717
14788
|
children: childrenField
|
|
14718
14789
|
});
|
|
14719
14790
|
}
|
|
14720
|
-
return
|
|
14791
|
+
return $xeTable.handleTableData().then(() => {
|
|
14721
14792
|
if (transform) {
|
|
14722
14793
|
handleVirtualTreeToList($xeTable);
|
|
14723
|
-
return
|
|
14794
|
+
return $xeTable.handleTableData();
|
|
14724
14795
|
}
|
|
14725
14796
|
}).then(() => {
|
|
14726
14797
|
if (expList.length) {
|
|
14727
|
-
|
|
14798
|
+
$xeTable.recalculate();
|
|
14728
14799
|
}
|
|
14729
14800
|
});
|
|
14730
14801
|
},
|
|
@@ -14732,20 +14803,6 @@ const Methods = {
|
|
|
14732
14803
|
this.treeExpandedReserveRowMap = {};
|
|
14733
14804
|
return this.$nextTick();
|
|
14734
14805
|
},
|
|
14735
|
-
handleTreeExpandReserve(row, expanded) {
|
|
14736
|
-
const {
|
|
14737
|
-
treeExpandedReserveRowMap,
|
|
14738
|
-
treeOpts
|
|
14739
|
-
} = this;
|
|
14740
|
-
if (treeOpts.reserve) {
|
|
14741
|
-
const rowid = getRowid(this, row);
|
|
14742
|
-
if (expanded) {
|
|
14743
|
-
treeExpandedReserveRowMap[rowid] = row;
|
|
14744
|
-
} else if (treeExpandedReserveRowMap[rowid]) {
|
|
14745
|
-
delete treeExpandedReserveRowMap[rowid];
|
|
14746
|
-
}
|
|
14747
|
-
}
|
|
14748
|
-
},
|
|
14749
14806
|
/**
|
|
14750
14807
|
* 获取表格的滚动状态
|
|
14751
14808
|
*/
|
|
@@ -15409,15 +15466,15 @@ const Methods = {
|
|
|
15409
15466
|
const {
|
|
15410
15467
|
isAllOverflow,
|
|
15411
15468
|
scrollYLoad,
|
|
15412
|
-
expandColumn
|
|
15413
|
-
rowExpandedMaps
|
|
15469
|
+
expandColumn
|
|
15414
15470
|
} = reactData;
|
|
15415
15471
|
const {
|
|
15416
15472
|
scrollYStore,
|
|
15417
15473
|
elemStore,
|
|
15418
15474
|
isResizeCellHeight,
|
|
15419
15475
|
afterFullData,
|
|
15420
|
-
fullAllDataRowIdData
|
|
15476
|
+
fullAllDataRowIdData,
|
|
15477
|
+
rowExpandedMaps
|
|
15421
15478
|
} = internalData;
|
|
15422
15479
|
const {
|
|
15423
15480
|
startIndex
|
|
@@ -15774,7 +15831,7 @@ const Methods = {
|
|
|
15774
15831
|
if (this.footerSpanMethod) {
|
|
15775
15832
|
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
15776
15833
|
}
|
|
15777
|
-
setMerges(this, merges, this.mergeFooterList
|
|
15834
|
+
setMerges(this, merges, this.mergeFooterList);
|
|
15778
15835
|
return this.$nextTick().then(() => {
|
|
15779
15836
|
this.updateCellAreas();
|
|
15780
15837
|
return updateStyle($xeTable);
|
|
@@ -15940,7 +15997,7 @@ const isVMScrollProcess = $xeTable => {
|
|
|
15940
15997
|
} = tableReactData;
|
|
15941
15998
|
return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
|
|
15942
15999
|
};
|
|
15943
|
-
function renderLine(h, _vm, params, cellHeight) {
|
|
16000
|
+
function renderLine(h, _vm, rowid, params, cellHeight) {
|
|
15944
16001
|
const $xeTable = _vm.$parent;
|
|
15945
16002
|
const tableProps = $xeTable;
|
|
15946
16003
|
const tableInternalData = $xeTable;
|
|
@@ -15965,7 +16022,6 @@ function renderLine(h, _vm, params, cellHeight) {
|
|
|
15965
16022
|
if (slots && slots.line) {
|
|
15966
16023
|
return $xeTable.callSlot(slots.line, params, h);
|
|
15967
16024
|
}
|
|
15968
|
-
const rowid = getRowid($xeTable, row);
|
|
15969
16025
|
const rest = fullAllDataRowIdData[rowid];
|
|
15970
16026
|
let rLevel = 0;
|
|
15971
16027
|
let prevRow = null;
|
|
@@ -16267,7 +16323,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16267
16323
|
}));
|
|
16268
16324
|
} else {
|
|
16269
16325
|
// 渲染单元格
|
|
16270
|
-
tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
|
|
16326
|
+
tdVNs.push(...renderLine(h, _vm, rowid, cellParams, cellHeight), h('div', {
|
|
16271
16327
|
key: 'tc',
|
|
16272
16328
|
class: ['vxe-cell', {
|
|
16273
16329
|
'c--title': showTitle,
|
|
@@ -16377,20 +16433,23 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16377
16433
|
} = tableProps;
|
|
16378
16434
|
const {
|
|
16379
16435
|
hasFixedColumn,
|
|
16380
|
-
|
|
16436
|
+
treeExpandedFlag,
|
|
16381
16437
|
isColLoading,
|
|
16382
16438
|
scrollXLoad,
|
|
16383
16439
|
scrollYLoad,
|
|
16384
16440
|
isAllOverflow,
|
|
16385
|
-
|
|
16441
|
+
rowExpandedFlag,
|
|
16386
16442
|
expandColumn,
|
|
16387
16443
|
selectRadioRow,
|
|
16388
|
-
|
|
16444
|
+
pendingRowFlag,
|
|
16389
16445
|
isDragColMove,
|
|
16390
16446
|
rowExpandHeightFlag
|
|
16391
16447
|
} = tableReactData;
|
|
16392
16448
|
const {
|
|
16393
|
-
fullAllDataRowIdData
|
|
16449
|
+
fullAllDataRowIdData,
|
|
16450
|
+
treeExpandedMaps,
|
|
16451
|
+
pendingRowMaps,
|
|
16452
|
+
rowExpandedMaps
|
|
16394
16453
|
} = tableInternalData;
|
|
16395
16454
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
16396
16455
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -16405,6 +16464,9 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16405
16464
|
} = treeOpts;
|
|
16406
16465
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
16407
16466
|
const rows = [];
|
|
16467
|
+
const {
|
|
16468
|
+
handleGetRowId
|
|
16469
|
+
} = createHandleGetRowId($xeTable);
|
|
16408
16470
|
tableData.forEach((row, $rowIndex) => {
|
|
16409
16471
|
const trOn = {};
|
|
16410
16472
|
let rowIndex = $rowIndex;
|
|
@@ -16428,7 +16490,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16428
16490
|
$xeTable.clearHoverRow();
|
|
16429
16491
|
};
|
|
16430
16492
|
}
|
|
16431
|
-
const rowid =
|
|
16493
|
+
const rowid = handleGetRowId(row);
|
|
16432
16494
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
16433
16495
|
let rowLevel = 0;
|
|
16434
16496
|
let seq = -1;
|
|
@@ -16455,7 +16517,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16455
16517
|
_rowIndex
|
|
16456
16518
|
};
|
|
16457
16519
|
// 行是否被展开
|
|
16458
|
-
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid];
|
|
16520
|
+
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
16459
16521
|
// 树节点是否被展开
|
|
16460
16522
|
let isExpandTree = false;
|
|
16461
16523
|
let rowChildren = [];
|
|
@@ -16466,7 +16528,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16466
16528
|
}
|
|
16467
16529
|
if (treeConfig && !scrollYLoad && !transform) {
|
|
16468
16530
|
rowChildren = row[childrenField];
|
|
16469
|
-
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid];
|
|
16531
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
16470
16532
|
}
|
|
16471
16533
|
// 拖拽行事件
|
|
16472
16534
|
if (rowOpts.drag && (!treeConfig || transform)) {
|
|
@@ -16482,7 +16544,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16482
16544
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
16483
16545
|
'row--radio': radioOpts.highlight && selectRadioRow === row,
|
|
16484
16546
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
16485
|
-
'row--pending': !!pendingRowMaps[rowid]
|
|
16547
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
16486
16548
|
}, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''];
|
|
16487
16549
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
16488
16550
|
return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
@@ -21741,13 +21803,14 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21741
21803
|
} = props;
|
|
21742
21804
|
const {
|
|
21743
21805
|
mergeList,
|
|
21744
|
-
editStore
|
|
21745
|
-
selectCheckboxMaps
|
|
21806
|
+
editStore
|
|
21746
21807
|
} = reactData;
|
|
21747
21808
|
const {
|
|
21748
21809
|
tableFullTreeData,
|
|
21810
|
+
selectCheckboxMaps,
|
|
21749
21811
|
afterFullData,
|
|
21750
|
-
tableFullData
|
|
21812
|
+
tableFullData,
|
|
21813
|
+
pendingRowMaps
|
|
21751
21814
|
} = internalData;
|
|
21752
21815
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
21753
21816
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -21758,9 +21821,9 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21758
21821
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
21759
21822
|
const {
|
|
21760
21823
|
actived,
|
|
21761
|
-
removeMaps
|
|
21762
|
-
insertMaps
|
|
21824
|
+
removeMaps
|
|
21763
21825
|
} = editStore;
|
|
21826
|
+
const insertDataRowMaps = Object.assign({}, editStore.insertMaps);
|
|
21764
21827
|
const {
|
|
21765
21828
|
checkField
|
|
21766
21829
|
} = checkboxOpts;
|
|
@@ -21779,16 +21842,13 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21779
21842
|
});
|
|
21780
21843
|
// 如果绑定了多选属性,则更新状态
|
|
21781
21844
|
if (!checkField) {
|
|
21782
|
-
const selectRowMaps = {
|
|
21783
|
-
...selectCheckboxMaps
|
|
21784
|
-
};
|
|
21785
21845
|
rows.forEach(row => {
|
|
21786
21846
|
const rowid = getRowid(this, row);
|
|
21787
|
-
if (
|
|
21788
|
-
delete
|
|
21847
|
+
if (selectCheckboxMaps[rowid]) {
|
|
21848
|
+
delete selectCheckboxMaps[rowid];
|
|
21789
21849
|
}
|
|
21790
21850
|
});
|
|
21791
|
-
|
|
21851
|
+
reactData.updateCheckboxFlag++;
|
|
21792
21852
|
}
|
|
21793
21853
|
// 从数据源中移除
|
|
21794
21854
|
if (tableFullData === rows) {
|
|
@@ -21852,10 +21912,15 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21852
21912
|
// 从新增中移除已删除的数据
|
|
21853
21913
|
rows.forEach(row => {
|
|
21854
21914
|
const rowid = getRowid($xeTable, row);
|
|
21855
|
-
if (
|
|
21856
|
-
delete
|
|
21915
|
+
if (insertDataRowMaps[rowid]) {
|
|
21916
|
+
delete insertDataRowMaps[rowid];
|
|
21917
|
+
}
|
|
21918
|
+
if (pendingRowMaps[rowid]) {
|
|
21919
|
+
delete pendingRowMaps[rowid];
|
|
21857
21920
|
}
|
|
21858
21921
|
});
|
|
21922
|
+
editStore.insertMaps = insertDataRowMaps;
|
|
21923
|
+
reactData.pendingRowFlag++;
|
|
21859
21924
|
$xeTable.updateFooter();
|
|
21860
21925
|
$xeTable.cacheRowMap(false);
|
|
21861
21926
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -24965,11 +25030,11 @@ function validErrorRuleValue(rule, val) {
|
|
|
24965
25030
|
treeConfig
|
|
24966
25031
|
} = props;
|
|
24967
25032
|
const {
|
|
24968
|
-
editStore
|
|
24969
|
-
pendingRowMaps
|
|
25033
|
+
editStore
|
|
24970
25034
|
} = reactData;
|
|
24971
25035
|
const {
|
|
24972
|
-
afterFullData
|
|
25036
|
+
afterFullData,
|
|
25037
|
+
pendingRowMaps
|
|
24973
25038
|
} = internalData;
|
|
24974
25039
|
const {
|
|
24975
25040
|
removeMaps
|
|
@@ -25916,6 +25981,9 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
25916
25981
|
ref: 'refRowExpandYSpaceElem'
|
|
25917
25982
|
})];
|
|
25918
25983
|
if (expandColumn) {
|
|
25984
|
+
const {
|
|
25985
|
+
handleGetRowId
|
|
25986
|
+
} = createHandleGetRowId($xeTable);
|
|
25919
25987
|
tableRowExpandedList.forEach(row => {
|
|
25920
25988
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
25921
25989
|
const {
|
|
@@ -25931,7 +25999,7 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
25931
25999
|
seqMode
|
|
25932
26000
|
} = treeOpts;
|
|
25933
26001
|
const cellStyle = {};
|
|
25934
|
-
const rowid =
|
|
26002
|
+
const rowid = handleGetRowId(row);
|
|
25935
26003
|
const rest = fullAllDataRowIdData[rowid];
|
|
25936
26004
|
let rowLevel = 0;
|
|
25937
26005
|
let seq = -1;
|
|
@@ -26155,8 +26223,6 @@ function renderBody(h, $xeTable) {
|
|
|
26155
26223
|
isAllSelected: false,
|
|
26156
26224
|
// 复选框属性,有选中且非全选状态
|
|
26157
26225
|
isIndeterminate: false,
|
|
26158
|
-
// 复选框属性,已选中的行集合
|
|
26159
|
-
selectCheckboxMaps: {},
|
|
26160
26226
|
// 当前行
|
|
26161
26227
|
currentRow: null,
|
|
26162
26228
|
// 单选框属性,选中列
|
|
@@ -26170,16 +26236,6 @@ function renderBody(h, $xeTable) {
|
|
|
26170
26236
|
hasFixedColumn: false,
|
|
26171
26237
|
// 树节点列信息
|
|
26172
26238
|
treeNodeColumn: null,
|
|
26173
|
-
// 已展开的行集合
|
|
26174
|
-
rowExpandedMaps: {},
|
|
26175
|
-
// 懒加载中的展开行的集合
|
|
26176
|
-
rowExpandLazyLoadedMaps: {},
|
|
26177
|
-
// 已展开树节点集合
|
|
26178
|
-
treeExpandedMaps: {},
|
|
26179
|
-
// 懒加载中的树节点的集合
|
|
26180
|
-
treeExpandLazyLoadedMaps: {},
|
|
26181
|
-
// 树节点不确定状态的集合
|
|
26182
|
-
treeIndeterminateMaps: {},
|
|
26183
26239
|
// 合并单元格的对象集
|
|
26184
26240
|
mergeList: [],
|
|
26185
26241
|
// 合并表尾数据的对象集
|
|
@@ -26196,8 +26252,6 @@ function renderBody(h, $xeTable) {
|
|
|
26196
26252
|
upDataFlag: 0,
|
|
26197
26253
|
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
26198
26254
|
reColumnFlag: 0,
|
|
26199
|
-
// 已标记的对象集
|
|
26200
|
-
pendingRowMaps: {},
|
|
26201
26255
|
// 自定义列相关的信息
|
|
26202
26256
|
customStore: {
|
|
26203
26257
|
btnEl: null,
|
|
@@ -26332,6 +26386,10 @@ function renderBody(h, $xeTable) {
|
|
|
26332
26386
|
isHeader: false,
|
|
26333
26387
|
isFooter: false
|
|
26334
26388
|
},
|
|
26389
|
+
rowExpandedFlag: 1,
|
|
26390
|
+
treeExpandedFlag: 1,
|
|
26391
|
+
updateCheckboxFlag: 1,
|
|
26392
|
+
pendingRowFlag: 1,
|
|
26335
26393
|
rowHeightStore: {
|
|
26336
26394
|
default: 48,
|
|
26337
26395
|
medium: 44,
|
|
@@ -26478,17 +26536,29 @@ function renderBody(h, $xeTable) {
|
|
|
26478
26536
|
computeCellOpts() {
|
|
26479
26537
|
const $xeTable = this;
|
|
26480
26538
|
const props = $xeTable;
|
|
26481
|
-
|
|
26539
|
+
const cellOpts = Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
26540
|
+
if (cellOpts.height) {
|
|
26541
|
+
cellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);
|
|
26542
|
+
}
|
|
26543
|
+
return cellOpts;
|
|
26482
26544
|
},
|
|
26483
26545
|
computeHeaderCellOpts() {
|
|
26484
26546
|
const $xeTable = this;
|
|
26485
26547
|
const props = $xeTable;
|
|
26486
|
-
|
|
26548
|
+
const headerCellOpts = Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
26549
|
+
if (headerCellOpts.height) {
|
|
26550
|
+
headerCellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(headerCellOpts.height);
|
|
26551
|
+
}
|
|
26552
|
+
return headerCellOpts;
|
|
26487
26553
|
},
|
|
26488
26554
|
computeFooterCellOpts() {
|
|
26489
26555
|
const $xeTable = this;
|
|
26490
26556
|
const props = $xeTable;
|
|
26491
|
-
|
|
26557
|
+
const footerCellOpts = Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
26558
|
+
if (footerCellOpts.height) {
|
|
26559
|
+
footerCellOpts.height = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(footerCellOpts.height);
|
|
26560
|
+
}
|
|
26561
|
+
return footerCellOpts;
|
|
26492
26562
|
},
|
|
26493
26563
|
rowOpts() {
|
|
26494
26564
|
return this.computeRowOpts;
|
|
@@ -26777,16 +26847,23 @@ function renderBody(h, $xeTable) {
|
|
|
26777
26847
|
computeTableRowExpandedList() {
|
|
26778
26848
|
const $xeTable = this;
|
|
26779
26849
|
const reactData = $xeTable;
|
|
26850
|
+
const internalData = $xeTable;
|
|
26780
26851
|
const {
|
|
26781
|
-
|
|
26852
|
+
rowExpandedFlag,
|
|
26782
26853
|
tableData,
|
|
26783
26854
|
expandColumn
|
|
26784
26855
|
} = reactData;
|
|
26856
|
+
const {
|
|
26857
|
+
rowExpandedMaps
|
|
26858
|
+
} = internalData;
|
|
26859
|
+
const {
|
|
26860
|
+
handleGetRowId
|
|
26861
|
+
} = createHandleGetRowId($xeTable);
|
|
26785
26862
|
const expandList = [];
|
|
26786
|
-
if (expandColumn) {
|
|
26863
|
+
if (expandColumn && rowExpandedFlag) {
|
|
26787
26864
|
const rowKeys = {};
|
|
26788
26865
|
tableData.forEach(row => {
|
|
26789
|
-
rowKeys[
|
|
26866
|
+
rowKeys[handleGetRowId(row)] = true;
|
|
26790
26867
|
});
|
|
26791
26868
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps, (row, rowid) => {
|
|
26792
26869
|
if (rowKeys[rowid]) {
|
|
@@ -27056,13 +27133,15 @@ function renderBody(h, $xeTable) {
|
|
|
27056
27133
|
lastScrollTop: 0,
|
|
27057
27134
|
// 单选框属性,已选中保留的行
|
|
27058
27135
|
radioReserveRow: null,
|
|
27059
|
-
//
|
|
27136
|
+
// 复选框属性,已选中保留的行集合
|
|
27060
27137
|
checkboxReserveRowMap: {},
|
|
27061
|
-
//
|
|
27138
|
+
// 行数据,已展开保留的行集合
|
|
27062
27139
|
rowExpandedReserveRowMap: {},
|
|
27063
|
-
//
|
|
27140
|
+
// 树结构数据,已展开保留的行集合
|
|
27064
27141
|
treeExpandedReserveRowMap: {},
|
|
27065
|
-
//
|
|
27142
|
+
// 树结构数据,不确定状态的集合
|
|
27143
|
+
treeIndeterminateRowMaps: {},
|
|
27144
|
+
// 列表完整数据、条件处理后
|
|
27066
27145
|
tableFullData: [],
|
|
27067
27146
|
afterFullData: [],
|
|
27068
27147
|
// 列表条件处理后数据集合
|
|
@@ -27080,6 +27159,18 @@ function renderBody(h, $xeTable) {
|
|
|
27080
27159
|
fullColumnMap: new Map(),
|
|
27081
27160
|
fullColumnIdData: {},
|
|
27082
27161
|
fullColumnFieldData: {},
|
|
27162
|
+
// 已展开的行集合
|
|
27163
|
+
rowExpandedMaps: {},
|
|
27164
|
+
// 懒加载中的展开行的集合
|
|
27165
|
+
rowExpandLazyLoadedMaps: {},
|
|
27166
|
+
// 已展开树节点集合
|
|
27167
|
+
treeExpandedMaps: {},
|
|
27168
|
+
// 懒加载中的树节点的集合
|
|
27169
|
+
treeExpandLazyLoadedMaps: {},
|
|
27170
|
+
// 复选框属性,已选中的行集合
|
|
27171
|
+
selectCheckboxMaps: {},
|
|
27172
|
+
// 已标记的对象集
|
|
27173
|
+
pendingRowMaps: {},
|
|
27083
27174
|
swYSize: 0,
|
|
27084
27175
|
swYInterval: 0,
|
|
27085
27176
|
swYTotal: 0
|