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.
Files changed (45) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +14 -9
  3. package/es/table/module/validator/mixin.js +2 -2
  4. package/es/table/src/body.js +10 -10
  5. package/es/table/src/cell.js +15 -11
  6. package/es/table/src/methods.js +509 -458
  7. package/es/table/src/table.js +46 -26
  8. package/es/table/src/util.js +2 -2
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/index.umd.js +761 -670
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/style.css +1 -1
  14. package/lib/table/module/edit/mixin.js +16 -11
  15. package/lib/table/module/edit/mixin.min.js +1 -1
  16. package/lib/table/module/validator/mixin.js +3 -3
  17. package/lib/table/module/validator/mixin.min.js +1 -1
  18. package/lib/table/src/body.js +16 -11
  19. package/lib/table/src/body.min.js +1 -1
  20. package/lib/table/src/cell.js +22 -13
  21. package/lib/table/src/cell.min.js +1 -1
  22. package/lib/table/src/methods.js +623 -559
  23. package/lib/table/src/methods.min.js +1 -1
  24. package/lib/table/src/table.js +51 -25
  25. package/lib/table/src/table.min.js +1 -1
  26. package/lib/table/src/util.js +2 -2
  27. package/lib/table/src/util.min.js +1 -1
  28. package/lib/ui/index.js +1 -1
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/package.json +2 -2
  33. package/packages/table/module/edit/mixin.ts +17 -12
  34. package/packages/table/module/validator/mixin.ts +2 -2
  35. package/packages/table/src/body.ts +10 -10
  36. package/packages/table/src/cell.ts +15 -11
  37. package/packages/table/src/methods.ts +559 -481
  38. package/packages/table/src/table.ts +53 -31
  39. package/packages/table/src/util.ts +2 -2
  40. /package/es/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
  41. /package/es/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
  42. /package/es/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
  43. /package/lib/{iconfont.1742353673989.ttf → iconfont.1742437924038.ttf} +0 -0
  44. /package/lib/{iconfont.1742353673989.woff → iconfont.1742437924038.woff} +0 -0
  45. /package/lib/{iconfont.1742353673989.woff2 → iconfont.1742437924038.woff2} +0 -0
@@ -394,9 +394,12 @@ function updateAfterListIndex($xeTable) {
394
394
  fullDataRowIdData,
395
395
  fullAllDataRowIdData
396
396
  } = internalData;
397
+ const {
398
+ handleGetRowId
399
+ } = (0, _util.createHandleGetRowId)($xeTable);
397
400
  const fullMaps = {};
