vxe-table 3.7.0-beta.1 → 3.7.0-beta.10

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 (189) hide show
  1. package/README.md +6 -9
  2. package/helper/vetur/attributes.json +86 -22
  3. package/helper/vetur/tags.json +17 -1
  4. package/lib/button/src/button.js +9 -3
  5. package/lib/button/src/button.min.js +1 -1
  6. package/lib/edit/src/mixin.js +10 -10
  7. package/lib/edit/src/mixin.min.js +1 -1
  8. package/lib/export/src/mixin.js +24 -13
  9. package/lib/export/src/mixin.min.js +1 -1
  10. package/lib/filter/src/mixin.js +13 -7
  11. package/lib/filter/src/mixin.min.js +1 -1
  12. package/lib/form/src/form.js +27 -5
  13. package/lib/form/src/form.min.js +1 -1
  14. package/lib/grid/src/grid.js +7 -3
  15. package/lib/grid/src/grid.min.js +1 -1
  16. package/lib/icon/style/style.css +1 -1
  17. package/lib/icon/style/style.min.css +1 -1
  18. package/lib/index.css +1 -1
  19. package/lib/index.umd.js +544 -229
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/input/src/input.js +11 -1
  22. package/lib/input/src/input.min.js +1 -1
  23. package/lib/locale/lang/en-US.js +8 -0
  24. package/lib/locale/lang/en-US.min.js +1 -1
  25. package/lib/locale/lang/en-US.umd.js +8 -0
  26. package/lib/locale/lang/es-ES.js +8 -0
  27. package/lib/locale/lang/es-ES.min.js +1 -1
  28. package/lib/locale/lang/es-ES.umd.js +8 -0
  29. package/lib/locale/lang/ja-JP.d.ts +1 -1
  30. package/lib/locale/lang/ja-JP.js +8 -0
  31. package/lib/locale/lang/ja-JP.min.js +1 -1
  32. package/lib/locale/lang/ja-JP.umd.js +8 -0
  33. package/lib/locale/lang/pt-BR.d.ts +8 -0
  34. package/lib/locale/lang/pt-BR.js +330 -0
  35. package/lib/locale/lang/pt-BR.min.js +1 -0
  36. package/lib/locale/lang/pt-BR.umd.js +344 -0
  37. package/lib/locale/lang/zh-CN.d.ts +1 -1
  38. package/lib/locale/lang/zh-CN.js +8 -0
  39. package/lib/locale/lang/zh-CN.min.js +1 -1
  40. package/lib/locale/lang/zh-CN.umd.js +8 -0
  41. package/lib/locale/lang/zh-HK.d.ts +1 -1
  42. package/lib/locale/lang/zh-HK.min.js +1 -1
  43. package/lib/locale/lang/zh-HK.umd.js +8 -0
  44. package/lib/locale/lang/zh-MO.d.ts +1 -1
  45. package/lib/locale/lang/zh-MO.min.js +1 -1
  46. package/lib/locale/lang/zh-MO.umd.js +8 -0
  47. package/lib/locale/lang/zh-TC.d.ts +1 -1
  48. package/lib/locale/lang/zh-TC.js +8 -0
  49. package/lib/locale/lang/zh-TC.min.js +1 -1
  50. package/lib/locale/lang/zh-TC.umd.js +8 -0
  51. package/lib/locale/lang/zh-TW.d.ts +1 -1
  52. package/lib/locale/lang/zh-TW.min.js +1 -1
  53. package/lib/locale/lang/zh-TW.umd.js +8 -0
  54. package/lib/menu/src/mixin.js +3 -3
  55. package/lib/menu/src/mixin.min.js +1 -1
  56. package/lib/pulldown/src/pulldown.js +11 -2
  57. package/lib/pulldown/src/pulldown.min.js +1 -1
  58. package/lib/select/src/select.js +11 -2
  59. package/lib/select/src/select.min.js +1 -1
  60. package/lib/style.css +1 -1
  61. package/lib/style.min.css +1 -1
  62. package/lib/table/src/body.js +3 -2
  63. package/lib/table/src/body.min.js +1 -1
  64. package/lib/table/src/cell.js +9 -7
  65. package/lib/table/src/cell.min.js +1 -1
  66. package/lib/table/src/columnInfo.js +7 -7
  67. package/lib/table/src/columnInfo.min.js +1 -1
  68. package/lib/table/src/methods.js +171 -124
  69. package/lib/table/src/methods.min.js +1 -1
  70. package/lib/table/src/table.js +22 -29
  71. package/lib/table/src/table.min.js +1 -1
  72. package/lib/table/src/util.js +3 -1
  73. package/lib/table/src/util.min.js +1 -1
  74. package/lib/table/style/style.css +7 -2
  75. package/lib/table/style/style.min.css +1 -1
  76. package/lib/textarea/src/textarea.js +6 -1
  77. package/lib/textarea/src/textarea.min.js +1 -1
  78. package/lib/toolbar/src/toolbar.js +23 -7
  79. package/lib/toolbar/src/toolbar.min.js +1 -1
  80. package/lib/tools/log.js +1 -1
  81. package/lib/tools/log.min.js +1 -1
  82. package/lib/tooltip/src/tooltip.js +5 -1
  83. package/lib/tooltip/src/tooltip.min.js +1 -1
  84. package/lib/tooltip/style/style.css +0 -6
  85. package/lib/tooltip/style/style.min.css +1 -1
  86. package/lib/v-x-e-table/index.js +3 -1
  87. package/lib/v-x-e-table/index.min.js +1 -1
  88. package/lib/v-x-e-table/src/commands.js +60 -2
  89. package/lib/v-x-e-table/src/commands.min.js +1 -1
  90. package/lib/v-x-e-table/src/conf.js +7 -4
  91. package/lib/v-x-e-table/src/conf.min.js +1 -1
  92. package/lib/v-x-e-table/src/formats.js +60 -2
  93. package/lib/v-x-e-table/src/formats.min.js +1 -1
  94. package/lib/v-x-e-table/src/menus.js +60 -2
  95. package/lib/v-x-e-table/src/menus.min.js +1 -1
  96. package/lib/v-x-e-table/src/renderer.js +10 -0
  97. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  98. package/lib/v-x-e-table/src/store.js +5 -2
  99. package/lib/v-x-e-table/src/store.min.js +1 -1
  100. package/lib/v-x-e-table/src/validators.js +15 -0
  101. package/lib/v-x-e-table/src/validators.min.js +1 -0
  102. package/lib/validator/src/mixin.js +36 -4
  103. package/lib/validator/src/mixin.min.js +1 -1
  104. package/package.json +2 -2
  105. package/packages/button/src/button.js +5 -4
  106. package/packages/edit/src/mixin.js +10 -9
  107. package/packages/export/src/mixin.js +22 -13
  108. package/packages/filter/src/mixin.js +5 -1
  109. package/packages/form/src/form.js +27 -6
  110. package/packages/grid/src/grid.js +7 -3
  111. package/packages/input/src/input.js +9 -1
  112. package/packages/locale/lang/en-US.js +8 -0
  113. package/packages/locale/lang/es-ES.js +8 -0
  114. package/packages/locale/lang/ja-JP.d.ts +1 -1
  115. package/packages/locale/lang/ja-JP.js +8 -0
  116. package/packages/locale/lang/pt-BR.d.ts +8 -0
  117. package/packages/locale/lang/pt-BR.js +323 -0
  118. package/packages/locale/lang/zh-CN.d.ts +1 -1
  119. package/packages/locale/lang/zh-CN.js +8 -0
  120. package/packages/locale/lang/zh-HK.d.ts +1 -1
  121. package/packages/locale/lang/zh-MO.d.ts +1 -1
  122. package/packages/locale/lang/zh-TC.d.ts +1 -1
  123. package/packages/locale/lang/zh-TC.js +8 -0
  124. package/packages/locale/lang/zh-TW.d.ts +1 -1
  125. package/packages/menu/src/mixin.js +3 -3
  126. package/packages/pulldown/src/pulldown.js +6 -3
  127. package/packages/select/src/select.js +7 -3
  128. package/packages/table/src/body.js +3 -2
  129. package/packages/table/src/cell.js +9 -5
  130. package/packages/table/src/columnInfo.js +7 -7
  131. package/packages/table/src/methods.js +142 -93
  132. package/packages/table/src/table.js +17 -7
  133. package/packages/table/src/util.js +3 -1
  134. package/packages/textarea/src/textarea.js +4 -1
  135. package/packages/toolbar/src/toolbar.js +22 -7
  136. package/packages/tooltip/src/tooltip.js +3 -2
  137. package/packages/v-x-e-table/index.js +2 -0
  138. package/packages/v-x-e-table/src/commands.js +50 -2
  139. package/packages/v-x-e-table/src/conf.js +7 -4
  140. package/packages/v-x-e-table/src/formats.js +50 -2
  141. package/packages/v-x-e-table/src/menus.js +50 -2
  142. package/packages/v-x-e-table/src/renderer.js +11 -1
  143. package/packages/v-x-e-table/src/store.js +4 -2
  144. package/packages/v-x-e-table/src/validators.js +7 -0
  145. package/packages/validator/src/mixin.js +35 -4
  146. package/styles/all.scss +30 -0
  147. package/styles/css-variable.scss +272 -0
  148. package/styles/cssvar.scss +2 -275
  149. package/styles/index.scss +2 -0
  150. package/styles/modules.scss +4 -1
  151. package/styles/table.scss +11 -4
  152. package/styles/tooltip.scss +0 -8
  153. package/styles/variable.scss +1 -4
  154. package/types/all.d.ts +2 -2
  155. package/types/colgroup.d.ts +3 -1
  156. package/types/column.d.ts +3 -0
  157. package/types/edit.d.ts +4 -2
  158. package/types/export.d.ts +3 -0
  159. package/types/filter.d.ts +3 -1
  160. package/types/footer.d.ts +3 -1
  161. package/types/form-item.d.ts +2 -0
  162. package/types/form.d.ts +16 -12
  163. package/types/grid.d.ts +3 -0
  164. package/types/header.d.ts +3 -1
  165. package/types/index.d.ts +1 -1
  166. package/types/input.d.ts +2 -0
  167. package/types/list.d.ts +1 -1
  168. package/types/menu.d.ts +2 -0
  169. package/types/modal.d.ts +7 -3
  170. package/types/pulldown.d.ts +2 -3
  171. package/types/table.d.ts +54 -30
  172. package/types/textarea.d.ts +1 -0
  173. package/types/toolbar.d.ts +2 -0
  174. package/types/tooltip.d.ts +1 -1
  175. package/types/v-x-e-table/commands.d.ts +23 -13
  176. package/types/v-x-e-table/formats.d.ts +21 -12
  177. package/types/v-x-e-table/index.d.ts +33 -26
  178. package/types/v-x-e-table/interceptor.d.ts +1 -1
  179. package/types/v-x-e-table/menus.d.ts +17 -6
  180. package/types/v-x-e-table/renderer.d.ts +5 -3
  181. package/types/v-x-e-table/setup.d.ts +10 -33
  182. package/types/v-x-e-table/validators.d.ts +30 -0
  183. package/types/validator.d.ts +15 -4
  184. /package/lib/icon/style/{iconfont.1688948811910.ttf → iconfont.1690849077922.ttf} +0 -0
  185. /package/lib/icon/style/{iconfont.1688948811910.woff → iconfont.1690849077922.woff} +0 -0
  186. /package/lib/icon/style/{iconfont.1688948811910.woff2 → iconfont.1690849077922.woff2} +0 -0
  187. /package/lib/{iconfont.1688948811910.ttf → iconfont.1690849077922.ttf} +0 -0
  188. /package/lib/{iconfont.1688948811910.woff → iconfont.1690849077922.woff} +0 -0
  189. /package/lib/{iconfont.1688948811910.woff2 → iconfont.1690849077922.woff2} +0 -0
