vxe-table 3.5.9-beta.8 → 3.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/lib/button/src/button.js +5 -1
  2. package/lib/button/src/button.min.js +1 -1
  3. package/lib/edit/src/mixin.js +12 -8
  4. package/lib/edit/src/mixin.min.js +1 -1
  5. package/lib/filter/src/panel.js +2 -1
  6. package/lib/filter/src/panel.min.js +1 -1
  7. package/lib/form/src/form-config-item.js +9 -13
  8. package/lib/form/src/form-config-item.min.js +1 -1
  9. package/lib/form/src/form-gather.js +1 -3
  10. package/lib/form/src/form-gather.min.js +1 -1
  11. package/lib/form/src/form-item.js +12 -13
  12. package/lib/form/src/form-item.min.js +1 -1
  13. package/lib/form/src/form.js +6 -3
  14. package/lib/form/src/form.min.js +1 -1
  15. package/lib/form/src/util.js +41 -0
  16. package/lib/form/src/util.min.js +1 -1
  17. package/lib/grid/src/grid.js +3 -1
  18. package/lib/grid/src/grid.min.js +1 -1
  19. package/lib/grid/style/style.css +1 -1
  20. package/lib/grid/style/style.min.css +1 -1
  21. package/lib/header/src/header.js +9 -2
  22. package/lib/header/src/header.min.js +1 -1
  23. package/lib/header/style/style.css +0 -100
  24. package/lib/header/style/style.min.css +0 -1
  25. package/lib/index.css +1 -1
  26. package/lib/index.umd.js +756 -660
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/modal/src/modal.js +9 -7
  29. package/lib/modal/src/modal.min.js +1 -1
  30. package/lib/modal/style/style.css +2 -2
  31. package/lib/modal/style/style.min.css +1 -1
  32. package/lib/pager/style/style.css +1 -1
  33. package/lib/pager/style/style.min.css +1 -1
  34. package/lib/select/src/select.js +3 -1
  35. package/lib/select/src/select.min.js +1 -1
  36. package/lib/style.css +1 -1
  37. package/lib/style.min.css +1 -1
  38. package/lib/table/src/cell.js +23 -16
  39. package/lib/table/src/cell.min.js +1 -1
  40. package/lib/table/src/methods.js +300 -269
  41. package/lib/table/src/methods.min.js +1 -1
  42. package/lib/table/style/style.css +101 -0
  43. package/lib/table/style/style.min.css +1 -1
  44. package/lib/toolbar/style/style.css +1 -1
  45. package/lib/toolbar/style/style.min.css +1 -1
  46. package/lib/tools/log.js +1 -1
  47. package/lib/tools/log.min.js +1 -1
  48. package/lib/tools/vn.js +18 -0
  49. package/lib/tools/vn.min.js +1 -0
  50. package/lib/v-x-e-table/index.js +1 -1
  51. package/lib/v-x-e-table/index.min.js +1 -1
  52. package/lib/v-x-e-table/src/store.js +10 -5
  53. package/lib/v-x-e-table/src/store.min.js +1 -1
  54. package/lib/v-x-e-table/style/style.css +1 -1
  55. package/lib/v-x-e-table/style/style.min.css +1 -1
  56. package/package.json +2 -2
  57. package/packages/button/src/button.js +7 -1
  58. package/packages/edit/src/mixin.js +10 -7
  59. package/packages/filter/src/panel.js +1 -1
  60. package/packages/form/src/form-config-item.js +8 -12
  61. package/packages/form/src/form-gather.js +1 -3
  62. package/packages/form/src/form-item.js +12 -14
  63. package/packages/form/src/form.js +6 -4
  64. package/packages/form/src/util.js +23 -0
  65. package/packages/grid/src/grid.js +2 -1
  66. package/packages/header/src/header.js +3 -2
  67. package/packages/modal/src/modal.js +5 -4
  68. package/packages/select/src/select.js +2 -1
  69. package/packages/table/src/cell.js +17 -13
  70. package/packages/table/src/methods.js +67 -46
  71. package/packages/tools/vn.js +8 -0
  72. package/packages/v-x-e-table/src/store.js +8 -4
  73. package/styles/header.scss +0 -134
  74. package/styles/table.scss +134 -0
  75. package/styles/variable.scss +1 -1
  76. package/types/column.d.ts +8 -8
  77. package/types/component.d.ts +3 -1
  78. package/types/v-x-e-table/renderer.d.ts +2 -1
@@ -25,6 +25,8 @@ var _formats = require("../../v-x-e-table/src/formats");
25
25
 
26
26
  var _log = require("../../tools/log");
27
27
 
28
+ var _vn = require("../../tools/vn");
29
+
28
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
31
 
30
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -374,7 +376,7 @@ var Methods = {
374
376
  }
375
377
 
376
378
  if (_xeUtils.default.isFunction(slotFunc)) {
377
- return slotFunc.call(this, params, h, vNodes);
379
+ return (0, _vn.getSlotVNs)(slotFunc.call(this, params, h, vNodes));
378
380
  }
379
381
  }
380
382
 
@@ -1553,6 +1555,8 @@ var Methods = {
1553
1555
  * 用于多选行,获取已选中的数据
1554
1556
  */
1555
1557
  getCheckboxRecords: function getCheckboxRecords(isFull) {
1558
+ var _this17 = this;
1559
+
1556
1560
  var tableFullData = this.tableFullData,
1557
1561
  afterFullData = this.afterFullData,
1558
1562
  treeConfig = this.treeConfig,
@@ -1584,13 +1588,13 @@ var Methods = {
1584
1588
 
1585
1589
  if (treeConfig) {
1586
1590
  rowList = _xeUtils.default.filterTree(currTableData, function (row) {
1587
- return selection.indexOf(row) > -1;
1591
+ return _this17.findRowIndexOf(selection, row) > -1;
1588
1592
  }, {
1589
1593
  children: transform ? mapChildren : children
1590
1594
  });
1591
1595
  } else {
1592
1596
  rowList = currTableData.filter(function (row) {
1593
- return selection.indexOf(row) > -1;
1597
+ return _this17.findRowIndexOf(selection, row) > -1;
1594
1598
  });
1595
1599
  }
1596
1600
  }
@@ -1635,7 +1639,7 @@ var Methods = {
1635
1639
  * 如果存在筛选条件,继续处理
1636
1640
  */
1637
1641
  updateAfterFullData: function updateAfterFullData() {
1638
- var _this17 = this;
1642
+ var _this18 = this;
1639
1643
 
1640
1644
  var tableFullColumn = this.tableFullColumn,
1641
1645
  tableFullData = this.tableFullData,
@@ -1720,7 +1724,7 @@ var Methods = {
1720
1724
  cellValue: cellValue,
1721
1725
  row: row,
1722
1726
  column: column,
1723
- $table: _this17
1727
+ $table: _this18
1724
1728
  });
1725
1729
  });
1726
1730
  } else if (compFilterMethod) {
@@ -1731,7 +1735,7 @@ var Methods = {
1731
1735
  cellValue: cellValue,
1732
1736
  row: row,
1733
1737
  column: column,
1734
- $table: _this17
1738
+ $table: _this18
1735
1739
  });
1736
1740
  });
1737
1741
  } else if (allFilterMethod) {
@@ -1750,7 +1754,7 @@ var Methods = {
1750
1754
  cellValue: cellValue,
1751
1755
  row: row,
1752
1756
  column: column,
1753
- $table: _this17
1757
+ $table: _this18
1754
1758
  });
1755
1759
  });
1756
1760
  }
@@ -1803,7 +1807,7 @@ var Methods = {
1803
1807
  tableTree = _xeUtils.default.orderBy(tableTree, orderColumns.map(function (_ref2) {
1804
1808
  var column = _ref2.column,
1805
1809
  order = _ref2.order;
1806
- return [getOrderField(_this17, column), order];
1810
+ return [getOrderField(_this18, column), order];
1807
1811
  }));
1808
1812
  }
1809
1813
 
@@ -1827,7 +1831,7 @@ var Methods = {
1827
1831
  tableData = _xeUtils.default.orderBy(tableData, orderColumns.map(function (_ref3) {
1828
1832
  var column = _ref3.column,
1829
1833
  order = _ref3.order;
1830
- return [getOrderField(_this17, column), order];
1834
+ return [getOrderField(_this18, column), order];
1831
1835
  }));
1832
1836
  } else {
1833
1837
  // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
@@ -1842,7 +1846,7 @@ var Methods = {
1842
1846
  tableData = _xeUtils.default.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref4) {
1843
1847
  var column = _ref4.column,
1844
1848
  order = _ref4.order;
1845
- return [getOrderField(_this17, column), order];
1849
+ return [getOrderField(_this18, column), order];
1846
1850
  }));
1847
1851
  }
1848
1852
  }
