vxe-table 3.7.0-beta.15 → 3.7.0-beta.17

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 (56) hide show
  1. package/README.md +1 -1
  2. package/lib/edit/src/mixin.js +6 -4
  3. package/lib/edit/src/mixin.min.js +1 -1
  4. package/lib/export/src/mixin.js +4 -1
  5. package/lib/export/src/mixin.min.js +1 -1
  6. package/lib/icon/style/style.css +1 -1
  7. package/lib/icon/style/style.min.css +1 -1
  8. package/lib/index.css +1 -1
  9. package/lib/index.umd.js +663 -428
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/input/src/input.js +24 -1
  12. package/lib/input/src/input.min.js +1 -1
  13. package/lib/input/style/style.css +21 -0
  14. package/lib/input/style/style.min.css +1 -1
  15. package/lib/keyboard/src/mixin.js +4 -1
  16. package/lib/keyboard/src/mixin.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/body.js +10 -8
  20. package/lib/table/src/body.min.js +1 -1
  21. package/lib/table/src/cell.js +20 -16
  22. package/lib/table/src/cell.min.js +1 -1
  23. package/lib/table/src/methods.js +573 -379
  24. package/lib/table/src/methods.min.js +1 -1
  25. package/lib/table/src/table.js +15 -13
  26. package/lib/table/src/table.min.js +1 -1
  27. package/lib/table/style/style.css +2 -2
  28. package/lib/table/style/style.min.css +1 -1
  29. package/lib/tools/log.js +1 -1
  30. package/lib/tools/log.min.js +1 -1
  31. package/lib/v-x-e-table/index.js +1 -1
  32. package/lib/v-x-e-table/index.min.js +1 -1
  33. package/lib/validator/src/mixin.js +4 -1
  34. package/lib/validator/src/mixin.min.js +1 -1
  35. package/package.json +4 -9
  36. package/packages/edit/src/mixin.js +7 -5
  37. package/packages/export/src/mixin.js +2 -1
  38. package/packages/input/src/input.js +24 -1
  39. package/packages/keyboard/src/mixin.js +2 -1
  40. package/packages/table/src/body.js +10 -8
  41. package/packages/table/src/cell.js +18 -14
  42. package/packages/table/src/methods.js +408 -202
  43. package/packages/table/src/table.js +15 -13
  44. package/packages/validator/src/mixin.js +2 -1
  45. package/styles/css-variable.scss +3 -3
  46. package/styles/input.scss +25 -0
  47. package/styles/table.scss +6 -2
  48. package/styles/textarea.scss +3 -3
  49. package/styles/variable.scss +3 -3
  50. package/types/v-x-e-table/index.d.ts +1 -1
  51. /package/lib/icon/style/{iconfont.1692577739980.ttf → iconfont.1693628087676.ttf} +0 -0
  52. /package/lib/icon/style/{iconfont.1692577739980.woff → iconfont.1693628087676.woff} +0 -0
  53. /package/lib/icon/style/{iconfont.1692577739980.woff2 → iconfont.1693628087676.woff2} +0 -0
  54. /package/lib/{iconfont.1692577739980.ttf → iconfont.1693628087676.ttf} +0 -0
  55. /package/lib/{iconfont.1692577739980.woff → iconfont.1693628087676.woff} +0 -0
  56. /package/lib/{iconfont.1692577739980.woff2 → iconfont.1693628087676.woff2} +0 -0
@@ -77,12 +77,16 @@ function getCustomStorageMap(key) {
77
77
  _v: version
78
78
  };
79
79
  }