@@ -434,6 +434,7 @@ var Methods = {
434
434
  oldScrollYLoad = this.scrollYLoad,
435
435
  sXOpts = this.sXOpts,
436
436
  sYOpts = this.sYOpts;
437
+ var childrenField = treeOpts.children || treeOpts.childrenField;
437
438
  var treeData = [];
438
439
  var fullData = datas ? datas.slice(0) : [];
439
440
  if (treeConfig) {
@@ -446,26 +447,26 @@ var Methods = {
446
447
  if (!treeOpts.parentField) {
447
448
  (0, _log.errLog)('vxe.error.reqProp', ['table.tree-config.parentField']);
448
449
  }
449
- if (!treeOpts.children) {
450
- (0, _log.errLog)('vxe.error.reqProp', ['tree-config.children']);
450
+ if (!childrenField) {
451
+ (0, _log.errLog)('vxe.error.reqProp', ['tree-config.childrenField']);
451
452
  }
452
- if (!treeOpts.mapChildren) {
453
- (0, _log.errLog)('vxe.error.reqProp', ['tree-config.mapChildren']);
453
+ if (!treeOpts.mapChildrenField) {
454
+ (0, _log.errLog)('vxe.error.reqProp', ['tree-config.mapChildrenField']);
454
455
  }
455
- if (treeOpts.children === treeOpts.mapChildren) {
456
- (0, _log.errLog)('vxe.error.errConflicts', ['tree-config.children', 'tree-config.mapChildren']);
456
+ if (childrenField === treeOpts.mapChildrenField) {
457
+ (0, _log.errLog)('vxe.error.errConflicts', ['tree-config.childrenField', 'tree-config.mapChildrenField']);
457
458
  }
458
459
  fullData.forEach(function (row) {
459
- if (row[treeOpts.children] && row[treeOpts.children].length) {
460
- (0, _log.warnLog)('vxe.error.errConflicts', ['tree-config.transform', "row.".concat(treeOpts.children)]);
460
+ if (row[childrenField] && row[childrenField].length) {
461
+ (0, _log.warnLog)('vxe.error.errConflicts', ['tree-config.transform', "row.".concat(childrenField)]);
461
462
  }
462
463
  });
463
464
  }
464
465
  treeData = _xeUtils["default"].toArrayTree(fullData, {
465
466
  key: treeOpts.rowField,
466
467
  parentKey: treeOpts.parentField,
467
- children: treeOpts.children,
468
- mapChildren: treeOpts.mapChildren
468
+ children: childrenField,
469
+ mapChildren: treeOpts.mapChildrenField
469
470
  });
470
471
  fullData = treeData.slice(0);
471
472
  } else {
@@ -491,7 +492,7 @@ var Methods = {
491
492
  this.tableSynchData = datas;
492
493
  // 克隆原数据,用于显示编辑状态,与编辑值做对比
493
494
  if (keepSource) {
494
- this.tableSourceData = _xeUtils["default"].clone(fullData, true);
495
+ this.cacheSourceMap(fullData);
495
496
  }
496
497
  if (process.env.NODE_ENV === 'development') {
497
498
  if (sYLoad) {
@@ -691,6 +692,8 @@ var Methods = {
691
692
  tableFullTreeData = this.tableFullTreeData;
692
693
  var fullDataRowIdData = this.fullDataRowIdData,
693
694
  fullAllDataRowIdData = this.fullAllDataRowIdData;
695
+ var childrenField = treeOpts.children || treeOpts.childrenField;
696
+ var hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
694
697
  var rowkey = (0, _util.getRowkey)(this);
695
698
  var isLazy = treeConfig && treeOpts.lazy;
696
699
  var handleCache = function handleCache(row, index, items, path, parent, nodes) {
@@ -701,8 +704,8 @@ var Methods = {
701
704
  rowid = getRowUniqueId();
702
705
  _xeUtils["default"].set(row, rowkey, rowid);
703
706
  }
704
- if (isLazy && row[treeOpts.hasChild] && _xeUtils["default"].isUndefined(row[treeOpts.children])) {
705
- row[treeOpts.children] = null;
707
+ if (isLazy && row[hasChildField] && _xeUtils["default"].isUndefined(row[childrenField])) {
708
+ row[childrenField] = null;
706
709
  }
707
710
  var rest = {
708
711
  row: row,
@@ -734,8 +737,35 @@ var Methods = {
734
737
  tableFullData.forEach(handleCache);
735
738
  }
736
739
  },
737
- loadTreeChildren: function loadTreeChildren(row, childRecords) {
740
+ cacheSourceMap: function cacheSourceMap(fullData) {
738
741
  var _this11 = this;
742
+ var treeConfig = this.treeConfig,
743
+ treeOpts = this.treeOpts,
744
+ sourceDataRowIdData = this.sourceDataRowIdData;
745
+ var sourceData = _xeUtils["default"].clone(fullData, true);
746
+ var rowkey = (0, _util.getRowkey)(this);
747
+ sourceDataRowIdData = this.sourceDataRowIdData = {};
748
+ var handleSourceRow = function handleSourceRow(row) {
749
+ var rowid = (0, _util.getRowid)(_this11, row);
750
+ if ((0, _utils.eqEmptyValue)(rowid)) {
751
+ rowid = getRowUniqueId();
752
+ _xeUtils["default"].set(row, rowkey, rowid);
753
+ }
754
+ sourceDataRowIdData[rowid] = {
755
+ row: row,
756
+ rowid: rowid
757
+ };
758
+ };
759
+ // 源数据缓存
760
+ if (treeConfig && !treeOpts.transform) {
761
+ _xeUtils["default"].eachTree(sourceData, handleSourceRow, treeOpts);
762
+ } else {
763
+ sourceData.forEach(handleSourceRow);
764
+ }
765
+ this.tableSourceData = sourceData;
766
+ },
767
+ loadTreeChildren: function loadTreeChildren(row, childRecords) {
768
+ var _this12 = this;
739
769
  var keepSource = this.keepSource,
740
770
  tableSourceData = this.tableSourceData,
741
771
  treeOpts = this.treeOpts,
@@ -744,22 +774,22 @@ var Methods = {
744
774
  fullAllDataRowMap = this.fullAllDataRowMap,
745
775
  fullAllDataRowIdData = this.fullAllDataRowIdData;
746
776
  var transform = treeOpts.transform,
747
- children = treeOpts.children,
748
- mapChildren = treeOpts.mapChildren;
777
+ mapChildrenField = treeOpts.mapChildrenField;
778
+ var childrenField = treeOpts.children || treeOpts.childrenField;
749
779
  var rest = fullAllDataRowIdData[(0, _util.getRowid)(this, row)];
750
780
  var parentLevel = rest ? rest.level : 0;
751
781
  return this.createData(childRecords).then(function (rows) {
752
782
  if (keepSource) {
753
- var rowid = (0, _util.getRowid)(_this11, row);
783
+ var rowid = (0, _util.getRowid)(_this12, row);
754
784
  var matchObj = _xeUtils["default"].findTree(tableSourceData, function (item) {
755
- return rowid === (0, _util.getRowid)(_this11, item);
785
+ return rowid === (0, _util.getRowid)(_this12, item);
756
786
  }, treeOpts);
757
787
  if (matchObj) {
758
- matchObj.item[children] = _xeUtils["default"].clone(rows, true);
788
+ matchObj.item[childrenField] = _xeUtils["default"].clone(rows, true);
759
789
  }
760
790
  }
761
791
  _xeUtils["default"].eachTree(rows, function (childRow, index, items, path, parent, nodes) {
762
- var rowid = (0, _util.getRowid)(_this11, childRow);
792
+ var rowid = (0, _util.getRowid)(_this12, childRow);
763
793
  var rest = {
764
794
  row: childRow,
765
795
  rowid: rowid,
@@ -776,11 +806,11 @@ var Methods = {
776
806
  fullAllDataRowIdData[rowid] = rest;
777
807
  fullAllDataRowMap.set(childRow, rest);
778
808
  }, treeOpts);
779
- row[children] = rows;
809
+ row[childrenField] = rows;
780
810
  if (transform) {
781
- row[mapChildren] = rows;
811
+ row[mapChildrenField] = rows;
782
812
  }
783
- _this11.updateAfterDataIndex();
813
+ _this12.updateAfterDataIndex();
784
814
  return rows;
785
815
  });
786
816
  },
@@ -789,7 +819,7 @@ var Methods = {
789
819
  * 牺牲数据组装的耗时,用来换取使用过程中的流畅
790
820
  */
791
821
  cacheColumnMap: function cacheColumnMap() {
792
- var _this12 = this;
822
+ var _this13 = this;
793
823
  var tableFullColumn = this.tableFullColumn,
794
824
  collectColumn = this.collectColumn,
795
825
  fullColumnMap = this.fullColumnMap,
@@ -870,14 +900,14 @@ var Methods = {
870
900
  }
871
901
  }
872
902
  if (process.env.NODE_ENV === 'development') {
873
- if (_this12.showOverflow && column.showOverflow === false) {
874
- (0, _log.warnLog)('vxe.error.errConflicts', ["table.show-overflow=".concat(_this12.showOverflow), "column.show-overflow=".concat(column.showOverflow)]);
903
+ if (_this13.showOverflow && column.showOverflow === false) {
904
+ (0, _log.warnLog)('vxe.error.errConflicts', ["table.show-overflow=".concat(_this13.showOverflow), "column.show-overflow=".concat(column.showOverflow)]);
875
905
  }
876
- if (_this12.showHeaderOverflow && column.showHeaderOverflow === false) {
877
- (0, _log.warnLog)('vxe.error.errConflicts', ["table.show-header-overflow=".concat(_this12.showHeaderOverflow), "column.show-header-overflow=".concat(column.showHeaderOverflow)]);
906
+ if (_this13.showHeaderOverflow && column.showHeaderOverflow === false) {
907
+ (0, _log.warnLog)('vxe.error.errConflicts', ["table.show-header-overflow=".concat(_this13.showHeaderOverflow), "column.show-header-overflow=".concat(column.showHeaderOverflow)]);
878
908
  }
879
- if (_this12.showFooterOverflow && column.showFooterOverflow === false) {
880
- (0, _log.warnLog)('vxe.error.errConflicts', ["table.show-footer-overflow=".concat(_this12.showFooterOverflow), "column.show-footer-overflow=".concat(column.showFooterOverflow)]);
909
+ if (_this13.showFooterOverflow && column.showFooterOverflow === false) {
910
+ (0, _log.warnLog)('vxe.error.errConflicts', ["table.show-footer-overflow=".concat(_this13.showFooterOverflow), "column.show-footer-overflow=".concat(column.showFooterOverflow)]);
881
911
  }
882
912
  }
883
913
  if (process.env.NODE_ENV === 'development') {
@@ -1057,18 +1087,19 @@ var Methods = {
1057
1087
  * @param {Row} records 行数据
1058
1088
  */
1059
1089
  defineField: function defineField(records) {
1060
- var _this13 = this;
1090
+ var _this14 = this;
1061
1091
  var radioOpts = this.radioOpts,
1062
1092
  checkboxOpts = this.checkboxOpts,
1063
1093
  treeConfig = this.treeConfig,
1064
1094
  treeOpts = this.treeOpts,
1065
1095
  expandOpts = this.expandOpts;
1096
+ var childrenField = treeOpts.children || treeOpts.childrenField;
1066
1097
  var rowkey = (0, _util.getRowkey)(this);
1067
1098
  if (!_xeUtils["default"].isArray(records)) {
1068
1099
  records = [records || {}];
1069
1100
  }
1070
1101
  return records.map(function (record) {
1071
- _this13.tableFullColumn.forEach(function (column) {
1102
+ _this14.tableFullColumn.forEach(function (column) {
1072
1103
  var field = column.field,
1073
1104
  editRender = column.editRender;
1074
1105
  if (field && !_xeUtils["default"].has(record, field)) {
@@ -1092,8 +1123,8 @@ var Methods = {
1092
1123
  _xeUtils["default"].set(record, key, null);
1093
1124
  }
1094
1125
  });
1095
- if (treeConfig && treeOpts.lazy && _xeUtils["default"].isUndefined(record[treeOpts.children])) {
1096
- record[treeOpts.children] = null;
1126
+ if (treeConfig && treeOpts.lazy && _xeUtils["default"].isUndefined(record[childrenField])) {
1127
+ record[childrenField] = null;
1097
1128
  }
1098
1129
  // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
1099
1130
  if ((0, _utils.eqEmptyValue)(_xeUtils["default"].get(record, rowkey))) {
@@ -1108,9 +1139,9 @@ var Methods = {
1108
1139
  * @param {Array} records 新数据
1109
1140
  */
1110
1141
  createData: function createData(records) {
1111
- var _this14 = this;
1142
+ var _this15 = this;
1112
1143
  return this.$nextTick().then(function () {
1113
- return _this14.defineField(records);
1144
+ return _this15.defineField(records);
1114
1145
  });
1115
1146
  },
1116
1147
  /**
@@ -1135,7 +1166,7 @@ var Methods = {
1135
1166
  * 如果还额外传了 field 则还原指定的单元格数据
1136
1167
  */
1137
1168
  revertData: function revertData(rows, field) {
1138
- var _this15 = this;
1169
+ var _this16 = this;
1139
1170
  var keepSource = this.keepSource,
1140
1171
  tableSourceData = this.tableSourceData,
1141
1172
  treeConfig = this.treeConfig;
@@ -1155,8 +1186,8 @@ var Methods = {
1155
1186
  }
1156
1187
  if (targetRows.length) {
1157
1188
  targetRows.forEach(function (row) {
1158
- if (!_this15.isInsertByRow(row)) {
1159
- var rowIndex = _this15.getRowIndex(row);
1189
+ if (!_this16.isInsertByRow(row)) {
1190
+ var rowIndex = _this16.getRowIndex(row);
1160
1191
  if (treeConfig && rowIndex === -1) {
1161
1192
  (0, _log.errLog)('vxe.error.noTree', ['revertData']);
1162
1193
  }
@@ -1230,39 +1261,24 @@ var Methods = {
1230
1261
  * @param {String} field 字段名
1231
1262
  */
1232
1263
  isUpdateByRow: function isUpdateByRow(row, field) {
1233
- var _this16 = this;
1234
1264
  var tableFullColumn = this.tableFullColumn,
1235
1265
  keepSource = this.keepSource,
1236
- treeConfig = this.treeConfig,
1237
- treeOpts = this.treeOpts,
1238
- tableSourceData = this.tableSourceData,
1266
+ sourceDataRowIdData = this.sourceDataRowIdData,
1239
1267
  fullDataRowIdData = this.fullDataRowIdData;
1240
1268
  if (keepSource) {
1241
- var oRow, property;
1242
1269
  var rowid = (0, _util.getRowid)(this, row);
1243
1270
  // 新增的数据不需要检测
1244
1271
  if (!fullDataRowIdData[rowid]) {
1245
1272
  return false;
1246
1273
  }
1247
- if (treeConfig) {
1248
- var children = treeOpts.children;
1249
- var matchObj = _xeUtils["default"].findTree(tableSourceData, function (item) {
1250
- return rowid === (0, _util.getRowid)(_this16, item);
1251
- }, treeOpts);
1252
- row = Object.assign({}, row, _defineProperty({}, children, null));
1253
- if (matchObj) {
1254
- oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
1255
- }
1256
- } else {
1257
- var oRowIndex = fullDataRowIdData[rowid].index;
1258
- oRow = tableSourceData[oRowIndex];
1259
- }
1260
- if (oRow) {
1274
+ var oldRest = sourceDataRowIdData[rowid];
1275
+ if (oldRest) {
1276
+ var oRow = oldRest.row;
1261
1277
  if (arguments.length > 1) {
1262
1278
  return !eqCellValue(oRow, row, field);
1263
1279
  }
1264
1280
  for (var index = 0, len = tableFullColumn.length; index < len; index++) {
1265
- property = tableFullColumn[index].field;
1281
+ var property = tableFullColumn[index].field;
1266
1282
  if (property && !eqCellValue(oRow, row, property)) {
1267
1283
  return true;
1268
1284
  }
@@ -1327,9 +1343,9 @@ var Methods = {
1327
1343
  tableFullTreeData = this.tableFullTreeData,
1328
1344
  afterTreeFullData = this.afterTreeFullData;
1329
1345
  var transform = treeOpts.transform,
1330
- children = treeOpts.children,
1331
- mapChildren = treeOpts.mapChildren;
1346
+ mapChildrenField = treeOpts.mapChildrenField;
1332
1347
  var checkField = checkboxOpts.checkField;
1348
+ var childrenField = treeOpts.children || treeOpts.childrenField;
1333
1349
  var currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
1334
1350
  var rowList = [];
1335
1351
  if (checkField) {
@@ -1337,7 +1353,7 @@ var Methods = {
1337
1353
  rowList = _xeUtils["default"].filterTree(currTableData, function (row) {
1338
1354
  return _xeUtils["default"].get(row, checkField);
1339
1355
  }, {
1340
- children: transform ? mapChildren : children
1356
+ children: transform ? mapChildrenField : childrenField
1341
1357
  });
1342
1358
  } else {
1343
1359
  rowList = currTableData.filter(function (row) {
@@ -1345,16 +1361,16 @@ var Methods = {
1345
1361
  });
1346
1362
  }
1347
1363
  } else {
1348
- var selection = this.selection;
1364
+ var selectCheckboxRows = this.selectCheckboxRows;
1349
1365
  if (treeConfig) {
1350
1366
  rowList = _xeUtils["default"].filterTree(currTableData, function (row) {
1351
- return _this17.findRowIndexOf(selection, row) > -1;
1367
+ return _this17.findRowIndexOf(selectCheckboxRows, row) > -1;
1352
1368
  }, {
1353
- children: transform ? mapChildren : children
1369
+ children: transform ? mapChildrenField : childrenField
1354
1370
  });
1355
1371
  } else {
1356
1372
  rowList = currTableData.filter(function (row) {
1357
- return _this17.findRowIndexOf(selection, row) > -1;
1373
+ return _this17.findRowIndexOf(selectCheckboxRows, row) > -1;
1358
1374
  });
1359
1375
  }
1360
1376
  }
@@ -1379,7 +1395,7 @@ var Methods = {
1379
1395
  fullData.push(row);
1380
1396
  }
1381
1397
  }, {
1382
- children: treeOpts.mapChildren
1398
+ children: treeOpts.mapChildrenField
1383
1399
  });
1384
1400
  this.afterFullData = fullData;
1385
1401
  this.updateScrollYStatus(fullData);
@@ -1604,6 +1620,7 @@ var Methods = {
1604
1620
  fullAllDataRowIdData = this.fullAllDataRowIdData,
1605
1621
  afterTreeFullData = this.afterTreeFullData,
1606
1622
  treeOpts = this.treeOpts;
1623
+ var childrenField = treeOpts.children || treeOpts.childrenField;
1607
1624
  if (treeConfig) {
1608
1625
  _xeUtils["default"].eachTree(afterTreeFullData, function (row, index, items, path) {
1609
1626
  var rowid = (0, _util.getRowid)(_this19, row);
@@ -1630,7 +1647,7 @@ var Methods = {
1630
1647
  fullDataRowIdData[rowid] = rest;
1631
1648
  }
1632
1649
  }, {
1633
- children: treeOpts.transform ? treeOpts.mapChildren : treeOpts.children
1650
+ children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
1634
1651
  });
1635
1652
  } else {
1636
1653
  afterFullData.forEach(function (row, index) {
@@ -1795,7 +1812,7 @@ var Methods = {
1795
1812
  */
1796
1813
  showColumn: function showColumn(fieldOrColumn) {
1797
1814
  var column = (0, _util.handleFieldOrColumn)(this, fieldOrColumn);
1798
- if (column & !column.visible) {
1815
+ if (column && column.visible) {
1799
1816
  column.visible = true;
1800
1817
  return this.handleCustom();
1801
1818
  }
@@ -2445,6 +2462,7 @@ var Methods = {
2445
2462
  },
2446
2463
  updateHeight: function updateHeight() {
2447
2464
  this.customHeight = calcHeight(this, 'height');
2465
+ this.customMinHeight = calcHeight(this, 'minHeight');
2448
2466
  this.customMaxHeight = calcHeight(this, 'maxHeight');
2449
2467
  },
2450
2468
  updateStyle: function updateStyle() {
@@ -2454,6 +2472,7 @@ var Methods = {
2454
2472
  fullColumnIdData = this.fullColumnIdData,
2455
2473
  tableColumn = this.tableColumn,
2456
2474
  customHeight = this.customHeight,
2475
+ customMinHeight = this.customMinHeight,
2457
2476
  customMaxHeight = this.customMaxHeight,
2458
2477
  border = this.border,
2459
2478
  headerHeight = this.headerHeight,
@@ -2562,15 +2581,22 @@ var Methods = {
2562
2581
  } else if (layout === 'body') {
2563
2582
  var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
2564
2583
  if (isNodeElement(wrapperElem)) {
2584
+ var bodyMinHeight = fixedType ? customMinHeight - headerHeight - footerHeight - (showFooter ? 0 : scrollbarHeight) : customMinHeight - headerHeight - footerHeight;
2585
+ var bodyMaxHeight = 0;
2565
2586
  if (customMaxHeight) {
2566
- wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight - footerHeight, "px");
2567
- } else {
2568
- if (customHeight > 0) {
2569
- wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px");
2570
- } else {
2571
- wrapperElem.style.height = '';
2587
+ bodyMaxHeight = Math.max(bodyMinHeight, fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight - footerHeight);
2588
+ wrapperElem.style.maxHeight = "".concat(bodyMaxHeight, "px");
2589
+ }
2590
+ if (customHeight > 0) {
2591
+ var bodyHeight = fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight;
2592
+ if (bodyMaxHeight) {
2593
+ bodyHeight = Math.min(bodyMaxHeight, bodyHeight);
2572
2594
  }
2595
+ wrapperElem.style.height = "".concat(Math.max(bodyMinHeight, bodyHeight), "px");
2596
+ } else {
2597
+ wrapperElem.style.height = '';
2573
2598
  }
2599
+ wrapperElem.style.minHeight = "".concat(bodyMinHeight, "px");
2574
2600
  }
2575
2601
 
2576
2602
  // 如果是固定列
@@ -3452,12 +3478,12 @@ var Methods = {
3452
3478
  return this.handleCheckedCheckboxRow(rows, value, true);
3453
3479
  },
3454
3480
  isCheckedByCheckboxRow: function isCheckedByCheckboxRow(row) {
3455
- var selection = this.selection;
3481
+ var selectCheckboxRows = this.selectCheckboxRows;
3456
3482
  var checkField = this.checkboxOpts.checkField;
3457
3483
  if (checkField) {
3458
3484
  return _xeUtils["default"].get(row, checkField);
3459
3485
  }
3460
- return this.findRowIndexOf(selection, row) > -1;
3486
+ return this.findRowIndexOf(selectCheckboxRows, row) > -1;
3461
3487
  },
3462
3488
  isIndeterminateByCheckboxRow: function isIndeterminateByCheckboxRow(row) {
3463
3489
  var treeIndeterminates = this.treeIndeterminates;
@@ -3470,7 +3496,7 @@ var Methods = {
3470
3496
  handleSelectRow: function handleSelectRow(_ref6, value, isForce) {
3471
3497
  var _this33 = this;
3472
3498
  var row = _ref6.row;
3473
- var selection = this.selection,
3499
+ var selectCheckboxRows = this.selectCheckboxRows,
3474
3500
  afterFullData = this.afterFullData,
3475
3501
  treeConfig = this.treeConfig,
3476
3502
  treeOpts = this.treeOpts,
@@ -3542,7 +3568,7 @@ var Methods = {
3542
3568
  if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
3543
3569
  treeIndeterminates.push(row);
3544
3570
  }
3545
- _xeUtils["default"].remove(selection, function (item) {
3571
+ _xeUtils["default"].remove(selectCheckboxRows, function (item) {
3546
3572
  return _this33.eqRow(item, row);
3547
3573
  });
3548
3574
  } else {
@@ -3552,9 +3578,9 @@ var Methods = {
3552
3578
  row: item
3553
3579
  })) {
3554
3580
  if (value) {
3555
- selection.push(item);
3581
+ selectCheckboxRows.push(item);
3556
3582
  } else {
3557
- _xeUtils["default"].remove(selection, function (select) {
3583
+ _xeUtils["default"].remove(selectCheckboxRows, function (select) {
3558
3584
  return _this33.eqRow(select, item);
3559
3585
  });
3560
3586
  }
@@ -3583,7 +3609,7 @@ var Methods = {
3583
3609
  _parentStatus = -1;
3584
3610
  } else {
3585
3611
  var _selectItems = _matchObj.items.filter(function (item) {
3586
- return _this33.findRowIndexOf(selection, item) > -1;
3612
+ return _this33.findRowIndexOf(selectCheckboxRows, item) > -1;
3587
3613
  });
3588
3614
  _parentStatus = _selectItems.filter(function (item) {
3589
3615
  return _this33.findRowIndexOf(_vItems, item) > -1;
@@ -3598,11 +3624,11 @@ var Methods = {
3598
3624
  row: row
3599
3625
  })) {
3600
3626
  if (value) {
3601
- if (this.findRowIndexOf(selection, row) === -1) {
3602
- selection.push(row);
3627
+ if (this.findRowIndexOf(selectCheckboxRows, row) === -1) {
3628
+ selectCheckboxRows.push(row);
3603
3629
  }
3604
3630
  } else {
3605
- _xeUtils["default"].remove(selection, function (item) {
3631
+ _xeUtils["default"].remove(selectCheckboxRows, function (item) {
3606
3632
  return _this33.eqRow(item, row);
3607
3633
  });
3608
3634
  }
@@ -3613,11 +3639,11 @@ var Methods = {
3613
3639
  this.checkSelectionStatus();
3614
3640
  },
3615
3641
  handleToggleCheckRowEvent: function handleToggleCheckRowEvent(evnt, params) {
3616
- var selection = this.selection,
3642
+ var selectCheckboxRows = this.selectCheckboxRows,
3617
3643
  checkboxOpts = this.checkboxOpts;
3618
3644
  var checkField = checkboxOpts.checkField;
3619
3645
  var row = params.row;
3620
- var value = checkField ? !_xeUtils["default"].get(row, checkField) : this.findRowIndexOf(selection, row) === -1;
3646
+ var value = checkField ? !_xeUtils["default"].get(row, checkField) : this.findRowIndexOf(selectCheckboxRows, row) === -1;
3621
3647
  if (evnt) {
3622
3648
  this.triggerCheckRowEvent(evnt, params, value);
3623
3649
  } else {
@@ -3642,10 +3668,10 @@ var Methods = {
3642
3668
  * 多选,切换某一行的选中状态
3643
3669
  */
3644
3670
  toggleCheckboxRow: function toggleCheckboxRow(row) {
3645
- var selection = this.selection,
3671
+ var selectCheckboxRows = this.selectCheckboxRows,
3646
3672
  checkboxOpts = this.checkboxOpts;
3647
3673
  var checkField = checkboxOpts.checkField;
3648
- var value = checkField ? !_xeUtils["default"].get(row, checkField) : this.findRowIndexOf(selection, row) === -1;
3674
+ var value = checkField ? !_xeUtils["default"].get(row, checkField) : this.findRowIndexOf(selectCheckboxRows, row) === -1;
3649
3675
  this.handleSelectRow({
3650
3676
  row: row
3651
3677
  }, value, true);
@@ -3656,7 +3682,7 @@ var Methods = {
3656
3682
  var afterFullData = this.afterFullData,
3657
3683
  treeConfig = this.treeConfig,
3658
3684
  treeOpts = this.treeOpts,
3659
- selection = this.selection,
3685
+ selectCheckboxRows = this.selectCheckboxRows,
3660
3686
  checkboxReserveRowMap = this.checkboxReserveRowMap,
3661
3687
  checkboxOpts = this.checkboxOpts;
3662
3688
  var checkField = checkboxOpts.checkField,
@@ -3664,7 +3690,7 @@ var Methods = {
3664
3690
  checkStrictly = checkboxOpts.checkStrictly,
3665
3691
  checkMethod = checkboxOpts.checkMethod;
3666
3692
  var selectRows = [];
3667
- var beforeSelection = treeConfig ? [] : selection.filter(function (row) {
3693
+ var beforeSelection = treeConfig ? [] : selectCheckboxRows.filter(function (row) {
3668
3694
  return _this34.findRowIndexOf(afterFullData, row) === -1;
3669
3695
  });
3670
3696
  if (checkStrictly) {
@@ -3719,7 +3745,7 @@ var Methods = {
3719
3745
  _xeUtils["default"].eachTree(afterFullData, function (row) {
3720
3746
  if (checkMethod({
3721
3747
  row: row
3722
- }) ? 0 : _this34.findRowIndexOf(selection, row) > -1) {
3748
+ }) ? 0 : _this34.findRowIndexOf(selectCheckboxRows, row) > -1) {
3723
3749
  selectRows.push(row);
3724
3750
  }
3725
3751
  }, treeOpts);
@@ -3734,7 +3760,7 @@ var Methods = {
3734
3760
  */
3735
3761
  if (!isForce && checkMethod) {
3736
3762
  selectRows = afterFullData.filter(function (row) {
3737
- return _this34.findRowIndexOf(selection, row) > -1 || checkMethod({
3763
+ return _this34.findRowIndexOf(selectCheckboxRows, row) > -1 || checkMethod({
3738
3764
  row: row
3739
3765
  });
3740
3766
  });
@@ -3751,7 +3777,7 @@ var Methods = {
3751
3777
  selectRows = afterFullData.filter(function (row) {
3752
3778
  return checkMethod({
3753
3779
  row: row
3754
- }) ? 0 : _this34.findRowIndexOf(selection, row) > -1;
3780
+ }) ? 0 : _this34.findRowIndexOf(selectCheckboxRows, row) > -1;
3755
3781
  });
3756
3782
  }
3757
3783
  }
@@ -3768,7 +3794,7 @@ var Methods = {
3768
3794
  });
3769
3795
  }
3770
3796
  }
3771
- this.selection = checkField ? [] : beforeSelection.concat(selectRows);
3797
+ this.selectCheckboxRows = checkField ? [] : beforeSelection.concat(selectRows);
3772
3798
  }
3773
3799
  this.treeIndeterminates = [];
3774
3800
  this.checkSelectionStatus();
@@ -3784,7 +3810,7 @@ var Methods = {
3784
3810
  checkSelectionStatus: function checkSelectionStatus() {
3785
3811
  var _this35 = this;
3786
3812
  var afterFullData = this.afterFullData,
3787
- selection = this.selection,
3813
+ selectCheckboxRows = this.selectCheckboxRows,
3788
3814
  treeIndeterminates = this.treeIndeterminates,
3789
3815
  checkboxOpts = this.checkboxOpts,
3790
3816
  treeConfig = this.treeConfig;
@@ -3844,22 +3870,22 @@ var Methods = {
3844
3870
  disableRows.push(row);
3845
3871
  return true;
3846
3872
  }
3847
- if (_this35.findRowIndexOf(selection, row) > -1) {
3873
+ if (_this35.findRowIndexOf(selectCheckboxRows, row) > -1) {
3848
3874
  checkRows.push(row);
3849
3875
  return true;
3850
3876
  }
3851
3877
  return false;
3852
3878
  } : function (row) {
3853
- return _this35.findRowIndexOf(selection, row) > -1;
3879
+ return _this35.findRowIndexOf(selectCheckboxRows, row) > -1;
3854
3880
  });
3855
3881
  isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
3856
3882
  if (treeConfig) {
3857
3883
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
3858
- return _this35.findRowIndexOf(treeIndeterminates, row) > -1 || _this35.findRowIndexOf(selection, row) > -1;
3884
+ return _this35.findRowIndexOf(treeIndeterminates, row) > -1 || _this35.findRowIndexOf(selectCheckboxRows, row) > -1;
3859
3885
  });
3860
3886
  } else {
3861
3887
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
3862
- return _this35.findRowIndexOf(selection, row) > -1;
3888
+ return _this35.findRowIndexOf(selectCheckboxRows, row) > -1;
3863
3889
  });
3864
3890
  }
3865
3891
  }
@@ -3879,7 +3905,7 @@ var Methods = {
3879
3905
  radioReserveRow = this.radioReserveRow,
3880
3906
  radioOpts = this.radioOpts,
3881
3907
  checkboxOpts = this.checkboxOpts,
3882
- selection = this.selection,
3908
+ selectCheckboxRows = this.selectCheckboxRows,
3883
3909
  rowExpandeds = this.rowExpandeds,
3884
3910
  treeExpandeds = this.treeExpandeds,
3885
3911
  expandOpts = this.expandOpts;
@@ -3895,7 +3921,7 @@ var Methods = {
3895
3921
  }
3896
3922
  }
3897
3923
  // 复选框
3898
- this.selection = getRecoverRow(this, selection); // 刷新多选行状态
3924
+ this.selectCheckboxRows = getRecoverRow(this, selectCheckboxRows); // 刷新多选行状态
3899
3925
  // 还原保留选中状态
3900
3926
  if (checkboxOpts.reserve) {
3901
3927
  this.handleCheckedCheckboxRow(handleReserveRow(this, this.checkboxReserveRowMap), true, true);
@@ -4065,7 +4091,7 @@ var Methods = {
4065
4091
  }
4066
4092
  this.isAllSelected = false;
4067
4093
  this.isIndeterminate = false;
4068
- this.selection = [];
4094
+ this.selectCheckboxRows = [];
4069
4095
  this.treeIndeterminates = [];
4070
4096
  return this.$nextTick();
4071
4097
  },
@@ -4486,12 +4512,18 @@ var Methods = {
4486
4512
  });
4487
4513
  }
4488
4514
  var params = {
4515
+ $table: this,
4516
+ $event: evnt,
4489
4517
  column: column,
4490
4518
  field: field,
4491
4519
  property: field,
4492
4520
  order: column.order,
4493
- sortList: this.getSortColumns()
4521
+ sortList: this.getSortColumns(),
4522
+ sortTime: column.sortTime
4494
4523
  };
4524
+ if (this.mouseConfig && this.mouseOpts.area && this.handleSortEvent) {
4525
+ return this.handleSortEvent(evnt, params);
4526
+ }
4495
4527
  this.emitEvent('sort-change', params, evnt);
4496
4528
  }
4497
4529
  },
@@ -4541,7 +4573,10 @@ var Methods = {
4541
4573
  if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
4542
4574
  this.handleTableData(true);
4543
4575
  }
4544
- return this.$nextTick().then(this.updateStyle);
4576
+ return this.$nextTick().then(function () {
4577
+ _this41.updateCellAreas();
4578
+ return _this41.updateStyle();
4579
+ });
4545
4580
  }
4546
4581
  return this.$nextTick();
4547
4582
  },
@@ -4748,7 +4783,19 @@ var Methods = {
4748
4783
  * @param {Boolean} expanded 是否展开
4749
4784
  */
4750
4785
  setAllRowExpand: function setAllRowExpand(expanded) {
4751
- return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
4786
+ var treeConfig = this.treeConfig,
4787
+ treeOpts = this.treeOpts,
4788
+ tableFullData = this.tableFullData,
4789
+ tableFullTreeData = this.tableFullTreeData;
4790
+ var expandedRows = [];
4791
+ if (treeConfig) {
4792
+ _xeUtils["default"].eachTree(tableFullTreeData, function (row) {
4793
+ expandedRows.push(row);
4794
+ }, treeOpts);
4795
+ } else {
4796
+ expandedRows = tableFullData;
4797
+ }
4798
+ return this.setRowExpand(expandedRows, expanded);
4752
4799
  },
4753
4800
  handleAsyncRowExpand: function handleAsyncRowExpand(row) {
4754
4801
  var _this44 = this;
@@ -4940,9 +4987,9 @@ var Methods = {
4940
4987
  var treeOpts = this.treeOpts,
4941
4988
  treeLazyLoadeds = this.treeLazyLoadeds;
4942
4989
  var transform = treeOpts.transform,
4943
- lazy = treeOpts.lazy,
4944
- hasChild = treeOpts.hasChild;
4945
- if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
4990
+ lazy = treeOpts.lazy;
4991
+ var hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
4992
+ if (lazy && row[hasChildField] && treeLazyLoadeds.indexOf(row) === -1) {
4946
4993
  this.clearTreeExpandLoaded(row).then(function () {
4947
4994
  return _this47.handleAsyncTreeExpandChilds(row);
4948
4995
  }).then(function () {
@@ -5082,11 +5129,11 @@ var Methods = {
5082
5129
  setAllTreeExpand: function setAllTreeExpand(expanded) {
5083
5130
  var tableFullData = this.tableFullData,
5084
5131
  treeOpts = this.treeOpts;
5085
- var lazy = treeOpts.lazy,
5086
- children = treeOpts.children;
5132
+ var lazy = treeOpts.lazy;
5133
+ var childrenField = treeOpts.children || treeOpts.childrenField;
5087
5134
  var expandeds = [];
5088
5135
  _xeUtils["default"].eachTree(tableFullData, function (row) {
5089
- var rowChildren = row[children];
5136
+ var rowChildren = row[childrenField];
5090
5137
  if (lazy || rowChildren && rowChildren.length) {
5091
5138
  expandeds.push(row);
5092
5139
  }
@@ -5109,10 +5156,10 @@ var Methods = {
5109
5156
  treeNodeColumn = this.treeNodeColumn;
5110
5157
  var reserve = treeOpts.reserve,
5111
5158
  lazy = treeOpts.lazy,
5112
- hasChild = treeOpts.hasChild,
5113
- children = treeOpts.children,
5114
5159
  accordion = treeOpts.accordion,
5115
5160
  toggleMethod = treeOpts.toggleMethod;
5161
+ var childrenField = treeOpts.children || treeOpts.childrenField;
5162
+ var hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
5116
5163
  var result = [];
5117
5164
  var columnIndex = this.getColumnIndex(treeNodeColumn);
5118
5165
  var $columnIndex = this.getVMColumnIndex(treeNodeColumn);
@@ -5141,12 +5188,12 @@ var Methods = {
5141
5188
  validRows.forEach(function (row) {
5142
5189
  if (treeExpandeds.indexOf(row) === -1) {
5143
5190
  var rest = fullAllDataRowMap.get(row);
5144
- var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1;
5191
+ var isLoad = lazy && row[hasChildField] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1;
5145
5192
  // 是否使用懒加载
5146
5193
  if (isLoad) {
5147
5194
  result.push(_this49.handleAsyncTreeExpandChilds(row));
5148
5195
  } else {
5149
- if (row[children] && row[children].length) {
5196
+ if (row[childrenField] && row[childrenField].length) {
5150
5197
  treeExpandeds.push(row);
5151
5198
  }
5152
5199
  }
@@ -5631,16 +5678,16 @@ var Methods = {
5631
5678
  * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
5632
5679
  * 如果单元格配置了校验规则,则会进行校验
5633
5680
  */
5634
- updateStatus: function updateStatus(scope, cellValue) {
5681
+ updateStatus: function updateStatus(slotParams, cellValue) {
5635
5682
  var _this57 = this;
5636
5683
  var customVal = !_xeUtils["default"].isUndefined(cellValue);
5637
5684
  return this.$nextTick().then(function () {
5638
5685
  var $refs = _this57.$refs,
5639
5686
  editRules = _this57.editRules,
5640
5687
  validStore = _this57.validStore;
5641
- if (scope && $refs.tableBody && editRules) {
5642
- var row = scope.row,
5643
- column = scope.column;
5688
+ if (slotParams && $refs.tableBody && editRules) {
5689
+ var row = slotParams.row,
5690
+ column = slotParams.column;
5644
5691
  var type = 'change';
5645
5692
  if (_this57.hasCellRules(type, row, column)) {
5646
5693
  var cell = _this57.getCell(row, column);
@@ -5831,11 +5878,11 @@ var Methods = {
5831
5878
  columnIndex: this.getColumnIndex(column)
5832
5879
  };
5833
5880
  if (_xeUtils["default"].isString(formatter)) {
5834
- var globalFunc = _formats.formats.get(formatter);
5835
- cellLabel = globalFunc ? globalFunc(formatParams) : '';
5881
+ var gFormatOpts = _formats.formats.get(formatter);
5882
+ cellLabel = gFormatOpts && gFormatOpts.cellFormatMethod ? gFormatOpts.cellFormatMethod(formatParams) : '';
5836
5883
  } else if (_xeUtils["default"].isArray(formatter)) {
5837
- var _globalFunc = _formats.formats.get(formatter[0]);
5838
- cellLabel = _globalFunc ? _globalFunc.apply(void 0, [formatParams].concat(_toConsumableArray(formatter.slice(1)))) : '';
5884
+ var _gFormatOpts = _formats.formats.get(formatter[0]);
5885
+ cellLabel = _gFormatOpts && _gFormatOpts.cellFormatMethod ? _gFormatOpts.cellFormatMethod.apply(_gFormatOpts, [formatParams].concat(_toConsumableArray(formatter.slice(1)))) : '';
5839
5886
  } else {
5840
5887
  cellLabel = formatter(formatParams);
5841
5888
  }