vxe-table 3.7.7-beta.3 → 3.7.7-beta.4

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 (69) hide show
  1. package/README.md +1 -1
  2. package/helper/vetur/attributes.json +0 -4
  3. package/helper/vetur/tags.json +1 -2
  4. package/lib/edit/src/mixin.js +24 -5
  5. package/lib/edit/src/mixin.min.js +1 -1
  6. package/lib/grid/src/grid.js +21 -61
  7. package/lib/grid/src/grid.min.js +1 -1
  8. package/lib/grid/style/style.css +0 -18
  9. package/lib/grid/style/style.min.css +1 -1
  10. package/lib/icon/style/style.css +1 -1
  11. package/lib/icon/style/style.min.css +1 -1
  12. package/lib/index.css +1 -1
  13. package/lib/index.umd.js +496 -310
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/pulldown/src/pulldown.js +19 -6
  16. package/lib/pulldown/src/pulldown.min.js +1 -1
  17. package/lib/pulldown/style/style.css +2 -2
  18. package/lib/pulldown/style/style.min.css +1 -1
  19. package/lib/select/src/select.js +69 -48
  20. package/lib/select/src/select.min.js +1 -1
  21. package/lib/select/style/style.css +23 -6
  22. package/lib/select/style/style.min.css +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/table/src/body.js +19 -14
  26. package/lib/table/src/body.min.js +1 -1
  27. package/lib/table/src/methods.js +217 -130
  28. package/lib/table/src/methods.min.js +1 -1
  29. package/lib/table/src/table.js +10 -8
  30. package/lib/table/src/table.min.js +1 -1
  31. package/lib/table/style/style.css +72 -23
  32. package/lib/table/style/style.min.css +1 -1
  33. package/lib/textarea/src/textarea.js +1 -1
  34. package/lib/textarea/src/textarea.min.js +1 -1
  35. package/lib/tools/log.js +1 -1
  36. package/lib/tools/log.min.js +1 -1
  37. package/lib/tooltip/src/tooltip.js +1 -1
  38. package/lib/tooltip/src/tooltip.min.js +1 -1
  39. package/lib/v-x-e-table/index.js +1 -1
  40. package/lib/v-x-e-table/index.min.js +1 -1
  41. package/lib/v-x-e-table/src/conf.js +1 -1
  42. package/lib/v-x-e-table/src/conf.min.js +1 -1
  43. package/lib/validator/src/mixin.js +111 -33
  44. package/lib/validator/src/mixin.min.js +1 -1
  45. package/package.json +1 -1
  46. package/packages/edit/src/mixin.js +24 -5
  47. package/packages/grid/src/grid.js +16 -45
  48. package/packages/pulldown/src/pulldown.js +18 -6
  49. package/packages/select/src/select.js +33 -12
  50. package/packages/table/src/body.js +20 -15
  51. package/packages/table/src/methods.js +106 -23
  52. package/packages/table/src/table.js +10 -7
  53. package/packages/textarea/src/textarea.js +1 -1
  54. package/packages/tooltip/src/tooltip.js +1 -1
  55. package/packages/v-x-e-table/src/conf.js +1 -1
  56. package/packages/validator/src/mixin.js +105 -35
  57. package/styles/grid.scss +0 -20
  58. package/styles/pulldown.scss +2 -2
  59. package/styles/select.scss +23 -6
  60. package/styles/table.scss +95 -23
  61. package/types/grid.d.ts +1 -1
  62. package/types/table.d.ts +22 -0
  63. package/types/v-x-e-table/renderer.d.ts +1 -1
  64. /package/lib/icon/style/{iconfont.1701045072322.ttf → iconfont.1703431233417.ttf} +0 -0
  65. /package/lib/icon/style/{iconfont.1701045072322.woff → iconfont.1703431233417.woff} +0 -0
  66. /package/lib/icon/style/{iconfont.1701045072322.woff2 → iconfont.1703431233417.woff2} +0 -0
  67. /package/lib/{iconfont.1701045072322.ttf → iconfont.1703431233417.ttf} +0 -0
  68. /package/lib/{iconfont.1701045072322.woff → iconfont.1703431233417.woff} +0 -0
  69. /package/lib/{iconfont.1701045072322.woff2 → iconfont.1703431233417.woff2} +0 -0