80
- function getRecoverRow(_vm, list) {
81
- var fullAllDataRowMap = _vm.fullAllDataRowMap;
82
- return list.filter(function (row) {
83
- return fullAllDataRowMap.has(row);
80
+ var getRecoverRowMaps = function getRecoverRowMaps(_vm, keyMaps) {
81
+ var fullAllDataRowIdData = _vm.fullAllDataRowIdData;
82
+ var restKeys = {};
83
+ _xeUtils["default"].each(keyMaps, function (row, rowid) {
84
+ if (fullAllDataRowIdData[rowid]) {
85
+ restKeys[rowid] = row;
86
+ }
84
87
  });
85
- }
88
+ return restKeys;
89
+ };
86
90
  function handleReserveRow(_vm, reserveRowMap) {
87
91
  var fullDataRowIdData = _vm.fullDataRowIdData;
88
92
  var reserveList = [];
@@ -732,7 +736,9 @@ var Methods = {
732
736
  fullAllDataRowIdData = this.fullAllDataRowIdData = {};
733
737
  fullAllDataRowMap.clear();
734
738
  if (treeConfig) {
735
- _xeUtils["default"].eachTree(tableFullTreeData, handleCache, treeOpts);
739
+ _xeUtils["default"].eachTree(tableFullTreeData, handleCache, {
740
+ children: childrenField
741
+ });
736
742
  } else {
737
743
  tableFullData.forEach(handleCache);
738
744
  }
@@ -758,7 +764,10 @@ var Methods = {
758
764
  };
759
765
  // 源数据缓存
760
766
  if (treeConfig && !treeOpts.transform) {
761
- _xeUtils["default"].eachTree(sourceData, handleSourceRow, treeOpts);
767
+ var childrenField = treeOpts.children || treeOpts.childrenField;
768
+ _xeUtils["default"].eachTree(sourceData, handleSourceRow, {
769
+ children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
770
+ });
762
771
  } else {
763
772
  sourceData.forEach(handleSourceRow);
764
773
  }
@@ -772,7 +781,8 @@ var Methods = {
772
781
  fullDataRowIdData = this.fullDataRowIdData,
773
782
  fullDataRowMap = this.fullDataRowMap,
774
783
  fullAllDataRowMap = this.fullAllDataRowMap,
775
- fullAllDataRowIdData = this.fullAllDataRowIdData;
784
+ fullAllDataRowIdData = this.fullAllDataRowIdData,
785
+ sourceDataRowIdData = this.sourceDataRowIdData;
776
786
  var transform = treeOpts.transform,
777
787
  mapChildrenField = treeOpts.mapChildrenField;
778
788
  var childrenField = treeOpts.children || treeOpts.childrenField;
@@ -783,10 +793,16 @@ var Methods = {
783
793
  var rowid = (0, _util.getRowid)(_this12, row);
784
794
  var matchObj = _xeUtils["default"].findTree(tableSourceData, function (item) {
785
795
  return rowid === (0, _util.getRowid)(_this12, item);
786
- }, treeOpts);
796
+ }, {
797
+ children: childrenField
798
+ });
787
799
  if (matchObj) {
788
800
  matchObj.item[childrenField] = _xeUtils["default"].clone(rows, true);
789
801
  }
802
+ rows.forEach(function (childRow) {
803
+ var rowid = (0, _util.getRowid)(_this12, childRow);
804
+ sourceDataRowIdData[rowid] = _xeUtils["default"].clone(childRow, true);
805
+ });
790
806
  }
791
807
  _xeUtils["default"].eachTree(rows, function (childRow, index, items, path, parent, nodes) {
792
808
  var rowid = (0, _util.getRowid)(_this12, childRow);
@@ -805,7 +821,9 @@ var Methods = {
805
821
  fullDataRowMap.set(childRow, rest);
806
822
  fullAllDataRowIdData[rowid] = rest;
807
823
  fullAllDataRowMap.set(childRow, rest);
808
- }, treeOpts);
824
+ }, {
825
+ children: childrenField
826
+ });
809
827
  row[childrenField] = rows;
810
828
  if (transform) {
811
829
  row[mapChildrenField] = rows;
@@ -1334,14 +1352,14 @@ var Methods = {
1334
1352
  * 用于多选行,获取已选中的数据
1335
1353
  */
1336
1354
  getCheckboxRecords: function getCheckboxRecords(isFull) {
1337
- var _this17 = this;
1338
1355
  var tableFullData = this.tableFullData,
1339
1356
  afterFullData = this.afterFullData,
1340
1357
  treeConfig = this.treeConfig,
1341
1358
  treeOpts = this.treeOpts,
1342
1359
  checkboxOpts = this.checkboxOpts,
1343
1360
  tableFullTreeData = this.tableFullTreeData,
1344
- afterTreeFullData = this.afterTreeFullData;
1361
+ afterTreeFullData = this.afterTreeFullData,
1362
+ afterFullRowMaps = this.afterFullRowMaps;
1345
1363
  var transform = treeOpts.transform,
1346
1364
  mapChildrenField = treeOpts.mapChildrenField;
1347
1365
  var checkField = checkboxOpts.checkField;
@@ -1361,18 +1379,13 @@ var Methods = {
1361
1379
  });
1362
1380
  }
1363
1381
  } else {
1364
- var selectCheckboxRows = this.selectCheckboxRows;
1365
- if (treeConfig) {
1366
- rowList = _xeUtils["default"].filterTree(currTableData, function (row) {
1367
- return _this17.findRowIndexOf(selectCheckboxRows, row) > -1;
1368
- }, {
1369
- children: transform ? mapChildrenField : childrenField
1370
- });
1371
- } else {
1372
- rowList = currTableData.filter(function (row) {
1373
- return _this17.findRowIndexOf(selectCheckboxRows, row) > -1;
1374
- });
1375
- }
1382
+ var selectCheckboxMaps = this.selectCheckboxMaps,
1383
+ fullDataRowIdData = this.fullDataRowIdData;
1384
+ _xeUtils["default"].each(selectCheckboxMaps, function (row, rowid) {
1385
+ if (isFull ? fullDataRowIdData[rowid] : afterFullRowMaps[rowid]) {
1386
+ rowList.push(row);
1387
+ }
1388
+ });
1376
1389
  }
1377
1390
  return rowList;
1378
1391
  },
@@ -1381,17 +1394,20 @@ var Methods = {
1381
1394
  * @returns
1382
1395
  */
1383
1396
  handleVirtualTreeToList: function handleVirtualTreeToList() {
1397
+ var _this17 = this;
1384
1398
  var treeOpts = this.treeOpts,
1385
1399
  treeConfig = this.treeConfig,
1386
- treeExpandeds = this.treeExpandeds,
1400
+ treeExpandedMaps = this.treeExpandedMaps,
1387
1401
  afterTreeFullData = this.afterTreeFullData,
1388
1402
  afterFullData = this.afterFullData;
1389
1403
  if (treeConfig && treeOpts.transform) {
1390
1404
  var fullData = [];
1391
- var expandMaps = new Map();
1405
+ var expandMaps = {};
1392
1406
  _xeUtils["default"].eachTree(afterTreeFullData, function (row, index, items, path, parent) {
1393
- if (!parent || expandMaps.has(parent) && treeExpandeds.indexOf(parent) > -1) {
1394
- expandMaps.set(row, 1);
1407
+ var rowid = (0, _util.getRowid)(_this17, row);
1408
+ var parentRowid = (0, _util.getRowid)(_this17, parent);
1409
+ if (!parent || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
1410
+ expandMaps[rowid] = 1;
1395
1411
  fullData.push(row);
1396
1412
  }
1397
1413
  }, {
@@ -1621,6 +1637,7 @@ var Methods = {
1621
1637
  afterTreeFullData = this.afterTreeFullData,
1622
1638
  treeOpts = this.treeOpts;
1623
1639
  var childrenField = treeOpts.children || treeOpts.childrenField;
1640
+ var fullMaps = {};
1624
1641
  if (treeConfig) {
1625
1642
  _xeUtils["default"].eachTree(afterTreeFullData, function (row, index, items, path) {
1626
1643
  var rowid = (0, _util.getRowid)(_this19, row);
@@ -1646,6 +1663,7 @@ var Methods = {
1646
1663
  fullAllDataRowIdData[rowid] = rest;
1647
1664
  fullDataRowIdData[rowid] = rest;
1648
1665
  }
1666
+ fullMaps[rowid] = row;
1649
1667
  }, {
1650
1668
  children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
1651
1669
  });
@@ -1672,8 +1690,10 @@ var Methods = {
1672
1690
  fullAllDataRowIdData[rowid] = rest;
1673
1691
  fullDataRowIdData[rowid] = rest;
1674
1692
  }
1693
+ fullMaps[rowid] = row;
1675
1694
  });
1676
1695
  }
1696
+ this.afterFullRowMaps = fullMaps;
1677
1697
  },
1678
1698
  /**
1679
1699
  * 只对 tree-config 有效,获取行的父级
@@ -2975,6 +2995,7 @@ var Methods = {
2975
2995
  var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow;
2976
2996
  var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow);
2977
2997
  var isEditStatus = (0, _utils.isEnableConf)(editConfig) && actived.column && actived.row;
2998
+ var childrenField = treeOpts.children || treeOpts.childrenField;
2978
2999
  var params;
2979
3000
  if (filterStore.visible) {
2980
3001
  if (isEsc) {
@@ -3049,7 +3070,7 @@ var Methods = {
3049
3070
  }
3050
3071
  } else if (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
3051
3072
  // 如果是树形表格当前行回车移动到子节点
3052
- var childrens = currentRow[treeOpts.children];
3073
+ var childrens = currentRow[childrenField];
3053
3074
  if (childrens && childrens.length) {
3054
3075
  evnt.preventDefault();
3055
3076
  var targetRow = childrens[0];
@@ -3119,7 +3140,9 @@ var Methods = {
3119
3140
  // 如果树形表格回退键关闭当前行返回父节点
3120
3141
  var _XEUtils$findTree = _xeUtils["default"].findTree(_this29.afterFullData, function (item) {
3121
3142
  return item === currentRow;
3122
- }, treeOpts),
3143
+ }, {
3144
+ children: childrenField
3145
+ }),
3123
3146
  parentRow = _XEUtils$findTree.parent;
3124
3147
  if (parentRow) {
3125
3148
  evnt.preventDefault();
@@ -3425,15 +3448,24 @@ var Methods = {
3425
3448
  * 获取复选框半选状态的行数据
3426
3449
  */
3427
3450
  getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords(isFull) {
3428
- var _this31 = this;
3429
3451
  var treeConfig = this.treeConfig,
3430
- treeIndeterminates = this.treeIndeterminates,
3452
+ treeIndeterminateMaps = this.treeIndeterminateMaps,
3431
3453
  fullDataRowIdData = this.fullDataRowIdData;
3432
3454
  if (treeConfig) {
3433
- return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(function (row) {
3434
- var rowid = (0, _util.getRowid)(_this31, row);
3435
- return fullDataRowIdData[rowid];
3455
+ var fullRest = [];
3456
+ var defRest = [];
3457
+ _xeUtils["default"].each(treeIndeterminateMaps, function (item, rowid) {
3458
+ if (item) {
3459
+ fullRest.push(item);
3460
+ if (fullDataRowIdData[rowid]) {
3461
+ defRest.push(item);
3462
+ }
3463
+ }
3436
3464
  });
3465
+ if (isFull) {
3466
+ return fullRest;
3467
+ }
3468
+ return defRest;
3437
3469
  }
3438
3470
  return [];
3439
3471
  },
@@ -3458,12 +3490,12 @@ var Methods = {
3458
3490
  }
3459
3491
  },
3460
3492
  handleCheckedCheckboxRow: function handleCheckedCheckboxRow(rows, value, isForce) {
3461
- var _this32 = this;
3493
+ var _this31 = this;
3462
3494
  if (rows && !_xeUtils["default"].isArray(rows)) {
3463
3495
  rows = [rows];
3464
3496
  }
3465
3497
  rows.forEach(function (row) {
3466
- return _this32.handleSelectRow({
3498
+ return _this31.handleSelectRow({
3467
3499
  row: row
3468
3500
  }, !!value, isForce);
3469
3501
  });
@@ -3478,78 +3510,108 @@ var Methods = {
3478
3510
  return this.handleCheckedCheckboxRow(rows, value, true);
3479
3511
  },
3480
3512
  isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
3481
- var selectCheckboxRows = this.selectCheckboxRows;
3513
+ var selectCheckboxMaps = this.selectCheckboxMaps;
3482
3514
  var checkField = this.checkboxOpts.checkField;
3483
3515
  if (checkField) {
3484
3516
  return _xeUtils["default"].get(row, checkField);
3485
3517
  }
3486
- return this.findRowIndexOf(selectCheckboxRows, row) > -1;
3518
+ return !!selectCheckboxMaps[(0, _util.getRowid)(this, row)];
3487
3519
  },
3488
3520
  isIndeterminateByCheckboxRow: function isIndeterminateByCheckboxRow(row) {
3489
- var treeIndeterminates = this.treeIndeterminates;
3490
- return this.findRowIndexOf(treeIndeterminates, row) > -1 && !this.isCheckedByCheckboxRow(row);
3521
+ var treeIndeterminateMaps = this.treeIndeterminateMaps;
3522
+ return !!treeIndeterminateMaps[(0, _util.getRowid)(this, row)] && !this.isCheckedByCheckboxRow(row);
3491
3523
  },
3492
3524
  /**
3493
3525
  * 多选,行选中事件
3494
3526
  * value 选中true 不选false 半选-1
3495
3527
  */
3496
3528
  handleSelectRow: function handleSelectRow(_ref6, value, isForce) {
3497
- var _this33 = this;
3529
+ var _this32 = this;
3498
3530
  var row = _ref6.row;
3499
- var selectCheckboxRows = this.selectCheckboxRows,
3531
+ var selectCheckboxMaps = this.selectCheckboxMaps,
3500
3532
  afterFullData = this.afterFullData,
3501
3533
  treeConfig = this.treeConfig,
3502
3534
  treeOpts = this.treeOpts,
3503
- treeIndeterminates = this.treeIndeterminates,
3535
+ treeIndeterminateMaps = this.treeIndeterminateMaps,
3504
3536
  checkboxOpts = this.checkboxOpts;
3505
3537
  var checkField = checkboxOpts.checkField,
3506
3538
  checkStrictly = checkboxOpts.checkStrictly,
3507
3539
  checkMethod = checkboxOpts.checkMethod;
3540
+ var selectRowMaps = _objectSpread({}, selectCheckboxMaps);
3541
+ var childrenField = treeOpts.children || treeOpts.childrenField;
3542
+ var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
3543
+ var rowid = (0, _util.getRowid)(this, row);
3508
3544
  if (checkField) {
3509
3545
  if (treeConfig && !checkStrictly) {
3510
3546
  if (value === -1) {
3511
- if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
3512
- treeIndeterminates.push(row);
3547
+ if (!treeIndeterminateMaps[rowid]) {
3548
+ if (indeterminateField) {
3549
+ _xeUtils["default"].set(row, indeterminateField, true);
3550
+ }
3551
+ treeIndeterminateMaps[rowid] = row;
3513
3552
  }
3514
3553
  _xeUtils["default"].set(row, checkField, false);
3515
3554
  } else {
3516
3555
  // 更新子节点状态
3517
3556
  _xeUtils["default"].eachTree([row], function (item) {
3518
- if (_this33.eqRow(item, row) || isForce || !checkMethod || checkMethod({
3557
+ if (_this32.eqRow(item, row) || isForce || !checkMethod || checkMethod({
3519
3558
  row: item
3520
3559
  })) {
3521
3560
  _xeUtils["default"].set(item, checkField, value);
3522
- _xeUtils["default"].remove(treeIndeterminates, function (half) {
3523
- return _this33.eqRow(half, item);
3524
- });
3525
- _this33.handleCheckboxReserveRow(row, value);
3561
+ if (indeterminateField) {
3562
+ _xeUtils["default"].set(row, indeterminateField, false);
3563
+ }
3564
+ delete treeIndeterminateMaps[(0, _util.getRowid)(_this32, item)];
3565
+ _this32.handleCheckboxReserveRow(row, value);
3526
3566
  }
3527
- }, treeOpts);
3567
+ }, {
3568
+ children: childrenField
3569
+ });
3528
3570
  }
3529
3571
  // 如果存在父节点,更新父节点状态
3530
3572
  var matchObj = _xeUtils["default"].findTree(afterFullData, function (item) {
3531
- return _this33.eqRow(item, row);
3532
- }, treeOpts);
3573
+ return _this32.eqRow(item, row);
3574
+ }, {
3575
+ children: childrenField
3576
+ });
3533
3577
  if (matchObj && matchObj.parent) {
3534
3578
  var parentStatus;
3535
- var vItems = !isForce && checkMethod ? matchObj.items.filter(function (item) {
3536
- return checkMethod({
3537
- row: item
3579
+ var vItems = [];
3580
+ var vItemMaps = {};
3581
+ if (!isForce && checkMethod) {
3582
+ matchObj.items.forEach(function (item) {
3583
+ if (checkMethod({
3584
+ row: item
3585
+ })) {
3586
+ var itemRid = (0, _util.getRowid)(_this32, item);
3587
+ vItemMaps[itemRid] = item;
3588
+ vItems.push(item);
3589
+ }
3590
+ });
3591
+ } else {
3592
+ matchObj.items.forEach(function (item) {
3593
+ var itemRid = (0, _util.getRowid)(_this32, item);
3594
+ vItemMaps[itemRid] = item;
3595
+ vItems.push(item);
3538
3596
  });
3539
- }) : matchObj.items;
3597
+ }
3540
3598
  var indeterminatesItem = _xeUtils["default"].find(matchObj.items, function (item) {
3541
- return _this33.findRowIndexOf(treeIndeterminates, item) > -1;
3599
+ return !!treeIndeterminateMaps[(0, _util.getRowid)(_this32, item)];
3542
3600
  });
3543
3601
  if (indeterminatesItem) {
3544
3602
  parentStatus = -1;
3545
3603
  } else {
3546
- var selectItems = matchObj.items.filter(function (item) {
3547
- return _xeUtils["default"].get(item, checkField);
3604
+ var selectItems = [];
3605
+ matchObj.items.forEach(function (item) {
3606
+ if (_xeUtils["default"].get(item, checkField)) {
3607
+ selectItems.push(item);
3608
+ }
3548
3609
  });
3549
3610
  parentStatus = selectItems.filter(function (item) {
3550
- return _this33.findRowIndexOf(vItems, item) > -1;
3611
+ return vItemMaps[(0, _util.getRowid)(_this32, item)];
3551
3612
  }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
3552
3613
  }
3614
+ this.selectCheckboxMaps = selectRowMaps;
3553
3615
  return this.handleSelectRow({
3554
3616
  row: matchObj.parent
3555
3617
  }, parentStatus, isForce);
@@ -3565,56 +3627,84 @@ var Methods = {
3565
3627
  } else {
3566
3628
  if (treeConfig && !checkStrictly) {
3567
3629
  if (value === -1) {
3568
- if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
3569
- treeIndeterminates.push(row);
3630
+ if (!treeIndeterminateMaps[rowid]) {
3631
+ if (indeterminateField) {
3632
+ _xeUtils["default"].set(row, indeterminateField, true);
3633
+ }
3634
+ treeIndeterminateMaps[rowid] = row;
3635
+ }
3636
+ if (selectRowMaps[rowid]) {
3637
+ delete selectRowMaps[rowid];
3570
3638
  }
3571
- _xeUtils["default"].remove(selectCheckboxRows, function (item) {
3572
- return _this33.eqRow(item, row);
3573
- });
3574
3639
  } else {
3575
3640
  // 更新子节点状态
3576
3641
  _xeUtils["default"].eachTree([row], function (item) {
3577
- if (_this33.eqRow(item, row) || isForce || !checkMethod || checkMethod({
3642
+ var itemRid = (0, _util.getRowid)(_this32, item);
3643
+ if (_this32.eqRow(item, row) || isForce || !checkMethod || checkMethod({
3578
3644
  row: item
3579
3645
  })) {
3580
3646
  if (value) {
3581
- selectCheckboxRows.push(item);
3647
+ selectRowMaps[itemRid] = item;
3582
3648
  } else {
3583
- _xeUtils["default"].remove(selectCheckboxRows, function (select) {
3584
- return _this33.eqRow(select, item);
3585
- });
3649
+ if (selectRowMaps[itemRid]) {
3650
+ delete selectRowMaps[itemRid];
3651
+ }
3586
3652
  }
3587
- _xeUtils["default"].remove(treeIndeterminates, function (half) {
3588
- return _this33.eqRow(half, item);
3589
- });
3590
- _this33.handleCheckboxReserveRow(row, value);
3653
+ if (indeterminateField) {
3654
+ _xeUtils["default"].set(row, indeterminateField, false);
3655
+ }
3656
+ delete treeIndeterminateMaps[(0, _util.getRowid)(_this32, item)];
3657
+ _this32.handleCheckboxReserveRow(row, value);
3591
3658
  }
3592
- }, treeOpts);
3659
+ }, {
3660
+ children: childrenField
3661
+ });
3593
3662
  }
3594
3663
  // 如果存在父节点,更新父节点状态
3595
3664
  var _matchObj = _xeUtils["default"].findTree(afterFullData, function (item) {
3596
- return _this33.eqRow(item, row);
3597
- }, treeOpts);
3665
+ return _this32.eqRow(item, row);
3666
+ }, {
3667
+ children: childrenField
3668
+ });
3598
3669
  if (_matchObj && _matchObj.parent) {
3599
3670
  var _parentStatus;
3600
- var _vItems = !isForce && checkMethod ? _matchObj.items.filter(function (item) {
3601
- return checkMethod({
3602
- row: item
3671
+ var _vItems = [];
3672
+ var _vItemMaps = {};
3673
+ if (!isForce && checkMethod) {
3674
+ _matchObj.items.forEach(function (item) {
3675
+ if (checkMethod({
3676
+ row: item
3677
+ })) {
3678
+ var itemRid = (0, _util.getRowid)(_this32, item);
3679
+ _vItemMaps[itemRid] = item;
3680
+ _vItems.push(item);
3681
+ }
3682
+ });
3683
+ } else {
3684
+ _matchObj.items.forEach(function (item) {
3685
+ var itemRid = (0, _util.getRowid)(_this32, item);
3686
+ _vItemMaps[itemRid] = item;
3687
+ _vItems.push(item);
3603
3688
  });
3604
- }) : _matchObj.items;
3689
+ }
3605
3690
  var _indeterminatesItem = _xeUtils["default"].find(_matchObj.items, function (item) {
3606
- return _this33.findRowIndexOf(treeIndeterminates, item) > -1;
3691
+ return !!treeIndeterminateMaps[(0, _util.getRowid)(_this32, item)];
3607
3692
  });
3608
3693
  if (_indeterminatesItem) {
3609
3694
  _parentStatus = -1;
3610
3695
  } else {
3611
- var _selectItems = _matchObj.items.filter(function (item) {
3612
- return _this33.findRowIndexOf(selectCheckboxRows, item) > -1;
3696
+ var _selectItems = [];
3697
+ _matchObj.items.forEach(function (item) {
3698
+ var itemRid = (0, _util.getRowid)(_this32, item);
3699
+ if (selectRowMaps[itemRid]) {
3700
+ _selectItems.push(item);
3701
+ }
3613
3702
  });
3614
3703
  _parentStatus = _selectItems.filter(function (item) {
3615
- return _this33.findRowIndexOf(_vItems, item) > -1;
3704
+ return _vItemMaps[(0, _util.getRowid)(_this32, item)];
3616
3705
  }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
3617
3706
  }
3707
+ this.selectCheckboxMaps = selectRowMaps;
3618
3708
  return this.handleSelectRow({
3619
3709
  row: _matchObj.parent
3620
3710
  }, _parentStatus, isForce);
@@ -3624,26 +3714,32 @@ var Methods = {
3624
3714
  row: row
3625
3715
  })) {
3626
3716
  if (value) {
3627
- if (this.findRowIndexOf(selectCheckboxRows, row) === -1) {
3628
- selectCheckboxRows.push(row);
3717
+ if (!selectRowMaps[rowid]) {
3718
+ selectRowMaps[rowid] = row;
3629
3719
  }
3630
3720
  } else {
3631
- _xeUtils["default"].remove(selectCheckboxRows, function (item) {
3632
- return _this33.eqRow(item, row);
3633
- });
3721
+ if (selectRowMaps[rowid]) {
3722
+ delete selectRowMaps[rowid];
3723
+ }
3634
3724
  }
3635
3725
  this.handleCheckboxReserveRow(row, value);
3636
3726
  }
3637
3727
  }
3638
3728
  }
3729
+ this.selectCheckboxMaps = selectRowMaps;
3639
3730
  this.checkSelectionStatus();
3640
3731
  },
3641
3732
  handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
3642
- var selectCheckboxRows = this.selectCheckboxRows,
3733
+ var selectCheckboxMaps = this.selectCheckboxMaps,
3643
3734
  checkboxOpts = this.checkboxOpts;
3644
3735
  var checkField = checkboxOpts.checkField;
3645
3736
  var row = params.row;
3646
- var value = checkField ? !_xeUtils["default"].get(row, checkField) : this.findRowIndexOf(selectCheckboxRows, row) === -1;
3737
+ var value = false;
3738
+ if (checkField) {
3739
+ value = !_xeUtils["default"].get(row, checkField);
3740
+ } else {
3741
+ value = !selectCheckboxMaps[(0, _util.getRowid)(this, row)];
3742
+ }
3647
3743
  if (evnt) {
3648
3744
  this.triggerCheckRowEvent(evnt, params, value);
3649
3745
  } else {
@@ -3688,32 +3784,42 @@ var Methods = {
3688
3784
  * 多选,切换某一行的选中状态
3689
3785
  */
3690
3786
  toggleCheckboxRow: function toggleCheckboxRow(row) {
3691
- var selectCheckboxRows = this.selectCheckboxRows,
3787
+ var selectCheckboxMaps = this.selectCheckboxMaps,
3692
3788
  checkboxOpts = this.checkboxOpts;
3693
3789
  var checkField = checkboxOpts.checkField;
3694
- var value = checkField ? !_xeUtils["default"].get(row, checkField) : this.findRowIndexOf(selectCheckboxRows, row) === -1;
3790
+ var value = checkField ? !_xeUtils["default"].get(row, checkField) : !selectCheckboxMaps[(0, _util.getRowid)(this, row)];
3695
3791
  this.handleSelectRow({
3696
3792
  row: row
3697
3793
  }, value, true);
3698
3794
  return this.$nextTick();
3699
3795
  },
3700
3796
  handleCheckedAllCheckboxRow: function handleCheckedAllCheckboxRow(value, isForce) {
3701
- var _this34 = this;
3797
+ var _this33 = this;
3702
3798
  var afterFullData = this.afterFullData,
3703
3799
  treeConfig = this.treeConfig,
3704
3800
  treeOpts = this.treeOpts,
3705
- selectCheckboxRows = this.selectCheckboxRows,
3801
+ selectCheckboxMaps = this.selectCheckboxMaps,
3706
3802
  checkboxReserveRowMap = this.checkboxReserveRowMap,
3707
- checkboxOpts = this.checkboxOpts;
3803
+ checkboxOpts = this.checkboxOpts,
3804
+ afterFullRowMaps = this.afterFullRowMaps;
3708
3805
  var checkField = checkboxOpts.checkField,
3709
3806
  reserve = checkboxOpts.reserve,
3710
3807
  checkStrictly = checkboxOpts.checkStrictly,
3711
3808
  checkMethod = checkboxOpts.checkMethod;
3712
3809
  var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
3713
- var selectRows = [];
3714
- var beforeSelection = treeConfig ? [] : selectCheckboxRows.filter(function (row) {
3715
- return _this34.findRowIndexOf(afterFullData, row) === -1;
3716
- });
3810
+ var childrenField = treeOpts.children || treeOpts.childrenField;
3811
+ var selectRowMaps = {};
3812
+
3813
+ // 疑惑!
3814
+ if (!treeConfig) {
3815
+ _xeUtils["default"].each(selectCheckboxMaps, function (row, rowid) {
3816
+ if (!afterFullRowMaps[rowid]) {
3817
+ selectRowMaps[rowid] = row;
3818
+ }
3819
+ });
3820
+ }
3821
+ // 疑惑!
3822
+
3717
3823
  if (checkStrictly) {
3718
3824
  this.isAllSelected = value;
3719
3825
  } else {
@@ -3727,7 +3833,7 @@ var Methods = {
3727
3833
  row: row
3728
3834
  })) {
3729
3835
  if (value) {
3730
- selectRows.push(row);
3836
+ selectRowMaps[(0, _util.getRowid)(_this33, row)] = row;
3731
3837
  }
3732
3838
  _xeUtils["default"].set(row, checkField, value);
3733
3839
  }
@@ -3738,7 +3844,9 @@ var Methods = {
3738
3844
  // 如果存在选中方法
3739
3845
  // 如果方法成立,则更新值,否则忽略该数据
3740
3846
  if (treeConfig) {
3741
- _xeUtils["default"].eachTree(afterFullData, checkValFn, treeOpts);
3847
+ _xeUtils["default"].eachTree(afterFullData, checkValFn, {
3848
+ children: childrenField
3849
+ });
3742
3850
  } else {
3743
3851
  afterFullData.forEach(checkValFn);
3744
3852
  }
@@ -3757,9 +3865,11 @@ var Methods = {
3757
3865
  if (isForce || !checkMethod || checkMethod({
3758
3866
  row: row
3759
3867
  })) {
3760
- selectRows.push(row);
3868
+ selectRowMaps[(0, _util.getRowid)(_this33, row)] = row;
3761
3869
  }
3762
- }, treeOpts);
3870
+ }, {
3871
+ children: childrenField
3872
+ });
3763
3873
  } else {
3764
3874
  /**
3765
3875
  * 如果是树取消
@@ -3767,12 +3877,15 @@ var Methods = {
3767
3877
  */
3768
3878
  if (!isForce && checkMethod) {
3769
3879
  _xeUtils["default"].eachTree(afterFullData, function (row) {
3880
+ var rowid = (0, _util.getRowid)(_this33, row);
3770
3881
  if (checkMethod({
3771
3882
  row: row
3772
- }) ? 0 : _this34.findRowIndexOf(selectCheckboxRows, row) > -1) {
3773
- selectRows.push(row);
3883
+ }) ? 0 : selectCheckboxMaps[rowid]) {
3884
+ selectRowMaps[rowid] = row;
3774
3885
  }
3775
- }, treeOpts);
3886
+ }, {
3887
+ children: childrenField
3888
+ });
3776
3889
  }
3777
3890
  }
3778
3891
  } else {
@@ -3783,13 +3896,18 @@ var Methods = {
3783
3896
  * 如果不存在选中方法,则添加所有数据到临时集合中
3784
3897
  */
3785
3898
  if (!isForce && checkMethod) {
3786
- selectRows = afterFullData.filter(function (row) {
3787
- return _this34.findRowIndexOf(selectCheckboxRows, row) > -1 || checkMethod({
3899
+ afterFullData.forEach(function (row) {
3900
+ var rowid = (0, _util.getRowid)(_this33, row);
3901
+ if (selectCheckboxMaps[rowid] || checkMethod({
3788
3902
  row: row
3789
- });
3903
+ })) {
3904
+ selectRowMaps[rowid] = row;
3905
+ }
3790
3906
  });
3791
3907
  } else {
3792
- selectRows = afterFullData.slice(0);
3908
+ afterFullData.forEach(function (row) {
3909
+ selectRowMaps[(0, _util.getRowid)(_this33, row)] = row;
3910
+ });
3793
3911
  }
3794
3912
  } else {
3795
3913
  /**
@@ -3798,10 +3916,13 @@ var Methods = {
3798
3916
  * 如果不存在选中方法,无需处理,临时集合默认为空
3799
3917
  */
3800
3918
  if (!isForce && checkMethod) {
3801
- selectRows = afterFullData.filter(function (row) {
3802
- return checkMethod({
3919
+ afterFullData.forEach(function (row) {
3920
+ var rowid = (0, _util.getRowid)(_this33, row);
3921
+ if (checkMethod({
3803
3922
  row: row
3804
- }) ? 0 : _this34.findRowIndexOf(selectCheckboxRows, row) > -1;
3923
+ }) ? 0 : selectCheckboxMaps[rowid]) {
3924
+ selectRowMaps[rowid] = row;
3925
+ }
3805
3926
  });
3806
3927
  }
3807
3928
  }
@@ -3809,18 +3930,19 @@ var Methods = {
3809
3930
  }
3810
3931
  if (reserve) {
3811
3932
  if (value) {
3812
- selectRows.forEach(function (row) {
3813
- checkboxReserveRowMap[(0, _util.getRowid)(_this34, row)] = row;
3933
+ _xeUtils["default"].each(selectRowMaps, function (row, rowid) {
3934
+ checkboxReserveRowMap[rowid] = row;
3814
3935
  });
3815
3936
  } else {
3816
3937
  afterFullData.forEach(function (row) {
3817
- return _this34.handleCheckboxReserveRow(row, false);
3938
+ return _this33.handleCheckboxReserveRow(row, false);
3818
3939
  });
3819
3940
  }
3820
3941
  }
3821
- this.selectCheckboxRows = checkField ? [] : beforeSelection.concat(selectRows);
3942
+ this.selectCheckboxMaps = checkField ? {} : selectRowMaps;
3822
3943
  }
3823
- this.treeIndeterminates = [];
3944
+ this.treeIndeterminateMaps = {};
3945
+ this.treeIndeterminateRowMaps = {};
3824
3946
  this.checkSelectionStatus();
3825
3947
  return this.$nextTick();
3826
3948
  },
@@ -3832,10 +3954,10 @@ var Methods = {
3832
3954
  return this.handleCheckedAllCheckboxRow(value, true);
3833
3955
  },
3834
3956
  checkSelectionStatus: function checkSelectionStatus() {
3835
- var _this35 = this;
3957
+ var _this34 = this;
3836
3958
  var afterFullData = this.afterFullData,
3837
- selectCheckboxRows = this.selectCheckboxRows,
3838
- treeIndeterminates = this.treeIndeterminates,
3959
+ selectCheckboxMaps = this.selectCheckboxMaps,
3960
+ treeIndeterminateMaps = this.treeIndeterminateMaps,
3839
3961
  checkboxOpts = this.checkboxOpts,
3840
3962
  treeConfig = this.treeConfig;
3841
3963
  var checkField = checkboxOpts.checkField,
@@ -3868,11 +3990,11 @@ var Methods = {
3868
3990
  if (treeConfig) {
3869
3991
  if (indeterminateField) {
3870
3992
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
3871
- return _xeUtils["default"].get(row, checkField) || _xeUtils["default"].get(row, indeterminateField) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
3993
+ return _xeUtils["default"].get(row, checkField) || _xeUtils["default"].get(row, indeterminateField) || !!treeIndeterminateMaps[(0, _util.getRowid)(_this34, row)];
3872
3994
  });
3873
3995
  } else {
3874
3996
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
3875
- return _xeUtils["default"].get(row, checkField) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
3997
+ return _xeUtils["default"].get(row, checkField) || !!treeIndeterminateMaps[(0, _util.getRowid)(_this34, row)];
3876
3998
  });
3877
3999
  }
3878
4000
  } else {
@@ -3894,22 +4016,23 @@ var Methods = {
3894
4016
  disableRows.push(row);
3895
4017
  return true;
3896
4018
  }
3897
- if (_this35.findRowIndexOf(selectCheckboxRows, row) > -1) {
4019
+ if (selectCheckboxMaps[(0, _util.getRowid)(_this34, row)]) {
3898
4020
  checkRows.push(row);
3899
4021
  return true;
3900
4022
  }
3901
4023
  return false;
3902
4024
  } : function (row) {
3903
- return _this35.findRowIndexOf(selectCheckboxRows, row) > -1;
4025
+ return selectCheckboxMaps[(0, _util.getRowid)(_this34, row)];
3904
4026
  });
3905
4027
  isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
3906
4028
  if (treeConfig) {
3907
4029
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
3908
- return _this35.findRowIndexOf(treeIndeterminates, row) > -1 || _this35.findRowIndexOf(selectCheckboxRows, row) > -1;
4030
+ var itemRid = (0, _util.getRowid)(_this34, row);
4031
+ return treeIndeterminateMaps[itemRid] || selectCheckboxMaps[itemRid];
3909
4032
  });
3910
4033
  } else {
3911
4034
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
3912
- return _this35.findRowIndexOf(selectCheckboxRows, row) > -1;
4035
+ return selectCheckboxMaps[(0, _util.getRowid)(_this34, row)];
3913
4036
  });
3914
4037
  }
3915
4038
  }
@@ -3925,17 +4048,17 @@ var Methods = {
3925
4048
  fullDataRowIdData = this.fullDataRowIdData,
3926
4049
  fullAllDataRowMap = this.fullAllDataRowMap,
3927
4050
  currentRow = this.currentRow,
3928
- selectRow = this.selectRow,
4051
+ selectRadioRow = this.selectRadioRow,
3929
4052
  radioReserveRow = this.radioReserveRow,
3930
4053
  radioOpts = this.radioOpts,
3931
4054
  checkboxOpts = this.checkboxOpts,
3932
- selectCheckboxRows = this.selectCheckboxRows,
3933
- rowExpandeds = this.rowExpandeds,
3934
- treeExpandeds = this.treeExpandeds,
4055
+ selectCheckboxMaps = this.selectCheckboxMaps,
4056
+ rowExpandedMaps = this.rowExpandedMaps,
4057
+ treeExpandedMaps = this.treeExpandedMaps,
3935
4058
  expandOpts = this.expandOpts;
3936
4059
  // 单选框
3937
- if (selectRow && !fullAllDataRowMap.has(selectRow)) {
3938
- this.selectRow = null; // 刷新单选行状态
4060
+ if (selectRadioRow && !fullAllDataRowMap.has(selectRadioRow)) {
4061
+ this.selectRadioRow = null; // 刷新单选行状态
3939
4062
  }
3940
4063
  // 还原保留选中状态
3941
4064
  if (radioOpts.reserve && radioReserveRow) {
@@ -3945,7 +4068,7 @@ var Methods = {
3945
4068
  }
3946
4069
  }
3947
4070
  // 复选框
3948
- this.selectCheckboxRows = getRecoverRow(this, selectCheckboxRows); // 刷新多选行状态
4071
+ this.selectCheckboxMaps = getRecoverRowMaps(this, selectCheckboxMaps); // 刷新多选行状态
3949
4072
  // 还原保留选中状态
3950
4073
  if (checkboxOpts.reserve) {
3951
4074
  this.handleCheckedCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true, true);
@@ -3954,13 +4077,13 @@ var Methods = {
3954
4077
  this.currentRow = null; // 刷新当前行状态
3955
4078
  }
3956
4079
  // 行展开
3957
- this.rowExpandeds = expandColumn ? getRecoverRow(this, rowExpandeds) : []; // 刷新行展开状态
4080
+ this.rowExpandedMaps = expandColumn ? getRecoverRowMaps(this, rowExpandedMaps) : []; // 刷新行展开状态
3958
4081
  // 还原保留状态
3959
4082
  if (expandColumn && expandOpts.reserve) {
3960
4083
  this.setRowExpand(handleReserveRow(this, this.rowExpandedReserveRowMap), true);
3961
4084
  }
3962
4085
  // 树展开
3963
- this.treeExpandeds = treeConfig ? getRecoverRow(this, treeExpandeds) : []; // 刷新树展开状态
4086
+ this.treeExpandedMaps = treeConfig ? getRecoverRowMaps(this, treeExpandedMaps) : []; // 刷新树展开状态
3964
4087
  if (treeConfig && treeOpts.reserve) {
3965
4088
  this.setTreeExpand(handleReserveRow(this, this.treeExpandedReserveRowMap), true);
3966
4089
  }
@@ -3975,6 +4098,7 @@ var Methods = {
3975
4098
  afterFullData = this.afterFullData,
3976
4099
  treeConfig = this.treeConfig,
3977
4100
  treeOpts = this.treeOpts;
4101
+ var childrenField = treeOpts.children || treeOpts.childrenField;
3978
4102
  if (radioOpts.reserve && radioReserveRow) {
3979
4103
  var rowid = (0, _util.getRowid)(this, radioReserveRow);
3980
4104
  if (isFull) {
@@ -3986,7 +4110,9 @@ var Methods = {
3986
4110
  if (treeConfig) {
3987
4111
  var matchObj = _xeUtils["default"].findTree(afterFullData, function (row) {
3988
4112
  return rowid === _xeUtils["default"].get(row, rowkey);
3989
- }, treeOpts);
4113
+ }, {
4114
+ children: childrenField
4115
+ });
3990
4116
  if (matchObj) {
3991
4117
  return radioReserveRow;
3992
4118
  }
@@ -4015,23 +4141,26 @@ var Methods = {
4015
4141
  * 获取复选框保留选中的行
4016
4142
  */
4017
4143
  getCheckboxReserveRecords: function getCheckboxReserveRecords(isFull) {
4018
- var _this36 = this;
4144
+ var _this35 = this;
4019
4145
  var fullDataRowIdData = this.fullDataRowIdData,
4020
4146
  afterFullData = this.afterFullData,
4021
4147
  checkboxReserveRowMap = this.checkboxReserveRowMap,
4022
4148
  checkboxOpts = this.checkboxOpts,
4023
4149
  treeConfig = this.treeConfig,
4024
4150
  treeOpts = this.treeOpts;
4151
+ var childrenField = treeOpts.children || treeOpts.childrenField;
4025
4152
  var reserveSelection = [];
4026
4153
  if (checkboxOpts.reserve) {
4027
4154
  var afterFullIdMaps = {};
4028
4155
  if (treeConfig) {
4029
4156
  _xeUtils["default"].eachTree(afterFullData, function (row) {
4030
- afterFullIdMaps[(0, _util.getRowid)(_this36, row)] = 1;
4031
- }, treeOpts);
4157
+ afterFullIdMaps[(0, _util.getRowid)(_this35, row)] = 1;
4158
+ }, {
4159
+ children: childrenField
4160
+ });
4032
4161
  } else {
4033
4162
  afterFullData.forEach(function (row) {
4034
- afterFullIdMaps[(0, _util.getRowid)(_this36, row)] = 1;
4163
+ afterFullIdMaps[(0, _util.getRowid)(_this35, row)] = 1;
4035
4164
  });
4036
4165
  }
4037
4166
  _xeUtils["default"].each(checkboxReserveRowMap, function (oldRow, oldRowid) {
@@ -4090,13 +4219,14 @@ var Methods = {
4090
4219
  * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
4091
4220
  */
4092
4221
  clearCheckboxRow: function clearCheckboxRow() {
4093
- var _this37 = this;
4222
+ var _this36 = this;
4094
4223
  var tableFullData = this.tableFullData,
4095
4224
  treeConfig = this.treeConfig,
4096
4225
  treeOpts = this.treeOpts,
4097
4226
  checkboxOpts = this.checkboxOpts;
4098
4227
  var checkField = checkboxOpts.checkField,
4099
4228
  reserve = checkboxOpts.reserve;
4229
+ var childrenField = treeOpts.children || treeOpts.childrenField;
4100
4230
  var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
4101
4231
  if (checkField) {
4102
4232
  var handleClearChecked = function handleClearChecked(item) {
@@ -4106,20 +4236,22 @@ var Methods = {
4106
4236
  _xeUtils["default"].set(item, checkField, false);
4107
4237
  };
4108
4238
  if (treeConfig) {
4109
- _xeUtils["default"].eachTree(tableFullData, handleClearChecked, treeOpts);
4239
+ _xeUtils["default"].eachTree(tableFullData, handleClearChecked, {
4240
+ children: childrenField
4241
+ });
4110
4242
  } else {
4111
4243
  tableFullData.forEach(handleClearChecked);
4112
4244
  }
4113
4245
  }
4114
4246
  if (reserve) {
4115
4247
  tableFullData.forEach(function (row) {
4116
- return _this37.handleCheckboxReserveRow(row, false);
4248
+ return _this36.handleCheckboxReserveRow(row, false);
4117
4249
  });
4118
4250
  }
4119
4251
  this.isAllSelected = false;
4120
4252
  this.isIndeterminate = false;
4121
- this.selectCheckboxRows = [];
4122
- this.treeIndeterminates = [];
4253
+ this.selectCheckboxMaps = {};
4254
+ this.treeIndeterminateMaps = {};
4123
4255
  return this.$nextTick();
4124
4256
  },
4125
4257
  /**
@@ -4144,7 +4276,7 @@ var Methods = {
4144
4276
  * 单选,行选中事件
4145
4277
  */
4146
4278
  triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) {
4147
- var oldValue = this.selectRow,
4279
+ var oldValue = this.selectRadioRow,
4148
4280
  radioOpts = this.radioOpts;
4149
4281
  var row = params.row;
4150
4282
  var newValue = row;
@@ -4197,7 +4329,7 @@ var Methods = {
4197
4329
  return this.$nextTick();
4198
4330
  },
4199
4331
  isCheckedByRadioRow: function isCheckedByRadioRow(row) {
4200
- return this.selectRow === row;
4332
+ return this.selectRadioRow === row;
4201
4333
  },
4202
4334
  handleCheckedRadioRow: function handleCheckedRadioRow(row, isForce) {
4203
4335
  var radioOpts = this.radioOpts;
@@ -4205,7 +4337,7 @@ var Methods = {
4205
4337
  if (row && (isForce || !checkMethod || checkMethod({
4206
4338
  row: row
4207
4339
  }))) {
4208
- this.selectRow = row;
4340
+ this.selectRadioRow = row;
4209
4341
  this.handleRadioReserveRow(row);
4210
4342
  }
4211
4343
  return this.$nextTick();
@@ -4235,7 +4367,7 @@ var Methods = {
4235
4367
  * 用于单选行,手动清空用户的选择
4236
4368
  */
4237
4369
  clearRadioRow: function clearRadioRow() {
4238
- this.selectRow = null;
4370
+ this.selectRadioRow = null;
4239
4371
  return this.$nextTick();
4240
4372
  },
4241
4373
  /**
@@ -4248,30 +4380,18 @@ var Methods = {
4248
4380
  * 用于单选行,获取当已选中的数据
4249
4381
  */
4250
4382
  getRadioRecord: function getRadioRecord(isFull) {
4251
- var treeConfig = this.treeConfig,
4252
- treeOpts = this.treeOpts,
4253
- selectRow = this.selectRow,
4383
+ var selectRadioRow = this.selectRadioRow,
4254
4384
  fullDataRowIdData = this.fullDataRowIdData,
4255
- afterFullData = this.afterFullData;
4256
- if (selectRow) {
4257
- var rowid = (0, _util.getRowid)(this, selectRow);
4385
+ afterFullRowMaps = this.afterFullRowMaps;
4386
+ if (selectRadioRow) {
4387
+ var rowid = (0, _util.getRowid)(this, selectRadioRow);
4258
4388
  if (isFull) {
4259
4389
  if (!fullDataRowIdData[rowid]) {
4260
- return selectRow;
4390
+ return selectRadioRow;
4261
4391
  }
4262
4392
  } else {
4263
- if (treeConfig) {
4264
- var rowkey = (0, _util.getRowkey)(this);
4265
- var matchObj = _xeUtils["default"].findTree(afterFullData, function (row) {
4266
- return rowid === _xeUtils["default"].get(row, rowkey);
4267
- }, treeOpts);
4268
- if (matchObj) {
4269
- return selectRow;
4270
- }
4271
- } else {
4272
- if (afterFullData.indexOf(selectRow) > -1) {
4273
- return selectRow;
4274
- }
4393
+ if (afterFullRowMaps[rowid]) {
4394
+ return selectRadioRow;
4275
4395
  }
4276
4396
  }
4277
4397
  }
@@ -4365,12 +4485,12 @@ var Methods = {
4365
4485
  * 如果存在规则,则校验
4366
4486
  */
4367
4487
  handleChangeCell: function handleChangeCell(evnt, params) {
4368
- var _this38 = this;
4488
+ var _this37 = this;
4369
4489
  this.checkValidate('blur')["catch"](function (e) {
4370
4490
  return e;
4371
4491
  }).then(function () {
4372
- _this38.handleActived(params, evnt).then(function () {
4373
- return _this38.checkValidate('change');
4492
+ _this37.handleActived(params, evnt).then(function () {
4493
+ return _this37.checkValidate('change');
4374
4494
  })["catch"](function (e) {
4375
4495
  return e;
4376
4496
  });
@@ -4464,7 +4584,7 @@ var Methods = {
4464
4584
  * 如果是双击模式,则激活为编辑状态
4465
4585
  */
4466
4586
  triggerCellDblclickEvent: function triggerCellDblclickEvent(evnt, params) {
4467
- var _this39 = this;
4587
+ var _this38 = this;
4468
4588
  var editStore = this.editStore,
4469
4589
  editConfig = this.editConfig,
4470
4590
  editOpts = this.editOpts;
@@ -4477,15 +4597,15 @@ var Methods = {
4477
4597
  this.checkValidate('blur')["catch"](function (e) {
4478
4598
  return e;
4479
4599
  }).then(function () {
4480
- _this39.handleActived(params, evnt).then(function () {
4481
- return _this39.checkValidate('change');
4600
+ _this38.handleActived(params, evnt).then(function () {
4601
+ return _this38.checkValidate('change');
4482
4602
  })["catch"](function (e) {
4483
4603
  return e;
4484
4604
  });
4485
4605
  });
4486
4606
  } else if (editOpts.mode === 'cell') {
4487
4607
  this.handleActived(params, evnt).then(function () {
4488
- return _this39.checkValidate('change');
4608
+ return _this38.checkValidate('change');
4489
4609
  })["catch"](function (e) {
4490
4610
  return e;
4491
4611
  });
@@ -4495,7 +4615,7 @@ var Methods = {
4495
4615
  this.emitEvent('cell-dblclick', params, evnt);
4496
4616
  },
4497
4617
  handleDefaultSort: function handleDefaultSort() {
4498
- var _this40 = this;
4618
+ var _this39 = this;
4499
4619
  var sortConfig = this.sortConfig,
4500
4620
  sortOpts = this.sortOpts;
4501
4621
  var defaultSort = sortOpts.defaultSort;
@@ -4508,7 +4628,7 @@ var Methods = {
4508
4628
  var field = item.field,
4509
4629
  order = item.order;
4510
4630
  if (field && order) {
4511
- var column = _this40.getColumnByField(field);
4631
+ var column = _this39.getColumnByField(field);
4512
4632
  if (column && column.sortable) {
4513
4633
  column.order = order;
4514
4634
  column.sortTime = Date.now() + index;
@@ -4555,7 +4675,7 @@ var Methods = {
4555
4675
  }
4556
4676
  },
4557
4677
  sort: function sort(sortConfs, sortOrder) {
4558
- var _this41 = this;
4678
+ var _this40 = this;
4559
4679
  var sortOpts = this.sortOpts;
4560
4680
  var multiple = sortOpts.multiple,
4561
4681
  remote = sortOpts.remote,
@@ -4581,14 +4701,14 @@ var Methods = {
4581
4701
  order = confs.order;
4582
4702
  var column = field;
4583
4703
  if (_xeUtils["default"].isString(field)) {
4584
- column = _this41.getColumnByField(field);
4704
+ column = _this40.getColumnByField(field);
4585
4705
  }
4586
4706
  if (column && (column.sortable || column.remoteSort)) {
4587
4707
  if (!firstSortColumn) {
4588
4708
  firstSortColumn = column;
4589
4709
  }
4590
4710
  if (orders.indexOf(order) === -1) {
4591
- order = getNextSortOrder(_this41, column);
4711
+ order = getNextSortOrder(_this40, column);
4592
4712
  }
4593
4713
  if (column.order !== order) {
4594
4714
  column.order = order;
@@ -4601,8 +4721,8 @@ var Methods = {
4601
4721
  this.handleTableData(true);
4602
4722
  }
4603
4723
  return this.$nextTick().then(function () {
4604
- _this41.updateCellAreas();
4605
- return _this41.updateStyle();
4724
+ _this40.updateCellAreas();
4725
+ return _this40.updateStyle();
4606
4726
  });
4607
4727
  }
4608
4728
  return this.$nextTick();
@@ -4717,17 +4837,19 @@ var Methods = {
4717
4837
  return rest && rest.expandLoaded;
4718
4838
  },
4719
4839
  clearRowExpandLoaded: function clearRowExpandLoaded(row) {
4720
- var _this42 = this;
4721
4840
  var expandOpts = this.expandOpts,
4722
- expandLazyLoadeds = this.expandLazyLoadeds,
4841
+ rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps,
4723
4842
  fullAllDataRowMap = this.fullAllDataRowMap;
4724
4843
  var lazy = expandOpts.lazy;
4844
+ var rowid = (0, _util.getRowid)(this, row);
4725
4845
  var rest = fullAllDataRowMap.get(row);
4726
4846
  if (lazy && rest) {
4727
4847
  rest.expandLoaded = false;
4728
- _xeUtils["default"].remove(expandLazyLoadeds, function (item) {
4729
- return _this42.eqRow(item, row);
4730
- });
4848
+ var rowTempExpandLazyLoadedMaps = _objectSpread({}, rowExpandLazyLoadedMaps);
4849
+ if (rowTempExpandLazyLoadedMaps[rowid]) {
4850
+ delete rowTempExpandLazyLoadedMaps[rowid];
4851
+ }
4852
+ this.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
4731
4853
  }
4732
4854
  return this.$nextTick();
4733
4855
  },
@@ -4736,13 +4858,14 @@ var Methods = {
4736
4858
  * @param {Row} row 行对象
4737
4859
  */
4738
4860
  reloadRowExpand: function reloadRowExpand(row) {
4739
- var _this43 = this;
4861
+ var _this41 = this;
4740
4862
  var expandOpts = this.expandOpts,
4741
- expandLazyLoadeds = this.expandLazyLoadeds;
4863
+ rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps;
4742
4864
  var lazy = expandOpts.lazy;
4743
- if (lazy && this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
4865
+ var rowid = (0, _util.getRowid)(this, row);
4866
+ if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
4744
4867
  this.clearRowExpandLoaded(row).then(function () {
4745
- return _this43.handleAsyncRowExpand(row);
4868
+ return _this41.handleAsyncRowExpand(row);
4746
4869
  });
4747
4870
  }
4748
4871
  return this.$nextTick();
@@ -4759,11 +4882,12 @@ var Methods = {
4759
4882
  */
4760
4883
  triggerRowExpandEvent: function triggerRowExpandEvent(evnt, params) {
4761
4884
  var expandOpts = this.expandOpts,
4762
- expandLazyLoadeds = this.expandLazyLoadeds,
4885
+ rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps,
4763
4886
  column = this.expandColumn;
4764
4887
  var row = params.row;
4765
4888
  var lazy = expandOpts.lazy;
4766
- if (!lazy || this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
4889
+ var rowid = (0, _util.getRowid)(this, row);
4890
+ if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
4767
4891
  var expanded = !this.isExpandByRow(row);
4768
4892
  var columnIndex = this.getColumnIndex(column);
4769
4893
  var $columnIndex = this.getVMColumnIndex(column);
@@ -4814,37 +4938,57 @@ var Methods = {
4814
4938
  treeOpts = this.treeOpts,
4815
4939
  tableFullData = this.tableFullData,
4816
4940
  tableFullTreeData = this.tableFullTreeData;
4941
+ var childrenField = treeOpts.children || treeOpts.childrenField;
4817
4942
  var expandedRows = [];
4818
4943
  if (treeConfig) {
4819
4944
  _xeUtils["default"].eachTree(tableFullTreeData, function (row) {
4820
4945
  expandedRows.push(row);
4821
- }, treeOpts);
4946
+ }, {
4947
+ children: childrenField
4948
+ });
4822
4949
  } else {
4823
4950
  expandedRows = tableFullData;
4824
4951
  }
4825
4952
  return this.setRowExpand(expandedRows, expanded);
4826
4953
  },
4827
4954
  handleAsyncRowExpand: function handleAsyncRowExpand(row) {
4828
- var _this44 = this;
4829
- var rest = this.fullAllDataRowMap.get(row);
4955
+ var _this42 = this;
4956
+ var fullAllDataRowMap = this.fullAllDataRowMap,
4957
+ expandOpts = this.expandOpts;
4958
+ var rest = fullAllDataRowMap.get(row);
4830
4959
  return new Promise(function (resolve) {
4831
- _this44.expandLazyLoadeds.push(row);
4832
- _this44.expandOpts.loadMethod({
4833
- $table: _this44,
4834
- row: row,
4835
- rowIndex: _this44.getRowIndex(row),
4836
- $rowIndex: _this44.getVMRowIndex(row)
4837
- }).then(function () {
4838
- rest.expandLoaded = true;
4839
- _this44.rowExpandeds.push(row);
4840
- })["catch"](function () {
4841
- rest.expandLoaded = false;
4842
- })["finally"](function () {
4843
- _xeUtils["default"].remove(_this44.expandLazyLoadeds, function (item) {
4844
- return _this44.eqRow(item, row);
4960
+ var loadMethod = expandOpts.loadMethod;
4961
+ if (loadMethod) {
4962
+ var rowExpandLazyLoadedMaps = _this42.rowExpandLazyLoadedMaps;
4963
+ var rowTempExpandLazyLoadedMaps = _objectSpread({}, rowExpandLazyLoadedMaps);
4964
+ var rowid = (0, _util.getRowid)(_this42, row);
4965
+ rowTempExpandLazyLoadedMaps[rowid] = row;
4966
+ _this42.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
4967
+ loadMethod({
4968
+ $table: _this42,
4969
+ row: row,
4970
+ rowIndex: _this42.getRowIndex(row),
4971
+ $rowIndex: _this42.getVMRowIndex(row)
4972
+ }).then(function () {
4973
+ rest.expandLoaded = true;
4974
+ var rowExpandedMaps = _this42.rowExpandedMaps;
4975
+ var rowTempExpandedMaps = _objectSpread({}, rowExpandedMaps);
4976
+ rowTempExpandedMaps[rowid] = row;
4977
+ _this42.rowExpandedMaps = rowTempExpandedMaps;
4978
+ })["catch"](function () {
4979
+ rest.expandLoaded = false;
4980
+ })["finally"](function () {
4981
+ var rowExpandLazyLoadedMaps = _this42.rowExpandLazyLoadedMaps;
4982
+ var rowTempExpandLazyLoadedMaps = _objectSpread({}, rowExpandLazyLoadedMaps);
4983
+ if (rowTempExpandLazyLoadedMaps[rowid]) {
4984
+ delete rowTempExpandLazyLoadedMaps[rowid];
4985
+ }
4986
+ _this42.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
4987
+ resolve(_this42.$nextTick().then(_this42.recalculate));
4845
4988
  });
4846
- resolve(_this44.$nextTick().then(_this44.recalculate));
4847
- });
4989
+ } else {
4990
+ resolve();
4991
+ }
4848
4992
  });
4849
4993
  },
4850
4994
  /**
@@ -4855,12 +4999,13 @@ var Methods = {
4855
4999
  * @param {Boolean} expanded 是否展开
4856
5000
  */
4857
5001
  setRowExpand: function setRowExpand(rows, expanded) {
4858
- var _this45 = this;
4859
- var fullAllDataRowMap = this.fullAllDataRowMap,
4860
- expandLazyLoadeds = this.expandLazyLoadeds,
5002
+ var _this43 = this;
5003
+ var rowExpandedMaps = this.rowExpandedMaps,
5004
+ fullAllDataRowIdData = this.fullAllDataRowIdData,
5005
+ rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps,
4861
5006
  expandOpts = this.expandOpts,
4862
5007
  column = this.expandColumn;
4863
- var rowExpandeds = this.rowExpandeds;
5008
+ var rExpandedMaps = _objectSpread({}, rowExpandedMaps);
4864
5009
  var reserve = expandOpts.reserve,
4865
5010
  lazy = expandOpts.lazy,
4866
5011
  accordion = expandOpts.accordion,
@@ -4874,7 +5019,7 @@ var Methods = {
4874
5019
  }
4875
5020
  if (accordion) {
4876
5021
  // 只能同时展开一个
4877
- rowExpandeds = [];
5022
+ rExpandedMaps = {};
4878
5023
  rows = rows.slice(rows.length - 1, rows.length);
4879
5024
  }
4880
5025
  var validRows = toggleMethod ? rows.filter(function (row) {
@@ -4884,34 +5029,38 @@ var Methods = {
4884
5029
  columnIndex: columnIndex,
4885
5030
  $columnIndex: $columnIndex,
4886
5031
  row: row,
4887
- rowIndex: _this45.getRowIndex(row),
4888
- $rowIndex: _this45.getVMRowIndex(row)
5032
+ rowIndex: _this43.getRowIndex(row),
5033
+ $rowIndex: _this43.getVMRowIndex(row)
4889
5034
  });
4890
5035
  }) : rows;
4891
5036
  if (expanded) {
4892
5037
  validRows.forEach(function (row) {
4893
- if (_this45.findRowIndexOf(rowExpandeds, row) === -1) {
4894
- var rest = fullAllDataRowMap.get(row);
4895
- var isLoad = lazy && !rest.expandLoaded && _this45.findRowIndexOf(expandLazyLoadeds, row) === -1;
5038
+ var rowid = (0, _util.getRowid)(_this43, row);
5039
+ if (!rExpandedMaps[rowid]) {
5040
+ var rest = fullAllDataRowIdData[rowid];
5041
+ var isLoad = lazy && !rest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
4896
5042
  if (isLoad) {
4897
- lazyRests.push(_this45.handleAsyncRowExpand(row));
5043
+ lazyRests.push(_this43.handleAsyncRowExpand(row));
4898
5044
  } else {
4899
- rowExpandeds.push(row);
5045
+ rExpandedMaps[rowid] = row;
4900
5046
  }
4901
5047
  }
4902
5048
  });
4903
5049
  } else {
4904
- _xeUtils["default"].remove(rowExpandeds, function (row) {
4905
- return _this45.findRowIndexOf(validRows, row) > -1;
5050
+ validRows.forEach(function (item) {
5051
+ var rowid = (0, _util.getRowid)(_this43, item);
5052
+ if (rExpandedMaps[rowid]) {
5053
+ delete rExpandedMaps[rowid];
5054
+ }
4906
5055
  });
4907
5056
  }
4908
5057
  if (reserve) {
4909
5058
  validRows.forEach(function (row) {
4910
- return _this45.handleRowExpandReserve(row, expanded);
5059
+ return _this43.handleRowExpandReserve(row, expanded);
4911
5060
  });
4912
5061
  }
4913
5062
  }
4914
- this.rowExpandeds = rowExpandeds;
5063
+ this.rowExpandedMaps = rExpandedMaps;
4915
5064
  return Promise.all(lazyRests).then(this.recalculate);
4916
5065
  },
4917
5066
  /**
@@ -4919,28 +5068,28 @@ var Methods = {
4919
5068
  * @param {Row} row 行对象
4920
5069
  */
4921
5070
  isExpandByRow: function isExpandByRow(row) {
4922
- var rowExpandeds = this.rowExpandeds;
4923
- return this.findRowIndexOf(rowExpandeds, row) > -1;
5071
+ var rowExpandedMaps = this.rowExpandedMaps;
5072
+ var rowid = (0, _util.getRowid)(this, row);
5073
+ return !!rowExpandedMaps[rowid];
4924
5074
  },
4925
5075
  /**
4926
5076
  * 手动清空展开行状态,数据会恢复成未展开的状态
4927
5077
  */
4928
5078
  clearRowExpand: function clearRowExpand() {
4929
- var _this46 = this;
5079
+ var _this44 = this;
4930
5080
  var expandOpts = this.expandOpts,
4931
- rowExpandeds = this.rowExpandeds,
4932
5081
  tableFullData = this.tableFullData;
4933
5082
  var reserve = expandOpts.reserve;
4934
- var isExists = rowExpandeds.length;
4935
- this.rowExpandeds = [];
5083
+ var expList = this.getRowExpandRecords();
5084
+ this.rowExpandedMaps = {};
4936
5085
  if (reserve) {
4937
5086
  tableFullData.forEach(function (row) {
4938
- return _this46.handleRowExpandReserve(row, false);
5087
+ return _this44.handleRowExpandReserve(row, false);
4939
5088
  });
4940
5089
  }
4941
5090
  return this.$nextTick().then(function () {
4942
- if (isExists) {
4943
- _this46.recalculate();
5091
+ if (expList.length) {
5092
+ _this44.recalculate();
4944
5093
  }
4945
5094
  });
4946
5095
  },
@@ -4961,13 +5110,25 @@ var Methods = {
4961
5110
  }
4962
5111
  },
4963
5112
  getRowExpandRecords: function getRowExpandRecords() {
4964
- return this.rowExpandeds.slice(0);
5113
+ var rest = [];
5114
+ _xeUtils["default"].each(this.rowExpandedMaps, function (item) {
5115
+ if (item) {
5116
+ rest.push(item);
5117
+ }
5118
+ });
5119
+ return rest;
4965
5120
  },
4966
5121
  getTreeExpandRecords: function getTreeExpandRecords() {
4967
- return this.treeExpandeds.slice(0);
5122
+ var rest = [];
5123
+ _xeUtils["default"].each(this.treeExpandedMaps, function (item) {
5124
+ if (item) {
5125
+ rest.push(item);
5126
+ }
5127
+ });
5128
+ return rest;
4968
5129
  },
4969
5130
  /**
4970
- * 获取数表格状态
5131
+ * 获取树表格状态
4971
5132
  */
4972
5133
  getTreeStatus: function getTreeStatus() {
4973
5134
  if (this.treeConfig) {
@@ -4988,16 +5149,17 @@ var Methods = {
4988
5149
  },
4989
5150
  clearTreeExpandLoaded: function clearTreeExpandLoaded(row) {
4990
5151
  var treeOpts = this.treeOpts,
4991
- treeExpandeds = this.treeExpandeds,
5152
+ treeExpandedMaps = this.treeExpandedMaps,
4992
5153
  fullAllDataRowMap = this.fullAllDataRowMap;
4993
5154
  var transform = treeOpts.transform,
4994
5155
  lazy = treeOpts.lazy;
5156
+ var rowid = (0, _util.getRowid)(this, row);
4995
5157
  var rest = fullAllDataRowMap.get(row);
4996
5158
  if (lazy && rest) {
4997
5159
  rest.treeLoaded = false;
4998
- _xeUtils["default"].remove(treeExpandeds, function (item) {
4999
- return row === item;
5000
- });
5160
+ if (treeExpandedMaps[rowid]) {
5161
+ delete treeExpandedMaps[rowid];
5162
+ }
5001
5163
  }
5002
5164
  if (transform) {
5003
5165
  this.handleVirtualTreeToList();
@@ -5010,22 +5172,23 @@ var Methods = {
5010
5172
  * @param {Row} row 行对象
5011
5173
  */
5012
5174
  reloadTreeExpand: function reloadTreeExpand(row) {
5013
- var _this47 = this;
5175
+ var _this45 = this;
5014
5176
  var treeOpts = this.treeOpts,
5015
- treeLazyLoadeds = this.treeLazyLoadeds;
5177
+ treeExpandLazyLoadedMaps = this.treeExpandLazyLoadedMaps;
5016
5178
  var transform = treeOpts.transform,
5017
5179
  lazy = treeOpts.lazy;
5018
5180
  var hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
5019
- if (lazy && row[hasChildField] && treeLazyLoadeds.indexOf(row) === -1) {
5181
+ var rowid = (0, _util.getRowid)(this, row);
5182
+ if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
5020
5183
  this.clearTreeExpandLoaded(row).then(function () {
5021
- return _this47.handleAsyncTreeExpandChilds(row);
5184
+ return _this45.handleAsyncTreeExpandChilds(row);
5022
5185
  }).then(function () {
5023
5186
  if (transform) {
5024
- _this47.handleVirtualTreeToList();
5025
- return _this47.handleTableData();
5187
+ _this45.handleVirtualTreeToList();
5188
+ return _this45.handleTableData();
5026
5189
  }
5027
5190
  }).then(function () {
5028
- return _this47.recalculate();
5191
+ return _this45.recalculate();
5029
5192
  });
5030
5193
  }
5031
5194
  return this.$nextTick();
@@ -5042,11 +5205,12 @@ var Methods = {
5042
5205
  */
5043
5206
  triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, params) {
5044
5207
  var treeOpts = this.treeOpts,
5045
- treeLazyLoadeds = this.treeLazyLoadeds;
5208
+ treeExpandLazyLoadedMaps = this.treeExpandLazyLoadedMaps;
5046
5209
  var row = params.row,
5047
5210
  column = params.column;
5048
5211
  var lazy = treeOpts.lazy;
5049
- if (!lazy || treeLazyLoadeds.indexOf(row) === -1) {
5212
+ var rowid = (0, _util.getRowid)(this, row);
5213
+ if (!lazy || !treeExpandLazyLoadedMaps[rowid]) {
5050
5214
  var expanded = !this.isTreeExpandByRow(row);
5051
5215
  var columnIndex = this.getColumnIndex(column);
5052
5216
  var $columnIndex = this.getVMColumnIndex(column);
@@ -5076,6 +5240,7 @@ var Methods = {
5076
5240
  if (treeConfig) {
5077
5241
  var expandAll = treeOpts.expandAll,
5078
5242
  expandRowKeys = treeOpts.expandRowKeys;
5243
+ var childrenField = treeOpts.children || treeOpts.childrenField;
5079
5244
  if (expandAll) {
5080
5245
  this.setAllTreeExpand(true);
5081
5246
  } else if (expandRowKeys) {
@@ -5084,7 +5249,9 @@ var Methods = {
5084
5249
  expandRowKeys.forEach(function (rowid) {
5085
5250
  var matchObj = _xeUtils["default"].findTree(tableFullData, function (item) {
5086
5251
  return rowid === _xeUtils["default"].get(item, rowkey);
5087
- }, treeOpts);
5252
+ }, {
5253
+ children: childrenField
5254
+ });
5088
5255
  if (matchObj) {
5089
5256
  defExpandeds.push(matchObj.item);
5090
5257
  }
@@ -5094,59 +5261,67 @@ var Methods = {
5094
5261
  }
5095
5262
  },
5096
5263
  handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
5097
- var _this48 = this;
5098
- var fullAllDataRowMap = this.fullAllDataRowMap,
5099
- treeExpandeds = this.treeExpandeds,
5100
- treeOpts = this.treeOpts,
5101
- treeLazyLoadeds = this.treeLazyLoadeds,
5264
+ var _this46 = this;
5265
+ var treeOpts = this.treeOpts,
5102
5266
  checkboxOpts = this.checkboxOpts;
5103
5267
  var transform = treeOpts.transform,
5104
5268
  loadMethod = treeOpts.loadMethod;
5105
5269
  var checkStrictly = checkboxOpts.checkStrictly;
5106
- var rest = fullAllDataRowMap.get(row);
5107
5270
  return new Promise(function (resolve) {
5108
- treeLazyLoadeds.push(row);
5109
- loadMethod({
5110
- $table: _this48,
5111
- row: row
5112
- }).then(function (childRecords) {
5113
- // 响应成功后则展开行,并将子节点挂载到该节点下
5114
- rest.treeLoaded = true;
5115
- _xeUtils["default"].remove(treeLazyLoadeds, function (item) {
5116
- return item === row;
5117
- });
5118
- if (!_xeUtils["default"].isArray(childRecords)) {
5119
- childRecords = [];
5120
- }
5121
- if (childRecords) {
5122
- return _this48.loadTreeChildren(row, childRecords).then(function (childRows) {
5123
- if (childRows.length && treeExpandeds.indexOf(row) === -1) {
5124
- treeExpandeds.push(row);
5125
- }
5126
- // 如果当前节点已选中,则展开后子节点也被选中
5127
- if (!checkStrictly && _this48.isCheckedByCheckboxRow(row)) {
5128
- _this48.handleCheckedCheckboxRow(childRows, true, true);
5129
- }
5130
- return _this48.$nextTick().then(function () {
5131
- if (transform) {
5132
- return _this48.handleTableData();
5271
+ if (loadMethod) {
5272
+ var fullAllDataRowMap = _this46.fullAllDataRowMap,
5273
+ treeExpandLazyLoadedMaps = _this46.treeExpandLazyLoadedMaps;
5274
+ var rowid = (0, _util.getRowid)(_this46, row);
5275
+ var rest = fullAllDataRowMap.get(row);
5276
+ treeExpandLazyLoadedMaps[rowid] = row;
5277
+ loadMethod({
5278
+ $table: _this46,
5279
+ row: row
5280
+ }).then(function (childRecords) {
5281
+ // 响应成功后则展开行,并将子节点挂载到该节点下
5282
+ rest.treeLoaded = true;
5283
+ if (treeExpandLazyLoadedMaps[rowid]) {
5284
+ treeExpandLazyLoadedMaps[rowid] = null;
5285
+ }
5286
+ if (!_xeUtils["default"].isArray(childRecords)) {
5287
+ childRecords = [];
5288
+ }
5289
+ if (childRecords) {
5290
+ return _this46.loadTreeChildren(row, childRecords).then(function (childRows) {
5291
+ var treeExpandedMaps = _this46.treeExpandedMaps;
5292
+ var treeTempExpandedMaps = _objectSpread({}, treeExpandedMaps);
5293
+ if (childRows.length && !treeTempExpandedMaps[rowid]) {
5294
+ treeTempExpandedMaps[rowid] = row;
5295
+ _this46.treeExpandedMaps = treeTempExpandedMaps;
5133
5296
  }
5297
+ // 如果当前节点已选中,则展开后子节点也被选中
5298
+ if (!checkStrictly && _this46.isCheckedByCheckboxRow(row)) {
5299
+ _this46.handleCheckedCheckboxRow(childRows, true, true);
5300
+ }
5301
+ return _this46.$nextTick().then(function () {
5302
+ if (transform) {
5303
+ return _this46.handleTableData();
5304
+ }
5305
+ });
5134
5306
  });
5307
+ }
5308
+ })["catch"](function () {
5309
+ // 如果响应异常,则不展开,再次点击后将重新触发懒加载
5310
+ rest.treeLoaded = false;
5311
+ var treeExpandLazyLoadedMaps = _this46.treeExpandLazyLoadedMaps;
5312
+ if (treeExpandLazyLoadedMaps[rowid]) {
5313
+ treeExpandLazyLoadedMaps[rowid] = null;
5314
+ }
5315
+ })["finally"](function () {
5316
+ _this46.$nextTick().then(function () {
5317
+ return _this46.recalculate();
5318
+ }).then(function () {
5319
+ return resolve();
5135
5320
  });
5136
- }
5137
- })["catch"](function () {
5138
- // 如果响应异常,则不展开,再次点击后将重新触发懒加载
5139
- rest.treeLoaded = false;
5140
- _xeUtils["default"].remove(treeLazyLoadeds, function (item) {
5141
- return item === row;
5142
- });
5143
- })["finally"](function () {
5144
- _this48.$nextTick().then(function () {
5145
- return _this48.recalculate();
5146
- }).then(function () {
5147
- return resolve();
5148
5321
  });
5149
- });
5322
+ } else {
5323
+ resolve();
5324
+ }
5150
5325
  });
5151
5326
  },
5152
5327
  /**
@@ -5164,7 +5339,9 @@ var Methods = {
5164
5339
  if (lazy || rowChildren && rowChildren.length) {
5165
5340
  expandeds.push(row);
5166
5341
  }
5167
- }, treeOpts);
5342
+ }, {
5343
+ children: childrenField
5344
+ });
5168
5345
  return this.setTreeExpand(expandeds, expanded);
5169
5346
  },
5170
5347
  /**
@@ -5174,17 +5351,18 @@ var Methods = {
5174
5351
  * @returns
5175
5352
  */
5176
5353
  handleBaseTreeExpand: function handleBaseTreeExpand(rows, expanded) {
5177
- var _this49 = this;
5354
+ var _this47 = this;
5178
5355
  var fullAllDataRowMap = this.fullAllDataRowMap,
5179
5356
  tableFullData = this.tableFullData,
5180
- treeExpandeds = this.treeExpandeds,
5357
+ treeExpandedMaps = this.treeExpandedMaps,
5181
5358
  treeOpts = this.treeOpts,
5182
- treeLazyLoadeds = this.treeLazyLoadeds,
5359
+ treeExpandLazyLoadedMaps = this.treeExpandLazyLoadedMaps,
5183
5360
  treeNodeColumn = this.treeNodeColumn;
5184
5361
  var reserve = treeOpts.reserve,
5185
5362
  lazy = treeOpts.lazy,
5186
5363
  accordion = treeOpts.accordion,
5187
5364
  toggleMethod = treeOpts.toggleMethod;
5365
+ var treeTempExpandedMaps = _objectSpread({}, treeExpandedMaps);
5188
5366
  var childrenField = treeOpts.children || treeOpts.childrenField;
5189
5367
  var hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
5190
5368
  var result = [];
@@ -5204,38 +5382,48 @@ var Methods = {
5204
5382
  // 同一级只能展开一个
5205
5383
  var matchObj = _xeUtils["default"].findTree(tableFullData, function (item) {
5206
5384
  return item === validRows[0];
5207
- }, treeOpts);
5385
+ }, {
5386
+ children: childrenField
5387
+ });
5208
5388
  if (matchObj) {
5209
- _xeUtils["default"].remove(treeExpandeds, function (item) {
5210
- return matchObj.items.indexOf(item) > -1;
5389
+ matchObj.items.forEach(function (item) {
5390
+ var rowid = (0, _util.getRowid)(_this47, item);
5391
+ if (treeTempExpandedMaps[rowid]) {
5392
+ delete treeTempExpandedMaps[rowid];
5393
+ }
5211
5394
  });
5212
5395
  }
5213
5396
  }
5214
5397
  if (expanded) {
5215
5398
  validRows.forEach(function (row) {
5216
- if (treeExpandeds.indexOf(row) === -1) {
5399
+ var rowid = (0, _util.getRowid)(_this47, row);
5400
+ if (!treeTempExpandedMaps[rowid]) {
5217
5401
  var rest = fullAllDataRowMap.get(row);
5218
- var isLoad = lazy && row[hasChildField] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1;
5402
+ var isLoad = lazy && row[hasChildField] && !rest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
5219
5403
  // 是否使用懒加载
5220
5404
  if (isLoad) {
5221
- result.push(_this49.handleAsyncTreeExpandChilds(row));
5405
+ result.push(_this47.handleAsyncTreeExpandChilds(row));
5222
5406
  } else {
5223
5407
  if (row[childrenField] && row[childrenField].length) {
5224
- treeExpandeds.push(row);
5408
+ treeTempExpandedMaps[rowid] = row;
5225
5409
  }
5226
5410
  }
5227
5411
  }
5228
5412
  });
5229
5413
  } else {
5230
- _xeUtils["default"].remove(treeExpandeds, function (row) {
5231
- return validRows.indexOf(row) > -1;
5414
+ validRows.forEach(function (item) {
5415
+ var rowid = (0, _util.getRowid)(_this47, item);
5416
+ if (treeTempExpandedMaps[rowid]) {
5417
+ delete treeTempExpandedMaps[rowid];
5418
+ }
5232
5419
  });
5233
5420
  }
5234
5421
  if (reserve) {
5235
5422
  validRows.forEach(function (row) {
5236
- return _this49.handleTreeExpandReserve(row, expanded);
5423
+ return _this47.handleTreeExpandReserve(row, expanded);
5237
5424
  });
5238
5425
  }
5426
+ this.treeExpandedMaps = treeTempExpandedMaps;
5239
5427
  return Promise.all(result).then(this.recalculate);
5240
5428
  },
5241
5429
  /**
@@ -5245,12 +5433,12 @@ var Methods = {
5245
5433
  * @returns
5246
5434
  */
5247
5435
  handleVirtualTreeExpand: function handleVirtualTreeExpand(rows, expanded) {
5248
- var _this50 = this;
5436
+ var _this48 = this;
5249
5437
  return this.handleBaseTreeExpand(rows, expanded).then(function () {
5250
- _this50.handleVirtualTreeToList();
5251
- return _this50.handleTableData();
5438
+ _this48.handleVirtualTreeToList();
5439
+ return _this48.handleTableData();
5252
5440
  }).then(function () {
5253
- return _this50.recalculate();
5441
+ return _this48.recalculate();
5254
5442
  });
5255
5443
  },
5256
5444
  /**
@@ -5283,33 +5471,36 @@ var Methods = {
5283
5471
  * @param {Row} row 行对象
5284
5472
  */
5285
5473
  isTreeExpandByRow: function isTreeExpandByRow(row) {
5286
- return this.treeExpandeds.indexOf(row) > -1;
5474
+ var treeExpandedMaps = this.treeExpandedMaps;
5475
+ return !!treeExpandedMaps[(0, _util.getRowid)(this, row)];
5287
5476
  },
5288
5477
  /**
5289
5478
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
5290
5479
  */
5291
5480
  clearTreeExpand: function clearTreeExpand() {
5292
- var _this51 = this;
5481
+ var _this49 = this;
5293
5482
  var treeOpts = this.treeOpts,
5294
- treeExpandeds = this.treeExpandeds,
5295
5483
  tableFullData = this.tableFullData;
5296
5484
  var transform = treeOpts.transform,
5297
5485
  reserve = treeOpts.reserve;
5298
- var isExists = treeExpandeds.length;
5299
- this.treeExpandeds = [];
5486
+ var childrenField = treeOpts.children || treeOpts.childrenField;
5487
+ var expList = this.getTreeExpandRecords();
5488
+ this.treeExpandedMaps = {};
5300
5489
  if (reserve) {
5301
5490
  _xeUtils["default"].eachTree(tableFullData, function (row) {
5302
- return _this51.handleTreeExpandReserve(row, false);
5303
- }, treeOpts);
5491
+ return _this49.handleTreeExpandReserve(row, false);
5492
+ }, {
5493
+ children: childrenField
5494
+ });
5304
5495
  }
5305
5496
  return this.handleTableData().then(function () {
5306
5497
  if (transform) {
5307
- _this51.handleVirtualTreeToList();
5308
- return _this51.handleTableData();
5498
+ _this49.handleVirtualTreeToList();
5499
+ return _this49.handleTableData();
5309
5500
  }
5310
5501
  }).then(function () {
5311
- if (isExists) {
5312
- _this51.recalculate();
5502
+ if (expList.length) {
5503
+ _this49.recalculate();
5313
5504
  }
5314
5505
  });
5315
5506
  },
@@ -5428,28 +5619,28 @@ var Methods = {
5428
5619
  },
5429
5620
  // 计算可视渲染相关数据
5430
5621
  computeScrollLoad: function computeScrollLoad() {
5431
- var _this52 = this;
5622
+ var _this50 = this;
5432
5623
  return this.$nextTick().then(function () {
5433
- var sYOpts = _this52.sYOpts,
5434
- sXOpts = _this52.sXOpts,
5435
- scrollXLoad = _this52.scrollXLoad,
5436
- scrollYLoad = _this52.scrollYLoad,
5437
- scrollXStore = _this52.scrollXStore,
5438
- scrollYStore = _this52.scrollYStore;
5624
+ var sYOpts = _this50.sYOpts,
5625
+ sXOpts = _this50.sXOpts,
5626
+ scrollXLoad = _this50.scrollXLoad,
5627
+ scrollYLoad = _this50.scrollYLoad,
5628
+ scrollXStore = _this50.scrollXStore,
5629
+ scrollYStore = _this50.scrollYStore;
5439
5630
  // 计算 X 逻辑
5440
5631
  if (scrollXLoad) {
5441
- var _computeVirtualX3 = computeVirtualX(_this52),
5632
+ var _computeVirtualX3 = computeVirtualX(_this50),
5442
5633
  visibleXSize = _computeVirtualX3.visibleSize;
5443
5634
  var offsetXSize = sXOpts.oSize ? _xeUtils["default"].toNumber(sXOpts.oSize) : _dom.browse.msie ? 10 : _dom.browse.edge ? 5 : 0;
5444
5635
  scrollXStore.offsetSize = offsetXSize;
5445
5636
  scrollXStore.visibleSize = visibleXSize;
5446
5637
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
5447
- _this52.updateScrollXData();
5638
+ _this50.updateScrollXData();
5448
5639
  } else {
5449
- _this52.updateScrollXSpace();
5640
+ _this50.updateScrollXSpace();
5450
5641
  }
5451
5642
  // 计算 Y 逻辑
5452
- var _computeVirtualY = computeVirtualY(_this52),
5643
+ var _computeVirtualY = computeVirtualY(_this50),
5453
5644
  rowHeight = _computeVirtualY.rowHeight,
5454
5645
  visibleYSize = _computeVirtualY.visibleSize;
5455
5646
  scrollYStore.rowHeight = rowHeight;
@@ -5458,12 +5649,12 @@ var Methods = {
5458
5649
  scrollYStore.offsetSize = offsetYSize;
5459
5650
  scrollYStore.visibleSize = visibleYSize;
5460
5651
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
5461
- _this52.updateScrollYData();
5652
+ _this50.updateScrollYData();
5462
5653
  } else {
5463
- _this52.updateScrollYSpace();
5654
+ _this50.updateScrollYSpace();
5464
5655
  }
5465
- _this52.rowHeight = rowHeight;
5466
- _this52.$nextTick(_this52.updateStyle);
5656
+ _this50.rowHeight = rowHeight;
5657
+ _this50.$nextTick(_this50.updateStyle);
5467
5658
  });
5468
5659
  },
5469
5660
  handleTableColumn: function handleTableColumn() {
@@ -5473,11 +5664,11 @@ var Methods = {
5473
5664
  this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
5474
5665
  },
5475
5666
  updateScrollXData: function updateScrollXData() {
5476
- var _this53 = this;
5667
+ var _this51 = this;
5477
5668
  // this.tableColumn = []
5478
5669
  this.$nextTick(function () {
5479
- _this53.handleTableColumn();
5480
- _this53.updateScrollXSpace();
5670
+ _this51.handleTableColumn();
5671
+ _this51.updateScrollXSpace();
5481
5672
  });
5482
5673
  },
5483
5674
  // 更新横向 X 可视渲染上下剩余空间大小
@@ -5528,11 +5719,11 @@ var Methods = {
5528
5719
  }
5529
5720
  },
5530
5721
  updateScrollYData: function updateScrollYData() {
5531
- var _this54 = this;
5722
+ var _this52 = this;
5532
5723
  // this.tableData = []
5533
5724
  this.$nextTick(function () {
5534
- _this54.handleTableData();
5535
- _this54.updateScrollYSpace();
5725
+ _this52.handleTableData();
5726
+ _this52.updateScrollYSpace();
5536
5727
  });
5537
5728
  },
5538
5729
  // 更新纵向 Y 可视渲染上下剩余空间大小
@@ -5573,7 +5764,7 @@ var Methods = {
5573
5764
  * @param {Number} scrollTop 上距离
5574
5765
  */
5575
5766
  scrollTo: function scrollTo(scrollLeft, scrollTop) {
5576
- var _this55 = this;
5767
+ var _this53 = this;
5577
5768
  var $refs = this.$refs;
5578
5769
  var tableBody = $refs.tableBody,
5579
5770
  rightBody = $refs.rightBody,
@@ -5590,7 +5781,7 @@ var Methods = {
5590
5781
  if (this.scrollXLoad || this.scrollYLoad) {
5591
5782
  return new Promise(function (resolve) {
5592
5783
  return setTimeout(function () {
5593
- return resolve(_this55.$nextTick());
5784
+ return resolve(_this53.$nextTick());
5594
5785
  }, 50);
5595
5786
  });
5596
5787
  }
@@ -5632,26 +5823,29 @@ var Methods = {
5632
5823
  * @param {Row} row 行对象
5633
5824
  */
5634
5825
  scrollToTreeRow: function scrollToTreeRow(row) {
5635
- var _this56 = this;
5826
+ var _this54 = this;
5636
5827
  var tableFullData = this.tableFullData,
5637
5828
  treeConfig = this.treeConfig,
5638
5829
  treeOpts = this.treeOpts;
5830
+ var childrenField = treeOpts.children || treeOpts.childrenField;
5639
5831
  var rests = [];
5640
5832
  if (treeConfig) {
5641
5833
  var matchObj = _xeUtils["default"].findTree(tableFullData, function (item) {
5642
5834
  return item === row;
5643
- }, treeOpts);
5835
+ }, {
5836
+ children: childrenField
5837
+ });
5644
5838
  if (matchObj) {
5645
5839
  var nodes = matchObj.nodes;
5646
5840
  nodes.forEach(function (row, index) {
5647
- if (index < nodes.length - 1 && !_this56.isTreeExpandByRow(row)) {
5648
- rests.push(_this56.setTreeExpand(row, true));
5841
+ if (index < nodes.length - 1 && !_this54.isTreeExpandByRow(row)) {
5842
+ rests.push(_this54.setTreeExpand(row, true));
5649
5843
  }
5650
5844
  });
5651
5845
  }
5652
5846
  }
5653
5847
  return Promise.all(rests).then(function () {
5654
- return (0, _util.rowToVisible)(_this56, row);
5848
+ return (0, _util.rowToVisible)(_this54, row);
5655
5849
  });
5656
5850
  },
5657
5851
  /**
@@ -5706,30 +5900,30 @@ var Methods = {
5706
5900
  * 如果单元格配置了校验规则,则会进行校验
5707
5901
  */
5708
5902
  updateStatus: function updateStatus(slotParams, cellValue) {
5709
- var _this57 = this;
5903
+ var _this55 = this;
5710
5904
  var customVal = !_xeUtils["default"].isUndefined(cellValue);
5711
5905
  return this.$nextTick().then(function () {
5712
- var $refs = _this57.$refs,
5713
- editRules = _this57.editRules,
5714
- validStore = _this57.validStore;
5906
+ var $refs = _this55.$refs,
5907
+ editRules = _this55.editRules,
5908
+ validStore = _this55.validStore;
5715
5909
  if (slotParams && $refs.tableBody && editRules) {
5716
5910
  var row = slotParams.row,
5717
5911
  column = slotParams.column;
5718
5912
  var type = 'change';
5719
- if (_this57.hasCellRules(type, row, column)) {
5720
- var cell = _this57.getCell(row, column);
5913
+ if (_this55.hasCellRules(type, row, column)) {
5914
+ var cell = _this55.getCell(row, column);
5721
5915
  if (cell) {
5722
- return _this57.validCellRules(type, row, column, cellValue).then(function () {
5916
+ return _this55.validCellRules(type, row, column, cellValue).then(function () {
5723
5917
  if (customVal && validStore.visible) {
5724
5918
  setCellValue(row, column, cellValue);
5725
5919
  }
5726
- _this57.clearValidate();
5920
+ _this55.clearValidate();
5727
5921
  })["catch"](function (_ref8) {
5728
5922
  var rule = _ref8.rule;
5729
5923
  if (customVal) {
5730
5924
  setCellValue(row, column, cellValue);
5731
5925
  }
5732
- _this57.showValidTooltip({
5926
+ _this55.showValidTooltip({
5733
5927
  rule: rule,
5734
5928
  row: row,
5735
5929
  column: column,
@@ -5749,13 +5943,13 @@ var Methods = {
5749
5943
  * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
5750
5944
  */
5751
5945
  setMergeCells: function setMergeCells(merges) {
5752
- var _this58 = this;
5946
+ var _this56 = this;
5753
5947
  if (this.spanMethod) {
5754
5948
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-cells', 'span-method']);
5755
5949
  }
5756
5950
  setMerges(this, merges, this.mergeList, this.afterFullData);
5757
5951
  return this.$nextTick().then(function () {
5758
- return _this58.updateCellAreas();
5952
+ return _this56.updateCellAreas();
5759
5953
  });
5760
5954
  },
5761
5955
  /**
@@ -5763,13 +5957,13 @@ var Methods = {
5763
5957
  * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
5764
5958
  */
5765
5959
  removeMergeCells: function removeMergeCells(merges) {
5766
- var _this59 = this;
5960
+ var _this57 = this;
5767
5961
  if (this.spanMethod) {
5768
5962
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-cells', 'span-method']);
5769
5963
  }
5770
5964
  var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
5771
5965
  return this.$nextTick().then(function () {
5772
- _this59.updateCellAreas();
5966
+ _this57.updateCellAreas();
5773
5967
  return rest;
5774
5968
  });
5775
5969
  },
@@ -5790,23 +5984,23 @@ var Methods = {
5790
5984
  this.setMergeFooterItems(this.mergeFooterItems);
5791
5985
  },
5792
5986
  setMergeFooterItems: function setMergeFooterItems(merges) {
5793
- var _this60 = this;
5987
+ var _this58 = this;
5794
5988
  if (this.footerSpanMethod) {
5795
5989
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
5796
5990
  }
5797
5991
  setMerges(this, merges, this.mergeFooterList, null);
5798
5992
  return this.$nextTick().then(function () {
5799
- return _this60.updateCellAreas();
5993
+ return _this58.updateCellAreas();
5800
5994
  });
5801
5995
  },
5802
5996
  removeMergeFooterItems: function removeMergeFooterItems(merges) {
5803
- var _this61 = this;
5997
+ var _this59 = this;
5804
5998
  if (this.footerSpanMethod) {
5805
5999
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
5806
6000
  }
5807
6001
  var rest = removeMerges(this, merges, this.mergeFooterList, null);
5808
6002
  return this.$nextTick().then(function () {
5809
- _this61.updateCellAreas();
6003
+ _this59.updateCellAreas();
5810
6004
  return rest;
5811
6005
  });
5812
6006
  },
@@ -5923,9 +6117,9 @@ var Methods = {
5923
6117
  return cellLabel;
5924
6118
  },
5925
6119
  findRowIndexOf: function findRowIndexOf(list, row) {
5926
- var _this62 = this;
6120
+ var _this60 = this;
5927
6121
  return row ? _xeUtils["default"].findIndexOf(list, function (item) {
5928
- return _this62.eqRow(item, row);
6122
+ return _this60.eqRow(item, row);
5929
6123
  }) : -1;
5930
6124
  },
5931
6125
  eqRow: function eqRow(row1, row2) {