398
401
  afterFullData.forEach((row, index) => {
399
- const rowid = (0, _util.getRowid)($xeTable, row);
402
+ const rowid = handleGetRowId(row);
400
403
  const rowRest = fullAllDataRowIdData[rowid];
401
404
  const seq = index + 1;
402
405
  if (rowRest) {
@@ -450,8 +453,11 @@ function updateAfterDataIndex($xeTable) {
450
453
  const childrenField = treeOpts.children || treeOpts.childrenField;
451
454
  const fullMaps = {};
452
455
  if (treeConfig) {
456
+ const {
457
+ handleGetRowId
458
+ } = (0, _util.createHandleGetRowId)($xeTable);
453
459
  _xeUtils.default.eachTree(afterTreeFullData, (row, index, items, path) => {
454
- const rowid = (0, _util.getRowid)($xeTable, row);
460
+ const rowid = handleGetRowId(row);
455
461
  const rowRest = fullAllDataRowIdData[rowid];
456
462
  const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
457
463
  if (rowRest) {
@@ -493,25 +499,25 @@ function updateAfterDataIndex($xeTable) {
493
499
  */
494
500
  function handleVirtualTreeToList($xeTable) {
495
501
  const props = $xeTable;
496
- const reactData = $xeTable;
497
502
  const internalData = $xeTable;
498
503
  const {
499
504
  treeConfig
500
505
  } = props;
501
506
  const {
507
+ fullAllDataRowIdData,
502
508
  treeExpandedMaps
503
- } = reactData;
504
- const {
505
- fullAllDataRowIdData
506
509
  } = internalData;
507
510
  const treeOpts = $xeTable.computeTreeOpts;
508
511
  const childrenField = treeOpts.children || treeOpts.childrenField;
509
512
  if (treeConfig && treeOpts.transform) {
513
+ const {
514
+ handleGetRowId
515
+ } = (0, _util.createHandleGetRowId)($xeTable);
510
516
  const fullData = [];
511
517
  const expandMaps = {};
512
518
  _xeUtils.default.eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
513
- const rowid = (0, _util.getRowid)($xeTable, row);
514
- const parentRowid = (0, _util.getRowid)($xeTable, parentRow);
519
+ const rowid = handleGetRowId(row);
520
+ const parentRowid = handleGetRowId(parentRow);
515
521
  if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
516
522
  const rowRest = fullAllDataRowIdData[rowid];
517
523
  if (rowRest) {
@@ -966,12 +972,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
966
972
  const {
967
973
  treeConfig
968
974
  } = props;
969
- const {
970
- selectCheckboxMaps
971
- } = reactData;
972
975
  const {
973
976
  afterFullData,
974
- checkboxReserveRowMap
977
+ checkboxReserveRowMap,
978
+ selectCheckboxMaps
975
979
  } = internalData;
976
980
  const treeOpts = $xeTable.computeTreeOpts;
977
981
  const childrenField = treeOpts.children || treeOpts.childrenField;
@@ -997,7 +1001,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
997
1001
  row
998
1002
  })) {
999
1003
  if (checked) {
1000
- selectRowMaps[(0, _util.getRowid)($xeTable, row)] = row;
1004
+ selectRowMaps[handleGetRowId(row)] = row;
1001
1005
  }
1002
1006
  _xeUtils.default.set(row, checkField, checked);
1003
1007
  }
@@ -1103,10 +1107,10 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
1103
1107
  afterFullData.forEach(row => handleCheckboxReserveRow($xeTable, row, false));
1104
1108
  }
1105
1109
  }
1106
- reactData.selectCheckboxMaps = checkField ? {} : selectRowMaps;
1110
+ reactData.updateCheckboxFlag++;
1111
+ internalData.selectCheckboxMaps = checkField ? {} : selectRowMaps;
1107
1112
  reactData.isAllSelected = checked;
1108
1113
  reactData.isIndeterminate = false;
1109
- reactData.treeIndeterminateMaps = {};
1110
1114
  internalData.treeIndeterminateRowMaps = {};
1111
1115
  $xeTable.checkSelectionStatus();
1112
1116
  return $xeTable.$nextTick();
@@ -1122,15 +1126,15 @@ function handleReserveStatus($xeTable) {
1122
1126
  const {
1123
1127
  expandColumn,
1124
1128
  currentRow,
1125
- selectCheckboxMaps,
1126
- selectRadioRow,
1127
- rowExpandedMaps,
1128
- treeExpandedMaps
1129
+ selectRadioRow
1129
1130
  } = reactData;
1130
1131
  const {
1131
1132
  fullDataRowIdData,
1132
1133
  fullAllDataRowIdData,
1133
- radioReserveRow
1134
+ radioReserveRow,
1135
+ selectCheckboxMaps,
1136
+ treeExpandedMaps,
1137
+ rowExpandedMaps
1134
1138
  } = internalData;
1135
1139
  const expandOpts = $xeTable.computeExpandOpts;
1136
1140
  const treeOpts = $xeTable.computeTreeOpts;
@@ -1148,7 +1152,8 @@ function handleReserveStatus($xeTable) {
1148
1152
  }
1149
1153
  }
1150
1154
  // 复选框
1151
- reactData.selectCheckboxMaps = getRecoverRowMaps($xeTable, selectCheckboxMaps); // 刷新多选行状态
1155
+ internalData.selectCheckboxMaps = getRecoverRowMaps($xeTable, selectCheckboxMaps); // 刷新多选行状态
1156
+ reactData.updateCheckboxFlag++;
1152
1157
  // 还原保留选中状态
1153
1158
  if (checkboxOpts.reserve) {
1154
1159
  handleCheckedCheckboxRow($xeTable, handleReserveRow($xeTable, internalData.checkboxReserveRowMap), true, true);
@@ -1157,17 +1162,194 @@ function handleReserveStatus($xeTable) {
1157
1162
  reactData.currentRow = null; // 刷新当前行状态
1158
1163
  }
1159
1164
  // 行展开
1160
- reactData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {}; // 刷新行展开状态
1165
+ internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {}; // 刷新行展开状态
1166
+ reactData.rowExpandedFlag++;
1161
1167
  // 还原保留状态
1162
1168
  if (expandColumn && expandOpts.reserve) {
1163
1169
  $xeTable.setRowExpand(handleReserveRow($xeTable, internalData.rowExpandedReserveRowMap), true);
1164
1170
  }
1165
1171
  // 树展开
1166
- reactData.treeExpandedMaps = treeConfig ? getRecoverRowMaps($xeTable, treeExpandedMaps) : {}; // 刷新树展开状态
1172
+ internalData.treeExpandedMaps = treeConfig ? getRecoverRowMaps($xeTable, treeExpandedMaps) : {}; // 刷新树展开状态
1173
+ reactData.treeExpandedFlag++;
1167
1174
  if (treeConfig && treeOpts.reserve) {
1168
1175
  $xeTable.setTreeExpand(handleReserveRow($xeTable, internalData.treeExpandedReserveRowMap), true);
1169
1176
  }
1170
1177
  }
1178
+ /**
1179
+ * 处理默认展开树节点
1180
+ */
1181
+ const handleDefaultTreeExpand = $xeTable => {
1182
+ const props = $xeTable;
1183
+ const internalData = $xeTable;
1184
+ const {
1185
+ treeConfig
1186
+ } = props;
1187
+ if (treeConfig) {
1188
+ const {
1189
+ tableFullData
1190
+ } = internalData;
1191
+ const treeOpts = $xeTable.computeTreeOpts;
1192
+ const {
1193
+ expandAll,
1194
+ expandRowKeys
1195
+ } = treeOpts;
1196
+ const childrenField = treeOpts.children || treeOpts.childrenField;
1197
+ if (expandAll) {
1198
+ $xeTable.setAllTreeExpand(true);
1199
+ } else if (expandRowKeys) {
1200
+ const defExpandeds = [];
1201
+ const rowkey = (0, _util.getRowkey)($xeTable);
1202
+ expandRowKeys.forEach(rowid => {
1203
+ const matchObj = _xeUtils.default.findTree(tableFullData, item => rowid === _xeUtils.default.get(item, rowkey), {
1204
+ children: childrenField
1205
+ });
1206
+ if (matchObj) {
1207
+ defExpandeds.push(matchObj.item);
1208
+ }
1209
+ });
1210
+ $xeTable.setTreeExpand(defExpandeds, true);
1211
+ }
1212
+ }
1213
+ };
1214
+ const handleAsyncTreeExpandChilds = ($xeTable, row) => {
1215
+ const reactData = $xeTable;
1216
+ const internalData = $xeTable;
1217
+ const treeOpts = $xeTable.computeTreeOpts;
1218
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
1219
+ const {
1220
+ transform,
1221
+ loadMethod
1222
+ } = treeOpts;
1223
+ const {
1224
+ checkStrictly
1225
+ } = checkboxOpts;
1226
+ return new Promise(resolve => {
1227
+ if (loadMethod) {
1228
+ const {
1229
+ fullAllDataRowIdData,
1230
+ treeExpandLazyLoadedMaps
1231
+ } = internalData;
1232
+ const rowid = (0, _util.getRowid)($xeTable, row);
1233
+ const rowRest = fullAllDataRowIdData[rowid];
1234
+ treeExpandLazyLoadedMaps[rowid] = row;
1235
+ Promise.resolve(loadMethod({
1236
+ $table: $xeTable,
1237
+ row
1238
+ })).then(childRecords => {
1239
+ if (rowRest) {
1240
+ rowRest.treeLoaded = true;
1241
+ }
1242
+ if (treeExpandLazyLoadedMaps[rowid]) {
1243
+ delete treeExpandLazyLoadedMaps[rowid];
1244
+ }
1245
+ if (!_xeUtils.default.isArray(childRecords)) {
1246
+ childRecords = [];
1247
+ }
1248
+ if (childRecords) {
1249
+ return $xeTable.loadTreeChildren(row, childRecords).then(childRows => {
1250
+ const {
1251
+ treeExpandedMaps
1252
+ } = internalData;
1253
+ if (childRows.length && !treeExpandedMaps[rowid]) {
1254
+ treeExpandedMaps[rowid] = row;
1255
+ }
1256
+ reactData.treeExpandedFlag++;
1257
+ // 如果当前节点已选中,则展开后子节点也被选中
1258
+ if (!checkStrictly && $xeTable.isCheckedByCheckboxRow(row)) {
1259
+ handleCheckedCheckboxRow($xeTable, childRows, true);
1260
+ }
1261
+ return $xeTable.$nextTick().then(() => {
1262
+ if (transform) {
1263
+ $xeTable.handleTableData();
1264
+ updateAfterDataIndex($xeTable);
1265
+ return $xeTable.$nextTick();
1266
+ }
1267
+ });
1268
+ });
1269
+ }
1270
+ }).catch(() => {
1271
+ const {
1272
+ treeExpandLazyLoadedMaps
1273
+ } = internalData;
1274
+ if (rowRest) {
1275
+ rowRest.treeLoaded = false;
1276
+ }
1277
+ if (treeExpandLazyLoadedMaps[rowid]) {
1278
+ delete treeExpandLazyLoadedMaps[rowid];
1279
+ }
1280
+ }).finally(() => {
1281
+ reactData.treeExpandedFlag++;
1282
+ $xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve());
1283
+ });
1284
+ } else {
1285
+ resolve();
1286
+ }
1287
+ });
1288
+ };
1289
+ const handleTreeExpandReserve = ($xeTable, row, expanded) => {
1290
+ const internalData = $xeTable;
1291
+ const {
1292
+ treeExpandedReserveRowMap
1293
+ } = internalData;
1294
+ const treeOpts = $xeTable.computeTreeOpts;
1295
+ if (treeOpts.reserve) {
1296
+ const rowid = (0, _util.getRowid)($xeTable, row);
1297
+ if (expanded) {
1298
+ treeExpandedReserveRowMap[rowid] = row;
1299
+ } else if (treeExpandedReserveRowMap[rowid]) {
1300
+ delete treeExpandedReserveRowMap[rowid];
1301
+ }
1302
+ }
1303
+ };
1304
+ const handleAsyncRowExpand = ($xeTable, row) => {
1305
+ const reactData = $xeTable;
1306
+ const internalData = $xeTable;
1307
+ return new Promise(resolve => {
1308
+ const expandOpts = $xeTable.computeExpandOpts;
1309
+ const {
1310
+ loadMethod
1311
+ } = expandOpts;
1312
+ if (loadMethod) {
1313
+ const {
1314
+ fullAllDataRowIdData,
1315
+ rowExpandLazyLoadedMaps
1316
+ } = internalData;
1317
+ const rowid = (0, _util.getRowid)($xeTable, row);
1318
+ const rowRest = fullAllDataRowIdData[rowid];
1319
+ rowExpandLazyLoadedMaps[rowid] = row;
1320
+ loadMethod({
1321
+ $table: $xeTable,
1322
+ row,
1323
+ rowIndex: $xeTable.getRowIndex(row),
1324
+ $rowIndex: $xeTable.getVMRowIndex(row)
1325
+ }).then(() => {
1326
+ const {
1327
+ rowExpandedMaps
1328
+ } = internalData;
1329
+ if (rowRest) {
1330
+ rowRest.expandLoaded = true;
1331
+ }
1332
+ rowExpandedMaps[rowid] = row;
1333
+ reactData.rowExpandedFlag++;
1334
+ }).catch(() => {
1335
+ if (rowRest) {
1336
+ rowRest.expandLoaded = false;
1337
+ }
1338
+ }).finally(() => {
1339
+ const {
1340
+ rowExpandLazyLoadedMaps
1341
+ } = internalData;
1342
+ if (rowExpandLazyLoadedMaps[rowid]) {
1343
+ delete rowExpandLazyLoadedMaps[rowid];
1344
+ }
1345
+ reactData.rowExpandedFlag++;
1346
+ $xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
1347
+ });
1348
+ } else {
1349
+ resolve();
1350
+ }
1351
+ });
1352
+ };
1171
1353
  function calcVarRowHeightConfig($xeTable, sizeKey, sizeEl) {
1172
1354
  const reactData = $xeTable;
1173
1355
  const {
@@ -1242,12 +1424,15 @@ function handleVirtualYVisible($xeTable) {
1242
1424
  toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1;
1243
1425
  visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
1244
1426
  } else {
1427
+ const {
1428
+ handleGetRowId
1429
+ } = (0, _util.createHandleGetRowId)($xeTable);
1245
1430
  let leftIndex = 0;
1246
1431
  let rightIndex = afterFullData.length;
1247
1432
  while (leftIndex < rightIndex) {
1248
1433
  const rIndex = Math.floor((leftIndex + rightIndex) / 2);
1249
1434
  const row = afterFullData[rIndex];
1250
- const rowid = (0, _util.getRowid)($xeTable, row);
1435
+ const rowid = handleGetRowId(row);
1251
1436
  const rowRest = fullAllDataRowIdData[rowid] || {};
1252
1437
  if (rowRest.oTop <= startTop) {
1253
1438
  leftIndex = rIndex + 1;
@@ -1258,7 +1443,7 @@ function handleVirtualYVisible($xeTable) {
1258
1443
  toVisibleIndex = Math.max(0, leftIndex < afterFullData.length ? leftIndex - 2 : 0);
1259
1444
  for (let rIndex = toVisibleIndex, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
1260
1445
  const row = afterFullData[rIndex];
1261
- const rowid = (0, _util.getRowid)($xeTable, row);
1446
+ const rowid = handleGetRowId(row);
1262
1447
  const rowRest = fullAllDataRowIdData[rowid] || {};
1263
1448
  visibleSize++;
1264
1449
  if (rowRest.oTop > endTop || visibleSize >= 100) {
@@ -1297,12 +1482,16 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
1297
1482
  }
1298
1483
  }
1299
1484
  }
1300
- function setMerges(_vm, merges, mList, rowList) {
1485
+ function setMerges($xeTable, merges, mList, rowList) {
1486
+ const props = $xeTable;
1487
+ const internalData = $xeTable;
1301
1488
  if (merges) {
1302
1489
  const {
1303
- treeConfig,
1490
+ treeConfig
1491
+ } = props;
1492
+ const {
1304
1493
  visibleColumn
1305
- } = _vm;
1494
+ } = internalData;
1306
1495
  if (!_xeUtils.default.isArray(merges)) {
1307
1496
  merges = [merges];
1308
1497
  }
@@ -1352,13 +1541,17 @@ function setMerges(_vm, merges, mList, rowList) {
1352
1541
  });
1353
1542
  }
1354
1543
  }
1355
- function removeMerges(_vm, merges, mList, rowList) {
1544
+ function removeMerges($xeTable, merges, mList, rowList) {
1545
+ const props = $xeTable;
1546
+ const internalData = $xeTable;
1356
1547
  const rest = [];
1357
1548
  if (merges) {
1358
1549
  const {
1359
- treeConfig,
1550
+ treeConfig
1551
+ } = props;
1552
+ const {
1360
1553
  visibleColumn
1361
- } = _vm;
1554
+ } = internalData;
1362
1555
  if (!_xeUtils.default.isArray(merges)) {
1363
1556
  merges = [merges];
1364
1557
  }
@@ -1589,8 +1782,11 @@ const calcCellHeight = $xeTable => {
1589
1782
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
1590
1783
  const el = $xeTable.$refs.refElem;
1591
1784
  if (!isAllOverflow && scrollYLoad && el) {
1785
+ const {
1786
+ handleGetRowId
1787
+ } = (0, _util.createHandleGetRowId)($xeTable);
1592
1788
  tableData.forEach(row => {
1593
- const rowid = (0, _util.getRowid)($xeTable, row);
1789
+ const rowid = handleGetRowId(row);
1594
1790
  const rowRest = fullAllDataRowIdData[rowid];
1595
1791
  if (rowRest) {
1596
1792
  const height = calcCellAutoHeight(rowRest, el);
@@ -2328,6 +2524,39 @@ function loadScrollYData($xeTable) {
2328
2524
  }
2329
2525
  }
2330
2526
  }
2527
+ const createGetRowCacheProp = prop => {
2528
+ return function (row) {
2529
+ const $xeTable = this;
2530
+ const internalData = $xeTable;
2531
+ const {
2532
+ fullAllDataRowIdData
2533
+ } = internalData;
2534
+ if (row) {
2535
+ const rowid = (0, _util.getRowid)($xeTable, row);
2536
+ const rowRest = fullAllDataRowIdData[rowid];
2537
+ if (rowRest) {
2538
+ return rowRest[prop];
2539
+ }
2540
+ }
2541
+ return -1;
2542
+ };
2543
+ };
2544
+ const createGetColumnCacheProp = prop => {
2545
+ return function (column) {
2546
+ const $xeTable = this;
2547
+ const internalData = $xeTable;
2548
+ const {
2549
+ fullColumnIdData
2550
+ } = internalData;
2551
+ if (column) {
2552
+ const colRest = fullColumnIdData[column.id];
2553
+ if (colRest) {
2554
+ return colRest[prop];
2555
+ }
2556
+ }
2557
+ return -1;
2558
+ };
2559
+ };
2331
2560
  function lazyScrollXData($xeTable) {
2332
2561
  const internalData = $xeTable;
2333
2562
  const {
@@ -2499,7 +2728,7 @@ function calcCellWidth($xeTable) {
2499
2728
  }
2500
2729
  function handleUpdateColResize($xeTable, evnt, params) {
2501
2730
  $xeTable.analyColumnWidth();
2502
- $xeTable.recalculate(true).then(() => {
2731
+ $xeTable.recalculate().then(() => {
2503
2732
  $xeTable.saveCustomStore('update:width');
2504
2733
  $xeTable.updateCellAreas();
2505
2734
  $xeTable.dispatchEvent('column-resizable-change', params, evnt);
@@ -2511,7 +2740,7 @@ function handleUpdateColResize($xeTable, evnt, params) {
2511
2740
  function handleUpdateRowResize($xeTable, evnt, params) {
2512
2741
  const reactData = $xeTable;
2513
2742
  reactData.resizeHeightFlag++;
2514
- $xeTable.recalculate(true).then(() => {
2743
+ $xeTable.recalculate().then(() => {
2515
2744
  $xeTable.updateCellAreas();
2516
2745
  $xeTable.dispatchEvent('row-resizable-change', params, evnt);
2517
2746
  setTimeout(() => $xeTable.recalculate(true), 300);
@@ -2536,21 +2765,24 @@ function updateRowOffsetTop($xeTable) {
2536
2765
  const reactData = $xeTable;
2537
2766
  const internalData = $xeTable;
2538
2767
  const {
2539
- expandColumn,
2540
- rowExpandedMaps
2768
+ expandColumn
2541
2769
  } = reactData;
2542
2770
  const {
2543
2771
  afterFullData,
2544
- fullAllDataRowIdData
2772
+ fullAllDataRowIdData,
2773
+ rowExpandedMaps
2545
2774
  } = internalData;
2546
2775
  const expandOpts = $xeTable.computeExpandOpts;
2547
2776
  const rowOpts = $xeTable.computeRowOpts;
2548
2777
  const cellOpts = $xeTable.computeCellOpts;
2549
2778
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
2779
+ const {
2780
+ handleGetRowId
2781
+ } = (0, _util.createHandleGetRowId)($xeTable);
2550
2782
  let offsetTop = 0;
2551
2783
  for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
2552
2784
  const row = afterFullData[rIndex];
2553
- const rowid = (0, _util.getRowid)($xeTable, row);
2785
+ const rowid = handleGetRowId(row);
2554
2786
  const rowRest = fullAllDataRowIdData[rowid] || {};
2555
2787
  rowRest.oTop = offsetTop;
2556
2788
  offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
@@ -2566,7 +2798,8 @@ function updateRowExpandStyle($xeTable) {
2566
2798
  const {
2567
2799
  expandColumn,
2568
2800
  scrollYLoad,
2569
- rowExpandedMaps
2801
+ scrollYTop,
2802
+ isScrollYBig
2570
2803
  } = reactData;
2571
2804
  const expandOpts = $xeTable.computeExpandOpts;
2572
2805
  const rowOpts = $xeTable.computeRowOpts;
@@ -2578,41 +2811,35 @@ function updateRowExpandStyle($xeTable) {
2578
2811
  if (expandColumn && mode === 'fixed') {
2579
2812
  const {
2580
2813
  elemStore,
2581
- afterFullData,
2582
2814
  fullAllDataRowIdData
2583
2815
  } = internalData;
2584
2816
  const rowExpandEl = $xeTable.$refs.refRowExpandElem;
2585
2817
  const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
2586
2818
  if (rowExpandEl && bodyScrollElem) {
2587
2819
  let isUpdateHeight = false;
2588
- if (scrollYLoad) {
2589
- let offsetTop = 0;
2590
- for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
2591
- const row = afterFullData[rIndex];
2592
- const rowid = (0, _util.getRowid)($xeTable, row);
2593
- const rowRest = fullAllDataRowIdData[rowid] || {};
2594
- rowRest.oTop = offsetTop;
2595
- offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
2596
- // 是否展开行
2597
- if (expandColumn && rowExpandedMaps[rowid]) {
2598
- offsetTop += rowRest.expandHeight || expandOpts.height || 0;
2599
- }
2600
- }
2601
- }
2602
2820
  _xeUtils.default.arrayEach(rowExpandEl.children, reEl => {
2603
2821
  const expandEl = reEl;
2604
2822
  const rowid = expandEl.getAttribute('rowid') || '';
2605
2823
  const rowRest = fullAllDataRowIdData[rowid];
2606
2824
  if (rowRest) {
2607
2825
  const expandHeight = expandEl.offsetHeight + 1;
2826
+ const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
2827
+ let offsetTop = 0;
2608
2828
  if (scrollYLoad) {
2609
- expandEl.style.top = (0, _dom.toCssUnit)(rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight));
2829
+ if (isScrollYBig && trEl) {
2830
+ offsetTop = trEl.offsetTop + trEl.offsetHeight;
2831
+ } else {
2832
+ offsetTop = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
2833
+ }
2610
2834
  } else {
2611
- const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
2612
2835
  if (trEl) {
2613
- expandEl.style.top = (0, _dom.toCssUnit)(trEl.offsetTop + trEl.offsetHeight);
2836
+ offsetTop = trEl.offsetTop + trEl.offsetHeight;
2614
2837
  }
2615
2838
  }
2839
+ if (isScrollYBig) {
2840
+ offsetTop += scrollYTop;
2841
+ }
2842
+ expandEl.style.top = (0, _dom.toCssUnit)(offsetTop);
2616
2843
  if (!isUpdateHeight) {
2617
2844
  if (rowRest.expandHeight !== expandHeight) {
2618
2845
  isUpdateHeight = true;
@@ -2623,6 +2850,9 @@ function updateRowExpandStyle($xeTable) {
2623
2850
  });
2624
2851
  if (isUpdateHeight) {
2625
2852
  reactData.rowExpandHeightFlag++;
2853
+ $xeTable.$nextTick(() => {
2854
+ updateRowOffsetTop($xeTable);
2855
+ });
2626
2856
  }
2627
2857
  }
2628
2858
  }
@@ -3046,13 +3276,11 @@ const Methods = {
3046
3276
  const {
3047
3277
  treeConfig
3048
3278
  } = props;
3049
- const {
3050
- treeExpandedMaps
3051
- } = reactData;
3052
3279
  const {
3053
3280
  fullAllDataRowIdData,
3054
3281
  tableFullData,
3055
- tableFullTreeData
3282
+ tableFullTreeData,
3283
+ treeExpandedMaps
3056
3284
  } = internalData;
3057
3285
  const treeOpts = $xeTable.computeTreeOpts;
3058
3286
  const childrenField = treeOpts.children || treeOpts.childrenField;
@@ -3062,7 +3290,6 @@ const Methods = {
3062
3290
  } = treeOpts;
3063
3291
  const fullAllDataRowIdMaps = Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
3064
3292
  const fullDataRowIdMaps = {};
3065
- const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
3066
3293
  const {
3067
3294
  handleUpdateRowId
3068
3295
  } = (0, _util.createHandleUpdateRowId)($xeTable);
@@ -3101,13 +3328,12 @@ const Methods = {
3101
3328
  _xeUtils.default.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
3102
3329
  const rowid = handleUpdateRowId(row);
3103
3330
  if (treeConfig && lazy) {
3104
- const treeExpRest = treeTempExpandedMaps[rowid];
3105
3331
  if (row[hasChildField] && row[childrenField] === undefined) {
3106
3332
  row[childrenField] = null;
3107
3333
  }
3108
- if (treeExpRest) {
3334
+ if (treeExpandedMaps[rowid]) {
3109
3335
  if (!row[childrenField] || !row[childrenField].length) {
3110
- delete treeTempExpandedMaps[rowid];
3336
+ delete treeExpandedMaps[rowid];
3111
3337
  }
3112
3338
  }
3113
3339
  }
@@ -3122,7 +3348,7 @@ const Methods = {
3122
3348
  }
3123
3349
  internalData.fullDataRowIdData = fullDataRowIdMaps;
3124
3350
  internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
3125
- reactData.treeExpandedMaps = treeTempExpandedMaps;
3351
+ reactData.treeExpandedFlag++;
3126
3352
  },
3127
3353
  cacheSourceMap(fullData) {
3128
3354
  const $xeTable = this;
@@ -3271,53 +3497,22 @@ const Methods = {
3271
3497
  * 根据 row 获取序号
3272
3498
  * @param {Row} row 行对象
3273
3499
  */
3274
- getRowSeq(row) {
3275
- const {
3276
- fullAllDataRowIdData
3277
- } = this;
3278
- if (row) {
3279
- const rowid = (0, _util.getRowid)(this, row);
3280
- const rest = fullAllDataRowIdData[rowid];
3281
- if (rest) {
3282
- return rest.seq;
3283
- }
3284
- }
3285
- return -1;
3286
- },
3500
+ getRowSeq: createGetRowCacheProp('seq'),
3287
3501
  /**
3288
3502
  * 根据 row 获取相对于 data 中的索引
3289
3503
  * @param {Row} row 行对象
3290
3504
  */
3291
- getRowIndex(row) {
3292
- const {
3293
- fullAllDataRowIdData
3294
- } = this;
3295
- if (row) {
3296
- const rowid = (0, _util.getRowid)(this, row);
3297
- const rest = fullAllDataRowIdData[rowid];
3298
- if (rest) {
3299
- return rest.index;
3300
- }
3301
- }
3302
- return -1;
3303
- },
3505
+ getRowIndex: createGetRowCacheProp('index'),
3304
3506
  /**
3305
3507
  * 根据 row 获取相对于当前数据中的索引
3306
3508
  * @param {Row} row 行对象
3307
3509
  */
3308
- getVTRowIndex(row) {
3309
- const {
3310
- fullAllDataRowIdData
3311
- } = this;
3312
- if (row) {
3313
- const rowid = (0, _util.getRowid)(this, row);
3314
- const rest = fullAllDataRowIdData[rowid];
3315
- if (rest) {
3316
- return rest._index;
3317
- }
3318
- }
3319
- return -1;
3320
- },
3510
+ getVTRowIndex: createGetRowCacheProp('_index'),
3511
+ /**
3512
+ * 根据 row 获取渲染中的虚拟索引
3513
+ * @param {Row} row 行对象
3514
+ */
3515
+ getVMRowIndex: createGetRowCacheProp('$index'),
3321
3516
  // 在 v3 中废弃
3322
3517
  _getRowIndex(row) {
3323
3518
  if (process.env.NODE_ENV === 'development') {
@@ -3325,23 +3520,6 @@ const Methods = {
3325
3520
  }
3326
3521
  return this.getVTRowIndex(row);
3327
3522
  },
3328
- /**
3329
- * 根据 row 获取渲染中的虚拟索引
3330
- * @param {Row} row 行对象
3331
- */
3332
- getVMRowIndex(row) {
3333
- const {
3334
- fullAllDataRowIdData
3335
- } = this;
3336
- if (row) {
3337
- const rowid = (0, _util.getRowid)(this, row);
3338
- const rest = fullAllDataRowIdData[rowid];
3339
- if (rest) {
3340
- return rest.$index;
3341
- }
3342
- }
3343
- return -1;
3344
- },
3345
3523
  // 在 v3 中废弃
3346
3524
  $getRowIndex(row) {
3347
3525
  if (process.env.NODE_ENV === 'development') {
@@ -3353,34 +3531,17 @@ const Methods = {
3353
3531
  * 根据 column 获取相对于 columns 中的索引
3354
3532
  * @param {ColumnInfo} column 列配置
3355
3533
  */
3356
- getColumnIndex(column) {
3357
- const {
3358
- fullColumnIdData
3359
- } = this;
3360
- if (column) {
3361
- const rest = fullColumnIdData[column.id];
3362
- if (rest) {
3363
- return rest.index;
3364
- }
3365
- }
3366
- return -1;
3367
- },
3534
+ getColumnIndex: createGetColumnCacheProp('index'),
3368
3535
  /**
3369
3536
  * 根据 column 获取相对于当前表格列中的索引
3370
3537
  * @param {ColumnInfo} column 列配置
3371
3538
  */
3372
- getVTColumnIndex(column) {
3373
- const {
3374
- fullColumnIdData
3375
- } = this;
3376
- if (column) {
3377
- const rest = fullColumnIdData[column.id];
3378
- if (rest) {
3379
- return rest._index;
3380
- }
3381
- }
3382
- return -1;
3383
- },
3539
+ getVTColumnIndex: createGetColumnCacheProp('_index'),
3540
+ /**
3541
+ * 根据 column 获取渲染中的虚拟索引
3542
+ * @param {ColumnInfo} column 列配置
3543
+ */
3544
+ getVMColumnIndex: createGetColumnCacheProp('$index'),
3384
3545
  // 在 v3 中废弃
3385
3546
  _getColumnIndex(column) {
3386
3547
  if (process.env.NODE_ENV === 'development') {
@@ -3388,22 +3549,6 @@ const Methods = {
3388
3549
  }
3389
3550
  return this.getVTColumnIndex(column);
3390
3551
  },
3391
- /**
3392
- * 根据 column 获取渲染中的虚拟索引
3393
- * @param {ColumnInfo} column 列配置
3394
- */
3395
- getVMColumnIndex(column) {
3396
- const {
3397
- fullColumnIdData
3398
- } = this;
3399
- if (column) {
3400
- const rest = fullColumnIdData[column.id];
3401
- if (rest) {
3402
- return rest.$index;
3403
- }
3404
- }
3405
- return -1;
3406
- },
3407
3552
  // 在 v3 中废弃
3408
3553
  $getColumnIndex(column) {
3409
3554
  if (process.env.NODE_ENV === 'development') {
@@ -3528,6 +3673,9 @@ const Methods = {
3528
3673
  const {
3529
3674
  transform
3530
3675
  } = treeOpts;
3676
+ const {
3677
+ handleGetRowId
3678
+ } = (0, _util.createHandleGetRowId)($xeTable);
3531
3679
  if (!keepSource) {
3532
3680
  if (process.env.NODE_ENV === 'development') {
3533
3681
  (0, _log.errLog)('vxe.error.reqProp', ['keep-source']);
@@ -3545,7 +3693,7 @@ const Methods = {
3545
3693
  let reDelFlag = false;
3546
3694
  if (targetRows.length) {
3547
3695
  targetRows.forEach(item => {
3548
- const rowid = (0, _util.getRowid)($xeTable, item);
3696
+ const rowid = handleGetRowId(item);
3549
3697
  const rowRest = fullAllDataRowIdData[rowid];
3550
3698
  if (rowRest) {
3551
3699
  const row = rowRest.row;
@@ -3967,21 +4115,18 @@ const Methods = {
3967
4115
  getCheckboxRecords(isFull) {
3968
4116
  const $xeTable = this;
3969
4117
  const props = $xeTable;
3970
- const reactData = $xeTable;
3971
4118
  const internalData = $xeTable;
3972
4119
  const {
3973
4120
  treeConfig
3974
4121
  } = props;
3975
- const {
3976
- selectCheckboxMaps
3977
- } = reactData;
3978
4122
  const {
3979
4123
  tableFullData,
3980
4124
  afterFullData,
3981
4125
  afterTreeFullData,
3982
4126
  tableFullTreeData,
3983
4127
  fullDataRowIdData,
3984
- afterFullRowMaps
4128
+ afterFullRowMaps,
4129
+ selectCheckboxMaps
3985
4130
  } = internalData;
3986
4131
  const treeOpts = $xeTable.computeTreeOpts;
3987
4132
  const checkboxOpts = $xeTable.computeCheckboxOpts;
@@ -4423,6 +4568,7 @@ const Methods = {
4423
4568
  * 默认执行一次,除非被重置
4424
4569
  */
4425
4570
  handleLoadDefaults() {
4571
+ const $xeTable = this;
4426
4572
  if (this.checkboxConfig) {
4427
4573
  this.handleDefaultSelectionChecked();
4428
4574
  }
@@ -4433,7 +4579,7 @@ const Methods = {
4433
4579
  this.handleDefaultRowExpand();
4434
4580
  }
4435
4581
  if (this.treeConfig) {
4436
- this.handleDefaultTreeExpand();
4582
+ handleDefaultTreeExpand($xeTable);
4437
4583
  }
4438
4584
  if (this.mergeCells) {
4439
4585
  this.handleDefaultMergeCells();
@@ -5343,12 +5489,15 @@ const Methods = {
5343
5489
  fullAllDataRowIdData,
5344
5490
  afterFullData
5345
5491
  } = internalData;
5492
+ const {
5493
+ handleGetRowId
5494
+ } = (0, _util.createHandleGetRowId)($xeTable);
5346
5495
  const rowOpts = $xeTable.computeRowOpts;
5347
5496
  const cellOpts = $xeTable.computeCellOpts;
5348
5497
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
5349
5498
  const rest = {};
5350
5499
  afterFullData.forEach(row => {
5351
- const rowid = (0, _util.getRowid)($xeTable, row);
5500
+ const rowid = handleGetRowId(row);
5352
5501
  const rowRest = fullAllDataRowIdData[rowid];
5353
5502
  if (rowRest) {
5354
5503
  const resizeHeight = rowRest.resizeHeight;
@@ -5377,8 +5526,11 @@ const Methods = {
5377
5526
  rHeight = Math.floor(rHeight * bodyHeight);
5378
5527
  }
5379
5528
  if (rHeight) {
5529
+ const {
5530
+ handleGetRowId
5531
+ } = (0, _util.createHandleGetRowId)($xeTable);
5380
5532
  rows.forEach(row => {
5381
- const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : (0, _util.getRowid)($xeTable, row);
5533
+ const rowid = _xeUtils.default.isString(row) || _xeUtils.default.isNumber(row) ? row : handleGetRowId(row);
5382
5534
  const rowRest = fullAllDataRowIdData[rowid];
5383
5535
  if (rowRest) {
5384
5536
  rowRest.resizeHeight = rHeight;
@@ -6338,15 +6490,20 @@ const Methods = {
6338
6490
  * 获取复选框半选状态的行数据
6339
6491
  */
6340
6492
  getCheckboxIndeterminateRecords(isFull) {
6493
+ const $xeTable = this;
6494
+ const props = $xeTable;
6495
+ const internalData = $xeTable;
6341
6496
  const {
6342
- treeConfig,
6343
- treeIndeterminateMaps,
6344
- fullDataRowIdData
6345
- } = this;
6497
+ treeConfig
6498
+ } = props;
6499
+ const {
6500
+ fullDataRowIdData,
6501
+ treeIndeterminateRowMaps
6502
+ } = internalData;
6346
6503
  if (treeConfig) {
6347
6504
  const fullRest = [];
6348
6505
  const defRest = [];
6349
- _xeUtils.default.each(treeIndeterminateMaps, (item, rowid) => {
6506
+ _xeUtils.default.each(treeIndeterminateRowMaps, (item, rowid) => {
6350
6507
  if (item) {
6351
6508
  fullRest.push(item);
6352
6509
  if (fullDataRowIdData[rowid]) {
@@ -6423,9 +6580,13 @@ const Methods = {
6423
6580
  isCheckedByCheckboxRow(row) {
6424
6581
  const $xeTable = this;
6425
6582
  const reactData = $xeTable;
6583
+ const internalData = $xeTable;
6426
6584
  const {
6427
- selectCheckboxMaps
6585
+ updateCheckboxFlag
6428
6586
  } = reactData;
6587
+ const {
6588
+ selectCheckboxMaps
6589
+ } = internalData;
6429
6590
  const checkboxOpts = $xeTable.computeCheckboxOpts;
6430
6591
  const {
6431
6592
  checkField
@@ -6433,17 +6594,18 @@ const Methods = {
6433
6594
  if (checkField) {
6434
6595
  return _xeUtils.default.get(row, checkField);
6435
6596
  }
6436
- return !!selectCheckboxMaps[(0, _util.getRowid)($xeTable, row)];
6597
+ return !!updateCheckboxFlag && !!selectCheckboxMaps[(0, _util.getRowid)($xeTable, row)];
6437
6598
  },
6438
6599
  isCheckedByCheckboxRowKey(rowid) {
6439
6600
  const $xeTable = this;
6440
6601
  const reactData = $xeTable;
6441
6602
  const internalData = $xeTable;
6442
6603
  const {
6443
- selectCheckboxMaps
6604
+ updateCheckboxFlag
6444
6605
  } = reactData;
6445
6606
  const {
6446
- fullAllDataRowIdData
6607
+ fullAllDataRowIdData,
6608
+ selectCheckboxMaps
6447
6609
  } = internalData;
6448
6610
  const checkboxOpts = $xeTable.computeCheckboxOpts;
6449
6611
  const {
@@ -6456,23 +6618,23 @@ const Methods = {
6456
6618
  }
6457
6619
  return false;
6458
6620
  }
6459
- return !!selectCheckboxMaps[rowid];
6621
+ return !!updateCheckboxFlag && !!selectCheckboxMaps[rowid];
6460
6622
  },
6461
6623
  isIndeterminateByCheckboxRow(row) {
6462
6624
  const $xeTable = this;
6463
- const reactData = $xeTable;
6625
+ const internalData = $xeTable;
6464
6626
  const {
6465
- treeIndeterminateMaps
6466
- } = reactData;
6467
- return !!treeIndeterminateMaps[(0, _util.getRowid)($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row);
6627
+ treeIndeterminateRowMaps
6628
+ } = internalData;
6629
+ return !!treeIndeterminateRowMaps[(0, _util.getRowid)($xeTable, row)] && !$xeTable.isCheckedByCheckboxRow(row);
6468
6630
  },
6469
6631
  isIndeterminateByCheckboxRowKey(rowid) {
6470
6632
  const $xeTable = this;
6471
- const reactData = $xeTable;
6633
+ const internalData = $xeTable;
6472
6634
  const {
6473
- treeIndeterminateMaps
6474
- } = reactData;
6475
- return !!treeIndeterminateMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid);
6635
+ treeIndeterminateRowMaps
6636
+ } = internalData;
6637
+ return !!treeIndeterminateRowMaps[rowid] && !$xeTable.isCheckedByCheckboxRowKey(rowid);
6476
6638
  },
6477
6639
  /**
6478
6640
  * 切换选中
@@ -6482,13 +6644,13 @@ const Methods = {
6482
6644
  const $xeTable = this;
6483
6645
  const props = $xeTable;
6484
6646
  const reactData = $xeTable;
6647
+ const internalData = $xeTable;
6485
6648
  const {
6486
6649
  treeConfig
6487
6650
  } = props;
6488
6651
  const {
6489
6652
  selectCheckboxMaps
6490
- } = reactData;
6491
- const selectRowMaps = Object.assign({}, selectCheckboxMaps);
6653
+ } = internalData;
6492
6654
  const treeOpts = $xeTable.computeTreeOpts;
6493
6655
  const {
6494
6656
  transform,
@@ -6523,20 +6685,19 @@ const Methods = {
6523
6685
  }, {
6524
6686
  children: transform ? mapChildrenField : childrenField
6525
6687
  });
6526
- reactData.selectCheckboxMaps = selectRowMaps;
6688
+ reactData.updateCheckboxFlag++;
6527
6689
  return;
6528
- } else {
6529
- // 列表
6530
- rows.forEach(row => {
6531
- if (isForce || !checkMethod || checkMethod({
6532
- row
6533
- })) {
6534
- _xeUtils.default.set(row, checkField, checked);
6535
- handleCheckboxReserveRow($xeTable, row, checked);
6536
- }
6537
- });
6538
6690
  }
6539
- reactData.selectCheckboxMaps = selectRowMaps;
6691
+ // 列表
6692
+ rows.forEach(row => {
6693
+ if (isForce || !checkMethod || checkMethod({
6694
+ row
6695
+ })) {
6696
+ _xeUtils.default.set(row, checkField, checked);
6697
+ handleCheckboxReserveRow($xeTable, row, checked);
6698
+ }
6699
+ });
6700
+ reactData.updateCheckboxFlag++;
6540
6701
  return;
6541
6702
  }
6542
6703
  // 树结构
@@ -6548,10 +6709,10 @@ const Methods = {
6548
6709
  row
6549
6710
  })) {
6550
6711
  if (checked) {
6551
- selectRowMaps[rowid] = row;
6712
+ selectCheckboxMaps[rowid] = row;
6552
6713
  } else {
6553
- if (selectRowMaps[rowid]) {
6554
- delete selectRowMaps[rowid];
6714
+ if (selectCheckboxMaps[rowid]) {
6715
+ delete selectCheckboxMaps[rowid];
6555
6716
  }
6556
6717
  }
6557
6718
  handleCheckboxReserveRow($xeTable, row, checked);
@@ -6559,7 +6720,7 @@ const Methods = {
6559
6720
  }, {
6560
6721
  children: transform ? mapChildrenField : childrenField
6561
6722
  });
6562
- reactData.selectCheckboxMaps = selectRowMaps;
6723
+ reactData.updateCheckboxFlag++;
6563
6724
  return;
6564
6725
  }
6565
6726
  // 列表
@@ -6569,18 +6730,18 @@ const Methods = {
6569
6730
  row
6570
6731
  })) {
6571
6732
  if (checked) {
6572
- if (!selectRowMaps[rowid]) {
6573
- selectRowMaps[rowid] = row;
6733
+ if (!selectCheckboxMaps[rowid]) {
6734
+ selectCheckboxMaps[rowid] = row;
6574
6735
  }
6575
6736
  } else {
6576
- if (selectRowMaps[rowid]) {
6577
- delete selectRowMaps[rowid];
6737
+ if (selectCheckboxMaps[rowid]) {
6738
+ delete selectCheckboxMaps[rowid];
6578
6739
  }
6579
6740
  }
6580
6741
  handleCheckboxReserveRow($xeTable, row, checked);
6742
+ reactData.updateCheckboxFlag++;
6581
6743
  }
6582
6744
  });
6583
- reactData.selectCheckboxMaps = selectRowMaps;
6584
6745
  },
6585
6746
  /**
6586
6747
  * 即将移除
@@ -6594,10 +6755,10 @@ const Methods = {
6594
6755
  },
6595
6756
  handleToggleCheckRowEvent(evnt, params) {
6596
6757
  const $xeTable = this;
6597
- const reactData = $xeTable;
6758
+ const internalData = $xeTable;
6598
6759
  const {
6599
6760
  selectCheckboxMaps
6600
- } = reactData;
6761
+ } = internalData;
6601
6762
  const checkboxOpts = $xeTable.computeCheckboxOpts;
6602
6763
  const {
6603
6764
  checkField,
@@ -6613,17 +6774,18 @@ const Methods = {
6613
6774
  if (checkField) {
6614
6775
  checked = !_xeUtils.default.get(row, checkField);
6615
6776
  } else {
6616
- checked = !selectCheckboxMaps[(0, _util.getRowid)(this, row)];
6777
+ checked = !selectCheckboxMaps[(0, _util.getRowid)($xeTable, row)];
6617
6778
  }
6618
6779
  if (evnt) {
6619
6780
  $xeTable.triggerCheckRowEvent(evnt, params, checked);
6620
6781
  } else {
6621
- $xeTable.handleBatchSelectRows(params, checked);
6782
+ $xeTable.handleBatchSelectRows([row], checked);
6622
6783
  $xeTable.checkSelectionStatus();
6623
6784
  }
6624
6785
  },
6625
6786
  triggerCheckRowEvent(evnt, params, checked) {
6626
6787
  const $xeTable = this;
6788
+ const props = $xeTable;
6627
6789
  const internalData = $xeTable;
6628
6790
  const {
6629
6791
  row
@@ -6640,7 +6802,7 @@ const Methods = {
6640
6802
  return;
6641
6803
  }
6642
6804
  evnt.stopPropagation();
6643
- if (checkboxOpts.isShiftKey && evnt.shiftKey && !this.treeConfig) {
6805
+ if (checkboxOpts.isShiftKey && evnt.shiftKey && !props.treeConfig) {
6644
6806
  const checkboxRecords = $xeTable.getCheckboxRecords();
6645
6807
  if (checkboxRecords.length) {
6646
6808
  const firstRow = checkboxRecords[0];
@@ -6649,7 +6811,9 @@ const Methods = {
6649
6811
  if (_rowIndex !== _firstRowIndex) {
6650
6812
  $xeTable.setAllCheckboxRow(false);
6651
6813
  const rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
6652
- handleCheckedCheckboxRow($xeTable, rangeRows, true, false);
6814
+ $xeTable.$nextTick(() => {
6815
+ handleCheckedCheckboxRow($xeTable, rangeRows, true, false);
6816
+ });
6653
6817
  $xeTable.dispatchEvent('checkbox-range-select', Object.assign({
6654
6818
  rangeRecords: rangeRows
6655
6819
  }, params), evnt);
@@ -6660,7 +6824,7 @@ const Methods = {
6660
6824
  if (!checkMethod || checkMethod({
6661
6825
  row
6662
6826
  })) {
6663
- $xeTable.handleBatchSelectRows(params, checked);
6827
+ $xeTable.handleBatchSelectRows([row], checked);
6664
6828
  $xeTable.checkSelectionStatus();
6665
6829
  $xeTable.dispatchEvent('checkbox-change', Object.assign({
6666
6830
  records: () => $xeTable.getCheckboxRecords(),
@@ -6675,10 +6839,11 @@ const Methods = {
6675
6839
  */
6676
6840
  toggleCheckboxRow(row) {
6677
6841
  const $xeTable = this;
6842
+ const internalData = $xeTable;
6678
6843
  const {
6679
- selectCheckboxMaps,
6680
- checkboxOpts
6681
- } = this;
6844
+ selectCheckboxMaps
6845
+ } = internalData;
6846
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
6682
6847
  const {
6683
6848
  checkField
6684
6849
  } = checkboxOpts;
@@ -6705,10 +6870,8 @@ const Methods = {
6705
6870
  } = props;
6706
6871
  const {
6707
6872
  selectCheckboxMaps,
6708
- treeIndeterminateMaps
6709
- } = reactData;
6710
- const selectRowMaps = Object.assign({}, selectCheckboxMaps);
6711
- const halfRowMaps = Object.assign({}, treeIndeterminateMaps);
6873
+ treeIndeterminateRowMaps
6874
+ } = internalData;
6712
6875
  const treeOpts = $xeTable.computeTreeOpts;
6713
6876
  const {
6714
6877
  transform,
@@ -6753,29 +6916,29 @@ const Methods = {
6753
6916
  let vLen = 0; // 有效行
6754
6917
  childList.forEach(checkMethod ? item => {
6755
6918
  const childRowid = handleGetRowId(item);
6756
- const isSelect = checkField ? _xeUtils.default.get(item, checkField) : selectRowMaps[childRowid];
6919
+ const isSelect = checkField ? _xeUtils.default.get(item, checkField) : selectCheckboxMaps[childRowid];
6757
6920
  if (checkMethod({
6758
6921
  row: item
6759
6922
  })) {
6760
6923
  if (isSelect) {
6761
6924
  sLen++;
6762
- } else if (halfRowMaps[childRowid]) {
6925
+ } else if (treeIndeterminateRowMaps[childRowid]) {
6763
6926
  hLen++;
6764
6927
  }
6765
6928
  vLen++;
6766
6929
  } else {
6767
6930
  if (isSelect) {
6768
6931
  sLen++;
6769
- } else if (halfRowMaps[childRowid]) {
6932
+ } else if (treeIndeterminateRowMaps[childRowid]) {
6770
6933
  hLen++;
6771
6934
  }
6772
6935
  }
6773
6936
  } : item => {
6774
6937
  const childRowid = handleGetRowId(item);
6775
- const isSelect = checkField ? _xeUtils.default.get(item, checkField) : selectRowMaps[childRowid];
6938
+ const isSelect = checkField ? _xeUtils.default.get(item, checkField) : selectCheckboxMaps[childRowid];
6776
6939
  if (isSelect) {
6777
6940
  sLen++;
6778
- } else if (halfRowMaps[childRowid]) {
6941
+ } else if (treeIndeterminateRowMaps[childRowid]) {
6779
6942
  hLen++;
6780
6943
  }
6781
6944
  vLen++;
@@ -6787,29 +6950,28 @@ const Methods = {
6787
6950
  }
6788
6951
  if (isSelected) {
6789
6952
  if (!checkField) {
6790
- selectRowMaps[rowid] = row;
6953
+ selectCheckboxMaps[rowid] = row;
6791
6954
  }
6792
- if (halfRowMaps[rowid]) {
6793
- delete halfRowMaps[rowid];
6955
+ if (treeIndeterminateRowMaps[rowid]) {
6956
+ delete treeIndeterminateRowMaps[rowid];
6794
6957
  }
6795
6958
  } else {
6796
6959
  if (!checkField) {
6797
- if (selectRowMaps[rowid]) {
6798
- delete selectRowMaps[rowid];
6960
+ if (selectCheckboxMaps[rowid]) {
6961
+ delete selectCheckboxMaps[rowid];
6799
6962
  }
6800
6963
  }
6801
6964
  if (halfSelect) {
6802
- halfRowMaps[rowid] = row;
6965
+ treeIndeterminateRowMaps[rowid] = row;
6803
6966
  } else {
6804
- if (halfRowMaps[rowid]) {
6805
- delete halfRowMaps[rowid];
6967
+ if (treeIndeterminateRowMaps[rowid]) {
6968
+ delete treeIndeterminateRowMaps[rowid];
6806
6969
  }
6807
6970
  }
6808
6971
  }
6809
6972
  });
6810
6973
  }
6811
- reactData.selectCheckboxMaps = selectRowMaps;
6812
- reactData.treeIndeterminateMaps = halfRowMaps;
6974
+ reactData.updateCheckboxFlag++;
6813
6975
  },
6814
6976
  updateAllCheckboxStatus() {
6815
6977
  const $xeTable = this;
@@ -6820,20 +6982,18 @@ const Methods = {
6820
6982
  treeConfig
6821
6983
  } = props;
6822
6984
  const {
6985
+ afterFullData,
6986
+ afterTreeFullData,
6987
+ checkboxReserveRowMap,
6823
6988
  selectCheckboxMaps,
6824
- treeIndeterminateMaps
6825
- } = reactData;
6989
+ treeIndeterminateRowMaps
6990
+ } = internalData;
6826
6991
  const checkboxOpts = $xeTable.computeCheckboxOpts;
6827
6992
  const {
6828
6993
  checkField,
6829
6994
  checkMethod,
6830
6995
  showReserveStatus
6831
6996
  } = checkboxOpts;
6832
- const {
6833
- afterFullData,
6834
- afterTreeFullData,
6835
- checkboxReserveRowMap
6836
- } = internalData;
6837
6997
  const {
6838
6998
  handleGetRowId
6839
6999
  } = (0, _util.createHandleGetRowId)($xeTable);
@@ -6849,14 +7009,14 @@ const Methods = {
6849
7009
  })) {
6850
7010
  if (selected) {
6851
7011
  sLen++;
6852
- } else if (treeIndeterminateMaps[childRowid]) {
7012
+ } else if (treeIndeterminateRowMaps[childRowid]) {
6853
7013
  hLen++;
6854
7014
  }
6855
7015
  vLen++;
6856
7016
  } else {
6857
7017
  if (selected) {
6858
7018
  sLen++;
6859
- } else if (treeIndeterminateMaps[childRowid]) {
7019
+ } else if (treeIndeterminateRowMaps[childRowid]) {
6860
7020
  hLen++;
6861
7021
  }
6862
7022
  }
@@ -6865,7 +7025,7 @@ const Methods = {
6865
7025
  const selected = checkField ? _xeUtils.default.get(row, checkField) : selectCheckboxMaps[childRowid];
6866
7026
  if (selected) {
6867
7027
  sLen++;
6868
- } else if (treeIndeterminateMaps[childRowid]) {
7028
+ } else if (treeIndeterminateRowMaps[childRowid]) {
6869
7029
  hLen++;
6870
7030
  }
6871
7031
  vLen++;
@@ -6929,27 +7089,35 @@ const Methods = {
6929
7089
  * 获取复选框保留选中的行
6930
7090
  */
6931
7091
  getCheckboxReserveRecords(isFull) {
7092
+ const $xeTable = this;
7093
+ const props = $xeTable;
7094
+ const internalData = $xeTable;
7095
+ const {
7096
+ treeConfig
7097
+ } = props;
6932
7098
  const {
6933
- fullDataRowIdData,
6934
7099
  afterFullData,
6935
- checkboxReserveRowMap,
6936
- checkboxOpts,
6937
- treeConfig,
6938
- treeOpts
6939
- } = this;
7100
+ fullDataRowIdData,
7101
+ checkboxReserveRowMap
7102
+ } = internalData;
7103
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
7104
+ const treeOpts = $xeTable.computeTreeOpts;
6940
7105
  const childrenField = treeOpts.children || treeOpts.childrenField;
6941
7106
  const reserveSelection = [];
6942
7107
  if (checkboxOpts.reserve) {
7108
+ const {
7109
+ handleGetRowId
7110
+ } = (0, _util.createHandleGetRowId)($xeTable);
6943
7111
  const afterFullIdMaps = {};
6944
7112
  if (treeConfig) {
6945
7113
  _xeUtils.default.eachTree(afterFullData, row => {
6946
- afterFullIdMaps[(0, _util.getRowid)(this, row)] = 1;
7114
+ afterFullIdMaps[handleGetRowId(row)] = 1;
6947
7115
  }, {
6948
7116
  children: childrenField
6949
7117
  });
6950
7118
  } else {
6951
7119
  afterFullData.forEach(row => {
6952
- afterFullIdMaps[(0, _util.getRowid)(this, row)] = 1;
7120
+ afterFullIdMaps[handleGetRowId(row)] = 1;
6953
7121
  });
6954
7122
  }
6955
7123
  _xeUtils.default.each(checkboxReserveRowMap, (oldRow, oldRowid) => {
@@ -7029,17 +7197,23 @@ const Methods = {
7029
7197
  * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
7030
7198
  */
7031
7199
  clearCheckboxRow() {
7200
+ const $xeTable = this;
7201
+ const props = $xeTable;
7202
+ const reactData = $xeTable;
7203
+ const internalData = $xeTable;
7204
+ const {
7205
+ treeConfig
7206
+ } = props;
7032
7207
  const {
7033
- tableFullData,
7034
- treeConfig,
7035
- treeOpts,
7036
- checkboxOpts
7037
- } = this;
7208
+ tableFullData
7209
+ } = internalData;
7210
+ const treeOpts = $xeTable.computeTreeOpts;
7211
+ const childrenField = treeOpts.children || treeOpts.childrenField;
7212
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
7038
7213
  const {
7039
7214
  checkField,
7040
7215
  reserve
7041
7216
  } = checkboxOpts;
7042
- const childrenField = treeOpts.children || treeOpts.childrenField;
7043
7217
  // indeterminateField 仅支持读取
7044
7218
  const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
7045
7219
  if (checkField) {
@@ -7060,10 +7234,11 @@ const Methods = {
7060
7234
  if (reserve) {
7061
7235
  tableFullData.forEach(row => this.handleCheckboxReserveRow(row, false));
7062
7236
  }
7063
- this.isAllSelected = false;
7064
- this.isIndeterminate = false;
7065
- this.selectCheckboxMaps = {};
7066
- this.treeIndeterminateMaps = {};
7237
+ reactData.isAllSelected = false;
7238
+ reactData.isIndeterminate = false;
7239
+ internalData.selectCheckboxMaps = {};
7240
+ internalData.treeIndeterminateRowMaps = {};
7241
+ reactData.updateCheckboxFlag++;
7067
7242
  return this.$nextTick();
7068
7243
  },
7069
7244
  /**
@@ -7797,6 +7972,8 @@ const Methods = {
7797
7972
  } = props;
7798
7973
  const rowDragOpts = $xeTable.computeRowDragOpts;
7799
7974
  const {
7975
+ afterFullData,
7976
+ tableFullData,
7800
7977
  fullAllDataRowIdData
7801
7978
  } = internalData;
7802
7979
  const {
@@ -7814,10 +7991,6 @@ const Methods = {
7814
7991
  parentField
7815
7992
  } = treeOpts;
7816
7993
  const childrenField = treeOpts.children || treeOpts.childrenField;
7817
- const {
7818
- afterFullData,
7819
- tableFullData
7820
- } = internalData;
7821
7994
  const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
7822
7995
  const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
7823
7996
  const errRest = {
@@ -8485,46 +8658,58 @@ const Methods = {
8485
8658
  setPendingRow(rows, status) {
8486
8659
  const $xeTable = this;
8487
8660
  const reactData = $xeTable;
8488
- const pendingMaps = Object.assign({}, reactData.pendingRowMaps);
8661
+ const internalData = $xeTable;
8662
+ const {
8663
+ handleGetRowId
8664
+ } = (0, _util.createHandleGetRowId)($xeTable);
8665
+ const {
8666
+ pendingRowMaps
8667
+ } = internalData;
8489
8668
  if (rows && !_xeUtils.default.isArray(rows)) {
8490
8669
  rows = [rows];
8491
8670
  }
8492
8671
  if (status) {
8493
8672
  rows.forEach(row => {
8494
- const rowid = (0, _util.getRowid)($xeTable, row);
8495
- if (rowid && !pendingMaps[rowid]) {
8496
- pendingMaps[rowid] = row;
8673
+ const rowid = handleGetRowId(row);
8674
+ if (rowid && !pendingRowMaps[rowid]) {
8675
+ pendingRowMaps[rowid] = row;
8497
8676
  }
8498
8677
  });
8499
8678
  } else {
8500
8679
  rows.forEach(row => {
8501
- const rowid = (0, _util.getRowid)($xeTable, row);
8502
- if (rowid && pendingMaps[rowid]) {
8503
- delete pendingMaps[rowid];
8680
+ const rowid = handleGetRowId(row);
8681
+ if (rowid && pendingRowMaps[rowid]) {
8682
+ delete pendingRowMaps[rowid];
8504
8683
  }
8505
8684
  });
8506
8685
  }
8507
- reactData.pendingRowMaps = pendingMaps;
8686
+ reactData.pendingRowFlag++;
8508
8687
  return $xeTable.$nextTick();
8509
8688
  },
8510
8689
  togglePendingRow(rows) {
8511
8690
  const $xeTable = this;
8512
8691
  const reactData = $xeTable;
8513
- const pendingMaps = Object.assign({}, reactData.pendingRowMaps);
8692
+ const internalData = $xeTable;
8693
+ const {
8694
+ handleGetRowId
8695
+ } = (0, _util.createHandleGetRowId)($xeTable);
8696
+ const {
8697
+ pendingRowMaps
8698
+ } = internalData;
8514
8699
  if (rows && !_xeUtils.default.isArray(rows)) {
8515
8700
  rows = [rows];
8516
8701
  }
8517
8702
  rows.forEach(row => {
8518
- const rowid = (0, _util.getRowid)($xeTable, row);
8703
+ const rowid = handleGetRowId(row);
8519
8704
  if (rowid) {
8520
- if (pendingMaps[rowid]) {
8521
- delete pendingMaps[rowid];
8705
+ if (pendingRowMaps[rowid]) {
8706
+ delete pendingRowMaps[rowid];
8522
8707
  } else {
8523
- pendingMaps[rowid] = row;
8708
+ pendingRowMaps[rowid] = row;
8524
8709
  }
8525
8710
  }
8526
8711
  });
8527
- reactData.pendingRowMaps = pendingMaps;
8712
+ reactData.pendingRowFlag++;
8528
8713
  return $xeTable.$nextTick();
8529
8714
  },
8530
8715
  hasPendingByRow(row) {
@@ -8542,13 +8727,10 @@ const Methods = {
8542
8727
  },
8543
8728
  getPendingRecords() {
8544
8729
  const $xeTable = this;
8545
- const reactData = $xeTable;
8546
8730
  const internalData = $xeTable;
8547
8731
  const {
8732
+ fullAllDataRowIdData,
8548
8733
  pendingRowMaps
8549
- } = reactData;
8550
- const {
8551
- fullAllDataRowIdData
8552
8734
  } = internalData;
8553
8735
  const insertRecords = [];
8554
8736
  _xeUtils.default.each(pendingRowMaps, (row, rowid) => {
@@ -8559,8 +8741,12 @@ const Methods = {
8559
8741
  return insertRecords;
8560
8742
  },
8561
8743
  clearPendingRow() {
8562
- this.pendingRowMaps = {};
8563
- return this.$nextTick();
8744
+ const $xeTable = this;
8745
+ const reactData = $xeTable;
8746
+ const internalData = $xeTable;
8747
+ internalData.pendingRowMaps = {};
8748
+ reactData.pendingRowFlag++;
8749
+ return $xeTable.$nextTick();
8564
8750
  },
8565
8751
  sort(sortConfs, sortOrder) {
8566
8752
  const $xeTable = this;
@@ -8798,9 +8984,9 @@ const Methods = {
8798
8984
  const $xeTable = this;
8799
8985
  const reactData = $xeTable;
8800
8986
  const internalData = $xeTable;
8801
- const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
8802
8987
  const {
8803
- fullAllDataRowIdData
8988
+ fullAllDataRowIdData,
8989
+ rowExpandLazyLoadedMaps
8804
8990
  } = internalData;
8805
8991
  const expandOpts = $xeTable.computeExpandOpts;
8806
8992
  const {
@@ -8810,9 +8996,9 @@ const Methods = {
8810
8996
  const rowRest = fullAllDataRowIdData[rowid];
8811
8997
  if (lazy && rowRest) {
8812
8998
  rowRest.expandLoaded = false;
8813
- delete rExpandLazyLoadedMaps[rowid];
8999
+ delete rowExpandLazyLoadedMaps[rowid];
8814
9000
  }
8815
- reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
9001
+ reactData.rowExpandedFlag++;
8816
9002
  return $xeTable.$nextTick();
8817
9003
  },
8818
9004
  /**
@@ -8820,18 +9006,20 @@ const Methods = {
8820
9006
  * @param {Row} row 行对象
8821
9007
  */
8822
9008
  reloadRowExpand(row) {
9009
+ const $xeTable = this;
9010
+ const internalData = $xeTable;
8823
9011
  const {
8824
- expandOpts,
8825
9012
  rowExpandLazyLoadedMaps
8826
- } = this;
9013
+ } = internalData;
9014
+ const expandOpts = $xeTable.computeExpandOpts;
8827
9015
  const {
8828
9016
  lazy
8829
9017
  } = expandOpts;
8830
9018
  const rowid = (0, _util.getRowid)(this, row);
8831
9019
  if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
8832
- this.clearRowExpandLoaded(row).then(() => this.handleAsyncRowExpand(row));
9020
+ $xeTable.clearRowExpandLoaded(row).then(() => handleAsyncRowExpand($xeTable, row));
8833
9021
  }
8834
- return this.$nextTick();
9022
+ return $xeTable.$nextTick();
8835
9023
  },
8836
9024
  reloadExpandContent(row) {
8837
9025
  if (process.env.NODE_ENV === 'development') {
@@ -8844,11 +9032,16 @@ const Methods = {
8844
9032
  * 展开行事件
8845
9033
  */
8846
9034
  triggerRowExpandEvent(evnt, params) {
9035
+ const $xeTable = this;
9036
+ const reactData = $xeTable;
9037
+ const internalData = $xeTable;
8847
9038
  const {
8848
- expandOpts,
8849
- rowExpandLazyLoadedMaps,
8850
9039
  expandColumn: column
8851
- } = this;
9040
+ } = reactData;
9041
+ const {
9042
+ rowExpandLazyLoadedMaps
9043
+ } = internalData;
9044
+ const expandOpts = $xeTable.computeExpandOpts;
8852
9045
  const {
8853
9046
  row
8854
9047
  } = params;
@@ -8860,20 +9053,20 @@ const Methods = {
8860
9053
  return;
8861
9054
  }
8862
9055
  evnt.stopPropagation();
8863
- const rowid = (0, _util.getRowid)(this, row);
9056
+ const rowid = (0, _util.getRowid)($xeTable, row);
8864
9057
  if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
8865
- const expanded = !this.isRowExpandByRow(row);
8866
- const columnIndex = this.getColumnIndex(column);
8867
- const $columnIndex = this.getVMColumnIndex(column);
8868
- this.setRowExpand(row, expanded);
8869
- this.emitEvent('toggle-row-expand', {
9058
+ const expanded = !$xeTable.isRowExpandByRow(row);
9059
+ const columnIndex = $xeTable.getColumnIndex(column);
9060
+ const $columnIndex = $xeTable.getVMColumnIndex(column);
9061
+ $xeTable.setRowExpand(row, expanded);
9062
+ $xeTable.dispatchEvent('toggle-row-expand', {
8870
9063
  expanded,
8871
9064
  column,
8872
9065
  columnIndex,
8873
9066
  $columnIndex,
8874
9067
  row,
8875
- rowIndex: this.getRowIndex(row),
8876
- $rowIndex: this.getVMRowIndex(row)
9068
+ rowIndex: $xeTable.getRowIndex(row),
9069
+ $rowIndex: $xeTable.getVMRowIndex(row)
8877
9070
  }, evnt);
8878
9071
  }
8879
9072
  },
@@ -8931,55 +9124,6 @@ const Methods = {
8931
9124
  }
8932
9125
  return this.setRowExpand(expandedRows, expanded);
8933
9126
  },
8934
- handleAsyncRowExpand(row) {
8935
- const $xeTable = this;
8936
- const reactData = $xeTable;
8937
- const internalData = $xeTable;
8938
- return new Promise(resolve => {
8939
- const {
8940
- expandOpts
8941
- } = this;
8942
- const {
8943
- loadMethod
8944
- } = expandOpts;
8945
- if (loadMethod) {
8946
- const {
8947
- fullAllDataRowIdData
8948
- } = internalData;
8949
- const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
8950
- const rowid = (0, _util.getRowid)($xeTable, row);
8951
- const rowRest = fullAllDataRowIdData[rowid];
8952
- rExpandLazyLoadedMaps[rowid] = row;
8953
- reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
8954
- loadMethod({
8955
- $table: $xeTable,
8956
- row,
8957
- rowIndex: $xeTable.getRowIndex(row),
8958
- $rowIndex: $xeTable.getVMRowIndex(row)
8959
- }).then(() => {
8960
- const rExpandedMaps = Object.assign({}, reactData.rowExpandedMaps);
8961
- if (rowRest) {
8962
- rowRest.expandLoaded = true;
8963
- }
8964
- rExpandedMaps[rowid] = row;
8965
- reactData.rowExpandedMaps = rExpandedMaps;
8966
- }).catch(() => {
8967
- if (rowRest) {
8968
- rowRest.expandLoaded = false;
8969
- }
8970
- }).finally(() => {
8971
- const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
8972
- if (rExpandLazyLoadedMaps[rowid]) {
8973
- delete rExpandLazyLoadedMaps[rowid];
8974
- }
8975
- reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
8976
- $xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => $xeTable.updateCellAreas()).then(() => resolve());
8977
- });
8978
- } else {
8979
- resolve();
8980
- }
8981
- });
8982
- },
8983
9127
  /**
8984
9128
  * 设置展开行,二个参数设置这一行展开与否
8985
9129
  * 支持单行
@@ -8989,14 +9133,20 @@ const Methods = {
8989
9133
  */
8990
9134
  setRowExpand(rows, expanded) {
8991
9135
  const $xeTable = this;
9136
+ const reactData = $xeTable;
9137
+ const internalData = $xeTable;
8992
9138
  const {
8993
- rowExpandedMaps,
8994
- fullAllDataRowIdData,
8995
- rowExpandLazyLoadedMaps,
8996
- expandOpts,
8997
9139
  expandColumn
8998
- } = this;
8999
- let rExpandedMaps = Object.assign({}, rowExpandedMaps);
9140
+ } = reactData;
9141
+ let {
9142
+ fullAllDataRowIdData,
9143
+ rowExpandedMaps,
9144
+ rowExpandLazyLoadedMaps
9145
+ } = internalData;
9146
+ const {
9147
+ handleGetRowId
9148
+ } = (0, _util.createHandleGetRowId)($xeTable);
9149
+ const expandOpts = $xeTable.computeExpandOpts;
9000
9150
  const {
9001
9151
  reserve,
9002
9152
  lazy,
@@ -9012,10 +9162,12 @@ const Methods = {
9012
9162
  }
9013
9163
  if (accordion) {
9014
9164
  // 只能同时展开一个
9015
- rExpandedMaps = {};
9165
+ rowExpandedMaps = {};
9166
+ internalData.rowExpandedMaps = rowExpandedMaps;
9016
9167
  rows = rows.slice(rows.length - 1, rows.length);
9017
9168
  }
9018
9169
  const validRows = toggleMethod ? rows.filter(row => toggleMethod({
9170
+ $table: $xeTable,
9019
9171
  expanded,
9020
9172
  column: expandColumn,
9021
9173
  columnIndex,
@@ -9026,22 +9178,22 @@ const Methods = {
9026
9178
  })) : rows;
9027
9179
  if (expanded) {
9028
9180
  validRows.forEach(row => {
9029
- const rowid = (0, _util.getRowid)(this, row);
9030
- if (!rExpandedMaps[rowid]) {
9181
+ const rowid = handleGetRowId(row);
9182
+ if (!rowExpandedMaps[rowid]) {
9031
9183
  const rowRest = fullAllDataRowIdData[rowid];
9032
9184
  const isLoad = lazy && !rowRest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
9033
9185
  if (isLoad) {
9034
- lazyRests.push(this.handleAsyncRowExpand(row));
9186
+ lazyRests.push(handleAsyncRowExpand($xeTable, row));
9035
9187
  } else {
9036
- rExpandedMaps[rowid] = row;
9188
+ rowExpandedMaps[rowid] = row;
9037
9189
  }
9038
9190
  }
9039
9191
  });
9040
9192
  } else {
9041
9193
  validRows.forEach(item => {
9042
- const rowid = (0, _util.getRowid)(this, item);
9043
- if (rExpandedMaps[rowid]) {
9044
- delete rExpandedMaps[rowid];
9194
+ const rowid = handleGetRowId(item);
9195
+ if (rowExpandedMaps[rowid]) {
9196
+ delete rowExpandedMaps[rowid];
9045
9197
  }
9046
9198
  });
9047
9199
  }
@@ -9049,7 +9201,7 @@ const Methods = {
9049
9201
  validRows.forEach(row => handleRowExpandReserve($xeTable, row, expanded));
9050
9202
  }
9051
9203
  }
9052
- this.rowExpandedMaps = rExpandedMaps;
9204
+ reactData.rowExpandedFlag++;
9053
9205
  return Promise.all(lazyRests).then(() => $xeTable.$nextTick()).then(() => $xeTable.recalculate(true)).then(() => {
9054
9206
  updateRowOffsetTop($xeTable);
9055
9207
  updateRowExpandStyle($xeTable);
@@ -9062,11 +9214,17 @@ const Methods = {
9062
9214
  * @param {Row} row 行对象
9063
9215
  */
9064
9216
  isRowExpandByRow(row) {
9217
+ const $xeTable = this;
9218
+ const reactData = $xeTable;
9219
+ const internalData = $xeTable;
9220
+ const {
9221
+ rowExpandedFlag
9222
+ } = reactData;
9065
9223
  const {
9066
9224
  rowExpandedMaps
9067
- } = this;
9225
+ } = internalData;
9068
9226
  const rowid = (0, _util.getRowid)(this, row);
9069
- return !!rowExpandedMaps[rowid];
9227
+ return !!rowExpandedFlag && !!rowExpandedMaps[rowid];
9070
9228
  },
9071
9229
  isExpandByRow(row) {
9072
9230
  if (process.env.NODE_ENV === 'development') {
@@ -9090,7 +9248,8 @@ const Methods = {
9090
9248
  reserve
9091
9249
  } = expandOpts;
9092
9250
  const expList = $xeTable.getRowExpandRecords();
9093
- reactData.rowExpandedMaps = {};
9251
+ internalData.rowExpandedMaps = {};
9252
+ reactData.rowExpandedFlag++;
9094
9253
  if (reserve) {
9095
9254
  tableFullData.forEach(row => handleRowExpandReserve($xeTable, row, false));
9096
9255
  }
@@ -9110,8 +9269,10 @@ const Methods = {
9110
9269
  return this.$nextTick();
9111
9270
  },
9112
9271
  getRowExpandRecords() {
9272
+ const $xeTable = this;
9273
+ const internalData = $xeTable;
9113
9274
  const rest = [];
9114
- _xeUtils.default.each(this.rowExpandedMaps, item => {
9275
+ _xeUtils.default.each(internalData.rowExpandedMaps, item => {
9115
9276
  if (item) {
9116
9277
  rest.push(item);
9117
9278
  }
@@ -9119,8 +9280,10 @@ const Methods = {
9119
9280
  return rest;
9120
9281
  },
9121
9282
  getTreeExpandRecords() {
9283
+ const $xeTable = this;
9284
+ const internalData = $xeTable;
9122
9285
  const rest = [];
9123
- _xeUtils.default.each(this.treeExpandedMaps, item => {
9286
+ _xeUtils.default.each(internalData.treeExpandedMaps, item => {
9124
9287
  if (item) {
9125
9288
  rest.push(item);
9126
9289
  }
@@ -9156,15 +9319,14 @@ const Methods = {
9156
9319
  const reactData = $xeTable;
9157
9320
  const internalData = $xeTable;
9158
9321
  const {
9159
- fullAllDataRowIdData
9322
+ fullAllDataRowIdData,
9323
+ treeExpandedMaps
9160
9324
  } = internalData;
9161
9325
  const treeOpts = $xeTable.computeTreeOpts;
9162
9326
  const {
9163
9327
  transform
9164
9328
  } = treeOpts;
9165
- let tExpandedMaps = {};
9166
9329
  if (rows) {
9167
- tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
9168
9330
  if (!_xeUtils.default.isArray(rows)) {
9169
9331
  rows = [rows];
9170
9332
  }
@@ -9173,8 +9335,8 @@ const Methods = {
9173
9335
  const rowRest = fullAllDataRowIdData[rowid];
9174
9336
  if (rowRest) {
9175
9337
  rowRest.treeLoaded = false;
9176
- if (tExpandedMaps[rowid]) {
9177
- delete tExpandedMaps[rowid];
9338
+ if (treeExpandedMaps[rowid]) {
9339
+ delete treeExpandedMaps[rowid];
9178
9340
  }
9179
9341
  }
9180
9342
  });
@@ -9183,7 +9345,8 @@ const Methods = {
9183
9345
  rowRest.treeLoaded = false;
9184
9346
  });
9185
9347
  }
9186
- reactData.treeExpandedMaps = {};
9348
+ internalData.treeExpandedMaps = {};
9349
+ reactData.treeExpandedFlag++;
9187
9350
  if (transform) {
9188
9351
  handleVirtualTreeToList($xeTable);
9189
9352
  return $xeTable.handleTableData();
@@ -9196,45 +9359,49 @@ const Methods = {
9196
9359
  */
9197
9360
  reloadTreeExpand(row) {
9198
9361
  const $xeTable = this;
9362
+ const internalData = $xeTable;
9199
9363
  const {
9200
- treeOpts,
9201
9364
  treeExpandLazyLoadedMaps
9202
- } = this;
9365
+ } = internalData;
9366
+ const treeOpts = $xeTable.computeTreeOpts;
9203
9367
  const {
9204
9368
  transform,
9205
9369
  lazy
9206
9370
  } = treeOpts;
9207
9371
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
9208
- const rowid = (0, _util.getRowid)(this, row);
9372
+ const rowid = (0, _util.getRowid)($xeTable, row);
9209
9373
  if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
9210
- return this.clearTreeExpandLoaded(row).then(() => {
9211
- return this.handleAsyncTreeExpandChilds(row);
9374
+ return $xeTable.clearTreeExpandLoaded(row).then(() => {
9375
+ return handleAsyncTreeExpandChilds($xeTable, row);
9212
9376
  }).then(() => {
9213
9377
  if (transform) {
9214
9378
  handleVirtualTreeToList($xeTable);
9215
- return this.handleTableData();
9379
+ return $xeTable.handleTableData();
9216
9380
  }
9217
9381
  }).then(() => {
9218
- return this.recalculate();
9382
+ return $xeTable.recalculate();
9219
9383
  });
9220
9384
  }
9221
- return this.$nextTick();
9385
+ return $xeTable.$nextTick();
9222
9386
  },
9223
9387
  reloadTreeChilds(row) {
9388
+ const $xeTable = this;
9224
9389
  if (process.env.NODE_ENV === 'development') {
9225
9390
  (0, _log.warnLog)('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
9226
9391
  }
9227
9392
  // 即将废弃
9228
- return this.reloadTreeExpand(row);
9393
+ return $xeTable.reloadTreeExpand(row);
9229
9394
  },
9230
9395
  /**
9231
9396
  * 展开树节点事件
9232
9397
  */
9233
9398
  triggerTreeExpandEvent(evnt, params) {
9399
+ const $xeTable = this;
9400
+ const internalData = $xeTable;
9234
9401
  const {
9235
- treeOpts,
9236
9402
  treeExpandLazyLoadedMaps
9237
- } = this;
9403
+ } = internalData;
9404
+ const treeOpts = $xeTable.computeTreeOpts;
9238
9405
  const {
9239
9406
  row,
9240
9407
  column
@@ -9249,11 +9416,11 @@ const Methods = {
9249
9416
  evnt.stopPropagation();
9250
9417
  const rowid = (0, _util.getRowid)(this, row);
9251
9418
  if (!lazy || !treeExpandLazyLoadedMaps[rowid]) {
9252
- const expanded = !this.isTreeExpandByRow(row);
9253
- const columnIndex = this.getColumnIndex(column);
9254
- const $columnIndex = this.getVMColumnIndex(column);
9255
- this.setTreeExpand(row, expanded);
9256
- this.emitEvent('toggle-tree-expand', {
9419
+ const expanded = !$xeTable.isTreeExpandByRow(row);
9420
+ const columnIndex = $xeTable.getColumnIndex(column);
9421
+ const $columnIndex = $xeTable.getVMColumnIndex(column);
9422
+ $xeTable.setTreeExpand(row, expanded);
9423
+ $xeTable.dispatchEvent('toggle-tree-expand', {
9257
9424
  expanded,
9258
9425
  column,
9259
9426
  columnIndex,
@@ -9268,112 +9435,6 @@ const Methods = {
9268
9435
  toggleTreeExpand(row) {
9269
9436
  return this.setTreeExpand(row, !this.isTreeExpandByRow(row));
9270
9437
  },
9271
- /**
9272
- * 处理默认展开树节点
9273
- */
9274
- handleDefaultTreeExpand() {
9275
- const {
9276
- treeConfig,
9277
- treeOpts,
9278
- tableFullData
9279
- } = this;
9280
- if (treeConfig) {
9281
- const {
9282
- expandAll,
9283
- expandRowKeys
9284
- } = treeOpts;
9285
- const childrenField = treeOpts.children || treeOpts.childrenField;
9286
- if (expandAll) {
9287
- this.setAllTreeExpand(true);
9288
- } else if (expandRowKeys) {
9289
- const defExpandeds = [];
9290
- const rowkey = (0, _util.getRowkey)(this);
9291
- expandRowKeys.forEach(rowid => {
9292
- const matchObj = _xeUtils.default.findTree(tableFullData, item => rowid === _xeUtils.default.get(item, rowkey), {
9293
- children: childrenField
9294
- });
9295
- if (matchObj) {
9296
- defExpandeds.push(matchObj.item);
9297
- }
9298
- });
9299
- this.setTreeExpand(defExpandeds, true);
9300
- }
9301
- }
9302
- },
9303
- handleAsyncTreeExpandChilds(row) {
9304
- const $xeTable = this;
9305
- const {
9306
- treeOpts,
9307
- checkboxOpts
9308
- } = this;
9309
- const {
9310
- transform,
9311
- loadMethod
9312
- } = treeOpts;
9313
- const {
9314
- checkStrictly
9315
- } = checkboxOpts;
9316
- return new Promise(resolve => {
9317
- if (loadMethod) {
9318
- const {
9319
- treeExpandLazyLoadedMaps,
9320
- fullAllDataRowIdData
9321
- } = this;
9322
- const rowid = (0, _util.getRowid)($xeTable, row);
9323
- const rowRest = fullAllDataRowIdData[rowid];
9324
- treeExpandLazyLoadedMaps[rowid] = row;
9325
- Promise.resolve(loadMethod({
9326
- $table: $xeTable,
9327
- row
9328
- })).then(childRecords => {
9329
- if (rowRest) {
9330
- rowRest.treeLoaded = true;
9331
- }
9332
- if (treeExpandLazyLoadedMaps[rowid]) {
9333
- delete treeExpandLazyLoadedMaps[rowid];
9334
- }
9335
- if (!_xeUtils.default.isArray(childRecords)) {
9336
- childRecords = [];
9337
- }
9338
- if (childRecords) {
9339
- return this.loadTreeChildren(row, childRecords).then(childRows => {
9340
- const {
9341
- treeExpandedMaps
9342
- } = this;
9343
- if (childRows.length && !treeExpandedMaps[rowid]) {
9344
- treeExpandedMaps[rowid] = row;
9345
- }
9346
- // 如果当前节点已选中,则展开后子节点也被选中
9347
- if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
9348
- handleCheckedCheckboxRow($xeTable, childRows, true);
9349
- }
9350
- return this.$nextTick().then(() => {
9351
- if (transform) {
9352
- this.handleTableData();
9353
- updateAfterDataIndex($xeTable);
9354
- return this.$nextTick();
9355
- }
9356
- });
9357
- });
9358
- }
9359
- }).catch(() => {
9360
- const {
9361
- treeExpandLazyLoadedMaps
9362
- } = this;
9363
- if (rowRest) {
9364
- rowRest.treeLoaded = false;
9365
- }
9366
- if (treeExpandLazyLoadedMaps[rowid]) {
9367
- delete treeExpandLazyLoadedMaps[rowid];
9368
- }
9369
- }).finally(() => {
9370
- this.$nextTick().then(() => this.recalculate()).then(() => resolve());
9371
- });
9372
- } else {
9373
- resolve();
9374
- }
9375
- });
9376
- },
9377
9438
  /**
9378
9439
  * 设置所有树节点的展开与否
9379
9440
  * @param {Boolean} expanded 是否展开
@@ -9405,27 +9466,35 @@ const Methods = {
9405
9466
  * @returns
9406
9467
  */
9407
9468
  handleBaseTreeExpand(rows, expanded) {
9469
+ const $xeTable = this;
9470
+ const reactData = $xeTable;
9471
+ const internalData = $xeTable;
9472
+ const {
9473
+ treeNodeColumn
9474
+ } = reactData;
9408
9475
  const {
9409
9476
  fullAllDataRowIdData,
9410
9477
  tableFullData,
9411
9478
  treeExpandedMaps,
9412
- treeOpts,
9413
- treeExpandLazyLoadedMaps,
9414
- treeNodeColumn
9415
- } = this;
9479
+ treeExpandLazyLoadedMaps
9480
+ } = internalData;
9481
+ const treeOpts = $xeTable.computeTreeOpts;
9416
9482
  const {
9417
9483
  reserve,
9418
9484
  lazy,
9419
9485
  accordion,
9420
9486
  toggleMethod
9421
9487
  } = treeOpts;
9422
- const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
9423
9488
  const childrenField = treeOpts.children || treeOpts.childrenField;
9424
9489
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
9425
9490
  const result = [];
9426
- const columnIndex = this.getColumnIndex(treeNodeColumn);
9427
- const $columnIndex = this.getVMColumnIndex(treeNodeColumn);
9491
+ const columnIndex = $xeTable.getColumnIndex(treeNodeColumn);
9492
+ const $columnIndex = $xeTable.getVMColumnIndex(treeNodeColumn);
9493
+ const {
9494
+ handleGetRowId
9495
+ } = (0, _util.createHandleGetRowId)($xeTable);
9428
9496
  let validRows = toggleMethod ? rows.filter(row => toggleMethod({
9497
+ $table: $xeTable,
9429
9498
  expanded,
9430
9499
  column: treeNodeColumn,
9431
9500
  columnIndex,
@@ -9440,26 +9509,26 @@ const Methods = {
9440
9509
  });
9441
9510
  if (matchObj) {
9442
9511
  matchObj.items.forEach(item => {
9443
- const rowid = (0, _util.getRowid)(this, item);
9444
- if (treeTempExpandedMaps[rowid]) {
9445
- delete treeTempExpandedMaps[rowid];
9512
+ const rowid = handleGetRowId(item);
9513
+ if (treeExpandedMaps[rowid]) {
9514
+ delete treeExpandedMaps[rowid];
9446
9515
  }
9447
9516
  });
9448
9517
  }
9449
9518
  }
9450
9519
  if (expanded) {
9451
9520
  validRows.forEach(row => {
9452
- const rowid = (0, _util.getRowid)(this, row);
9453
- if (!treeTempExpandedMaps[rowid]) {
9521
+ const rowid = handleGetRowId(row);
9522
+ if (!treeExpandedMaps[rowid]) {
9454
9523
  const rowRest = fullAllDataRowIdData[rowid];
9455
9524
  if (rowRest) {
9456
9525
  const isLoad = lazy && row[hasChildField] && !rowRest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
9457
9526
  // 是否使用懒加载
9458
9527
  if (isLoad) {
9459
- result.push(this.handleAsyncTreeExpandChilds(row));
9528
+ result.push(handleAsyncTreeExpandChilds($xeTable, row));
9460
9529
  } else {
9461
9530
  if (row[childrenField] && row[childrenField].length) {
9462
- treeTempExpandedMaps[rowid] = row;
9531
+ treeExpandedMaps[rowid] = row;
9463
9532
  }
9464
9533
  }
9465
9534
  }
@@ -9467,18 +9536,18 @@ const Methods = {
9467
9536
  });
9468
9537
  } else {
9469
9538
  validRows.forEach(item => {
9470
- const rowid = (0, _util.getRowid)(this, item);
9471
- if (treeTempExpandedMaps[rowid]) {
9472
- delete treeTempExpandedMaps[rowid];
9539
+ const rowid = handleGetRowId(item);
9540
+ if (treeExpandedMaps[rowid]) {
9541
+ delete treeExpandedMaps[rowid];
9473
9542
  }
9474
9543
  });
9475
9544
  }
9476
9545
  if (reserve) {
9477
- validRows.forEach(row => this.handleTreeExpandReserve(row, expanded));
9546
+ validRows.forEach(row => handleTreeExpandReserve($xeTable, row, expanded));
9478
9547
  }
9479
- this.treeExpandedMaps = treeTempExpandedMaps;
9548
+ reactData.treeExpandedFlag++;
9480
9549
  return Promise.all(result).then(() => {
9481
- return this.recalculate();
9550
+ return $xeTable.recalculate();
9482
9551
  });
9483
9552
  },
9484
9553
  /**
@@ -9535,40 +9604,49 @@ const Methods = {
9535
9604
  * @param {Row} row 行对象
9536
9605
  */
9537
9606
  isTreeExpandByRow(row) {
9607
+ const $xeTable = this;
9608
+ const reactData = $xeTable;
9609
+ const internalData = $xeTable;
9610
+ const {
9611
+ treeExpandedFlag
9612
+ } = reactData;
9538
9613
  const {
9539
9614
  treeExpandedMaps
9540
- } = this;
9541
- return !!treeExpandedMaps[(0, _util.getRowid)(this, row)];
9615
+ } = internalData;
9616
+ return !!treeExpandedFlag && !!treeExpandedMaps[(0, _util.getRowid)($xeTable, row)];
9542
9617
  },
9543
9618
  /**
9544
9619
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
9545
9620
  */
9546
9621
  clearTreeExpand() {
9547
9622
  const $xeTable = this;
9623
+ const reactData = $xeTable;
9624
+ const internalData = $xeTable;
9548
9625
  const {
9549
- treeOpts,
9550
- tableFullData
9551
- } = this;
9626
+ tableFullTreeData
9627
+ } = internalData;
9628
+ const treeOpts = $xeTable.computeTreeOpts;
9629
+ const childrenField = treeOpts.children || treeOpts.childrenField;
9552
9630
  const {
9553
9631
  transform,
9554
9632
  reserve
9555
9633
  } = treeOpts;
9556
- const childrenField = treeOpts.children || treeOpts.childrenField;
9557
- const expList = this.getTreeExpandRecords();
9558
- this.treeExpandedMaps = {};
9634
+ const expList = $xeTable.getTreeExpandRecords();
9635
+ internalData.treeExpandedMaps = {};
9636
+ reactData.treeExpandedFlag++;
9559
9637
  if (reserve) {
9560
- _xeUtils.default.eachTree(tableFullData, row => this.handleTreeExpandReserve(row, false), {
9638
+ _xeUtils.default.eachTree(tableFullTreeData, row => handleTreeExpandReserve($xeTable, row, false), {
9561
9639
  children: childrenField
9562
9640
  });
9563
9641
  }
9564
- return this.handleTableData().then(() => {
9642
+ return $xeTable.handleTableData().then(() => {
9565
9643
  if (transform) {
9566
9644
  handleVirtualTreeToList($xeTable);
9567
- return this.handleTableData();
9645
+ return $xeTable.handleTableData();
9568
9646
  }
9569
9647
  }).then(() => {
9570
9648
  if (expList.length) {
9571
- this.recalculate();
9649
+ $xeTable.recalculate();
9572
9650
  }
9573
9651
  });
9574
9652
  },
@@ -9576,20 +9654,6 @@ const Methods = {
9576
9654
  this.treeExpandedReserveRowMap = {};
9577
9655
  return this.$nextTick();
9578
9656
  },
9579
- handleTreeExpandReserve(row, expanded) {
9580
- const {
9581
- treeExpandedReserveRowMap,
9582
- treeOpts
9583
- } = this;
9584
- if (treeOpts.reserve) {
9585
- const rowid = (0, _util.getRowid)(this, row);
9586
- if (expanded) {
9587
- treeExpandedReserveRowMap[rowid] = row;
9588
- } else if (treeExpandedReserveRowMap[rowid]) {
9589
- delete treeExpandedReserveRowMap[rowid];
9590
- }
9591
- }
9592
- },
9593
9657
  /**
9594
9658
  * 获取表格的滚动状态
9595
9659
  */
@@ -10252,15 +10316,15 @@ const Methods = {
10252
10316
  const {
10253
10317
  isAllOverflow,
10254
10318
  scrollYLoad,
10255
- expandColumn,
10256
- rowExpandedMaps
10319
+ expandColumn
10257
10320
  } = reactData;
10258
10321
  const {
10259
10322
  scrollYStore,
10260
10323
  elemStore,
10261
10324
  isResizeCellHeight,
10262
10325
  afterFullData,
10263
- fullAllDataRowIdData
10326
+ fullAllDataRowIdData,
10327
+ rowExpandedMaps
10264
10328
  } = internalData;
10265
10329
  const {
10266
10330
  startIndex
@@ -10617,7 +10681,7 @@ const Methods = {
10617
10681
  if (this.footerSpanMethod) {
10618
10682
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
10619
10683
  }
10620
- setMerges(this, merges, this.mergeFooterList, null);
10684
+ setMerges(this, merges, this.mergeFooterList);
10621
10685
  return this.$nextTick().then(() => {
10622
10686
  this.updateCellAreas();
10623
10687
  return updateStyle($xeTable);