@@ -1861,7 +1865,7 @@ var Methods = {
1861
1865
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
1862
1866
  */
1863
1867
  updateAfterDataIndex: function updateAfterDataIndex() {
1864
- var _this18 = this;
1868
+ var _this19 = this;
1865
1869
 
1866
1870
  var treeConfig = this.treeConfig,
1867
1871
  afterFullData = this.afterFullData,
@@ -1872,7 +1876,7 @@ var Methods = {
1872
1876
 
1873
1877
  if (treeConfig) {
1874
1878
  _xeUtils.default.eachTree(afterTreeFullData, function (row, index, items, path) {
1875
- var rowid = (0, _util.getRowid)(_this18, row);
1879
+ var rowid = (0, _util.getRowid)(_this19, row);
1876
1880
  var allrest = fullAllDataRowIdData[rowid];
1877
1881
  var seq = path.map(function (num, i) {
1878
1882
  return i % 2 === 0 ? Number(num) + 1 : '.';
@@ -1901,7 +1905,7 @@ var Methods = {
1901
1905
  });
1902
1906
  } else {
1903
1907
  afterFullData.forEach(function (row, index) {
1904
- var rowid = (0, _util.getRowid)(_this18, row);
1908
+ var rowid = (0, _util.getRowid)(_this19, row);
1905
1909
  var allrest = fullAllDataRowIdData[rowid];
1906
1910
  var seq = index + 1;
1907
1911
 
@@ -1993,7 +1997,7 @@ var Methods = {
1993
1997
  * 默认执行一次,除非被重置
1994
1998
  */
1995
1999
  handleLoadDefaults: function handleLoadDefaults() {
1996
- var _this19 = this;
2000
+ var _this20 = this;
1997
2001
 
1998
2002
  if (this.checkboxConfig) {
1999
2003
  this.handleDefaultSelectionChecked();
@@ -2020,7 +2024,7 @@ var Methods = {
2020
2024
  }
2021
2025
 
2022
2026
  this.$nextTick(function () {
2023
- return setTimeout(_this19.recalculate);
2027
+ return setTimeout(_this20.recalculate);
2024
2028
  });
2025
2029
  },
2026
2030
 
@@ -2274,12 +2278,12 @@ var Methods = {
2274
2278
  * 刷新列配置
2275
2279
  */
2276
2280
  refreshColumn: function refreshColumn() {
2277
- var _this20 = this;
2281
+ var _this21 = this;
2278
2282
 
2279
2283
  return this.parseColumns().then(function () {
2280
- return _this20.refreshScroll();
2284
+ return _this21.refreshScroll();
2281
2285
  }).then(function () {
2282
- return _this20.recalculate();
2286
+ return _this21.recalculate();
2283
2287
  });
2284
2288
  },
2285
2289
 
@@ -2288,7 +2292,7 @@ var Methods = {
2288
2292
  * 将固定的列左边、右边分别靠边
2289
2293
  */
2290
2294
  parseColumns: function parseColumns() {
2291
- var _this21 = this;
2295
+ var _this22 = this;
2292
2296
 
2293
2297
  var leftList = [];
2294
2298
  var centerList = [];
@@ -2415,11 +2419,11 @@ var Methods = {
2415
2419
  this.visibleColumn = visibleColumn;
2416
2420
  this.handleTableColumn();
2417
2421
  return this.updateFooter().then(function () {
2418
- return _this21.recalculate();
2422
+ return _this22.recalculate();
2419
2423
  }).then(function () {
2420
- _this21.updateCellAreas();
2424
+ _this22.updateCellAreas();
2421
2425
 
2422
- return _this21.recalculate();
2426
+ return _this22.recalculate();
2423
2427
  });
2424
2428
  },
2425
2429
 
@@ -2475,7 +2479,7 @@ var Methods = {
2475
2479
  * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
2476
2480
  */
2477
2481
  refreshScroll: function refreshScroll() {
2478
- var _this22 = this;
2482
+ var _this23 = this;
2479
2483
 
2480
2484
  var lastScrollLeft = this.lastScrollLeft,
2481
2485
  lastScrollTop = this.lastScrollTop;
@@ -2491,7 +2495,7 @@ var Methods = {
2491
2495
  return new Promise(function (resolve) {
2492
2496
  // 还原滚动条位置
2493
2497
  if (lastScrollLeft || lastScrollTop) {
2494
- return (0, _util.restoreScrollLocation)(_this22, lastScrollLeft, lastScrollTop).then(function () {
2498
+ return (0, _util.restoreScrollLocation)(_this23, lastScrollLeft, lastScrollTop).then(function () {
2495
2499
  // 存在滚动行为未结束情况
2496
2500
  setTimeout(resolve, 30);
2497
2501
  });
@@ -2512,7 +2516,7 @@ var Methods = {
2512
2516
  * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
2513
2517
  */
2514
2518
  recalculate: function recalculate(refull) {
2515
- var _this23 = this;
2519
+ var _this24 = this;
2516
2520
 
2517
2521
  var $refs = this.$refs;
2518
2522
  var tableBody = $refs.tableBody,
@@ -2528,9 +2532,9 @@ var Methods = {
2528
2532
  if (refull === true) {
2529
2533
  // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
2530
2534
  return this.computeScrollLoad().then(function () {
2531
- _this23.autoCellWidth(headerElem, bodyElem, footerElem);
2535
+ _this24.autoCellWidth(headerElem, bodyElem, footerElem);
2532
2536
 
2533
- return _this23.computeScrollLoad();
2537
+ return _this24.computeScrollLoad();
2534
2538
  });
2535
2539
  }
2536
2540
  }
@@ -2678,7 +2682,7 @@ var Methods = {
2678
2682
  this.customMaxHeight = calcHeight(this, 'maxHeight');
2679
2683
  },
2680
2684
  updateStyle: function updateStyle() {
2681
- var _this24 = this;
2685
+ var _this25 = this;
2682
2686
 
2683
2687
  var $refs = this.$refs,
2684
2688
  isGroup = this.isGroup,
@@ -2782,7 +2786,7 @@ var Methods = {
2782
2786
 
2783
2787
  if (isGroup && listElem) {
2784
2788
  _xeUtils.default.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
2785
- var colNode = _this24.getColumnNode(thElem);
2789
+ var colNode = _this25.getColumnNode(thElem);
2786
2790
 
2787
2791
  if (colNode) {
2788
2792
  var column = colNode.item;
@@ -2949,10 +2953,10 @@ var Methods = {
2949
2953
 
2950
2954
  if (cellElem) {
2951
2955
  if (colspan > 1) {
2952
- var columnIndex = _this24.getColumnIndex(column);
2956
+ var columnIndex = _this25.getColumnIndex(column);
2953
2957
 
2954
2958
  for (var _index = 1; _index < colspan; _index++) {
2955
- var nextColumn = _this24.getColumns(columnIndex + _index);
2959
+ var nextColumn = _this25.getColumns(columnIndex + _index);
2956
2960
 
2957
2961
  if (nextColumn) {
2958
2962
  colWidth += nextColumn.renderWidth;
@@ -3002,7 +3006,7 @@ var Methods = {
3002
3006
  }
3003
3007
  },
3004
3008
  preventEvent: function preventEvent(evnt, type, args, next, end) {
3005
- var _this25 = this;
3009
+ var _this26 = this;
3006
3010
 
3007
3011
  var evntList = _vXETable.default.interceptor.get(type);
3008
3012
 
@@ -3010,8 +3014,8 @@ var Methods = {
3010
3014
 
3011
3015
  if (!evntList.some(function (func) {
3012
3016
  return func(Object.assign({
3013
- $grid: _this25.$xegrid,
3014
- $table: _this25,
3017
+ $grid: _this26.$xegrid,
3018
+ $table: _this26,
3015
3019
  $event: evnt
3016
3020
  }, args)) === false;
3017
3021
  })) {
@@ -3031,7 +3035,7 @@ var Methods = {
3031
3035
  * 全局按下事件处理
3032
3036
  */
3033
3037
  handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
3034
- var _this26 = this;
3038
+ var _this27 = this;
3035
3039
 
3036
3040
  var $el = this.$el,
3037
3041
  $refs = this.$refs,
@@ -3092,7 +3096,7 @@ var Methods = {
3092
3096
  } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
3093
3097
 
3094
3098
 
3095
- if (!isClearActived && _this26.height && !_this26.overflowY) {
3099
+ if (!isClearActived && _this27.height && !_this27.overflowY) {
3096
3100
  var bodyWrapperElem = evnt.target;
3097
3101
 
3098
3102
  if (hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
@@ -3103,7 +3107,7 @@ var Methods = {
3103
3107
  if (isClearActived || // 如果点击了当前表格之外
3104
3108
  !getEventTargetNode(evnt, $el).flag) {
3105
3109
  setTimeout(function () {
3106
- return _this26.clearActived(evnt);
3110
+ return _this27.clearEdit(evnt);
3107
3111
  });
3108
3112
  }
3109
3113
  });
@@ -3117,9 +3121,9 @@ var Methods = {
3117
3121
 
3118
3122
  if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
3119
3123
  this.preventEvent(evnt, 'event.clearAreas', {}, function () {
3120
- _this26.clearCellAreas();
3124
+ _this27.clearCellAreas();
3121
3125
 
3122
- _this26.clearCopyCellArea();
3126
+ _this27.clearCopyCellArea();
3123
3127
  });
3124
3128
  }
3125
3129
  }
@@ -3154,7 +3158,7 @@ var Methods = {
3154
3158
  * 表格键盘事件
3155
3159
  */
3156
3160
  keydownEvent: function keydownEvent(evnt) {
3157
- var _this27 = this;
3161
+ var _this28 = this;
3158
3162
 
3159
3163
  var filterStore = this.filterStore,
3160
3164
  ctxMenuStore = this.ctxMenuStore,
@@ -3169,37 +3173,37 @@ var Methods = {
3169
3173
 
3170
3174
  if (isEsc) {
3171
3175
  this.preventEvent(evnt, 'event.keydown', null, function () {
3172
- _this27.emitEvent('keydown-start', {}, evnt);
3176
+ _this28.emitEvent('keydown-start', {}, evnt);
3173
3177
 
3174
- if (keyboardConfig && mouseConfig && mouseOpts.area && _this27.handleKeyboardEvent) {
3175
- _this27.handleKeyboardEvent(evnt);
3178
+ if (keyboardConfig && mouseConfig && mouseOpts.area && _this28.handleKeyboardEvent) {
3179
+ _this28.handleKeyboardEvent(evnt);
3176
3180
  } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
3177
3181
  evnt.stopPropagation(); // 如果按下了 Esc 键,关闭快捷菜单、筛选
3178
3182
 
3179
- _this27.closeFilter();
3183
+ _this28.closeFilter();
3180
3184
 
3181
- _this27.closeMenu();
3185
+ _this28.closeMenu();
3182
3186
 
3183
3187
  if (keyboardConfig && keyboardOpts.isEsc) {
3184
3188
  // 如果是激活编辑状态,则取消编辑
3185
3189
  if (actived.row) {
3186
3190
  var params = actived.args;
3187
3191
 
3188
- _this27.clearActived(evnt); // 如果配置了选中功能,则为选中状态
3192
+ _this28.clearEdit(evnt); // 如果配置了选中功能,则为选中状态
3189
3193
 
3190
3194
 
3191
3195
  if (mouseConfig && mouseOpts.selected) {
3192
- _this27.$nextTick(function () {
3193
- return _this27.handleSelected(params, evnt);
3196
+ _this28.$nextTick(function () {
3197
+ return _this28.handleSelected(params, evnt);
3194
3198
  });
3195
3199
  }
3196
3200
  }
3197
3201
  }
3198
3202
  }
3199
3203
 
3200
- _this27.emitEvent('keydown', {}, evnt);
3204
+ _this28.emitEvent('keydown', {}, evnt);
3201
3205
 
3202
- _this27.emitEvent('keydown-end', {}, evnt);
3206
+ _this28.emitEvent('keydown-end', {}, evnt);
3203
3207
  });
3204
3208
  }
3205
3209
  },
@@ -3208,27 +3212,27 @@ var Methods = {
3208
3212
  * 全局键盘事件
3209
3213
  */
3210
3214
  handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
3211
- var _this28 = this;
3215
+ var _this29 = this;
3212
3216
 
3213
3217
  // 该行为只对当前激活的表格有效
3214
3218
  if (this.isActivated) {
3215
3219
  this.preventEvent(evnt, 'event.keydown', null, function () {
3216
- var filterStore = _this28.filterStore,
3217
- isCtxMenu = _this28.isCtxMenu,
3218
- ctxMenuStore = _this28.ctxMenuStore,
3219
- editStore = _this28.editStore,
3220
- editOpts = _this28.editOpts,
3221
- editConfig = _this28.editConfig,
3222
- mouseConfig = _this28.mouseConfig,
3223
- mouseOpts = _this28.mouseOpts,
3224
- keyboardConfig = _this28.keyboardConfig,
3225
- keyboardOpts = _this28.keyboardOpts,
3226
- treeConfig = _this28.treeConfig,
3227
- treeOpts = _this28.treeOpts,
3228
- highlightCurrentRow = _this28.highlightCurrentRow,
3229
- currentRow = _this28.currentRow,
3230
- bodyCtxMenu = _this28.bodyCtxMenu,
3231
- rowOpts = _this28.rowOpts;
3220
+ var filterStore = _this29.filterStore,
3221
+ isCtxMenu = _this29.isCtxMenu,
3222
+ ctxMenuStore = _this29.ctxMenuStore,
3223
+ editStore = _this29.editStore,
3224
+ editOpts = _this29.editOpts,
3225
+ editConfig = _this29.editConfig,
3226
+ mouseConfig = _this29.mouseConfig,
3227
+ mouseOpts = _this29.mouseOpts,
3228
+ keyboardConfig = _this29.keyboardConfig,
3229
+ keyboardOpts = _this29.keyboardOpts,
3230
+ treeConfig = _this29.treeConfig,
3231
+ treeOpts = _this29.treeOpts,
3232
+ highlightCurrentRow = _this29.highlightCurrentRow,
3233
+ currentRow = _this29.currentRow,
3234
+ bodyCtxMenu = _this29.bodyCtxMenu,
3235
+ rowOpts = _this29.rowOpts;
3232
3236
  var selected = editStore.selected,
3233
3237
  actived = editStore.actived;
3234
3238
  var keyCode = evnt.keyCode;
@@ -3255,7 +3259,7 @@ var Methods = {
3255
3259
 
3256
3260
  if (filterStore.visible) {
3257
3261
  if (isEsc) {
3258
- _this28.closeFilter();
3262
+ _this29.closeFilter();
3259
3263
  }
3260
3264
 
3261
3265
  return;
@@ -3266,20 +3270,20 @@ var Methods = {
3266
3270
  evnt.preventDefault();
3267
3271
 
3268
3272
  if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
3269
- _this28.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
3273
+ _this29.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
3270
3274
  } else {
3271
- _this28.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this28.ctxMenuList);
3275
+ _this29.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this29.ctxMenuList);
3272
3276
  }
3273
- } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this28.handleKeyboardEvent) {
3274
- _this28.handleKeyboardEvent(evnt);
3277
+ } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this29.handleKeyboardEvent) {
3278
+ _this29.handleKeyboardEvent(evnt);
3275
3279
  } else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
3276
3280
  // 空格键支持选中复选框
3277
3281
  evnt.preventDefault();
3278
3282
 
3279
3283
  if (selected.column.type === 'checkbox') {
3280
- _this28.handleToggleCheckRowEvent(evnt, selected.args);
3284
+ _this29.handleToggleCheckRowEvent(evnt, selected.args);
3281
3285
  } else {
3282
- _this28.triggerRadioRowEvent(evnt, selected.args);
3286
+ _this29.triggerRadioRowEvent(evnt, selected.args);
3283
3287
  }
3284
3288
  } else if (isF2 && (0, _utils.isEnableConf)(editConfig)) {
3285
3289
  if (!isEditStatus) {
@@ -3288,15 +3292,15 @@ var Methods = {
3288
3292
  evnt.stopPropagation();
3289
3293
  evnt.preventDefault();
3290
3294
 
3291
- _this28.handleActived(selected.args, evnt);
3295
+ _this29.handleActived(selected.args, evnt);
3292
3296
  }
3293
3297
  }
3294
3298
  } else if (isContextMenu) {
3295
3299
  // 如果按下上下文键
3296
- _this28._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
3297
- clearTimeout(_this28.keyCtxTimeout);
3298
- _this28.keyCtxTimeout = setTimeout(function () {
3299
- _this28._keyCtx = false;
3300
+ _this29._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
3301
+ clearTimeout(_this29.keyCtxTimeout);
3302
+ _this29.keyCtxTimeout = setTimeout(function () {
3303
+ _this29._keyCtx = false;
3300
3304
  }, 1000);
3301
3305
  } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
3302
3306
  // 退出选中
@@ -3305,12 +3309,12 @@ var Methods = {
3305
3309
  if (actived.row) {
3306
3310
  params = actived.args;
3307
3311
 
3308
- _this28.clearActived(evnt); // 如果配置了选中功能,则为选中状态
3312
+ _this29.clearEdit(evnt); // 如果配置了选中功能,则为选中状态
3309
3313
 
3310
3314
 
3311
3315
  if (mouseConfig && mouseOpts.selected) {
3312
- _this28.$nextTick(function () {
3313
- return _this28.handleSelected(params, evnt);
3316
+ _this29.$nextTick(function () {
3317
+ return _this29.handleSelected(params, evnt);
3314
3318
  });
3315
3319
  }
3316
3320
  }
@@ -3321,15 +3325,15 @@ var Methods = {
3321
3325
 
3322
3326
  if (hasShiftKey) {
3323
3327
  if (keyboardOpts.enterToTab) {
3324
- _this28.moveTabSelected(targetArgs, hasShiftKey, evnt);
3328
+ _this29.moveTabSelected(targetArgs, hasShiftKey, evnt);
3325
3329
  } else {
3326
- _this28.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
3330
+ _this29.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
3327
3331
  }
3328
3332
  } else {
3329
3333
  if (keyboardOpts.enterToTab) {
3330
- _this28.moveTabSelected(targetArgs, hasShiftKey, evnt);
3334
+ _this29.moveTabSelected(targetArgs, hasShiftKey, evnt);
3331
3335
  } else {
3332
- _this28.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
3336
+ _this29.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
3333
3337
  }
3334
3338
  }
3335
3339
  } else if (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
@@ -3340,14 +3344,14 @@ var Methods = {
3340
3344
  evnt.preventDefault();
3341
3345
  var targetRow = childrens[0];
3342
3346
  params = {
3343
- $table: _this28,
3347
+ $table: _this29,
3344
3348
  row: targetRow
3345
3349
  };
3346
3350
 
3347
- _this28.setTreeExpand(currentRow, true).then(function () {
3348
- return _this28.scrollToRow(targetRow);
3351
+ _this29.setTreeExpand(currentRow, true).then(function () {
3352
+ return _this29.scrollToRow(targetRow);
3349
3353
  }).then(function () {
3350
- return _this28.triggerCurrentRowEvent(evnt, params);
3354
+ return _this29.triggerCurrentRowEvent(evnt, params);
3351
3355
  });
3352
3356
  }
3353
3357
  }
@@ -3356,18 +3360,18 @@ var Methods = {
3356
3360
  if (!isEditStatus) {
3357
3361
  // 如果按下了方向键
3358
3362
  if (selected.row && selected.column) {
3359
- _this28.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
3363
+ _this29.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
3360
3364
  } else if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
3361
3365
  // 当前行按键上下移动
3362
- _this28.moveCurrentRow(isUpArrow, isDwArrow, evnt);
3366
+ _this29.moveCurrentRow(isUpArrow, isDwArrow, evnt);
3363
3367
  }
3364
3368
  }
3365
3369
  } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
3366
3370
  // 如果按下了 Tab 键切换
3367
3371
  if (selected.row || selected.column) {
3368
- _this28.moveTabSelected(selected.args, hasShiftKey, evnt);
3372
+ _this29.moveTabSelected(selected.args, hasShiftKey, evnt);
3369
3373
  } else if (actived.row || actived.column) {
3370
- _this28.moveTabSelected(actived.args, hasShiftKey, evnt);
3374
+ _this29.moveTabSelected(actived.args, hasShiftKey, evnt);
3371
3375
  }
3372
3376
  } else if (keyboardConfig && (isDel || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
3373
3377
  if (!isEditStatus) {
@@ -3378,10 +3382,10 @@ var Methods = {
3378
3382
  if (delMethod) {
3379
3383
  delMethod({
3380
3384
  row: selected.row,
3381
- rowIndex: _this28.getRowIndex(selected.row),
3385
+ rowIndex: _this29.getRowIndex(selected.row),
3382
3386
  column: selected.column,
3383
- columnIndex: _this28.getColumnIndex(selected.column),
3384
- $table: _this28
3387
+ columnIndex: _this29.getColumnIndex(selected.column),
3388
+ $table: _this29
3385
3389
  });
3386
3390
  } else {
3387
3391
  setCellValue(selected.row, selected.column, null);
@@ -3391,21 +3395,21 @@ var Methods = {
3391
3395
  if (backMethod) {
3392
3396
  backMethod({
3393
3397
  row: selected.row,
3394
- rowIndex: _this28.getRowIndex(selected.row),
3398
+ rowIndex: _this29.getRowIndex(selected.row),
3395
3399
  column: selected.column,
3396
- columnIndex: _this28.getColumnIndex(selected.column),
3397
- $table: _this28
3400
+ columnIndex: _this29.getColumnIndex(selected.column),
3401
+ $table: _this29
3398
3402
  });
3399
3403
  } else {
3400
- _this28.handleActived(selected.args, evnt);
3404
+ _this29.handleActived(selected.args, evnt);
3401
3405
  }
3402
3406
  } else if (isDel) {
3403
3407
  // 如果按下 del 键,更新表尾数据
3404
- _this28.updateFooter();
3408
+ _this29.updateFooter();
3405
3409
  }
3406
3410
  } else if (isBack && keyboardOpts.isArrow && treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
3407
3411
  // 如果树形表格回退键关闭当前行返回父节点
3408
- var _XEUtils$findTree = _xeUtils.default.findTree(_this28.afterFullData, function (item) {
3412
+ var _XEUtils$findTree = _xeUtils.default.findTree(_this29.afterFullData, function (item) {
3409
3413
  return item === currentRow;
3410
3414
  }, treeOpts),
3411
3415
  parentRow = _XEUtils$findTree.parent;
@@ -3413,14 +3417,14 @@ var Methods = {
3413
3417
  if (parentRow) {
3414
3418
  evnt.preventDefault();
3415
3419
  params = {
3416
- $table: _this28,
3420
+ $table: _this29,
3417
3421
  row: parentRow
3418
3422
  };
3419
3423
 
3420
- _this28.setTreeExpand(parentRow, false).then(function () {
3421
- return _this28.scrollToRow(parentRow);
3424
+ _this29.setTreeExpand(parentRow, false).then(function () {
3425
+ return _this29.scrollToRow(parentRow);
3422
3426
  }).then(function () {
3423
- return _this28.triggerCurrentRowEvent(evnt, params);
3427
+ return _this29.triggerCurrentRowEvent(evnt, params);
3424
3428
  });
3425
3429
  }
3426
3430
  }
@@ -3436,26 +3440,26 @@ var Methods = {
3436
3440
  var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
3437
3441
 
3438
3442
  if (!beforeEditMethod || beforeEditMethod(_objectSpread(_objectSpread({}, selected.args), {}, {
3439
- $table: _this28
3443
+ $table: _this29
3440
3444
  }))) {
3441
3445
  if (editMethod) {
3442
3446
  editMethod({
3443
3447
  row: selected.row,
3444
- rowIndex: _this28.getRowIndex(selected.row),
3448
+ rowIndex: _this29.getRowIndex(selected.row),
3445
3449
  column: selected.column,
3446
- columnIndex: _this28.getColumnIndex(selected.column),
3447
- $table: _this28
3450
+ columnIndex: _this29.getColumnIndex(selected.column),
3451
+ $table: _this29
3448
3452
  });
3449
3453
  } else {
3450
3454
  setCellValue(selected.row, selected.column, null);
3451
3455
 
3452
- _this28.handleActived(selected.args, evnt);
3456
+ _this29.handleActived(selected.args, evnt);
3453
3457
  }
3454
3458
  }
3455
3459
  }
3456
3460
  }
3457
3461
 
3458
- _this28.emitEvent('keydown', {}, evnt);
3462
+ _this29.emitEvent('keydown', {}, evnt);
3459
3463
  });
3460
3464
  }
3461
3465
  },
@@ -3537,7 +3541,7 @@ var Methods = {
3537
3541
  }
3538
3542
  },
3539
3543
  handleTargetLeaveEvent: function handleTargetLeaveEvent() {
3540
- var _this29 = this;
3544
+ var _this30 = this;
3541
3545
 
3542
3546
  var tooltipOpts = this.tooltipOpts;
3543
3547
  var $tooltip = this.$refs.tooltip;
@@ -3548,10 +3552,10 @@ var Methods = {
3548
3552
 
3549
3553
  if (tooltipOpts.enterable) {
3550
3554
  this.tooltipTimeout = setTimeout(function () {
3551
- $tooltip = _this29.$refs.tooltip;
3555
+ $tooltip = _this30.$refs.tooltip;
3552
3556
 
3553
3557
  if ($tooltip && !$tooltip.isActived()) {
3554
- _this29.closeTooltip();
3558
+ _this30.closeTooltip();
3555
3559
  }
3556
3560
  }, tooltipOpts.leaveDelay);
3557
3561
  } else {
@@ -3749,13 +3753,15 @@ var Methods = {
3749
3753
  * 获取复选框半选状态的行数据
3750
3754
  */
3751
3755
  getCheckboxIndeterminateRecords: function getCheckboxIndeterminateRecords(isFull) {
3756
+ var _this31 = this;
3757
+
3752
3758
  var treeConfig = this.treeConfig,
3753
3759
  treeIndeterminates = this.treeIndeterminates,
3754
3760
  afterFullData = this.afterFullData;
3755
3761
 
3756
3762
  if (treeConfig) {
3757
3763
  return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(function (row) {
3758
- return afterFullData.indexOf(row);
3764
+ return _this31.findRowIndexOf(afterFullData, row) > -1;
3759
3765
  });
3760
3766
  }
3761
3767
 
@@ -3790,30 +3796,32 @@ var Methods = {
3790
3796
  * @param {Boolean} value 是否选中
3791
3797
  */
3792
3798
  setCheckboxRow: function setCheckboxRow(rows, value) {
3793
- var _this30 = this;
3799
+ var _this32 = this;
3794
3800
 
3795
3801
  if (rows && !_xeUtils.default.isArray(rows)) {
3796
3802
  rows = [rows];
3797
3803
  }
3798
3804
 
3799
3805
  rows.forEach(function (row) {
3800
- return _this30.handleSelectRow({
3806
+ return _this32.handleSelectRow({
3801
3807
  row: row
3802
3808
  }, !!value);
3803
3809
  });
3804
3810
  return this.$nextTick();
3805
3811
  },
3806
3812
  isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
3813
+ var selection = this.selection;
3807
3814
  var checkField = this.checkboxOpts.checkField;
3808
3815
 
3809
3816
  if (checkField) {
3810
3817
  return _xeUtils.default.get(row, checkField);
3811
3818
  }
3812
3819
 
3813
- return this.selection.indexOf(row) > -1;
3820
+ return this.findRowIndexOf(selection, row) > -1;
3814
3821
  },
3815
3822
  isIndeterminateByCheckboxRow: function isIndeterminateByCheckboxRow(row) {
3816
- return this.treeIndeterminates.indexOf(row) > -1 && !this.isCheckedByCheckboxRow(row);
3823
+ var treeIndeterminates = this.treeIndeterminates;
3824
+ return this.findRowIndexOf(treeIndeterminates, row) > -1 && !this.isCheckedByCheckboxRow(row);
3817
3825
  },
3818
3826
 
3819
3827
  /**
@@ -3821,7 +3829,7 @@ var Methods = {
3821
3829
  * value 选中true 不选false 半选-1
3822
3830
  */
3823
3831
  handleSelectRow: function handleSelectRow(_ref6, value) {
3824
- var _this31 = this;
3832
+ var _this33 = this;
3825
3833
 
3826
3834
  var row = _ref6.row;
3827
3835
  var selection = this.selection,
@@ -3837,7 +3845,7 @@ var Methods = {
3837
3845
  if (checkField) {
3838
3846
  if (treeConfig && !checkStrictly) {
3839
3847
  if (value === -1) {
3840
- if (treeIndeterminates.indexOf(row) === -1) {
3848
+ if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
3841
3849
  treeIndeterminates.push(row);
3842
3850
  }
3843
3851
 
@@ -3845,23 +3853,23 @@ var Methods = {
3845
3853
  } else {
3846
3854
  // 更新子节点状态
3847
3855
  _xeUtils.default.eachTree([row], function (item) {
3848
- if (row === item || !checkMethod || checkMethod({
3856
+ if (_this33.eqRow(item, row) || !checkMethod || checkMethod({
3849
3857
  row: item
3850
3858
  })) {
3851
3859
  _xeUtils.default.set(item, checkField, value);
3852
3860
 
3853
3861
  _xeUtils.default.remove(treeIndeterminates, function (half) {
3854
- return half === item;
3862
+ return _this33.eqRow(half, item);
3855
3863
  });
3856
3864
 
3857
- _this31.handleCheckboxReserveRow(row, value);
3865
+ _this33.handleCheckboxReserveRow(row, value);
3858
3866
  }
3859
3867
  }, treeOpts);
3860
3868
  } // 如果存在父节点,更新父节点状态
3861
3869
 
3862
3870
 
3863
3871
  var matchObj = _xeUtils.default.findTree(afterFullData, function (item) {
3864
- return item === row;
3872
+ return _this33.eqRow(item, row);
3865
3873
  }, treeOpts);
3866
3874
 
3867
3875
  if (matchObj && matchObj.parent) {
@@ -3873,7 +3881,7 @@ var Methods = {
3873
3881
  }) : matchObj.items;
3874
3882
 
3875
3883
  var indeterminatesItem = _xeUtils.default.find(matchObj.items, function (item) {
3876
- return treeIndeterminates.indexOf(item) > -1;
3884
+ return _this33.findRowIndexOf(treeIndeterminates, item) > -1;
3877
3885
  });
3878
3886
 
3879
3887
  if (indeterminatesItem) {
@@ -3883,7 +3891,7 @@ var Methods = {
3883
3891
  return _xeUtils.default.get(item, checkField);
3884
3892
  });
3885
3893
  parentStatus = selectItems.filter(function (item) {
3886
- return vItems.indexOf(item) > -1;
3894
+ return _this33.findRowIndexOf(vItems, item) > -1;
3887
3895
  }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false;
3888
3896
  }
3889
3897
 
@@ -3903,39 +3911,39 @@ var Methods = {
3903
3911
  } else {
3904
3912
  if (treeConfig && !checkStrictly) {
3905
3913
  if (value === -1) {
3906
- if (treeIndeterminates.indexOf(row) === -1) {
3914
+ if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
3907
3915
  treeIndeterminates.push(row);
3908
3916
  }
3909
3917
 
3910
3918
  _xeUtils.default.remove(selection, function (item) {
3911
- return item === row;
3919
+ return _this33.eqRow(item, row);
3912
3920
  });
3913
3921
  } else {
3914
3922
  // 更新子节点状态
3915
3923
  _xeUtils.default.eachTree([row], function (item) {
3916
- if (row === item || !checkMethod || checkMethod({
3924
+ if (_this33.eqRow(item, row) || !checkMethod || checkMethod({
3917
3925
  row: item
3918
3926
  })) {
3919
3927
  if (value) {
3920
3928
  selection.push(item);
3921
3929
  } else {
3922
3930
  _xeUtils.default.remove(selection, function (select) {
3923
- return select === item;
3931
+ return _this33.eqRow(select, item);
3924
3932
  });
3925
3933
  }
3926
3934
 
3927
3935
  _xeUtils.default.remove(treeIndeterminates, function (half) {
3928
- return half === item;
3936
+ return _this33.eqRow(half, item);
3929
3937
  });
3930
3938
 
3931
- _this31.handleCheckboxReserveRow(row, value);
3939
+ _this33.handleCheckboxReserveRow(row, value);
3932
3940
  }
3933
3941
  }, treeOpts);
3934
3942
  } // 如果存在父节点,更新父节点状态
3935
3943
 
3936
3944
 
3937
3945
  var _matchObj = _xeUtils.default.findTree(afterFullData, function (item) {
3938
- return item === row;
3946
+ return _this33.eqRow(item, row);
3939
3947
  }, treeOpts);
3940
3948
 
3941
3949
  if (_matchObj && _matchObj.parent) {
@@ -3948,18 +3956,18 @@ var Methods = {
3948
3956
  }) : _matchObj.items;
3949
3957
 
3950
3958
  var _indeterminatesItem = _xeUtils.default.find(_matchObj.items, function (item) {
3951
- return treeIndeterminates.indexOf(item) > -1;
3959
+ return _this33.findRowIndexOf(treeIndeterminates, item) > -1;
3952
3960
  });
3953
3961
 
3954
3962
  if (_indeterminatesItem) {
3955
3963
  _parentStatus = -1;
3956
3964
  } else {
3957
3965
  var _selectItems = _matchObj.items.filter(function (item) {
3958
- return selection.indexOf(item) > -1;
3966
+ return _this33.findRowIndexOf(selection, item) > -1;
3959
3967
  });
3960
3968
 
3961
3969
  _parentStatus = _selectItems.filter(function (item) {
3962
- return _vItems.indexOf(item) > -1;
3970
+ return _this33.findRowIndexOf(_vItems, item) > -1;
3963
3971
  }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false;
3964
3972
  }
3965
3973
 
@@ -3972,12 +3980,12 @@ var Methods = {
3972
3980
  row: row
3973
3981
  })) {
3974
3982
  if (value) {
3975
- if (selection.indexOf(row) === -1) {
3983
+ if (this.findRowIndexOf(selection, row) === -1) {
3976
3984
  selection.push(row);
3977
3985
  }
3978
3986
  } else {
3979
3987
  _xeUtils.default.remove(selection, function (item) {
3980
- return item === row;
3988
+ return _this33.eqRow(item, row);
3981
3989
  });
3982
3990
  }
3983
3991
 
@@ -3993,7 +4001,7 @@ var Methods = {
3993
4001
  checkboxOpts = this.checkboxOpts;
3994
4002
  var checkField = checkboxOpts.checkField;
3995
4003
  var row = params.row;
3996
- var value = checkField ? !_xeUtils.default.get(row, checkField) : selection.indexOf(row) === -1;
4004
+ var value = checkField ? !_xeUtils.default.get(row, checkField) : this.findRowIndexOf(selection, row) === -1;
3997
4005
 
3998
4006
  if (evnt) {
3999
4007
  this.triggerCheckRowEvent(evnt, params, value);
@@ -4032,7 +4040,7 @@ var Methods = {
4032
4040
  * @param {Boolean} value 是否选中
4033
4041
  */
4034
4042
  setAllCheckboxRow: function setAllCheckboxRow(value) {
4035
- var _this32 = this;
4043
+ var _this34 = this;
4036
4044
 
4037
4045
  var afterFullData = this.afterFullData,
4038
4046
  treeConfig = this.treeConfig,
@@ -4046,7 +4054,7 @@ var Methods = {
4046
4054
  checkMethod = checkboxOpts.checkMethod;
4047
4055
  var selectRows = [];
4048
4056
  var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
4049
- return afterFullData.indexOf(row) === -1;
4057
+ return _this34.findRowIndexOf(afterFullData, row) === -1;
4050
4058
  });
4051
4059
 
4052
4060
  if (checkStrictly) {
@@ -4103,7 +4111,7 @@ var Methods = {
4103
4111
  _xeUtils.default.eachTree(afterFullData, function (row) {
4104
4112
  if (checkMethod({
4105
4113
  row: row
4106
- }) ? 0 : selection.indexOf(row) > -1) {
4114
+ }) ? 0 : _this34.findRowIndexOf(selection, row) > -1) {
4107
4115
  selectRows.push(row);
4108
4116
  }
4109
4117
  }, treeOpts);
@@ -4118,7 +4126,7 @@ var Methods = {
4118
4126
  */
4119
4127
  if (checkMethod) {
4120
4128
  selectRows = afterFullData.filter(function (row) {
4121
- return selection.indexOf(row) > -1 || checkMethod({
4129
+ return _this34.findRowIndexOf(selection, row) > -1 || checkMethod({
4122
4130
  row: row
4123
4131
  });
4124
4132
  });
@@ -4135,7 +4143,7 @@ var Methods = {
4135
4143
  selectRows = afterFullData.filter(function (row) {
4136
4144
  return checkMethod({
4137
4145
  row: row
4138
- }) ? 0 : selection.indexOf(row) > -1;
4146
+ }) ? 0 : _this34.findRowIndexOf(selection, row) > -1;
4139
4147
  });
4140
4148
  }
4141
4149
  }
@@ -4145,11 +4153,11 @@ var Methods = {
4145
4153
  if (reserve) {
4146
4154
  if (value) {
4147
4155
  selectRows.forEach(function (row) {
4148
- checkboxReserveRowMap[(0, _util.getRowid)(_this32, row)] = row;
4156
+ checkboxReserveRowMap[(0, _util.getRowid)(_this34, row)] = row;
4149
4157
  });
4150
4158
  } else {
4151
4159
  afterFullData.forEach(function (row) {
4152
- return _this32.handleCheckboxReserveRow(row, false);
4160
+ return _this34.handleCheckboxReserveRow(row, false);
4153
4161
  });
4154
4162
  }
4155
4163
  }
@@ -4161,6 +4169,8 @@ var Methods = {
4161
4169
  this.checkSelectionStatus();
4162
4170
  },
4163
4171
  checkSelectionStatus: function checkSelectionStatus() {
4172
+ var _this35 = this;
4173
+
4164
4174
  var afterFullData = this.afterFullData,
4165
4175
  selection = this.selection,
4166
4176
  treeIndeterminates = this.treeIndeterminates,
@@ -4201,11 +4211,11 @@ var Methods = {
4201
4211
  if (treeConfig) {
4202
4212
  if (halfField) {
4203
4213
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
4204
- return _xeUtils.default.get(row, checkField) || _xeUtils.default.get(row, halfField) || treeIndeterminates.indexOf(row) > -1;
4214
+ return _xeUtils.default.get(row, checkField) || _xeUtils.default.get(row, halfField) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
4205
4215
  });
4206
4216
  } else {
4207
4217
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
4208
- return _xeUtils.default.get(row, checkField) || treeIndeterminates.indexOf(row) > -1;
4218
+ return _xeUtils.default.get(row, checkField) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
4209
4219
  });
4210
4220
  }
4211
4221
  } else {
@@ -4228,24 +4238,24 @@ var Methods = {
4228
4238
  return true;
4229
4239
  }
4230
4240
 
4231
- if (selection.indexOf(row) > -1) {
4241
+ if (_this35.findRowIndexOf(selection, row) > -1) {
4232
4242
  checkRows.push(row);
4233
4243
  return true;
4234
4244
  }
4235
4245
 
4236
4246
  return false;
4237
4247
  } : function (row) {
4238
- return selection.indexOf(row) > -1;
4248
+ return _this35.findRowIndexOf(selection, row) > -1;
4239
4249
  });
4240
4250
  isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
4241
4251
 
4242
4252
  if (treeConfig) {
4243
4253
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
4244
- return treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1;
4254
+ return _this35.findRowIndexOf(treeIndeterminates, row) > -1 || _this35.findRowIndexOf(selection, row) > -1;
4245
4255
  });
4246
4256
  } else {
4247
4257
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
4248
- return selection.indexOf(row) > -1;
4258
+ return _this35.findRowIndexOf(selection, row) > -1;
4249
4259
  });
4250
4260
  }
4251
4261
  }
@@ -4369,7 +4379,7 @@ var Methods = {
4369
4379
  * 获取复选框保留选中的行
4370
4380
  */
4371
4381
  getCheckboxReserveRecords: function getCheckboxReserveRecords(isFull) {
4372
- var _this33 = this;
4382
+ var _this36 = this;
4373
4383
 
4374
4384
  var fullDataRowIdData = this.fullDataRowIdData,
4375
4385
  afterFullData = this.afterFullData,
@@ -4384,11 +4394,11 @@ var Methods = {
4384
4394
 
4385
4395
  if (treeConfig) {
4386
4396
  _xeUtils.default.eachTree(afterFullData, function (row) {
4387
- afterFullIdMaps[(0, _util.getRowid)(_this33, row)] = 1;
4397
+ afterFullIdMaps[(0, _util.getRowid)(_this36, row)] = 1;
4388
4398
  }, treeOpts);
4389
4399
  } else {
4390
4400
  afterFullData.forEach(function (row) {
4391
- afterFullIdMaps[(0, _util.getRowid)(_this33, row)] = 1;
4401
+ afterFullIdMaps[(0, _util.getRowid)(_this36, row)] = 1;
4392
4402
  });
4393
4403
  }
4394
4404
 
@@ -4454,7 +4464,7 @@ var Methods = {
4454
4464
  * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
4455
4465
  */
4456
4466
  clearCheckboxRow: function clearCheckboxRow() {
4457
- var _this34 = this;
4467
+ var _this37 = this;
4458
4468
 
4459
4469
  var tableFullData = this.tableFullData,
4460
4470
  treeConfig = this.treeConfig,
@@ -4477,7 +4487,7 @@ var Methods = {
4477
4487
 
4478
4488
  if (reserve) {
4479
4489
  tableFullData.forEach(function (row) {
4480
- return _this34.handleCheckboxReserveRow(row, false);
4490
+ return _this37.handleCheckboxReserveRow(row, false);
4481
4491
  });
4482
4492
  }
4483
4493
 
@@ -4769,13 +4779,13 @@ var Methods = {
4769
4779
  * 如果存在规则,则校验
4770
4780
  */
4771
4781
  handleChangeCell: function handleChangeCell(evnt, params) {
4772
- var _this35 = this;
4782
+ var _this38 = this;
4773
4783
 
4774
4784
  this.checkValidate('blur').catch(function (e) {
4775
4785
  return e;
4776
4786
  }).then(function () {
4777
- _this35.handleActived(params, evnt).then(function () {
4778
- return _this35.checkValidate('change');
4787
+ _this38.handleActived(params, evnt).then(function () {
4788
+ return _this38.checkValidate('change');
4779
4789
  }).catch(function (e) {
4780
4790
  return e;
4781
4791
  });
@@ -4878,7 +4888,7 @@ var Methods = {
4878
4888
  * 如果是双击模式,则激活为编辑状态
4879
4889
  */
4880
4890
  triggerCellDblclickEvent: function triggerCellDblclickEvent(evnt, params) {
4881
- var _this36 = this;
4891
+ var _this39 = this;
4882
4892
 
4883
4893
  var editStore = this.editStore,
4884
4894
  editConfig = this.editConfig,
@@ -4893,15 +4903,15 @@ var Methods = {
4893
4903
  this.checkValidate('blur').catch(function (e) {
4894
4904
  return e;
4895
4905
  }).then(function () {
4896
- _this36.handleActived(params, evnt).then(function () {
4897
- return _this36.checkValidate('change');
4906
+ _this39.handleActived(params, evnt).then(function () {
4907
+ return _this39.checkValidate('change');
4898
4908
  }).catch(function (e) {
4899
4909
  return e;
4900
4910
  });
4901
4911
  });
4902
4912
  } else if (editOpts.mode === 'cell') {
4903
4913
  this.handleActived(params, evnt).then(function () {
4904
- return _this36.checkValidate('change');
4914
+ return _this39.checkValidate('change');
4905
4915
  }).catch(function (e) {
4906
4916
  return e;
4907
4917
  });
@@ -4912,7 +4922,7 @@ var Methods = {
4912
4922
  this.emitEvent('cell-dblclick', params, evnt);
4913
4923
  },
4914
4924
  handleDefaultSort: function handleDefaultSort() {
4915
- var _this37 = this;
4925
+ var _this40 = this;
4916
4926
 
4917
4927
  var sortConfig = this.sortConfig,
4918
4928
  sortOpts = this.sortOpts;
@@ -4929,7 +4939,7 @@ var Methods = {
4929
4939
  order = item.order;
4930
4940
 
4931
4941
  if (field && order) {
4932
- var column = _this37.getColumnByField(field);
4942
+ var column = _this40.getColumnByField(field);
4933
4943
 
4934
4944
  if (column && column.sortable) {
4935
4945
  column.order = order;
@@ -4975,7 +4985,7 @@ var Methods = {
4975
4985
  }
4976
4986
  },
4977
4987
  sort: function sort(sortConfs, sortOrder) {
4978
- var _this38 = this;
4988
+ var _this41 = this;
4979
4989
 
4980
4990
  var sortOpts = this.sortOpts;
4981
4991
  var multiple = sortOpts.multiple,
@@ -5008,7 +5018,7 @@ var Methods = {
5008
5018
  var column = field;
5009
5019
 
5010
5020
  if (_xeUtils.default.isString(field)) {
5011
- column = _this38.getColumnByField(field);
5021
+ column = _this41.getColumnByField(field);
5012
5022
  }
5013
5023
 
5014
5024
  if (column && (column.sortable || column.remoteSort)) {
@@ -5017,7 +5027,7 @@ var Methods = {
5017
5027
  }
5018
5028
 
5019
5029
  if (orders.indexOf(order) === -1) {
5020
- order = getNextSortOrder(_this38, column);
5030
+ order = getNextSortOrder(_this41, column);
5021
5031
  }
5022
5032
 
5023
5033
  if (column.order !== order) {
@@ -5160,6 +5170,8 @@ var Methods = {
5160
5170
  return rest && rest.expandLoaded;
5161
5171
  },
5162
5172
  clearRowExpandLoaded: function clearRowExpandLoaded(row) {
5173
+ var _this42 = this;
5174
+
5163
5175
  var expandOpts = this.expandOpts,
5164
5176
  expandLazyLoadeds = this.expandLazyLoadeds,
5165
5177
  fullAllDataRowMap = this.fullAllDataRowMap;
@@ -5170,7 +5182,7 @@ var Methods = {
5170
5182
  rest.expandLoaded = false;
5171
5183
 
5172
5184
  _xeUtils.default.remove(expandLazyLoadeds, function (item) {
5173
- return row === item;
5185
+ return _this42.eqRow(item, row);
5174
5186
  });
5175
5187
  }
5176
5188
 
@@ -5182,15 +5194,15 @@ var Methods = {
5182
5194
  * @param {Row} row 行对象
5183
5195
  */
5184
5196
  reloadRowExpand: function reloadRowExpand(row) {
5185
- var _this39 = this;
5197
+ var _this43 = this;
5186
5198
 
5187
5199
  var expandOpts = this.expandOpts,
5188
5200
  expandLazyLoadeds = this.expandLazyLoadeds;
5189
5201
  var lazy = expandOpts.lazy;
5190
5202
 
5191
- if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
5203
+ if (lazy && this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
5192
5204
  this.clearRowExpandLoaded(row).then(function () {
5193
- return _this39.handleAsyncRowExpand(row);
5205
+ return _this43.handleAsyncRowExpand(row);
5194
5206
  });
5195
5207
  }
5196
5208
 
@@ -5215,7 +5227,7 @@ var Methods = {
5215
5227
  var row = params.row;
5216
5228
  var lazy = expandOpts.lazy;
5217
5229
 
5218
- if (!lazy || expandLazyLoadeds.indexOf(row) === -1) {
5230
+ if (!lazy || this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
5219
5231
  var expanded = !this.isExpandByRow(row);
5220
5232
  var columnIndex = this.getColumnIndex(column);
5221
5233
  var $columnIndex = this.getVMColumnIndex(column);
@@ -5269,29 +5281,29 @@ var Methods = {
5269
5281
  return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
5270
5282
  },
5271
5283
  handleAsyncRowExpand: function handleAsyncRowExpand(row) {
5272
- var _this40 = this;
5284
+ var _this44 = this;
5273
5285
 
5274
5286
  var rest = this.fullAllDataRowMap.get(row);
5275
5287
  return new Promise(function (resolve) {
5276
- _this40.expandLazyLoadeds.push(row);
5288
+ _this44.expandLazyLoadeds.push(row);
5277
5289
 
5278
- _this40.expandOpts.loadMethod({
5279
- $table: _this40,
5290
+ _this44.expandOpts.loadMethod({
5291
+ $table: _this44,
5280
5292
  row: row,
5281
- rowIndex: _this40.getRowIndex(row),
5282
- $rowIndex: _this40.getVMRowIndex(row)
5293
+ rowIndex: _this44.getRowIndex(row),
5294
+ $rowIndex: _this44.getVMRowIndex(row)
5283
5295
  }).then(function () {
5284
5296
  rest.expandLoaded = true;
5285
5297
 
5286
- _this40.rowExpandeds.push(row);
5298
+ _this44.rowExpandeds.push(row);
5287
5299
  }).catch(function () {
5288
5300
  rest.expandLoaded = false;
5289
5301
  }).finally(function () {
5290
- _xeUtils.default.remove(_this40.expandLazyLoadeds, function (item) {
5291
- return item === row;
5302
+ _xeUtils.default.remove(_this44.expandLazyLoadeds, function (item) {
5303
+ return _this44.eqRow(item, row);
5292
5304
  });
5293
5305
 
5294
- resolve(_this40.$nextTick().then(_this40.recalculate));
5306
+ resolve(_this44.$nextTick().then(_this44.recalculate));
5295
5307
  });
5296
5308
  });
5297
5309
  },
@@ -5304,7 +5316,7 @@ var Methods = {
5304
5316
  * @param {Boolean} expanded 是否展开
5305
5317
  */
5306
5318
  setRowExpand: function setRowExpand(rows, expanded) {
5307
- var _this41 = this;
5319
+ var _this45 = this;
5308
5320
 
5309
5321
  var fullAllDataRowMap = this.fullAllDataRowMap,
5310
5322
  expandLazyLoadeds = this.expandLazyLoadeds,
@@ -5337,19 +5349,19 @@ var Methods = {
5337
5349
  columnIndex: columnIndex,
5338
5350
  $columnIndex: $columnIndex,
5339
5351
  row: row,
5340
- rowIndex: _this41.getRowIndex(row),
5341
- $rowIndex: _this41.getVMRowIndex(row)
5352
+ rowIndex: _this45.getRowIndex(row),
5353
+ $rowIndex: _this45.getVMRowIndex(row)
5342
5354
  });
5343
5355
  }) : rows;
5344
5356
 
5345
5357
  if (expanded) {
5346
5358
  validRows.forEach(function (row) {
5347
- if (rowExpandeds.indexOf(row) === -1) {
5359
+ if (_this45.findRowIndexOf(rowExpandeds, row) === -1) {
5348
5360
  var rest = fullAllDataRowMap.get(row);
5349
- var isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1;
5361
+ var isLoad = lazy && !rest.expandLoaded && _this45.findRowIndexOf(expandLazyLoadeds, row) === -1;
5350
5362
 
5351
5363
  if (isLoad) {
5352
- lazyRests.push(_this41.handleAsyncRowExpand(row));
5364
+ lazyRests.push(_this45.handleAsyncRowExpand(row));
5353
5365
  } else {
5354
5366
  rowExpandeds.push(row);
5355
5367
  }
@@ -5357,13 +5369,13 @@ var Methods = {
5357
5369
  });
5358
5370
  } else {
5359
5371
  _xeUtils.default.remove(rowExpandeds, function (row) {
5360
- return validRows.indexOf(row) > -1;
5372
+ return _this45.findRowIndexOf(validRows, row) > -1;
5361
5373
  });
5362
5374
  }
5363
5375
 
5364
5376
  if (reserve) {
5365
5377
  validRows.forEach(function (row) {
5366
- return _this41.handleRowExpandReserve(row, expanded);
5378
+ return _this45.handleRowExpandReserve(row, expanded);
5367
5379
  });
5368
5380
  }
5369
5381
  }
@@ -5377,14 +5389,15 @@ var Methods = {
5377
5389
  * @param {Row} row 行对象
5378
5390
  */
5379
5391
  isExpandByRow: function isExpandByRow(row) {
5380
- return this.rowExpandeds.indexOf(row) > -1;
5392
+ var rowExpandeds = this.rowExpandeds;
5393
+ return this.findRowIndexOf(rowExpandeds, row) > -1;
5381
5394
  },
5382
5395
 
5383
5396
  /**
5384
5397
  * 手动清空展开行状态,数据会恢复成未展开的状态
5385
5398
  */
5386
5399
  clearRowExpand: function clearRowExpand() {
5387
- var _this42 = this;
5400
+ var _this46 = this;
5388
5401
 
5389
5402
  var expandOpts = this.expandOpts,
5390
5403
  rowExpandeds = this.rowExpandeds,
@@ -5395,13 +5408,13 @@ var Methods = {
5395
5408
 
5396
5409
  if (reserve) {
5397
5410
  tableFullData.forEach(function (row) {
5398
- return _this42.handleRowExpandReserve(row, false);
5411
+ return _this46.handleRowExpandReserve(row, false);
5399
5412
  });
5400
5413
  }
5401
5414
 
5402
5415
  return this.$nextTick().then(function () {
5403
5416
  if (isExists) {
5404
- _this42.recalculate();
5417
+ _this46.recalculate();
5405
5418
  }
5406
5419
  });
5407
5420
  },
@@ -5481,7 +5494,7 @@ var Methods = {
5481
5494
  * @param {Row} row 行对象
5482
5495
  */
5483
5496
  reloadTreeExpand: function reloadTreeExpand(row) {
5484
- var _this43 = this;
5497
+ var _this47 = this;
5485
5498
 
5486
5499
  var treeOpts = this.treeOpts,
5487
5500
  treeLazyLoadeds = this.treeLazyLoadeds;
@@ -5491,15 +5504,15 @@ var Methods = {
5491
5504
 
5492
5505
  if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
5493
5506
  this.clearTreeExpandLoaded(row).then(function () {
5494
- return _this43.handleAsyncTreeExpandChilds(row);
5507
+ return _this47.handleAsyncTreeExpandChilds(row);
5495
5508
  }).then(function () {
5496
5509
  if (transform) {
5497
- _this43.handleVirtualTreeToList();
5510
+ _this47.handleVirtualTreeToList();
5498
5511
 
5499
- return _this43.handleTableData();
5512
+ return _this47.handleTableData();
5500
5513
  }
5501
5514
  }).then(function () {
5502
- return _this43.recalculate();
5515
+ return _this47.recalculate();
5503
5516
  });
5504
5517
  }
5505
5518
 
@@ -5577,7 +5590,7 @@ var Methods = {
5577
5590
  }
5578
5591
  },
5579
5592
  handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
5580
- var _this44 = this;
5593
+ var _this48 = this;
5581
5594
 
5582
5595
  var fullAllDataRowMap = this.fullAllDataRowMap,
5583
5596
  treeExpandeds = this.treeExpandeds,
@@ -5591,7 +5604,7 @@ var Methods = {
5591
5604
  return new Promise(function (resolve) {
5592
5605
  treeLazyLoadeds.push(row);
5593
5606
  loadMethod({
5594
- $table: _this44,
5607
+ $table: _this48,
5595
5608
  row: row
5596
5609
  }).then(function (childRecords) {
5597
5610
  // 响应成功后则展开行,并将子节点挂载到该节点下
@@ -5606,19 +5619,19 @@ var Methods = {
5606
5619
  }
5607
5620
 
5608
5621
  if (childRecords) {
5609
- return _this44.loadTreeChildren(row, childRecords).then(function (childRows) {
5622
+ return _this48.loadTreeChildren(row, childRecords).then(function (childRows) {
5610
5623
  if (childRows.length && treeExpandeds.indexOf(row) === -1) {
5611
5624
  treeExpandeds.push(row);
5612
5625
  } // 如果当前节点已选中,则展开后子节点也被选中
5613
5626
 
5614
5627
 
5615
- if (!checkStrictly && _this44.isCheckedByCheckboxRow(row)) {
5616
- _this44.setCheckboxRow(childRows, true);
5628
+ if (!checkStrictly && _this48.isCheckedByCheckboxRow(row)) {
5629
+ _this48.setCheckboxRow(childRows, true);
5617
5630
  }
5618
5631
 
5619
- return _this44.$nextTick().then(function () {
5632
+ return _this48.$nextTick().then(function () {
5620
5633
  if (transform) {
5621
- return _this44.handleTableData();
5634
+ return _this48.handleTableData();
5622
5635
  }
5623
5636
  });
5624
5637
  });
@@ -5631,8 +5644,8 @@ var Methods = {
5631
5644
  return item === row;
5632
5645
  });
5633
5646
  }).finally(function () {
5634
- _this44.$nextTick().then(function () {
5635
- return _this44.recalculate();
5647
+ _this48.$nextTick().then(function () {
5648
+ return _this48.recalculate();
5636
5649
  }).then(function () {
5637
5650
  return resolve();
5638
5651
  });
@@ -5669,7 +5682,7 @@ var Methods = {
5669
5682
  * @returns
5670
5683
  */
5671
5684
  handleBaseTreeExpand: function handleBaseTreeExpand(rows, expanded) {
5672
- var _this45 = this;
5685
+ var _this49 = this;
5673
5686
 
5674
5687
  var fullAllDataRowMap = this.fullAllDataRowMap,
5675
5688
  tableFullData = this.tableFullData,
@@ -5717,7 +5730,7 @@ var Methods = {
5717
5730
  var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
5718
5731
 
5719
5732
  if (isLoad) {
5720
- result.push(_this45.handleAsyncTreeExpandChilds(row));
5733
+ result.push(_this49.handleAsyncTreeExpandChilds(row));
5721
5734
  } else {
5722
5735
  if (row[children] && row[children].length) {
5723
5736
  treeExpandeds.push(row);
@@ -5733,7 +5746,7 @@ var Methods = {
5733
5746
 
5734
5747
  if (reserve) {
5735
5748
  validRows.forEach(function (row) {
5736
- return _this45.handleTreeExpandReserve(row, expanded);
5749
+ return _this49.handleTreeExpandReserve(row, expanded);
5737
5750
  });
5738
5751
  }
5739
5752
 
@@ -5747,14 +5760,14 @@ var Methods = {
5747
5760
  * @returns
5748
5761
  */
5749
5762
  handleVirtualTreeExpand: function handleVirtualTreeExpand(rows, expanded) {
5750
- var _this46 = this;
5763
+ var _this50 = this;
5751
5764
 
5752
5765
  return this.handleBaseTreeExpand(rows, expanded).then(function () {
5753
- _this46.handleVirtualTreeToList();
5766
+ _this50.handleVirtualTreeToList();
5754
5767
 
5755
- return _this46.handleTableData();
5768
+ return _this50.handleTableData();
5756
5769
  }).then(function () {
5757
- return _this46.recalculate();
5770
+ return _this50.recalculate();
5758
5771
  });
5759
5772
  },
5760
5773
 
@@ -5799,7 +5812,7 @@ var Methods = {
5799
5812
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
5800
5813
  */
5801
5814
  clearTreeExpand: function clearTreeExpand() {
5802
- var _this47 = this;
5815
+ var _this51 = this;
5803
5816
 
5804
5817
  var treeOpts = this.treeOpts,
5805
5818
  treeExpandeds = this.treeExpandeds,
@@ -5811,19 +5824,19 @@ var Methods = {
5811
5824
 
5812
5825
  if (reserve) {
5813
5826
  _xeUtils.default.eachTree(tableFullData, function (row) {
5814
- return _this47.handleTreeExpandReserve(row, false);
5827
+ return _this51.handleTreeExpandReserve(row, false);
5815
5828
  }, treeOpts);
5816
5829
  }
5817
5830
 
5818
5831
  return this.handleTableData().then(function () {
5819
5832
  if (transform) {
5820
- _this47.handleVirtualTreeToList();
5833
+ _this51.handleVirtualTreeToList();
5821
5834
 
5822
- return _this47.handleTableData();
5835
+ return _this51.handleTableData();
5823
5836
  }
5824
5837
  }).then(function () {
5825
5838
  if (isExists) {
5826
- _this47.recalculate();
5839
+ _this51.recalculate();
5827
5840
  }
5828
5841
  });
5829
5842
  },
@@ -5953,18 +5966,18 @@ var Methods = {
5953
5966
  },
5954
5967
  // 计算可视渲染相关数据
5955
5968
  computeScrollLoad: function computeScrollLoad() {
5956
- var _this48 = this;
5969
+ var _this52 = this;
5957
5970
 
5958
5971
  return this.$nextTick().then(function () {
5959
- var sYOpts = _this48.sYOpts,
5960
- sXOpts = _this48.sXOpts,
5961
- scrollXLoad = _this48.scrollXLoad,
5962
- scrollYLoad = _this48.scrollYLoad,
5963
- scrollXStore = _this48.scrollXStore,
5964
- scrollYStore = _this48.scrollYStore; // 计算 X 逻辑
5972
+ var sYOpts = _this52.sYOpts,
5973
+ sXOpts = _this52.sXOpts,
5974
+ scrollXLoad = _this52.scrollXLoad,
5975
+ scrollYLoad = _this52.scrollYLoad,
5976
+ scrollXStore = _this52.scrollXStore,
5977
+ scrollYStore = _this52.scrollYStore; // 计算 X 逻辑
5965
5978
 
5966
5979
  if (scrollXLoad) {
5967
- var _computeVirtualX3 = computeVirtualX(_this48),
5980
+ var _computeVirtualX3 = computeVirtualX(_this52),
5968
5981
  visibleXSize = _computeVirtualX3.visibleSize;
5969
5982
 
5970
5983
  var offsetXSize = sXOpts.oSize ? _xeUtils.default.toNumber(sXOpts.oSize) : _dom.browse.msie ? 10 : _dom.browse.edge ? 5 : 0;
@@ -5972,13 +5985,13 @@ var Methods = {
5972
5985
  scrollXStore.visibleSize = visibleXSize;
5973
5986
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
5974
5987
 
5975
- _this48.updateScrollXData();
5988
+ _this52.updateScrollXData();
5976
5989
  } else {
5977
- _this48.updateScrollXSpace();
5990
+ _this52.updateScrollXSpace();
5978
5991
  } // 计算 Y 逻辑
5979
5992
 
5980
5993
 
5981
- var _computeVirtualY = computeVirtualY(_this48),
5994
+ var _computeVirtualY = computeVirtualY(_this52),
5982
5995
  rowHeight = _computeVirtualY.rowHeight,
5983
5996
  visibleYSize = _computeVirtualY.visibleSize;
5984
5997
 
@@ -5990,14 +6003,14 @@ var Methods = {
5990
6003
  scrollYStore.visibleSize = visibleYSize;
5991
6004
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
5992
6005
 
5993
- _this48.updateScrollYData();
6006
+ _this52.updateScrollYData();
5994
6007
  } else {
5995
- _this48.updateScrollYSpace();
6008
+ _this52.updateScrollYSpace();
5996
6009
  }
5997
6010
 
5998
- _this48.rowHeight = rowHeight;
6011
+ _this52.rowHeight = rowHeight;
5999
6012
 
6000
- _this48.$nextTick(_this48.updateStyle);
6013
+ _this52.$nextTick(_this52.updateStyle);
6001
6014
  });
6002
6015
  },
6003
6016
  handleTableColumn: function handleTableColumn() {
@@ -6007,13 +6020,13 @@ var Methods = {
6007
6020
  this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
6008
6021
  },
6009
6022
  updateScrollXData: function updateScrollXData() {
6010
- var _this49 = this;
6023
+ var _this53 = this;
6011
6024
 
6012
6025
  // this.tableColumn = []
6013
6026
  this.$nextTick(function () {
6014
- _this49.handleTableColumn();
6027
+ _this53.handleTableColumn();
6015
6028
 
6016
- _this49.updateScrollXSpace();
6029
+ _this53.updateScrollXSpace();
6017
6030
  });
6018
6031
  },
6019
6032
  // 更新横向 X 可视渲染上下剩余空间大小
@@ -6070,13 +6083,13 @@ var Methods = {
6070
6083
  }
6071
6084
  },
6072
6085
  updateScrollYData: function updateScrollYData() {
6073
- var _this50 = this;
6086
+ var _this54 = this;
6074
6087
 
6075
6088
  // this.tableData = []
6076
6089
  this.$nextTick(function () {
6077
- _this50.handleTableData();
6090
+ _this54.handleTableData();
6078
6091
 
6079
- _this50.updateScrollYSpace();
6092
+ _this54.updateScrollYSpace();
6080
6093
  });
6081
6094
  },
6082
6095
  // 更新纵向 Y 可视渲染上下剩余空间大小
@@ -6123,7 +6136,7 @@ var Methods = {
6123
6136
  * @param {Number} scrollTop 上距离
6124
6137
  */
6125
6138
  scrollTo: function scrollTo(scrollLeft, scrollTop) {
6126
- var _this51 = this;
6139
+ var _this55 = this;
6127
6140
 
6128
6141
  var $refs = this.$refs;
6129
6142
  var tableBody = $refs.tableBody,
@@ -6144,7 +6157,7 @@ var Methods = {
6144
6157
  if (this.scrollXLoad || this.scrollYLoad) {
6145
6158
  return new Promise(function (resolve) {
6146
6159
  return setTimeout(function () {
6147
- return resolve(_this51.$nextTick());
6160
+ return resolve(_this55.$nextTick());
6148
6161
  }, 50);
6149
6162
  });
6150
6163
  }
@@ -6195,7 +6208,7 @@ var Methods = {
6195
6208
  * @param {Row} row 行对象
6196
6209
  */
6197
6210
  scrollToTreeRow: function scrollToTreeRow(row) {
6198
- var _this52 = this;
6211
+ var _this56 = this;
6199
6212
 
6200
6213
  var tableFullData = this.tableFullData,
6201
6214
  treeConfig = this.treeConfig,
@@ -6210,15 +6223,15 @@ var Methods = {
6210
6223
  if (matchObj) {
6211
6224
  var nodes = matchObj.nodes;
6212
6225
  nodes.forEach(function (row, index) {
6213
- if (index < nodes.length - 1 && !_this52.isTreeExpandByRow(row)) {
6214
- rests.push(_this52.setTreeExpand(row, true));
6226
+ if (index < nodes.length - 1 && !_this56.isTreeExpandByRow(row)) {
6227
+ rests.push(_this56.setTreeExpand(row, true));
6215
6228
  }
6216
6229
  });
6217
6230
  }
6218
6231
  }
6219
6232
 
6220
6233
  return Promise.all(rests).then(function () {
6221
- return (0, _util.rowToVisible)(_this52, row);
6234
+ return (0, _util.rowToVisible)(_this56, row);
6222
6235
  });
6223
6236
  },
6224
6237
 
@@ -6282,29 +6295,29 @@ var Methods = {
6282
6295
  * 如果单元格配置了校验规则,则会进行校验
6283
6296
  */
6284
6297
  updateStatus: function updateStatus(scope, cellValue) {
6285
- var _this53 = this;
6298
+ var _this57 = this;
6286
6299
 
6287
6300
  var customVal = !_xeUtils.default.isUndefined(cellValue);
6288
6301
  return this.$nextTick().then(function () {
6289
- var $refs = _this53.$refs,
6290
- editRules = _this53.editRules,
6291
- validStore = _this53.validStore;
6302
+ var $refs = _this57.$refs,
6303
+ editRules = _this57.editRules,
6304
+ validStore = _this57.validStore;
6292
6305
 
6293
6306
  if (scope && $refs.tableBody && editRules) {
6294
6307
  var row = scope.row,
6295
6308
  column = scope.column;
6296
6309
  var type = 'change';
6297
6310
 
6298
- if (_this53.hasCellRules(type, row, column)) {
6299
- var cell = _this53.getCell(row, column);
6311
+ if (_this57.hasCellRules(type, row, column)) {
6312
+ var cell = _this57.getCell(row, column);
6300
6313
 
6301
6314
  if (cell) {
6302
- return _this53.validCellRules(type, row, column, cellValue).then(function () {
6315
+ return _this57.validCellRules(type, row, column, cellValue).then(function () {
6303
6316
  if (customVal && validStore.visible) {
6304
6317
  setCellValue(row, column, cellValue);
6305
6318
  }
6306
6319
 
6307
- _this53.clearValidate();
6320
+ _this57.clearValidate();
6308
6321
  }).catch(function (_ref8) {
6309
6322
  var rule = _ref8.rule;
6310
6323
 
@@ -6312,7 +6325,7 @@ var Methods = {
6312
6325
  setCellValue(row, column, cellValue);
6313
6326
  }
6314
6327
 
6315
- _this53.showValidTooltip({
6328
+ _this57.showValidTooltip({
6316
6329
  rule: rule,
6317
6330
  row: row,
6318
6331
  column: column,
@@ -6333,7 +6346,7 @@ var Methods = {
6333
6346
  * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
6334
6347
  */
6335
6348
  setMergeCells: function setMergeCells(merges) {
6336
- var _this54 = this;
6349
+ var _this58 = this;
6337
6350
 
6338
6351
  if (this.spanMethod) {
6339
6352
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-cells', 'span-method']);
@@ -6341,7 +6354,7 @@ var Methods = {
6341
6354
 
6342
6355
  setMerges(this, merges, this.mergeList, this.afterFullData);
6343
6356
  return this.$nextTick().then(function () {
6344
- return _this54.updateCellAreas();
6357
+ return _this58.updateCellAreas();
6345
6358
  });
6346
6359
  },
6347
6360
 
@@ -6350,7 +6363,7 @@ var Methods = {
6350
6363
  * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
6351
6364
  */
6352
6365
  removeMergeCells: function removeMergeCells(merges) {
6353
- var _this55 = this;
6366
+ var _this59 = this;
6354
6367
 
6355
6368
  if (this.spanMethod) {
6356
6369
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-cells', 'span-method']);
@@ -6358,7 +6371,7 @@ var Methods = {
6358
6371
 
6359
6372
  var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
6360
6373
  return this.$nextTick().then(function () {
6361
- _this55.updateCellAreas();
6374
+ _this59.updateCellAreas();
6362
6375
 
6363
6376
  return rest;
6364
6377
  });
@@ -6382,7 +6395,7 @@ var Methods = {
6382
6395
  this.setMergeFooterItems(this.mergeFooterItems);
6383
6396
  },
6384
6397
  setMergeFooterItems: function setMergeFooterItems(merges) {
6385
- var _this56 = this;
6398
+ var _this60 = this;
6386
6399
 
6387
6400
  if (this.footerSpanMethod) {
6388
6401
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
@@ -6390,11 +6403,11 @@ var Methods = {
6390
6403
 
6391
6404
  setMerges(this, merges, this.mergeFooterList, null);
6392
6405
  return this.$nextTick().then(function () {
6393
- return _this56.updateCellAreas();
6406
+ return _this60.updateCellAreas();
6394
6407
  });
6395
6408
  },
6396
6409
  removeMergeFooterItems: function removeMergeFooterItems(merges) {
6397
- var _this57 = this;
6410
+ var _this61 = this;
6398
6411
 
6399
6412
  if (this.footerSpanMethod) {
6400
6413
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
@@ -6402,7 +6415,7 @@ var Methods = {
6402
6415
 
6403
6416
  var rest = removeMerges(this, merges, this.mergeFooterList, null);
6404
6417
  return this.$nextTick().then(function () {
6405
- _this57.updateCellAreas();
6418
+ _this61.updateCellAreas();
6406
6419
 
6407
6420
  return rest;
6408
6421
  });
@@ -6536,6 +6549,24 @@ var Methods = {
6536
6549
 
6537
6550
  return cellLabel;
6538
6551
  },
6552
+ findRowIndexOf: function findRowIndexOf(list, row) {
6553
+ var _this62 = this;
6554
+
6555
+ return row ? _xeUtils.default.findIndexOf(list, function (item) {
6556
+ return _this62.eqRow(item, row);
6557
+ }) : -1;
6558
+ },
6559
+ eqRow: function eqRow(row1, row2) {
6560
+ if (row1 && row2) {
6561
+ if (row1 === row2) {
6562
+ return true;
6563
+ }
6564
+
6565
+ return (0, _util.getRowid)(this, row1) === (0, _util.getRowid)(this, row2);
6566
+ }
6567
+
6568
+ return false;
6569
+ },
6539
6570
 
6540
6571
  /*************************
6541
6572
  * Publish methods