@@ -2817,7 +2817,9 @@ var Methods = {
2817
2817
  mouseConfig = this.mouseConfig,
2818
2818
  editStore = this.editStore,
2819
2819
  ctxMenuStore = this.ctxMenuStore,
2820
+ editRules = this.editRules,
2820
2821
  editOpts = this.editOpts,
2822
+ validOpts = this.validOpts,
2821
2823
  filterStore = this.filterStore,
2822
2824
  getRowNode = this.getRowNode;
2823
2825
  var actived = editStore.actived;
@@ -2898,8 +2900,13 @@ var Methods = {
2898
2900
  if (ctxMenuStore.visible && ctxWrapper && !getEventTargetNode(evnt, ctxWrapper.$el).flag) {
2899
2901
  this.closeMenu();
2900
2902
  }
2903
+ var isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
2904
+ // 如果存在校验,点击了表格之外则清除
2905
+ if (!isActivated && editRules && validOpts.autoClear) {
2906
+ this.validErrorMaps = {};
2907
+ }
2901
2908
  // 最后激活的表格
2902
- this.isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
2909
+ this.isActivated = isActivated;
2903
2910
  },
2904
2911
  /**
2905
2912
  * 窗口失焦事件处理
@@ -4684,8 +4691,78 @@ var Methods = {
4684
4691
  this.emitEvent('sort-change', params, evnt);
4685
4692
  }
4686
4693
  },
4687
- sort: function sort(sortConfs, sortOrder) {
4694
+ setPendingRow: function setPendingRow(rows, status) {
4688
4695
  var _this40 = this;
4696
+ var pendingMaps = _objectSpread({}, this.pendingRowMaps);
4697
+ var pendingList = _toConsumableArray(this.pendingRowList);
4698
+ if (rows && !_xeUtils.default.isArray(rows)) {
4699
+ rows = [rows];
4700
+ }
4701
+ if (status) {
4702
+ rows.forEach(function (row) {
4703
+ var rowid = (0, _util.getRowid)(_this40, row);
4704
+ if (rowid && !pendingMaps[rowid]) {
4705
+ pendingList.push(row);
4706
+ pendingMaps[rowid] = row;
4707
+ }
4708
+ });
4709
+ } else {
4710
+ rows.forEach(function (row) {
4711
+ var rowid = (0, _util.getRowid)(_this40, row);
4712
+ if (rowid && pendingMaps[rowid]) {
4713
+ var pendingIndex = _this40.findRowIndexOf(pendingList, row);
4714
+ if (pendingIndex > -1) {
4715
+ pendingList.splice(pendingIndex, 1);
4716
+ }
4717
+ delete pendingMaps[rowid];
4718
+ }
4719
+ });
4720
+ }
4721
+ this.pendingRowMaps = pendingMaps;
4722
+ this.pendingRowList = pendingList;
4723
+ return this.$nextTick();
4724
+ },
4725
+ togglePendingRow: function togglePendingRow(rows) {
4726
+ var _this41 = this;
4727
+ var pendingMaps = _objectSpread({}, this.pendingRowMaps);
4728
+ var pendingList = _toConsumableArray(this.pendingRowList);
4729
+ if (rows && !_xeUtils.default.isArray(rows)) {
4730
+ rows = [rows];
4731
+ }
4732
+ rows.forEach(function (row) {
4733
+ var rowid = (0, _util.getRowid)(_this41, row);
4734
+ if (rowid) {
4735
+ if (pendingMaps[rowid]) {
4736
+ var pendingIndex = _this41.findRowIndexOf(pendingList, row);
4737
+ if (pendingIndex > -1) {
4738
+ pendingList.splice(pendingIndex, 1);
4739
+ }
4740
+ delete pendingMaps[rowid];
4741
+ } else {
4742
+ pendingList.push(row);
4743
+ pendingMaps[rowid] = row;
4744
+ }
4745
+ }
4746
+ });
4747
+ this.pendingRowMaps = pendingMaps;
4748
+ this.pendingRowList = pendingList;
4749
+ return this.$nextTick();
4750
+ },
4751
+ getPendingRecords: function getPendingRecords() {
4752
+ return this.pendingRowList.slice(0);
4753
+ },
4754
+ hasPendingByRow: function hasPendingByRow(row) {
4755
+ var pendingRowMaps = this.pendingRowMaps;
4756
+ var rowid = (0, _util.getRowid)(this, row);
4757
+ return !!pendingRowMaps[rowid];
4758
+ },
4759
+ clearPendingRow: function clearPendingRow() {
4760
+ this.pendingRowMaps = {};
4761
+ this.pendingRowList = [];
4762
+ return this.$nextTick();
4763
+ },
4764
+ sort: function sort(sortConfs, sortOrder) {
4765
+ var _this42 = this;
4689
4766
  var sortOpts = this.sortOpts;
4690
4767
  var multiple = sortOpts.multiple,
4691
4768
  remote = sortOpts.remote,
@@ -4711,14 +4788,14 @@ var Methods = {
4711
4788
  order = confs.order;
4712
4789
  var column = field;
4713
4790
  if (_xeUtils.default.isString(field)) {
4714
- column = _this40.getColumnByField(field);
4791
+ column = _this42.getColumnByField(field);
4715
4792
  }
4716
4793
  if (column && (column.sortable || column.remoteSort)) {
4717
4794
  if (!firstSortColumn) {
4718
4795
  firstSortColumn = column;
4719
4796
  }
4720
4797
  if (orders.indexOf(order) === -1) {
4721
- order = getNextSortOrder(_this40, column);
4798
+ order = getNextSortOrder(_this42, column);
4722
4799
  }
4723
4800
  if (column.order !== order) {
4724
4801
  column.order = order;
@@ -4731,8 +4808,8 @@ var Methods = {
4731
4808
  this.handleTableData(true);
4732
4809
  }
4733
4810
  return this.$nextTick().then(function () {
4734
- _this40.updateCellAreas();
4735
- return _this40.updateStyle();
4811
+ _this42.updateCellAreas();
4812
+ return _this42.updateStyle();
4736
4813
  });
4737
4814
  }
4738
4815
  return this.$nextTick();
@@ -4868,14 +4945,14 @@ var Methods = {
4868
4945
  * @param {Row} row 行对象
4869
4946
  */
4870
4947
  reloadRowExpand: function reloadRowExpand(row) {
4871
- var _this41 = this;
4948
+ var _this43 = this;
4872
4949
  var expandOpts = this.expandOpts,
4873
4950
  rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps;
4874
4951
  var lazy = expandOpts.lazy;
4875
4952
  var rowid = (0, _util.getRowid)(this, row);
4876
4953
  if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
4877
4954
  this.clearRowExpandLoaded(row).then(function () {
4878
- return _this41.handleAsyncRowExpand(row);
4955
+ return _this43.handleAsyncRowExpand(row);
4879
4956
  });
4880
4957
  }
4881
4958
  return this.$nextTick();
@@ -4898,7 +4975,7 @@ var Methods = {
4898
4975
  var lazy = expandOpts.lazy;
4899
4976
  var rowid = (0, _util.getRowid)(this, row);
4900
4977
  if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
4901
- var expanded = !this.isExpandByRow(row);
4978
+ var expanded = !this.isRowExpandByRow(row);
4902
4979
  var columnIndex = this.getColumnIndex(column);
4903
4980
  var $columnIndex = this.getVMColumnIndex(column);
4904
4981
  this.setRowExpand(row, expanded);
@@ -4917,7 +4994,7 @@ var Methods = {
4917
4994
  * 切换展开行
4918
4995
  */
4919
4996
  toggleRowExpand: function toggleRowExpand(row) {
4920
- return this.setRowExpand(row, !this.isExpandByRow(row));
4997
+ return this.setRowExpand(row, !this.isRowExpandByRow(row));
4921
4998
  },
4922
4999
  /**
4923
5000
  * 处理默认展开行
@@ -4962,39 +5039,39 @@ var Methods = {
4962
5039
  return this.setRowExpand(expandedRows, expanded);
4963
5040
  },
4964
5041
  handleAsyncRowExpand: function handleAsyncRowExpand(row) {
4965
- var _this42 = this;
5042
+ var _this44 = this;
4966
5043
  var fullAllDataRowMap = this.fullAllDataRowMap,
4967
5044
  expandOpts = this.expandOpts;
4968
5045
  var rest = fullAllDataRowMap.get(row);
4969
5046
  return new Promise(function (resolve) {
4970
5047
  var loadMethod = expandOpts.loadMethod;
4971
5048
  if (loadMethod) {
4972
- var rowExpandLazyLoadedMaps = _this42.rowExpandLazyLoadedMaps;
5049
+ var rowExpandLazyLoadedMaps = _this44.rowExpandLazyLoadedMaps;
4973
5050
  var rowTempExpandLazyLoadedMaps = _objectSpread({}, rowExpandLazyLoadedMaps);
4974
- var rowid = (0, _util.getRowid)(_this42, row);
5051
+ var rowid = (0, _util.getRowid)(_this44, row);
4975
5052
  rowTempExpandLazyLoadedMaps[rowid] = row;
4976
- _this42.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
5053
+ _this44.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
4977
5054
  loadMethod({
4978
- $table: _this42,
5055
+ $table: _this44,
4979
5056
  row: row,
4980
- rowIndex: _this42.getRowIndex(row),
4981
- $rowIndex: _this42.getVMRowIndex(row)
5057
+ rowIndex: _this44.getRowIndex(row),
5058
+ $rowIndex: _this44.getVMRowIndex(row)
4982
5059
  }).then(function () {
4983
5060
  rest.expandLoaded = true;
4984
- var rowExpandedMaps = _this42.rowExpandedMaps;
5061
+ var rowExpandedMaps = _this44.rowExpandedMaps;
4985
5062
  var rowTempExpandedMaps = _objectSpread({}, rowExpandedMaps);
4986
5063
  rowTempExpandedMaps[rowid] = row;
4987
- _this42.rowExpandedMaps = rowTempExpandedMaps;
5064
+ _this44.rowExpandedMaps = rowTempExpandedMaps;
4988
5065
  }).catch(function () {
4989
5066
  rest.expandLoaded = false;
4990
5067
  }).finally(function () {
4991
- var rowExpandLazyLoadedMaps = _this42.rowExpandLazyLoadedMaps;
5068
+ var rowExpandLazyLoadedMaps = _this44.rowExpandLazyLoadedMaps;
4992
5069
  var rowTempExpandLazyLoadedMaps = _objectSpread({}, rowExpandLazyLoadedMaps);
4993
5070
  if (rowTempExpandLazyLoadedMaps[rowid]) {
4994
5071
  delete rowTempExpandLazyLoadedMaps[rowid];
4995
5072
  }
4996
- _this42.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
4997
- resolve(_this42.$nextTick().then(_this42.recalculate));
5073
+ _this44.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
5074
+ resolve(_this44.$nextTick().then(_this44.recalculate));
4998
5075
  });
4999
5076
  } else {
5000
5077
  resolve();
@@ -5009,7 +5086,7 @@ var Methods = {
5009
5086
  * @param {Boolean} expanded 是否展开
5010
5087
  */
5011
5088
  setRowExpand: function setRowExpand(rows, expanded) {
5012
- var _this43 = this;
5089
+ var _this45 = this;
5013
5090
  var rowExpandedMaps = this.rowExpandedMaps,
5014
5091
  fullAllDataRowIdData = this.fullAllDataRowIdData,
5015
5092
  rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps,
@@ -5039,18 +5116,18 @@ var Methods = {
5039
5116
  columnIndex: columnIndex,
5040
5117
  $columnIndex: $columnIndex,
5041
5118
  row: row,
5042
- rowIndex: _this43.getRowIndex(row),
5043
- $rowIndex: _this43.getVMRowIndex(row)
5119
+ rowIndex: _this45.getRowIndex(row),
5120
+ $rowIndex: _this45.getVMRowIndex(row)
5044
5121
  });
5045
5122
  }) : rows;
5046
5123
  if (expanded) {
5047
5124
  validRows.forEach(function (row) {
5048
- var rowid = (0, _util.getRowid)(_this43, row);
5125
+ var rowid = (0, _util.getRowid)(_this45, row);
5049
5126
  if (!rExpandedMaps[rowid]) {
5050
5127
  var rest = fullAllDataRowIdData[rowid];
5051
5128
  var isLoad = lazy && !rest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
5052
5129
  if (isLoad) {
5053
- lazyRests.push(_this43.handleAsyncRowExpand(row));
5130
+ lazyRests.push(_this45.handleAsyncRowExpand(row));
5054
5131
  } else {
5055
5132
  rExpandedMaps[rowid] = row;
5056
5133
  }
@@ -5058,7 +5135,7 @@ var Methods = {
5058
5135
  });
5059
5136
  } else {
5060
5137
  validRows.forEach(function (item) {
5061
- var rowid = (0, _util.getRowid)(_this43, item);
5138
+ var rowid = (0, _util.getRowid)(_this45, item);
5062
5139
  if (rExpandedMaps[rowid]) {
5063
5140
  delete rExpandedMaps[rowid];
5064
5141
  }
@@ -5066,7 +5143,7 @@ var Methods = {
5066
5143
  }
5067
5144
  if (reserve) {
5068
5145
  validRows.forEach(function (row) {
5069
- return _this43.handleRowExpandReserve(row, expanded);
5146
+ return _this45.handleRowExpandReserve(row, expanded);
5070
5147
  });
5071
5148
  }
5072
5149
  }
@@ -5077,16 +5154,23 @@ var Methods = {
5077
5154
  * 判断行是否为展开状态
5078
5155
  * @param {Row} row 行对象
5079
5156
  */
5080
- isExpandByRow: function isExpandByRow(row) {
5157
+ isRowExpandByRow: function isRowExpandByRow(row) {
5081
5158
  var rowExpandedMaps = this.rowExpandedMaps;
5082
5159
  var rowid = (0, _util.getRowid)(this, row);
5083
5160
  return !!rowExpandedMaps[rowid];
5084
5161
  },
5162
+ isExpandByRow: function isExpandByRow(row) {
5163
+ // if (process.env.NODE_ENV === 'development') {
5164
+ // warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow'])
5165
+ // }
5166
+ // 即将废弃
5167
+ return this.isRowExpandByRow(row);
5168
+ },
5085
5169
  /**
5086
5170
  * 手动清空展开行状态,数据会恢复成未展开的状态
5087
5171
  */
5088
5172
  clearRowExpand: function clearRowExpand() {
5089
- var _this44 = this;
5173
+ var _this46 = this;
5090
5174
  var expandOpts = this.expandOpts,
5091
5175
  tableFullData = this.tableFullData;
5092
5176
  var reserve = expandOpts.reserve;
@@ -5094,12 +5178,12 @@ var Methods = {
5094
5178
  this.rowExpandedMaps = {};
5095
5179
  if (reserve) {
5096
5180
  tableFullData.forEach(function (row) {
5097
- return _this44.handleRowExpandReserve(row, false);
5181
+ return _this46.handleRowExpandReserve(row, false);
5098
5182
  });
5099
5183
  }
5100
5184
  return this.$nextTick().then(function () {
5101
5185
  if (expList.length) {
5102
- _this44.recalculate();
5186
+ _this46.recalculate();
5103
5187
  }
5104
5188
  });
5105
5189
  },
@@ -5182,7 +5266,7 @@ var Methods = {
5182
5266
  * @param {Row} row 行对象
5183
5267
  */
5184
5268
  reloadTreeExpand: function reloadTreeExpand(row) {
5185
- var _this45 = this;
5269
+ var _this47 = this;
5186
5270
  var treeOpts = this.treeOpts,
5187
5271
  treeExpandLazyLoadedMaps = this.treeExpandLazyLoadedMaps;
5188
5272
  var transform = treeOpts.transform,
@@ -5191,14 +5275,14 @@ var Methods = {
5191
5275
  var rowid = (0, _util.getRowid)(this, row);
5192
5276
  if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
5193
5277
  this.clearTreeExpandLoaded(row).then(function () {
5194
- return _this45.handleAsyncTreeExpandChilds(row);
5278
+ return _this47.handleAsyncTreeExpandChilds(row);
5195
5279
  }).then(function () {
5196
5280
  if (transform) {
5197
- _this45.handleVirtualTreeToList();
5198
- return _this45.handleTableData();
5281
+ _this47.handleVirtualTreeToList();
5282
+ return _this47.handleTableData();
5199
5283
  }
5200
5284
  }).then(function () {
5201
- return _this45.recalculate();
5285
+ return _this47.recalculate();
5202
5286
  });
5203
5287
  }
5204
5288
  return this.$nextTick();
@@ -5271,7 +5355,7 @@ var Methods = {
5271
5355
  }
5272
5356
  },
5273
5357
  handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
5274
- var _this46 = this;
5358
+ var _this48 = this;
5275
5359
  var treeOpts = this.treeOpts,
5276
5360
  checkboxOpts = this.checkboxOpts;
5277
5361
  var transform = treeOpts.transform,
@@ -5279,13 +5363,13 @@ var Methods = {
5279
5363
  var checkStrictly = checkboxOpts.checkStrictly;
5280
5364
  return new Promise(function (resolve) {
5281
5365
  if (loadMethod) {
5282
- var fullAllDataRowMap = _this46.fullAllDataRowMap,
5283
- treeExpandLazyLoadedMaps = _this46.treeExpandLazyLoadedMaps;
5284
- var rowid = (0, _util.getRowid)(_this46, row);
5366
+ var fullAllDataRowMap = _this48.fullAllDataRowMap,
5367
+ treeExpandLazyLoadedMaps = _this48.treeExpandLazyLoadedMaps;
5368
+ var rowid = (0, _util.getRowid)(_this48, row);
5285
5369
  var rest = fullAllDataRowMap.get(row);
5286
5370
  treeExpandLazyLoadedMaps[rowid] = row;
5287
5371
  loadMethod({
5288
- $table: _this46,
5372
+ $table: _this48,
5289
5373
  row: row
5290
5374
  }).then(function (childRecords) {
5291
5375
  // 响应成功后则展开行,并将子节点挂载到该节点下
@@ -5297,20 +5381,20 @@ var Methods = {
5297
5381
  childRecords = [];
5298
5382
  }
5299
5383
  if (childRecords) {
5300
- return _this46.loadTreeChildren(row, childRecords).then(function (childRows) {
5301
- var treeExpandedMaps = _this46.treeExpandedMaps;
5384
+ return _this48.loadTreeChildren(row, childRecords).then(function (childRows) {
5385
+ var treeExpandedMaps = _this48.treeExpandedMaps;
5302
5386
  var treeTempExpandedMaps = _objectSpread({}, treeExpandedMaps);
5303
5387
  if (childRows.length && !treeTempExpandedMaps[rowid]) {
5304
5388
  treeTempExpandedMaps[rowid] = row;
5305
- _this46.treeExpandedMaps = treeTempExpandedMaps;
5389
+ _this48.treeExpandedMaps = treeTempExpandedMaps;
5306
5390
  }
5307
5391
  // 如果当前节点已选中,则展开后子节点也被选中
5308
- if (!checkStrictly && _this46.isCheckedByCheckboxRow(row)) {
5309
- _this46.handleCheckedCheckboxRow(childRows, true, true);
5392
+ if (!checkStrictly && _this48.isCheckedByCheckboxRow(row)) {
5393
+ _this48.handleCheckedCheckboxRow(childRows, true, true);
5310
5394
  }
5311
- return _this46.$nextTick().then(function () {
5395
+ return _this48.$nextTick().then(function () {
5312
5396
  if (transform) {
5313
- return _this46.handleTableData();
5397
+ return _this48.handleTableData();
5314
5398
  }
5315
5399
  });
5316
5400
  });
@@ -5318,13 +5402,13 @@ var Methods = {
5318
5402
  }).catch(function () {
5319
5403
  // 如果响应异常,则不展开,再次点击后将重新触发懒加载
5320
5404
  rest.treeLoaded = false;
5321
- var treeExpandLazyLoadedMaps = _this46.treeExpandLazyLoadedMaps;
5405
+ var treeExpandLazyLoadedMaps = _this48.treeExpandLazyLoadedMaps;
5322
5406
  if (treeExpandLazyLoadedMaps[rowid]) {
5323
5407
  treeExpandLazyLoadedMaps[rowid] = null;
5324
5408
  }
5325
5409
  }).finally(function () {
5326
- _this46.$nextTick().then(function () {
5327
- return _this46.recalculate();
5410
+ _this48.$nextTick().then(function () {
5411
+ return _this48.recalculate();
5328
5412
  }).then(function () {
5329
5413
  return resolve();
5330
5414
  });
@@ -5361,7 +5445,7 @@ var Methods = {
5361
5445
  * @returns
5362
5446
  */
5363
5447
  handleBaseTreeExpand: function handleBaseTreeExpand(rows, expanded) {
5364
- var _this47 = this;
5448
+ var _this49 = this;
5365
5449
  var fullAllDataRowMap = this.fullAllDataRowMap,
5366
5450
  tableFullData = this.tableFullData,
5367
5451
  treeExpandedMaps = this.treeExpandedMaps,
@@ -5397,7 +5481,7 @@ var Methods = {
5397
5481
  });
5398
5482
  if (matchObj) {
5399
5483
  matchObj.items.forEach(function (item) {
5400
- var rowid = (0, _util.getRowid)(_this47, item);
5484
+ var rowid = (0, _util.getRowid)(_this49, item);
5401
5485
  if (treeTempExpandedMaps[rowid]) {
5402
5486
  delete treeTempExpandedMaps[rowid];
5403
5487
  }
@@ -5406,13 +5490,13 @@ var Methods = {
5406
5490
  }
5407
5491
  if (expanded) {
5408
5492
  validRows.forEach(function (row) {
5409
- var rowid = (0, _util.getRowid)(_this47, row);
5493
+ var rowid = (0, _util.getRowid)(_this49, row);
5410
5494
  if (!treeTempExpandedMaps[rowid]) {
5411
5495
  var rest = fullAllDataRowMap.get(row);
5412
5496
  var isLoad = lazy && row[hasChildField] && !rest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
5413
5497
  // 是否使用懒加载
5414
5498
  if (isLoad) {
5415
- result.push(_this47.handleAsyncTreeExpandChilds(row));
5499
+ result.push(_this49.handleAsyncTreeExpandChilds(row));
5416
5500
  } else {
5417
5501
  if (row[childrenField] && row[childrenField].length) {
5418
5502
  treeTempExpandedMaps[rowid] = row;
@@ -5422,7 +5506,7 @@ var Methods = {
5422
5506
  });
5423
5507
  } else {
5424
5508
  validRows.forEach(function (item) {
5425
- var rowid = (0, _util.getRowid)(_this47, item);
5509
+ var rowid = (0, _util.getRowid)(_this49, item);
5426
5510
  if (treeTempExpandedMaps[rowid]) {
5427
5511
  delete treeTempExpandedMaps[rowid];
5428
5512
  }
@@ -5430,7 +5514,7 @@ var Methods = {
5430
5514
  }
5431
5515
  if (reserve) {
5432
5516
  validRows.forEach(function (row) {
5433
- return _this47.handleTreeExpandReserve(row, expanded);
5517
+ return _this49.handleTreeExpandReserve(row, expanded);
5434
5518
  });
5435
5519
  }
5436
5520
  this.treeExpandedMaps = treeTempExpandedMaps;
@@ -5443,12 +5527,12 @@ var Methods = {
5443
5527
  * @returns
5444
5528
  */
5445
5529
  handleVirtualTreeExpand: function handleVirtualTreeExpand(rows, expanded) {
5446
- var _this48 = this;
5530
+ var _this50 = this;
5447
5531
  return this.handleBaseTreeExpand(rows, expanded).then(function () {
5448
- _this48.handleVirtualTreeToList();
5449
- return _this48.handleTableData();
5532
+ _this50.handleVirtualTreeToList();
5533
+ return _this50.handleTableData();
5450
5534
  }).then(function () {
5451
- return _this48.recalculate();
5535
+ return _this50.recalculate();
5452
5536
  });
5453
5537
  },
5454
5538
  /**
@@ -5488,7 +5572,7 @@ var Methods = {
5488
5572
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
5489
5573
  */
5490
5574
  clearTreeExpand: function clearTreeExpand() {
5491
- var _this49 = this;
5575
+ var _this51 = this;
5492
5576
  var treeOpts = this.treeOpts,
5493
5577
  tableFullData = this.tableFullData;
5494
5578
  var transform = treeOpts.transform,
@@ -5498,19 +5582,19 @@ var Methods = {
5498
5582
  this.treeExpandedMaps = {};
5499
5583
  if (reserve) {
5500
5584
  _xeUtils.default.eachTree(tableFullData, function (row) {
5501
- return _this49.handleTreeExpandReserve(row, false);
5585
+ return _this51.handleTreeExpandReserve(row, false);
5502
5586
  }, {
5503
5587
  children: childrenField
5504
5588
  });
5505
5589
  }
5506
5590
  return this.handleTableData().then(function () {
5507
5591
  if (transform) {
5508
- _this49.handleVirtualTreeToList();
5509
- return _this49.handleTableData();
5592
+ _this51.handleVirtualTreeToList();
5593
+ return _this51.handleTableData();
5510
5594
  }
5511
5595
  }).then(function () {
5512
5596
  if (expList.length) {
5513
- _this49.recalculate();
5597
+ _this51.recalculate();
5514
5598
  }
5515
5599
  });
5516
5600
  },
@@ -5629,28 +5713,28 @@ var Methods = {
5629
5713
  },
5630
5714
  // 计算可视渲染相关数据
5631
5715
  computeScrollLoad: function computeScrollLoad() {
5632
- var _this50 = this;
5716
+ var _this52 = this;
5633
5717
  return this.$nextTick().then(function () {
5634
- var sYOpts = _this50.sYOpts,
5635
- sXOpts = _this50.sXOpts,
5636
- scrollXLoad = _this50.scrollXLoad,
5637
- scrollYLoad = _this50.scrollYLoad,
5638
- scrollXStore = _this50.scrollXStore,
5639
- scrollYStore = _this50.scrollYStore;
5718
+ var sYOpts = _this52.sYOpts,
5719
+ sXOpts = _this52.sXOpts,
5720
+ scrollXLoad = _this52.scrollXLoad,
5721
+ scrollYLoad = _this52.scrollYLoad,
5722
+ scrollXStore = _this52.scrollXStore,
5723
+ scrollYStore = _this52.scrollYStore;
5640
5724
  // 计算 X 逻辑
5641
5725
  if (scrollXLoad) {
5642
- var _computeVirtualX3 = computeVirtualX(_this50),
5726
+ var _computeVirtualX3 = computeVirtualX(_this52),
5643
5727
  visibleXSize = _computeVirtualX3.visibleSize;
5644
5728
  var offsetXSize = sXOpts.oSize ? _xeUtils.default.toNumber(sXOpts.oSize) : _dom.browse.msie ? 10 : _dom.browse.edge ? 5 : 0;
5645
5729
  scrollXStore.offsetSize = offsetXSize;
5646
5730
  scrollXStore.visibleSize = visibleXSize;
5647
5731
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
5648
- _this50.updateScrollXData();
5732
+ _this52.updateScrollXData();
5649
5733
  } else {
5650
- _this50.updateScrollXSpace();
5734
+ _this52.updateScrollXSpace();
5651
5735
  }
5652
5736
  // 计算 Y 逻辑
5653
- var _computeVirtualY = computeVirtualY(_this50),
5737
+ var _computeVirtualY = computeVirtualY(_this52),
5654
5738
  rowHeight = _computeVirtualY.rowHeight,
5655
5739
  visibleYSize = _computeVirtualY.visibleSize;
5656
5740
  scrollYStore.rowHeight = rowHeight;
@@ -5659,12 +5743,12 @@ var Methods = {
5659
5743
  scrollYStore.offsetSize = offsetYSize;
5660
5744
  scrollYStore.visibleSize = visibleYSize;
5661
5745
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
5662
- _this50.updateScrollYData();
5746
+ _this52.updateScrollYData();
5663
5747
  } else {
5664
- _this50.updateScrollYSpace();
5748
+ _this52.updateScrollYSpace();
5665
5749
  }
5666
- _this50.rowHeight = rowHeight;
5667
- _this50.$nextTick(_this50.updateStyle);
5750
+ _this52.rowHeight = rowHeight;
5751
+ _this52.$nextTick(_this52.updateStyle);
5668
5752
  });
5669
5753
  },
5670
5754
  handleTableColumn: function handleTableColumn() {
@@ -5674,11 +5758,11 @@ var Methods = {
5674
5758
  this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
5675
5759
  },
5676
5760
  updateScrollXData: function updateScrollXData() {
5677
- var _this51 = this;
5761
+ var _this53 = this;
5678
5762
  // this.tableColumn = []
5679
5763
  this.$nextTick(function () {
5680
- _this51.handleTableColumn();
5681
- _this51.updateScrollXSpace();
5764
+ _this53.handleTableColumn();
5765
+ _this53.updateScrollXSpace();
5682
5766
  });
5683
5767
  },
5684
5768
  // 更新横向 X 可视渲染上下剩余空间大小
@@ -5729,11 +5813,11 @@ var Methods = {
5729
5813
  }
5730
5814
  },
5731
5815
  updateScrollYData: function updateScrollYData() {
5732
- var _this52 = this;
5816
+ var _this54 = this;
5733
5817
  // this.tableData = []
5734
5818
  this.$nextTick(function () {
5735
- _this52.handleTableData();
5736
- _this52.updateScrollYSpace();
5819
+ _this54.handleTableData();
5820
+ _this54.updateScrollYSpace();
5737
5821
  });
5738
5822
  },
5739
5823
  // 更新纵向 Y 可视渲染上下剩余空间大小
@@ -5774,7 +5858,7 @@ var Methods = {
5774
5858
  * @param {Number} scrollTop 上距离
5775
5859
  */
5776
5860
  scrollTo: function scrollTo(scrollLeft, scrollTop) {
5777
- var _this53 = this;
5861
+ var _this55 = this;
5778
5862
  var $refs = this.$refs;
5779
5863
  var tableBody = $refs.tableBody,
5780
5864
  rightBody = $refs.rightBody,
@@ -5791,7 +5875,7 @@ var Methods = {
5791
5875
  if (this.scrollXLoad || this.scrollYLoad) {
5792
5876
  return new Promise(function (resolve) {
5793
5877
  return setTimeout(function () {
5794
- return resolve(_this53.$nextTick());
5878
+ return resolve(_this55.$nextTick());
5795
5879
  }, 50);
5796
5880
  });
5797
5881
  }
@@ -5833,7 +5917,7 @@ var Methods = {
5833
5917
  * @param {Row} row 行对象
5834
5918
  */
5835
5919
  scrollToTreeRow: function scrollToTreeRow(row) {
5836
- var _this54 = this;
5920
+ var _this56 = this;
5837
5921
  var tableFullData = this.tableFullData,
5838
5922
  treeConfig = this.treeConfig,
5839
5923
  treeOpts = this.treeOpts;
@@ -5848,14 +5932,14 @@ var Methods = {
5848
5932
  if (matchObj) {
5849
5933
  var nodes = matchObj.nodes;
5850
5934
  nodes.forEach(function (row, index) {
5851
- if (index < nodes.length - 1 && !_this54.isTreeExpandByRow(row)) {
5852
- rests.push(_this54.setTreeExpand(row, true));
5935
+ if (index < nodes.length - 1 && !_this56.isTreeExpandByRow(row)) {
5936
+ rests.push(_this56.setTreeExpand(row, true));
5853
5937
  }
5854
5938
  });
5855
5939
  }
5856
5940
  }
5857
5941
  return Promise.all(rests).then(function () {
5858
- return (0, _util.rowToVisible)(_this54, row);
5942
+ return (0, _util.rowToVisible)(_this56, row);
5859
5943
  });
5860
5944
  },
5861
5945
  /**
@@ -5905,41 +5989,44 @@ var Methods = {
5905
5989
  return this.$nextTick();
5906
5990
  },
5907
5991
  /**
5908
- * 更新列状态
5992
+ * 更新列状态 updateStatus({ row, column }, cellValue)
5909
5993
  * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
5910
5994
  * 如果单元格配置了校验规则,则会进行校验
5911
5995
  */
5912
5996
  updateStatus: function updateStatus(slotParams, cellValue) {
5913
- var _this55 = this;
5997
+ var _this57 = this;
5914
5998
  var customVal = !_xeUtils.default.isUndefined(cellValue);
5915
5999
  return this.$nextTick().then(function () {
5916
- var $refs = _this55.$refs,
5917
- editRules = _this55.editRules,
5918
- validStore = _this55.validStore;
5919
- if (slotParams && $refs.tableBody && editRules) {
6000
+ var $refs = _this57.$refs,
6001
+ editRules = _this57.editRules,
6002
+ validStore = _this57.validStore;
6003
+ var tableBody = $refs.tableBody;
6004
+ if (slotParams && tableBody && editRules) {
5920
6005
  var row = slotParams.row,
5921
6006
  column = slotParams.column;
5922
6007
  var type = 'change';
5923
- if (_this55.hasCellRules(type, row, column)) {
5924
- var cell = _this55.getCell(row, column);
5925
- if (cell) {
5926
- return _this55.validCellRules(type, row, column, cellValue).then(function () {
5927
- if (customVal && validStore.visible) {
5928
- setCellValue(row, column, cellValue);
5929
- }
5930
- _this55.clearValidate();
5931
- }).catch(function (_ref8) {
5932
- var rule = _ref8.rule;
5933
- if (customVal) {
5934
- setCellValue(row, column, cellValue);
5935
- }
5936
- _this55.showValidTooltip({
5937
- rule: rule,
5938
- row: row,
5939
- column: column,
5940
- cell: cell
6008
+ if (_this57.hasCellRules) {
6009
+ if (_this57.hasCellRules(type, row, column)) {
6010
+ var cell = _this57.getCell(row, column);
6011
+ if (cell) {
6012
+ return _this57.validCellRules(type, row, column, cellValue).then(function () {
6013
+ if (customVal && validStore.visible) {
6014
+ setCellValue(row, column, cellValue);
6015
+ }
6016
+ _this57.clearValidate(row, column);
6017
+ }).catch(function (_ref8) {
6018
+ var rule = _ref8.rule;
6019
+ if (customVal) {
6020
+ setCellValue(row, column, cellValue);
6021
+ }
6022
+ _this57.showValidTooltip({
6023
+ rule: rule,
6024
+ row: row,
6025
+ column: column,
6026
+ cell: cell
6027
+ });
5941
6028
  });
5942
- });
6029
+ }
5943
6030
  }
5944
6031
  }
5945
6032
  }
@@ -5953,13 +6040,13 @@ var Methods = {
5953
6040
  * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
5954
6041
  */
5955
6042
  setMergeCells: function setMergeCells(merges) {
5956
- var _this56 = this;
6043
+ var _this58 = this;
5957
6044
  if (this.spanMethod) {
5958
6045
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-cells', 'span-method']);
5959
6046
  }
5960
6047
  setMerges(this, merges, this.mergeList, this.afterFullData);
5961
6048
  return this.$nextTick().then(function () {
5962
- return _this56.updateCellAreas();
6049
+ return _this58.updateCellAreas();
5963
6050
  });
5964
6051
  },
5965
6052
  /**
@@ -5967,13 +6054,13 @@ var Methods = {
5967
6054
  * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
5968
6055
  */
5969
6056
  removeMergeCells: function removeMergeCells(merges) {
5970
- var _this57 = this;
6057
+ var _this59 = this;
5971
6058
  if (this.spanMethod) {
5972
6059
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-cells', 'span-method']);
5973
6060
  }
5974
6061
  var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
5975
6062
  return this.$nextTick().then(function () {
5976
- _this57.updateCellAreas();
6063
+ _this59.updateCellAreas();
5977
6064
  return rest;
5978
6065
  });
5979
6066
  },
@@ -5994,23 +6081,23 @@ var Methods = {
5994
6081
  this.setMergeFooterItems(this.mergeFooterItems);
5995
6082
  },
5996
6083
  setMergeFooterItems: function setMergeFooterItems(merges) {
5997
- var _this58 = this;
6084
+ var _this60 = this;
5998
6085
  if (this.footerSpanMethod) {
5999
6086
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
6000
6087
  }
6001
6088
  setMerges(this, merges, this.mergeFooterList, null);
6002
6089
  return this.$nextTick().then(function () {
6003
- return _this58.updateCellAreas();
6090
+ return _this60.updateCellAreas();
6004
6091
  });
6005
6092
  },
6006
6093
  removeMergeFooterItems: function removeMergeFooterItems(merges) {
6007
- var _this59 = this;
6094
+ var _this61 = this;
6008
6095
  if (this.footerSpanMethod) {
6009
6096
  (0, _log.errLog)('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
6010
6097
  }
6011
6098
  var rest = removeMerges(this, merges, this.mergeFooterList, null);
6012
6099
  return this.$nextTick().then(function () {
6013
- _this59.updateCellAreas();
6100
+ _this61.updateCellAreas();
6014
6101
  return rest;
6015
6102
  });
6016
6103
  },
@@ -6127,9 +6214,9 @@ var Methods = {
6127
6214
  return cellLabel;
6128
6215
  },
6129
6216
  findRowIndexOf: function findRowIndexOf(list, row) {
6130
- var _this60 = this;
6217
+ var _this62 = this;
6131
6218
  return row ? _xeUtils.default.findIndexOf(list, function (item) {
6132
- return _this60.eqRow(item, row);
6219
+ return _this62.eqRow(item, row);
6133
6220
  }) : -1;
6134
6221
  },
6135
6222
  eqRow: function eqRow(row1, row2) {