vxe-table 3.4.13 → 3.4.14-beta.3

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 (54) hide show
  1. package/README.md +2 -2
  2. package/README.zh-TW.md +2 -2
  3. package/lib/export/style/style.css +2 -0
  4. package/lib/export/style/style.min.css +1 -1
  5. package/lib/filter/src/mixin.js +24 -13
  6. package/lib/filter/src/mixin.min.js +1 -1
  7. package/lib/filter/style/style.css +2 -0
  8. package/lib/filter/style/style.min.css +1 -1
  9. package/lib/form/src/form.js +4 -0
  10. package/lib/form/src/form.min.js +1 -1
  11. package/lib/index.css +1 -1
  12. package/lib/index.umd.js +490 -349
  13. package/lib/index.umd.min.js +1 -1
  14. package/lib/input/src/date.js +54 -0
  15. package/lib/input/src/date.min.js +1 -0
  16. package/lib/input/src/input.js +12 -59
  17. package/lib/input/src/input.min.js +1 -1
  18. package/lib/input/src/number.js +23 -0
  19. package/lib/input/src/number.min.js +1 -0
  20. package/lib/pager/src/pager.js +15 -1
  21. package/lib/pager/src/pager.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/table/src/body.js +36 -10
  25. package/lib/table/src/body.min.js +1 -1
  26. package/lib/table/src/cell.js +5 -6
  27. package/lib/table/src/cell.min.js +1 -1
  28. package/lib/table/src/methods.js +365 -301
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/style/style.css +2 -0
  31. package/lib/table/style/style.min.css +1 -1
  32. package/lib/toolbar/style/style.css +2 -0
  33. package/lib/toolbar/style/style.min.css +1 -1
  34. package/lib/tools/src/dom.js +14 -1
  35. package/lib/tools/src/dom.min.js +1 -1
  36. package/lib/validator/src/mixin.js +2 -0
  37. package/lib/validator/src/mixin.min.js +1 -1
  38. package/package.json +1 -1
  39. package/packages/filter/src/mixin.js +17 -10
  40. package/packages/form/src/form.js +4 -3
  41. package/packages/input/src/date.js +38 -0
  42. package/packages/input/src/input.js +4 -46
  43. package/packages/input/src/number.js +12 -0
  44. package/packages/pager/src/pager.js +15 -1
  45. package/packages/table/src/body.js +32 -11
  46. package/packages/table/src/cell.js +4 -6
  47. package/packages/table/src/methods.js +71 -20
  48. package/packages/tools/src/dom.js +13 -1
  49. package/packages/validator/src/mixin.js +11 -1
  50. package/styles/base/checked.scss +5 -0
  51. package/types/all.d.ts +1 -0
  52. package/types/column.d.ts +7 -1
  53. package/types/form.d.ts +2 -1
  54. package/types/table.d.ts +6 -2
@@ -52,7 +52,8 @@ var calcHeight = _tools.DomTools.calcHeight,
52
52
  hasClass = _tools.DomTools.hasClass,
53
53
  addClass = _tools.DomTools.addClass,
54
54
  removeClass = _tools.DomTools.removeClass,
55
- getEventTargetNode = _tools.DomTools.getEventTargetNode;
55
+ getEventTargetNode = _tools.DomTools.getEventTargetNode,
56
+ isNodeElement = _tools.DomTools.isNodeElement;
56
57
  var isWebkit = _dom.browse['-webkit'] && !_dom.browse.edge;
57
58
  var debounceScrollYDuration = _dom.browse.msie ? 80 : 20;
58
59
  var resizableStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_WIDTH';
@@ -432,14 +433,43 @@ var Methods = {
432
433
  },
433
434
 
434
435
  /**
435
- * 手动处理数据
436
+ * 手动处理数据,用于手动排序与筛选
436
437
  * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
437
438
  */
438
439
  updateData: function updateData() {
439
- return this.handleTableData(true).then(this.updateFooter).then(this.recalculate);
440
+ var _this2 = this;
441
+
442
+ var scrollXLoad = this.scrollXLoad,
443
+ scrollYLoad = this.scrollYLoad;
444
+ return this.handleTableData(true).then(function () {
445
+ _this2.updateFooter();
446
+
447
+ _this2.checkSelectionStatus();
448
+
449
+ if (scrollXLoad || scrollYLoad) {
450
+ if (scrollXLoad) {
451
+ _this2.updateScrollXSpace();
452
+ }
453
+
454
+ if (scrollYLoad) {
455
+ _this2.updateScrollYSpace();
456
+ }
457
+
458
+ return _this2.refreshScroll();
459
+ }
460
+ }).then(function () {
461
+ _this2.updateCellAreas();
462
+
463
+ return _this2.recalculate(true);
464
+ }).then(function () {
465
+ // 存在滚动行为未结束情况
466
+ setTimeout(function () {
467
+ return _this2.recalculate();
468
+ }, 50);
469
+ });
440
470
  },
441
471
  handleTableData: function handleTableData(force) {
442
- var _this2 = this;
472
+ var _this3 = this;
443
473
 
444
474
  var scrollYLoad = this.scrollYLoad,
445
475
  scrollYStore = this.scrollYStore,
@@ -456,7 +486,7 @@ var Methods = {
456
486
 
457
487
  var tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
458
488
  tableData.forEach(function (row, $index) {
459
- var rowid = getRowid(_this2, row);
489
+ var rowid = getRowid(_this3, row);
460
490
  var rest = fullDataRowIdData[rowid];
461
491
 
462
492
  if (rest) {
@@ -481,7 +511,7 @@ var Methods = {
481
511
  * @param {Array} datas 数据
482
512
  */
483
513
  loadTableData: function loadTableData(datas) {
484
- var _this3 = this;
514
+ var _this4 = this;
485
515
 
486
516
  var keepSource = this.keepSource,
487
517
  treeConfig = this.treeConfig,
@@ -584,31 +614,31 @@ var Methods = {
584
614
  this.handleTableData(true);
585
615
  this.updateFooter();
586
616
  return this.$nextTick().then(function () {
587
- _this3.updateHeight();
617
+ _this4.updateHeight();
588
618
 
589
- _this3.updateStyle();
619
+ _this4.updateStyle();
590
620
  }).then(function () {
591
- _this3.computeScrollLoad();
621
+ _this4.computeScrollLoad();
592
622
  }).then(function () {
593
623
  // 是否启用了虚拟滚动
594
624
  if (sYLoad) {
595
625
  scrollYStore.endIndex = scrollYStore.visibleSize;
596
626
  }
597
627
 
598
- _this3.handleReserveStatus();
628
+ _this4.handleReserveStatus();
599
629
 
600
- _this3.checkSelectionStatus();
630
+ _this4.checkSelectionStatus();
601
631
 
602
632
  return new Promise(function (resolve) {
603
- _this3.$nextTick().then(function () {
604
- return _this3.recalculate();
633
+ _this4.$nextTick().then(function () {
634
+ return _this4.recalculate();
605
635
  }).then(function () {
606
636
  // 是否变更虚拟滚动
607
637
  if (oldScrollYLoad === sYLoad) {
608
- (0, _util.restoreScrollLocation)(_this3, lastScrollLeft, lastScrollTop).then(resolve);
638
+ (0, _util.restoreScrollLocation)(_this4, lastScrollLeft, lastScrollTop).then(resolve);
609
639
  } else {
610
640
  setTimeout(function () {
611
- return (0, _util.restoreScrollLocation)(_this3, lastScrollLeft, lastScrollTop).then(resolve);
641
+ return (0, _util.restoreScrollLocation)(_this4, lastScrollLeft, lastScrollTop).then(resolve);
612
642
  });
613
643
  }
614
644
  });
@@ -621,23 +651,23 @@ var Methods = {
621
651
  * @param {Array} datas 数据
622
652
  */
623
653
  loadData: function loadData(datas) {
624
- var _this4 = this;
654
+ var _this5 = this;
625
655
 
626
656
  var inited = this.inited,
627
657
  initStatus = this.initStatus;
628
658
  return this.loadTableData(datas).then(function () {
629
- _this4.inited = true;
630
- _this4.initStatus = true;
659
+ _this5.inited = true;
660
+ _this5.initStatus = true;
631
661
 
632
662
  if (!initStatus) {
633
- _this4.handleLoadDefaults();
663
+ _this5.handleLoadDefaults();
634
664
  }
635
665
 
636
666
  if (!inited) {
637
- _this4.handleInitDefaults();
667
+ _this5.handleInitDefaults();
638
668
  }
639
669
 
640
- return _this4.recalculate();
670
+ return _this5.recalculate();
641
671
  });
642
672
  },
643
673
 
@@ -646,21 +676,21 @@ var Methods = {
646
676
  * @param {Array} datas 数据
647
677
  */
648
678
  reloadData: function reloadData(datas) {
649
- var _this5 = this;
679
+ var _this6 = this;
650
680
 
651
681
  var inited = this.inited;
652
682
  return this.clearAll().then(function () {
653
- _this5.inited = true;
654
- _this5.initStatus = true;
655
- return _this5.loadTableData(datas);
683
+ _this6.inited = true;
684
+ _this6.initStatus = true;
685
+ return _this6.loadTableData(datas);
656
686
  }).then(function () {
657
- _this5.handleLoadDefaults();
687
+ _this6.handleLoadDefaults();
658
688
 
659
689
  if (!inited) {
660
- _this5.handleInitDefaults();
690
+ _this6.handleInitDefaults();
661
691
  }
662
692
 
663
- return _this5.recalculate();
693
+ return _this6.recalculate();
664
694
  });
665
695
  },
666
696
 
@@ -710,10 +740,10 @@ var Methods = {
710
740
  * @param {ColumnInfo} columns 列配置
711
741
  */
712
742
  loadColumn: function loadColumn(columns) {
713
- var _this6 = this;
743
+ var _this7 = this;
714
744
 
715
745
  var collectColumn = _xeUtils.default.mapTree(columns, function (column) {
716
- return _cell.default.createColumn(_this6, column);
746
+ return _cell.default.createColumn(_this7, column);
717
747
  }, {
718
748
  children: 'children'
719
749
  });
@@ -727,14 +757,14 @@ var Methods = {
727
757
  * @param {ColumnInfo} columns 列配置
728
758
  */
729
759
  reloadColumn: function reloadColumn(columns) {
730
- var _this7 = this;
760
+ var _this8 = this;
731
761
 
732
762
  return this.clearAll().then(function () {
733
- return _this7.loadColumn(columns);
763
+ return _this8.loadColumn(columns);
734
764
  });
735
765
  },
736
766
  handleColumn: function handleColumn(collectColumn) {
737
- var _this8 = this;
767
+ var _this9 = this;
738
768
 
739
769
  this.collectColumn = collectColumn;
740
770
  var tableFullColumn = getColumnList(collectColumn);
@@ -742,8 +772,8 @@ var Methods = {
742
772
  this.cacheColumnMap();
743
773
  this.restoreCustomStorage();
744
774
  this.parseColumns().then(function () {
745
- if (_this8.scrollXLoad) {
746
- _this8.loadScrollXData(true);
775
+ if (_this9.scrollXLoad) {
776
+ _this9.loadScrollXData(true);
747
777
  }
748
778
  });
749
779
  this.clearMergeCells();
@@ -757,14 +787,14 @@ var Methods = {
757
787
  }
758
788
 
759
789
  return this.$nextTick().then(function () {
760
- if (_this8.$toolbar) {
761
- _this8.$toolbar.syncUpdate({
790
+ if (_this9.$toolbar) {
791
+ _this9.$toolbar.syncUpdate({
762
792
  collectColumn: collectColumn,
763
- $table: _this8
793
+ $table: _this9
764
794
  });
765
795
  }
766
796
 
767
- return _this8.recalculate();
797
+ return _this9.recalculate();
768
798
  });
769
799
  },
770
800
 
@@ -773,7 +803,7 @@ var Methods = {
773
803
  * 牺牲数据组装的耗时,用来换取使用过程中的流畅
774
804
  */
775
805
  cacheRowMap: function cacheRowMap(source) {
776
- var _this9 = this;
806
+ var _this10 = this;
777
807
 
778
808
  var treeConfig = this.treeConfig,
779
809
  treeOpts = this.treeOpts,
@@ -787,7 +817,7 @@ var Methods = {
787
817
  var isLazy = treeConfig && treeOpts.lazy;
788
818
 
789
819
  var handleCache = function handleCache(row, index, items, path, parent, nodes) {
790
- var rowid = getRowid(_this9, row);
820
+ var rowid = getRowid(_this10, row);
791
821
  var seq = treeConfig && path ? (0, _util.toTreePathSeq)(path) : index + 1;
792
822
  var level = nodes ? nodes.length - 1 : 0;
793
823
 
@@ -837,7 +867,7 @@ var Methods = {
837
867
  }
838
868
  },
839
869
  loadTreeChildren: function loadTreeChildren(row, childRecords) {
840
- var _this10 = this;
870
+ var _this11 = this;
841
871
 
842
872
  var keepSource = this.keepSource,
843
873
  tableSourceData = this.tableSourceData,
@@ -853,10 +883,10 @@ var Methods = {
853
883
  var parentLevel = rest ? rest.level : 0;
854
884
  return this.createData(childRecords).then(function (rows) {
855
885
  if (keepSource) {
856
- var rowid = getRowid(_this10, row);
886
+ var rowid = getRowid(_this11, row);
857
887
 
858
888
  var matchObj = _xeUtils.default.findTree(tableSourceData, function (item) {
859
- return rowid === getRowid(_this10, item);
889
+ return rowid === getRowid(_this11, item);
860
890
  }, treeOpts);
861
891
 
862
892
  if (matchObj) {
@@ -865,7 +895,7 @@ var Methods = {
865
895
  }
866
896
 
867
897
  _xeUtils.default.eachTree(rows, function (childRow, index, items, path, parent, nodes) {
868
- var rowid = getRowid(_this10, childRow);
898
+ var rowid = getRowid(_this11, childRow);
869
899
  var rest = {
870
900
  row: childRow,
871
901
  rowid: rowid,
@@ -889,7 +919,7 @@ var Methods = {
889
919
  row[mapChildren] = rows;
890
920
  }
891
921
 
892
- _this10.updateAfterDataIndex();
922
+ _this11.updateAfterDataIndex();
893
923
 
894
924
  return rows;
895
925
  });
@@ -900,7 +930,7 @@ var Methods = {
900
930
  * 牺牲数据组装的耗时,用来换取使用过程中的流畅
901
931
  */
902
932
  cacheColumnMap: function cacheColumnMap() {
903
- var _this11 = this;
933
+ var _this12 = this;
904
934
 
905
935
  var tableFullColumn = this.tableFullColumn,
906
936
  collectColumn = this.collectColumn,
@@ -987,16 +1017,16 @@ var Methods = {
987
1017
  }
988
1018
 
989
1019
  if (process.env.NODE_ENV === 'development') {
990
- if (_this11.showOverflow && column.showOverflow === false) {
991
- _tools.UtilTools.warn('vxe.error.errConflicts', ["table.show-overflow=".concat(_this11.showOverflow), "column.show-overflow=".concat(column.showOverflow)]);
1020
+ if (_this12.showOverflow && column.showOverflow === false) {
1021
+ _tools.UtilTools.warn('vxe.error.errConflicts', ["table.show-overflow=".concat(_this12.showOverflow), "column.show-overflow=".concat(column.showOverflow)]);
992
1022
  }
993
1023
 
994
- if (_this11.showHeaderOverflow && column.showHeaderOverflow === false) {
995
- _tools.UtilTools.warn('vxe.error.errConflicts', ["table.show-header-overflow=".concat(_this11.showHeaderOverflow), "column.show-header-overflow=".concat(column.showHeaderOverflow)]);
1024
+ if (_this12.showHeaderOverflow && column.showHeaderOverflow === false) {
1025
+ _tools.UtilTools.warn('vxe.error.errConflicts', ["table.show-header-overflow=".concat(_this12.showHeaderOverflow), "column.show-header-overflow=".concat(column.showHeaderOverflow)]);
996
1026
  }
997
1027
 
998
- if (_this11.showFooterOverflow && column.showFooterOverflow === false) {
999
- _tools.UtilTools.warn('vxe.error.errConflicts', ["table.show-footer-overflow=".concat(_this11.showFooterOverflow), "column.show-footer-overflow=".concat(column.showFooterOverflow)]);
1028
+ if (_this12.showFooterOverflow && column.showFooterOverflow === false) {
1029
+ _tools.UtilTools.warn('vxe.error.errConflicts', ["table.show-footer-overflow=".concat(_this12.showFooterOverflow), "column.show-footer-overflow=".concat(column.showFooterOverflow)]);
1000
1030
  }
1001
1031
  }
1002
1032
 
@@ -1248,13 +1278,13 @@ var Methods = {
1248
1278
  * @param {Array} records 新数据
1249
1279
  */
1250
1280
  createData: function createData(records) {
1251
- var _this12 = this;
1281
+ var _this13 = this;
1252
1282
 
1253
1283
  var treeConfig = this.treeConfig,
1254
1284
  treeOpts = this.treeOpts;
1255
1285
 
1256
1286
  var handleRrecord = function handleRrecord(record) {
1257
- return _this12.defineField(Object.assign({}, record));
1287
+ return _this13.defineField(Object.assign({}, record));
1258
1288
  };
1259
1289
 
1260
1290
  var rows = treeConfig ? _xeUtils.default.mapTree(records, handleRrecord, treeOpts) : records.map(handleRrecord);
@@ -1269,7 +1299,7 @@ var Methods = {
1269
1299
  * @param {Array/Object} records 新数据
1270
1300
  */
1271
1301
  createRow: function createRow(records) {
1272
- var _this13 = this;
1302
+ var _this14 = this;
1273
1303
 
1274
1304
  var isArr = _xeUtils.default.isArray(records);
1275
1305
 
@@ -1278,7 +1308,7 @@ var Methods = {
1278
1308
  }
1279
1309
 
1280
1310
  return this.$nextTick().then(function () {
1281
- return _this13.createData(records).then(function (rows) {
1311
+ return _this14.createData(records).then(function (rows) {
1282
1312
  return isArr ? rows : rows[0];
1283
1313
  });
1284
1314
  });
@@ -1292,7 +1322,7 @@ var Methods = {
1292
1322
  * 如果还额外传了 field 则还原指定的单元格数据
1293
1323
  */
1294
1324
  revertData: function revertData(rows, field) {
1295
- var _this14 = this;
1325
+ var _this15 = this;
1296
1326
 
1297
1327
  var keepSource = this.keepSource,
1298
1328
  tableSourceData = this.tableSourceData,
@@ -1318,8 +1348,8 @@ var Methods = {
1318
1348
 
1319
1349
  if (targetRows.length) {
1320
1350
  targetRows.forEach(function (row) {
1321
- if (!_this14.isInsertByRow(row)) {
1322
- var rowIndex = _this14.getRowIndex(row);
1351
+ if (!_this15.isInsertByRow(row)) {
1352
+ var rowIndex = _this15.getRowIndex(row);
1323
1353
 
1324
1354
  if (treeConfig && rowIndex === -1) {
1325
1355
  throw new Error(_tools.UtilTools.getLog('vxe.error.noTree', ['revertData']));
@@ -1403,7 +1433,7 @@ var Methods = {
1403
1433
  * @param {String} field 字段名
1404
1434
  */
1405
1435
  isUpdateByRow: function isUpdateByRow(row, field) {
1406
- var _this15 = this;
1436
+ var _this16 = this;
1407
1437
 
1408
1438
  var visibleColumn = this.visibleColumn,
1409
1439
  keepSource = this.keepSource,
@@ -1424,7 +1454,7 @@ var Methods = {
1424
1454
  var children = treeOpts.children;
1425
1455
 
1426
1456
  var matchObj = _xeUtils.default.findTree(tableSourceData, function (item) {
1427
- return rowid === getRowid(_this15, item);
1457
+ return rowid === getRowid(_this16, item);
1428
1458
  }, treeOpts);
1429
1459
 
1430
1460
  row = Object.assign({}, row, _defineProperty({}, children, null));
@@ -1589,7 +1619,7 @@ var Methods = {
1589
1619
  * 如果存在筛选条件,继续处理
1590
1620
  */
1591
1621
  updateAfterFullData: function updateAfterFullData() {
1592
- var _this16 = this;
1622
+ var _this17 = this;
1593
1623
 
1594
1624
  var tableFullColumn = this.tableFullColumn,
1595
1625
  tableFullData = this.tableFullData,
@@ -1667,7 +1697,7 @@ var Methods = {
1667
1697
  cellValue: cellValue,
1668
1698
  row: row,
1669
1699
  column: column,
1670
- $table: _this16
1700
+ $table: _this17
1671
1701
  });
1672
1702
  });
1673
1703
  } else if (compFilterMethod) {
@@ -1678,7 +1708,7 @@ var Methods = {
1678
1708
  cellValue: cellValue,
1679
1709
  row: row,
1680
1710
  column: column,
1681
- $table: _this16
1711
+ $table: _this17
1682
1712
  });
1683
1713
  });
1684
1714
  } else if (allFilterMethod) {
@@ -1697,7 +1727,7 @@ var Methods = {
1697
1727
  cellValue: cellValue,
1698
1728
  row: row,
1699
1729
  column: column,
1700
- $table: _this16
1730
+ $table: _this17
1701
1731
  });
1702
1732
  });
1703
1733
  }
@@ -1750,7 +1780,7 @@ var Methods = {
1750
1780
  tableTree = _xeUtils.default.orderBy(tableTree, orderColumns.map(function (_ref2) {
1751
1781
  var column = _ref2.column,
1752
1782
  order = _ref2.order;
1753
- return [getOrderField(_this16, column), order];
1783
+ return [getOrderField(_this17, column), order];
1754
1784
  }));
1755
1785
  }
1756
1786
 
@@ -1773,7 +1803,7 @@ var Methods = {
1773
1803
  tableData = _xeUtils.default.orderBy(tableData, orderColumns.map(function (_ref3) {
1774
1804
  var column = _ref3.column,
1775
1805
  order = _ref3.order;
1776
- return [getOrderField(_this16, column), order];
1806
+ return [getOrderField(_this17, column), order];
1777
1807
  }));
1778
1808
  } else {
1779
1809
  // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
@@ -1788,7 +1818,7 @@ var Methods = {
1788
1818
  tableData = _xeUtils.default.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref4) {
1789
1819
  var column = _ref4.column,
1790
1820
  order = _ref4.order;
1791
- return [getOrderField(_this16, column), order];
1821
+ return [getOrderField(_this17, column), order];
1792
1822
  }));
1793
1823
  }
1794
1824
  }
@@ -1807,7 +1837,7 @@ var Methods = {
1807
1837
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
1808
1838
  */
1809
1839
  updateAfterDataIndex: function updateAfterDataIndex() {
1810
- var _this17 = this;
1840
+ var _this18 = this;
1811
1841
 
1812
1842
  var treeConfig = this.treeConfig,
1813
1843
  afterFullData = this.afterFullData,
@@ -1818,7 +1848,7 @@ var Methods = {
1818
1848
 
1819
1849
  if (treeConfig) {
1820
1850
  _xeUtils.default.eachTree(afterTreeFullData, function (row, index, items, path) {
1821
- var rowid = getRowid(_this17, row);
1851
+ var rowid = getRowid(_this18, row);
1822
1852
  var allrest = fullAllDataRowIdData[rowid];
1823
1853
  var seq = path.map(function (num, i) {
1824
1854
  return i % 2 === 0 ? Number(num) + 1 : '.';
@@ -1847,7 +1877,7 @@ var Methods = {
1847
1877
  });
1848
1878
  } else {
1849
1879
  afterFullData.forEach(function (row, index) {
1850
- var rowid = getRowid(_this17, row);
1880
+ var rowid = getRowid(_this18, row);
1851
1881
  var allrest = fullAllDataRowIdData[rowid];
1852
1882
  var seq = index + 1;
1853
1883
 
@@ -1938,7 +1968,7 @@ var Methods = {
1938
1968
  * 默认执行一次,除非被重置
1939
1969
  */
1940
1970
  handleLoadDefaults: function handleLoadDefaults() {
1941
- var _this18 = this;
1971
+ var _this19 = this;
1942
1972
 
1943
1973
  if (this.checkboxConfig) {
1944
1974
  this.handleDefaultSelectionChecked();
@@ -1965,7 +1995,7 @@ var Methods = {
1965
1995
  }
1966
1996
 
1967
1997
  this.$nextTick(function () {
1968
- return setTimeout(_this18.recalculate);
1998
+ return setTimeout(_this19.recalculate);
1969
1999
  });
1970
2000
  },
1971
2001
 
@@ -2222,12 +2252,12 @@ var Methods = {
2222
2252
  * 刷新列配置
2223
2253
  */
2224
2254
  refreshColumn: function refreshColumn() {
2225
- var _this19 = this;
2255
+ var _this20 = this;
2226
2256
 
2227
2257
  return this.parseColumns().then(function () {
2228
- return _this19.refreshScroll();
2258
+ return _this20.refreshScroll();
2229
2259
  }).then(function () {
2230
- return _this19.recalculate();
2260
+ return _this20.recalculate();
2231
2261
  });
2232
2262
  },
2233
2263
 
@@ -2236,7 +2266,7 @@ var Methods = {
2236
2266
  * 将固定的列左边、右边分别靠边
2237
2267
  */
2238
2268
  parseColumns: function parseColumns() {
2239
- var _this20 = this;
2269
+ var _this21 = this;
2240
2270
 
2241
2271
  var leftList = [];
2242
2272
  var centerList = [];
@@ -2363,11 +2393,11 @@ var Methods = {
2363
2393
  this.visibleColumn = visibleColumn;
2364
2394
  this.handleTableColumn();
2365
2395
  return this.updateFooter().then(function () {
2366
- return _this20.recalculate();
2396
+ return _this21.recalculate();
2367
2397
  }).then(function () {
2368
- _this20.updateCellAreas();
2398
+ _this21.updateCellAreas();
2369
2399
 
2370
- return _this20.recalculate();
2400
+ return _this21.recalculate();
2371
2401
  });
2372
2402
  },
2373
2403
 
@@ -2423,6 +2453,8 @@ var Methods = {
2423
2453
  * 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
2424
2454
  */
2425
2455
  refreshScroll: function refreshScroll() {
2456
+ var _this22 = this;
2457
+
2426
2458
  var lastScrollLeft = this.lastScrollLeft,
2427
2459
  lastScrollTop = this.lastScrollTop;
2428
2460
  var $refs = this.$refs;
@@ -2433,17 +2465,24 @@ var Methods = {
2433
2465
  var tableBodyElem = tableBody ? tableBody.$el : null;
2434
2466
  var leftBodyElem = leftBody ? leftBody.$el : null;
2435
2467
  var rightBodyElem = rightBody ? rightBody.$el : null;
2436
- var tableFooterElem = tableFooter ? tableFooter.$el : null; // 还原滚动条位置
2468
+ var tableFooterElem = tableFooter ? tableFooter.$el : null;
2469
+ return new Promise(function (resolve) {
2470
+ // 还原滚动条位置
2471
+ if (lastScrollLeft || lastScrollTop) {
2472
+ return (0, _util.restoreScrollLocation)(_this22, lastScrollLeft, lastScrollTop).then(function () {
2473
+ // 存在滚动行为未结束情况
2474
+ setTimeout(resolve, 30);
2475
+ });
2476
+ } // 重置
2437
2477
 
2438
- if (lastScrollLeft || lastScrollTop) {
2439
- return (0, _util.restoreScrollLocation)(this, lastScrollLeft, lastScrollTop);
2440
- } // 重置
2441
2478
 
2479
+ (0, _dom.setScrollTop)(tableBodyElem, lastScrollTop);
2480
+ (0, _dom.setScrollTop)(leftBodyElem, lastScrollTop);
2481
+ (0, _dom.setScrollTop)(rightBodyElem, lastScrollTop);
2482
+ (0, _dom.setScrollLeft)(tableFooterElem, lastScrollLeft); // 存在滚动行为未结束情况
2442
2483
 
2443
- (0, _dom.setScrollTop)(tableBodyElem, lastScrollTop);
2444
- (0, _dom.setScrollTop)(leftBodyElem, lastScrollTop);
2445
- (0, _dom.setScrollTop)(rightBodyElem, lastScrollTop);
2446
- (0, _dom.setScrollLeft)(tableFooterElem, lastScrollLeft);
2484
+ setTimeout(resolve, 30);
2485
+ });
2447
2486
  },
2448
2487
 
2449
2488
  /**
@@ -2451,7 +2490,7 @@ var Methods = {
2451
2490
  * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?%
2452
2491
  */
2453
2492
  recalculate: function recalculate(refull) {
2454
- var _this21 = this;
2493
+ var _this23 = this;
2455
2494
 
2456
2495
  var $refs = this.$refs;
2457
2496
  var tableBody = $refs.tableBody,
@@ -2467,9 +2506,9 @@ var Methods = {
2467
2506
  if (refull === true) {
2468
2507
  // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
2469
2508
  return this.computeScrollLoad().then(function () {
2470
- _this21.autoCellWidth(headerElem, bodyElem, footerElem);
2509
+ _this23.autoCellWidth(headerElem, bodyElem, footerElem);
2471
2510
 
2472
- return _this21.computeScrollLoad();
2511
+ return _this23.computeScrollLoad();
2473
2512
  });
2474
2513
  }
2475
2514
  }
@@ -2617,7 +2656,7 @@ var Methods = {
2617
2656
  this.customMaxHeight = calcHeight(this, 'maxHeight');
2618
2657
  },
2619
2658
  updateStyle: function updateStyle() {
2620
- var _this22 = this;
2659
+ var _this24 = this;
2621
2660
 
2622
2661
  var $refs = this.$refs,
2623
2662
  isGroup = this.isGroup,
@@ -2721,7 +2760,7 @@ var Methods = {
2721
2760
 
2722
2761
  if (isGroup && listElem) {
2723
2762
  _xeUtils.default.arrayEach(listElem.querySelectorAll('.col--group'), function (thElem) {
2724
- var colNode = _this22.getColumnNode(thElem);
2763
+ var colNode = _this24.getColumnNode(thElem);
2725
2764
 
2726
2765
  if (colNode) {
2727
2766
  var column = colNode.item;
@@ -2751,7 +2790,7 @@ var Methods = {
2751
2790
  } else if (layout === 'body') {
2752
2791
  var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")];
2753
2792
 
2754
- if (wrapperElem) {
2793
+ if (isNodeElement(wrapperElem)) {
2755
2794
  if (customMaxHeight) {
2756
2795
  wrapperElem.style.maxHeight = "".concat(fixedType ? customMaxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : customMaxHeight - headerHeight, "px");
2757
2796
  } else {
@@ -2768,7 +2807,7 @@ var Methods = {
2768
2807
  var isRightFixed = fixedType === 'right';
2769
2808
  var _fixedColumn = columnStore["".concat(fixedType, "List")];
2770
2809
 
2771
- if (wrapperElem) {
2810
+ if (isNodeElement(wrapperElem)) {
2772
2811
  wrapperElem.style.top = "".concat(headerHeight, "px");
2773
2812
  }
2774
2813
 
@@ -2838,7 +2877,7 @@ var Methods = {
2838
2877
  return previous + column.renderWidth;
2839
2878
  }, 0);
2840
2879
 
2841
- if (wrapperElem) {
2880
+ if (isNodeElement(wrapperElem)) {
2842
2881
  // 如果是固定列
2843
2882
  if (fixedWrapperElem) {
2844
2883
  wrapperElem.style.top = "".concat(customHeight > 0 ? customHeight - footerHeight : tableHeight + headerHeight, "px");
@@ -2902,10 +2941,10 @@ var Methods = {
2902
2941
 
2903
2942
  if (cellElem) {
2904
2943
  if (colspan > 1) {
2905
- var columnIndex = _this22.getColumnIndex(column);
2944
+ var columnIndex = _this24.getColumnIndex(column);
2906
2945
 
2907
2946
  for (var _index = 1; _index < colspan; _index++) {
2908
- var nextColumn = _this22.getColumns(columnIndex + _index);
2947
+ var nextColumn = _this24.getColumns(columnIndex + _index);
2909
2948
 
2910
2949
  if (nextColumn) {
2911
2950
  colWidth += nextColumn.renderWidth;
@@ -2955,7 +2994,7 @@ var Methods = {
2955
2994
  }
2956
2995
  },
2957
2996
  preventEvent: function preventEvent(evnt, type, args, next, end) {
2958
- var _this23 = this;
2997
+ var _this25 = this;
2959
2998
 
2960
2999
  var evntList = _vXETable.default.interceptor.get(type);
2961
3000
 
@@ -2963,8 +3002,8 @@ var Methods = {
2963
3002
 
2964
3003
  if (!evntList.some(function (func) {
2965
3004
  return func(Object.assign({
2966
- $grid: _this23.$xegrid,
2967
- $table: _this23,
3005
+ $grid: _this25.$xegrid,
3006
+ $table: _this25,
2968
3007
  $event: evnt
2969
3008
  }, args)) === false;
2970
3009
  })) {
@@ -2984,7 +3023,7 @@ var Methods = {
2984
3023
  * 全局按下事件处理
2985
3024
  */
2986
3025
  handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) {
2987
- var _this24 = this;
3026
+ var _this26 = this;
2988
3027
 
2989
3028
  var $el = this.$el,
2990
3029
  $refs = this.$refs,
@@ -3045,7 +3084,7 @@ var Methods = {
3045
3084
  } // 如果固定了高度且点击了行之外的空白处,则清除激活状态
3046
3085
 
3047
3086
 
3048
- if (!isClearActived && _this24.height && !_this24.overflowY) {
3087
+ if (!isClearActived && _this26.height && !_this26.overflowY) {
3049
3088
  var bodyWrapperElem = evnt.target;
3050
3089
 
3051
3090
  if (hasClass(bodyWrapperElem, 'vxe-table--body-wrapper')) {
@@ -3056,7 +3095,7 @@ var Methods = {
3056
3095
  if (isClearActived || // 如果点击了当前表格之外
3057
3096
  !getEventTargetNode(evnt, $el).flag) {
3058
3097
  setTimeout(function () {
3059
- return _this24.clearActived(evnt);
3098
+ return _this26.clearActived(evnt);
3060
3099
  });
3061
3100
  }
3062
3101
  });
@@ -3070,9 +3109,9 @@ var Methods = {
3070
3109
 
3071
3110
  if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
3072
3111
  this.preventEvent(evnt, 'event.clearAreas', {}, function () {
3073
- _this24.clearCellAreas();
3112
+ _this26.clearCellAreas();
3074
3113
 
3075
- _this24.clearCopyCellArea();
3114
+ _this26.clearCopyCellArea();
3076
3115
  });
3077
3116
  }
3078
3117
  }
@@ -3107,7 +3146,7 @@ var Methods = {
3107
3146
  * 表格键盘事件
3108
3147
  */
3109
3148
  keydownEvent: function keydownEvent(evnt) {
3110
- var _this25 = this;
3149
+ var _this27 = this;
3111
3150
 
3112
3151
  var filterStore = this.filterStore,
3113
3152
  ctxMenuStore = this.ctxMenuStore,
@@ -3122,33 +3161,33 @@ var Methods = {
3122
3161
 
3123
3162
  if (isEsc) {
3124
3163
  this.preventEvent(evnt, 'event.keydown', null, function () {
3125
- if (keyboardConfig && mouseConfig && mouseOpts.area && _this25.handleKeyboardEvent) {
3126
- _this25.handleKeyboardEvent(evnt);
3164
+ if (keyboardConfig && mouseConfig && mouseOpts.area && _this27.handleKeyboardEvent) {
3165
+ _this27.handleKeyboardEvent(evnt);
3127
3166
  } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
3128
3167
  evnt.stopPropagation(); // 如果按下了 Esc 键,关闭快捷菜单、筛选
3129
3168
 
3130
- _this25.closeFilter();
3169
+ _this27.closeFilter();
3131
3170
 
3132
- _this25.closeMenu();
3171
+ _this27.closeMenu();
3133
3172
 
3134
3173
  if (keyboardConfig && keyboardOpts.isEsc) {
3135
3174
  // 如果是激活编辑状态,则取消编辑
3136
3175
  if (actived.row) {
3137
3176
  var params = actived.args;
3138
3177
 
3139
- _this25.clearActived(evnt); // 如果配置了选中功能,则为选中状态
3178
+ _this27.clearActived(evnt); // 如果配置了选中功能,则为选中状态
3140
3179
 
3141
3180
 
3142
3181
  if (mouseConfig && mouseOpts.selected) {
3143
- _this25.$nextTick(function () {
3144
- return _this25.handleSelected(params, evnt);
3182
+ _this27.$nextTick(function () {
3183
+ return _this27.handleSelected(params, evnt);
3145
3184
  });
3146
3185
  }
3147
3186
  }
3148
3187
  }
3149
3188
  }
3150
3189
 
3151
- _this25.emitEvent('keydown', {}, evnt);
3190
+ _this27.emitEvent('keydown', {}, evnt);
3152
3191
  });
3153
3192
  }
3154
3193
  },
@@ -3157,27 +3196,27 @@ var Methods = {
3157
3196
  * 全局键盘事件
3158
3197
  */
3159
3198
  handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
3160
- var _this26 = this;
3199
+ var _this28 = this;
3161
3200
 
3162
3201
  // 该行为只对当前激活的表格有效
3163
3202
  if (this.isActivated) {
3164
3203
  this.preventEvent(evnt, 'event.keydown', null, function () {
3165
- var filterStore = _this26.filterStore,
3166
- isCtxMenu = _this26.isCtxMenu,
3167
- ctxMenuStore = _this26.ctxMenuStore,
3168
- editStore = _this26.editStore,
3169
- editOpts = _this26.editOpts,
3170
- editConfig = _this26.editConfig,
3171
- mouseConfig = _this26.mouseConfig,
3172
- mouseOpts = _this26.mouseOpts,
3173
- keyboardConfig = _this26.keyboardConfig,
3174
- keyboardOpts = _this26.keyboardOpts,
3175
- treeConfig = _this26.treeConfig,
3176
- treeOpts = _this26.treeOpts,
3177
- highlightCurrentRow = _this26.highlightCurrentRow,
3178
- currentRow = _this26.currentRow,
3179
- bodyCtxMenu = _this26.bodyCtxMenu,
3180
- rowOpts = _this26.rowOpts;
3204
+ var filterStore = _this28.filterStore,
3205
+ isCtxMenu = _this28.isCtxMenu,
3206
+ ctxMenuStore = _this28.ctxMenuStore,
3207
+ editStore = _this28.editStore,
3208
+ editOpts = _this28.editOpts,
3209
+ editConfig = _this28.editConfig,
3210
+ mouseConfig = _this28.mouseConfig,
3211
+ mouseOpts = _this28.mouseOpts,
3212
+ keyboardConfig = _this28.keyboardConfig,
3213
+ keyboardOpts = _this28.keyboardOpts,
3214
+ treeConfig = _this28.treeConfig,
3215
+ treeOpts = _this28.treeOpts,
3216
+ highlightCurrentRow = _this28.highlightCurrentRow,
3217
+ currentRow = _this28.currentRow,
3218
+ bodyCtxMenu = _this28.bodyCtxMenu,
3219
+ rowOpts = _this28.rowOpts;
3181
3220
  var selected = editStore.selected,
3182
3221
  actived = editStore.actived;
3183
3222
  var keyCode = evnt.keyCode;
@@ -3204,7 +3243,7 @@ var Methods = {
3204
3243
 
3205
3244
  if (filterStore.visible) {
3206
3245
  if (isEsc) {
3207
- _this26.closeFilter();
3246
+ _this28.closeFilter();
3208
3247
  }
3209
3248
 
3210
3249
  return;
@@ -3215,20 +3254,20 @@ var Methods = {
3215
3254
  evnt.preventDefault();
3216
3255
 
3217
3256
  if (ctxMenuStore.showChild && hasChildrenList(ctxMenuStore.selected)) {
3218
- _this26.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
3257
+ _this28.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children);
3219
3258
  } else {
3220
- _this26.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this26.ctxMenuList);
3259
+ _this28.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, _this28.ctxMenuList);
3221
3260
  }
3222
- } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this26.handleKeyboardEvent) {
3223
- _this26.handleKeyboardEvent(evnt);
3261
+ } else if (keyboardConfig && mouseConfig && mouseOpts.area && _this28.handleKeyboardEvent) {
3262
+ _this28.handleKeyboardEvent(evnt);
3224
3263
  } else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selected.column && (selected.column.type === 'checkbox' || selected.column.type === 'radio')) {
3225
3264
  // 空格键支持选中复选框
3226
3265
  evnt.preventDefault();
3227
3266
 
3228
3267
  if (selected.column.type === 'checkbox') {
3229
- _this26.handleToggleCheckRowEvent(evnt, selected.args);
3268
+ _this28.handleToggleCheckRowEvent(evnt, selected.args);
3230
3269
  } else {
3231
- _this26.triggerRadioRowEvent(evnt, selected.args);
3270
+ _this28.triggerRadioRowEvent(evnt, selected.args);
3232
3271
  }
3233
3272
  } else if (isF2 && (0, _utils.isEnableConf)(editConfig)) {
3234
3273
  if (!isEditStatus) {
@@ -3237,15 +3276,15 @@ var Methods = {
3237
3276
  evnt.stopPropagation();
3238
3277
  evnt.preventDefault();
3239
3278
 
3240
- _this26.handleActived(selected.args, evnt);
3279
+ _this28.handleActived(selected.args, evnt);
3241
3280
  }
3242
3281
  }
3243
3282
  } else if (isContextMenu) {
3244
3283
  // 如果按下上下文键
3245
- _this26._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
3246
- clearTimeout(_this26.keyCtxTimeout);
3247
- _this26.keyCtxTimeout = setTimeout(function () {
3248
- _this26._keyCtx = false;
3284
+ _this28._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
3285
+ clearTimeout(_this28.keyCtxTimeout);
3286
+ _this28.keyCtxTimeout = setTimeout(function () {
3287
+ _this28._keyCtx = false;
3249
3288
  }, 1000);
3250
3289
  } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
3251
3290
  // 退出选中
@@ -3254,12 +3293,12 @@ var Methods = {
3254
3293
  if (actived.row) {
3255
3294
  params = actived.args;
3256
3295
 
3257
- _this26.clearActived(evnt); // 如果配置了选中功能,则为选中状态
3296
+ _this28.clearActived(evnt); // 如果配置了选中功能,则为选中状态
3258
3297
 
3259
3298
 
3260
3299
  if (mouseConfig && mouseOpts.selected) {
3261
- _this26.$nextTick(function () {
3262
- return _this26.handleSelected(params, evnt);
3300
+ _this28.$nextTick(function () {
3301
+ return _this28.handleSelected(params, evnt);
3263
3302
  });
3264
3303
  }
3265
3304
  }
@@ -3270,15 +3309,15 @@ var Methods = {
3270
3309
 
3271
3310
  if (hasShiftKey) {
3272
3311
  if (keyboardOpts.enterToTab) {
3273
- _this26.moveTabSelected(targetArgs, hasShiftKey, evnt);
3312
+ _this28.moveTabSelected(targetArgs, hasShiftKey, evnt);
3274
3313
  } else {
3275
- _this26.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
3314
+ _this28.moveSelected(targetArgs, isLeftArrow, true, isRightArrow, false, evnt);
3276
3315
  }
3277
3316
  } else {
3278
3317
  if (keyboardOpts.enterToTab) {
3279
- _this26.moveTabSelected(targetArgs, hasShiftKey, evnt);
3318
+ _this28.moveTabSelected(targetArgs, hasShiftKey, evnt);
3280
3319
  } else {
3281
- _this26.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
3320
+ _this28.moveSelected(targetArgs, isLeftArrow, false, isRightArrow, true, evnt);
3282
3321
  }
3283
3322
  }
3284
3323
  } else if (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
@@ -3289,14 +3328,14 @@ var Methods = {
3289
3328
  evnt.preventDefault();
3290
3329
  var targetRow = childrens[0];
3291
3330
  params = {
3292
- $table: _this26,
3331
+ $table: _this28,
3293
3332
  row: targetRow
3294
3333
  };
3295
3334
 
3296
- _this26.setTreeExpand(currentRow, true).then(function () {
3297
- return _this26.scrollToRow(targetRow);
3335
+ _this28.setTreeExpand(currentRow, true).then(function () {
3336
+ return _this28.scrollToRow(targetRow);
3298
3337
  }).then(function () {
3299
- return _this26.triggerCurrentRowEvent(evnt, params);
3338
+ return _this28.triggerCurrentRowEvent(evnt, params);
3300
3339
  });
3301
3340
  }
3302
3341
  }
@@ -3305,18 +3344,18 @@ var Methods = {
3305
3344
  if (!isEditStatus) {
3306
3345
  // 如果按下了方向键
3307
3346
  if (selected.row && selected.column) {
3308
- _this26.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
3347
+ _this28.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
3309
3348
  } else if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
3310
3349
  // 当前行按键上下移动
3311
- _this26.moveCurrentRow(isUpArrow, isDwArrow, evnt);
3350
+ _this28.moveCurrentRow(isUpArrow, isDwArrow, evnt);
3312
3351
  }
3313
3352
  }
3314
3353
  } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
3315
3354
  // 如果按下了 Tab 键切换
3316
3355
  if (selected.row || selected.column) {
3317
- _this26.moveTabSelected(selected.args, hasShiftKey, evnt);
3356
+ _this28.moveTabSelected(selected.args, hasShiftKey, evnt);
3318
3357
  } else if (actived.row || actived.column) {
3319
- _this26.moveTabSelected(actived.args, hasShiftKey, evnt);
3358
+ _this28.moveTabSelected(actived.args, hasShiftKey, evnt);
3320
3359
  }
3321
3360
  } else if (keyboardConfig && (isDel || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow ? isBack && keyboardOpts.isArrow : isBack))) {
3322
3361
  if (!isEditStatus) {
@@ -3327,10 +3366,10 @@ var Methods = {
3327
3366
  if (delMethod) {
3328
3367
  delMethod({
3329
3368
  row: selected.row,
3330
- rowIndex: _this26.getRowIndex(selected.row),
3369
+ rowIndex: _this28.getRowIndex(selected.row),
3331
3370
  column: selected.column,
3332
- columnIndex: _this26.getColumnIndex(selected.column),
3333
- $table: _this26
3371
+ columnIndex: _this28.getColumnIndex(selected.column),
3372
+ $table: _this28
3334
3373
  });
3335
3374
  } else {
3336
3375
  setCellValue(selected.row, selected.column, null);
@@ -3340,21 +3379,21 @@ var Methods = {
3340
3379
  if (backMethod) {
3341
3380
  backMethod({
3342
3381
  row: selected.row,
3343
- rowIndex: _this26.getRowIndex(selected.row),
3382
+ rowIndex: _this28.getRowIndex(selected.row),
3344
3383
  column: selected.column,
3345
- columnIndex: _this26.getColumnIndex(selected.column),
3346
- $table: _this26
3384
+ columnIndex: _this28.getColumnIndex(selected.column),
3385
+ $table: _this28
3347
3386
  });
3348
3387
  } else {
3349
- _this26.handleActived(selected.args, evnt);
3388
+ _this28.handleActived(selected.args, evnt);
3350
3389
  }
3351
3390
  } else if (isDel) {
3352
3391
  // 如果按下 del 键,更新表尾数据
3353
- _this26.updateFooter();
3392
+ _this28.updateFooter();
3354
3393
  }
3355
3394
  } else if (isBack && keyboardOpts.isArrow && treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
3356
3395
  // 如果树形表格回退键关闭当前行返回父节点
3357
- var _XEUtils$findTree = _xeUtils.default.findTree(_this26.afterFullData, function (item) {
3396
+ var _XEUtils$findTree = _xeUtils.default.findTree(_this28.afterFullData, function (item) {
3358
3397
  return item === currentRow;
3359
3398
  }, treeOpts),
3360
3399
  parentRow = _XEUtils$findTree.parent;
@@ -3362,14 +3401,14 @@ var Methods = {
3362
3401
  if (parentRow) {
3363
3402
  evnt.preventDefault();
3364
3403
  params = {
3365
- $table: _this26,
3404
+ $table: _this28,
3366
3405
  row: parentRow
3367
3406
  };
3368
3407
 
3369
- _this26.setTreeExpand(parentRow, false).then(function () {
3370
- return _this26.scrollToRow(parentRow);
3408
+ _this28.setTreeExpand(parentRow, false).then(function () {
3409
+ return _this28.scrollToRow(parentRow);
3371
3410
  }).then(function () {
3372
- return _this26.triggerCurrentRowEvent(evnt, params);
3411
+ return _this28.triggerCurrentRowEvent(evnt, params);
3373
3412
  });
3374
3413
  }
3375
3414
  }
@@ -3383,26 +3422,26 @@ var Methods = {
3383
3422
 
3384
3423
  if (selected.column && selected.row && (0, _utils.isEnableConf)(selected.column.editRender)) {
3385
3424
  if (!editOpts.activeMethod || editOpts.activeMethod(_objectSpread(_objectSpread({}, selected.args), {}, {
3386
- $table: _this26
3425
+ $table: _this28
3387
3426
  }))) {
3388
3427
  if (editMethod) {
3389
3428
  editMethod({
3390
3429
  row: selected.row,
3391
- rowIndex: _this26.getRowIndex(selected.row),
3430
+ rowIndex: _this28.getRowIndex(selected.row),
3392
3431
  column: selected.column,
3393
- columnIndex: _this26.getColumnIndex(selected.column),
3394
- $table: _this26
3432
+ columnIndex: _this28.getColumnIndex(selected.column),
3433
+ $table: _this28
3395
3434
  });
3396
3435
  } else {
3397
3436
  setCellValue(selected.row, selected.column, null);
3398
3437
 
3399
- _this26.handleActived(selected.args, evnt);
3438
+ _this28.handleActived(selected.args, evnt);
3400
3439
  }
3401
3440
  }
3402
3441
  }
3403
3442
  }
3404
3443
 
3405
- _this26.emitEvent('keydown', {}, evnt);
3444
+ _this28.emitEvent('keydown', {}, evnt);
3406
3445
  });
3407
3446
  }
3408
3447
  },
@@ -3472,12 +3511,12 @@ var Methods = {
3472
3511
  this.recalculate(true);
3473
3512
  },
3474
3513
  handleTooltipLeaveMethod: function handleTooltipLeaveMethod() {
3475
- var _this27 = this;
3514
+ var _this29 = this;
3476
3515
 
3477
3516
  var tooltipOpts = this.tooltipOpts;
3478
3517
  setTimeout(function () {
3479
- if (!_this27.tooltipActive) {
3480
- _this27.closeTooltip();
3518
+ if (!_this29.tooltipActive) {
3519
+ _this29.closeTooltip();
3481
3520
  }
3482
3521
  }, tooltipOpts.leaveDelay);
3483
3522
  return false;
@@ -3488,17 +3527,17 @@ var Methods = {
3488
3527
  this.closeTooltip();
3489
3528
  },
3490
3529
  handleTargetLeaveEvent: function handleTargetLeaveEvent() {
3491
- var _this28 = this;
3530
+ var _this30 = this;
3492
3531
 
3493
3532
  var tooltipOpts = this.tooltipOpts;
3494
3533
  this.tooltipActive = false;
3495
3534
 
3496
3535
  if (tooltipOpts.enterable) {
3497
3536
  this.tooltipTimeout = setTimeout(function () {
3498
- var tooltip = _this28.$refs.tooltip;
3537
+ var tooltip = _this30.$refs.tooltip;
3499
3538
 
3500
3539
  if (tooltip && !tooltip.isHover) {
3501
- _this28.closeTooltip();
3540
+ _this30.closeTooltip();
3502
3541
  }
3503
3542
  }, tooltipOpts.leaveDelay);
3504
3543
  } else {
@@ -3731,14 +3770,14 @@ var Methods = {
3731
3770
  * @param {Boolean} value 是否选中
3732
3771
  */
3733
3772
  setCheckboxRow: function setCheckboxRow(rows, value) {
3734
- var _this29 = this;
3773
+ var _this31 = this;
3735
3774
 
3736
3775
  if (rows && !_xeUtils.default.isArray(rows)) {
3737
3776
  rows = [rows];
3738
3777
  }
3739
3778
 
3740
3779
  rows.forEach(function (row) {
3741
- return _this29.handleSelectRow({
3780
+ return _this31.handleSelectRow({
3742
3781
  row: row
3743
3782
  }, !!value);
3744
3783
  });
@@ -3762,7 +3801,7 @@ var Methods = {
3762
3801
  * value 选中true 不选false 半选-1
3763
3802
  */
3764
3803
  handleSelectRow: function handleSelectRow(_ref6, value) {
3765
- var _this30 = this;
3804
+ var _this32 = this;
3766
3805
 
3767
3806
  var row = _ref6.row;
3768
3807
  var selection = this.selection,
@@ -3795,7 +3834,7 @@ var Methods = {
3795
3834
  return half === item;
3796
3835
  });
3797
3836
 
3798
- _this30.handleCheckboxReserveRow(row, value);
3837
+ _this32.handleCheckboxReserveRow(row, value);
3799
3838
  }
3800
3839
  }, treeOpts);
3801
3840
  } // 如果存在父节点,更新父节点状态
@@ -3869,7 +3908,7 @@ var Methods = {
3869
3908
  return half === item;
3870
3909
  });
3871
3910
 
3872
- _this30.handleCheckboxReserveRow(row, value);
3911
+ _this32.handleCheckboxReserveRow(row, value);
3873
3912
  }
3874
3913
  }, treeOpts);
3875
3914
  } // 如果存在父节点,更新父节点状态
@@ -3973,7 +4012,7 @@ var Methods = {
3973
4012
  * @param {Boolean} value 是否选中
3974
4013
  */
3975
4014
  setAllCheckboxRow: function setAllCheckboxRow(value) {
3976
- var _this31 = this;
4015
+ var _this33 = this;
3977
4016
 
3978
4017
  var afterFullData = this.afterFullData,
3979
4018
  treeConfig = this.treeConfig,
@@ -4086,11 +4125,11 @@ var Methods = {
4086
4125
  if (reserve) {
4087
4126
  if (value) {
4088
4127
  selectRows.forEach(function (row) {
4089
- checkboxReserveRowMap[getRowid(_this31, row)] = row;
4128
+ checkboxReserveRowMap[getRowid(_this33, row)] = row;
4090
4129
  });
4091
4130
  } else {
4092
4131
  afterFullData.forEach(function (row) {
4093
- return _this31.handleCheckboxReserveRow(row, false);
4132
+ return _this33.handleCheckboxReserveRow(row, false);
4094
4133
  });
4095
4134
  }
4096
4135
  }
@@ -4113,17 +4152,31 @@ var Methods = {
4113
4152
  checkMethod = checkboxOpts.checkMethod;
4114
4153
 
4115
4154
  if (!checkStrictly) {
4155
+ var disableRows = [];
4156
+ var checkRows = [];
4157
+ var isAllResolve = false;
4116
4158
  var isAllSelected = false;
4117
4159
  var isIndeterminate = false;
4118
4160
 
4119
4161
  if (checkField) {
4120
- isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
4121
- return !checkMethod({
4162
+ isAllResolve = afterFullData.every(checkMethod ? function (row) {
4163
+ if (!checkMethod({
4122
4164
  row: row
4123
- }) || _xeUtils.default.get(row, checkField);
4165
+ })) {
4166
+ disableRows.push(row);
4167
+ return true;
4168
+ }
4169
+
4170
+ if (_xeUtils.default.get(row, checkField)) {
4171
+ checkRows.push(row);
4172
+ return true;
4173
+ }
4174
+
4175
+ return false;
4124
4176
  } : function (row) {
4125
4177
  return _xeUtils.default.get(row, checkField);
4126
4178
  });
4179
+ isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
4127
4180
 
4128
4181
  if (treeConfig) {
4129
4182
  if (halfField) {
@@ -4147,13 +4200,24 @@ var Methods = {
4147
4200
  }
4148
4201
  }
4149
4202
  } else {
4150
- isAllSelected = afterFullData.length && afterFullData.every(checkMethod ? function (row) {
4151
- return !checkMethod({
4203
+ isAllResolve = afterFullData.every(checkMethod ? function (row) {
4204
+ if (!checkMethod({
4152
4205
  row: row
4153
- }) || selection.indexOf(row) > -1;
4206
+ })) {
4207
+ disableRows.push(row);
4208
+ return true;
4209
+ }
4210
+
4211
+ if (selection.indexOf(row) > -1) {
4212
+ checkRows.push(row);
4213
+ return true;
4214
+ }
4215
+
4216
+ return false;
4154
4217
  } : function (row) {
4155
4218
  return selection.indexOf(row) > -1;
4156
4219
  });
4220
+ isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
4157
4221
 
4158
4222
  if (treeConfig) {
4159
4223
  isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
@@ -4285,7 +4349,7 @@ var Methods = {
4285
4349
  * 获取复选框保留选中的行
4286
4350
  */
4287
4351
  getCheckboxReserveRecords: function getCheckboxReserveRecords(isFull) {
4288
- var _this32 = this;
4352
+ var _this34 = this;
4289
4353
 
4290
4354
  var fullDataRowIdData = this.fullDataRowIdData,
4291
4355
  afterFullData = this.afterFullData,
@@ -4300,11 +4364,11 @@ var Methods = {
4300
4364
 
4301
4365
  if (treeConfig) {
4302
4366
  _xeUtils.default.eachTree(afterFullData, function (row) {
4303
- afterFullIdMaps[getRowid(_this32, row)] = 1;
4367
+ afterFullIdMaps[getRowid(_this34, row)] = 1;
4304
4368
  }, treeOpts);
4305
4369
  } else {
4306
4370
  afterFullData.forEach(function (row) {
4307
- afterFullIdMaps[getRowid(_this32, row)] = 1;
4371
+ afterFullIdMaps[getRowid(_this34, row)] = 1;
4308
4372
  });
4309
4373
  }
4310
4374
 
@@ -4370,7 +4434,7 @@ var Methods = {
4370
4434
  * 清空行为不管是否被禁用还是保留记录,都将彻底清空选中状态
4371
4435
  */
4372
4436
  clearCheckboxRow: function clearCheckboxRow() {
4373
- var _this33 = this;
4437
+ var _this35 = this;
4374
4438
 
4375
4439
  var tableFullData = this.tableFullData,
4376
4440
  treeConfig = this.treeConfig,
@@ -4393,7 +4457,7 @@ var Methods = {
4393
4457
 
4394
4458
  if (reserve) {
4395
4459
  tableFullData.forEach(function (row) {
4396
- return _this33.handleCheckboxReserveRow(row, false);
4460
+ return _this35.handleCheckboxReserveRow(row, false);
4397
4461
  });
4398
4462
  }
4399
4463
 
@@ -4685,13 +4749,13 @@ var Methods = {
4685
4749
  * 如果存在规则,则校验
4686
4750
  */
4687
4751
  handleChangeCell: function handleChangeCell(evnt, params) {
4688
- var _this34 = this;
4752
+ var _this36 = this;
4689
4753
 
4690
4754
  this.checkValidate('blur').catch(function (e) {
4691
4755
  return e;
4692
4756
  }).then(function () {
4693
- _this34.handleActived(params, evnt).then(function () {
4694
- return _this34.checkValidate('change');
4757
+ _this36.handleActived(params, evnt).then(function () {
4758
+ return _this36.checkValidate('change');
4695
4759
  }).catch(function (e) {
4696
4760
  return e;
4697
4761
  });
@@ -4794,7 +4858,7 @@ var Methods = {
4794
4858
  * 如果是双击模式,则激活为编辑状态
4795
4859
  */
4796
4860
  triggerCellDblclickEvent: function triggerCellDblclickEvent(evnt, params) {
4797
- var _this35 = this;
4861
+ var _this37 = this;
4798
4862
 
4799
4863
  var editStore = this.editStore,
4800
4864
  editConfig = this.editConfig,
@@ -4809,15 +4873,15 @@ var Methods = {
4809
4873
  this.checkValidate('blur').catch(function (e) {
4810
4874
  return e;
4811
4875
  }).then(function () {
4812
- _this35.handleActived(params, evnt).then(function () {
4813
- return _this35.checkValidate('change');
4876
+ _this37.handleActived(params, evnt).then(function () {
4877
+ return _this37.checkValidate('change');
4814
4878
  }).catch(function (e) {
4815
4879
  return e;
4816
4880
  });
4817
4881
  });
4818
4882
  } else if (editOpts.mode === 'cell') {
4819
4883
  this.handleActived(params, evnt).then(function () {
4820
- return _this35.checkValidate('change');
4884
+ return _this37.checkValidate('change');
4821
4885
  }).catch(function (e) {
4822
4886
  return e;
4823
4887
  });
@@ -4828,7 +4892,7 @@ var Methods = {
4828
4892
  this.emitEvent('cell-dblclick', params, evnt);
4829
4893
  },
4830
4894
  handleDefaultSort: function handleDefaultSort() {
4831
- var _this36 = this;
4895
+ var _this38 = this;
4832
4896
 
4833
4897
  var sortConfig = this.sortConfig,
4834
4898
  sortOpts = this.sortOpts;
@@ -4845,7 +4909,7 @@ var Methods = {
4845
4909
  order = item.order;
4846
4910
 
4847
4911
  if (field && order) {
4848
- var column = _this36.getColumnByField(field);
4912
+ var column = _this38.getColumnByField(field);
4849
4913
 
4850
4914
  if (column && column.sortable) {
4851
4915
  column.order = order;
@@ -4888,7 +4952,7 @@ var Methods = {
4888
4952
  }
4889
4953
  },
4890
4954
  sort: function sort(sortConfs, sortOrder) {
4891
- var _this37 = this;
4955
+ var _this39 = this;
4892
4956
 
4893
4957
  var sortOpts = this.sortOpts;
4894
4958
  var multiple = sortOpts.multiple,
@@ -4921,7 +4985,7 @@ var Methods = {
4921
4985
  var column = field;
4922
4986
 
4923
4987
  if (_xeUtils.default.isString(field)) {
4924
- column = _this37.getColumnByField(field);
4988
+ column = _this39.getColumnByField(field);
4925
4989
  }
4926
4990
 
4927
4991
  if (column && (column.sortable || column.remoteSort)) {
@@ -4930,7 +4994,7 @@ var Methods = {
4930
4994
  }
4931
4995
 
4932
4996
  if (orders.indexOf(order) === -1) {
4933
- order = getNextSortOrder(_this37, column);
4997
+ order = getNextSortOrder(_this39, column);
4934
4998
  }
4935
4999
 
4936
5000
  if (column.order !== order) {
@@ -5083,7 +5147,7 @@ var Methods = {
5083
5147
  * @param {Row} row 行对象
5084
5148
  */
5085
5149
  reloadRowExpand: function reloadRowExpand(row) {
5086
- var _this38 = this;
5150
+ var _this40 = this;
5087
5151
 
5088
5152
  var expandOpts = this.expandOpts,
5089
5153
  expandLazyLoadeds = this.expandLazyLoadeds;
@@ -5091,7 +5155,7 @@ var Methods = {
5091
5155
 
5092
5156
  if (lazy && expandLazyLoadeds.indexOf(row) === -1) {
5093
5157
  this.clearRowExpandLoaded(row).then(function () {
5094
- return _this38.handleAsyncRowExpand(row);
5158
+ return _this40.handleAsyncRowExpand(row);
5095
5159
  });
5096
5160
  }
5097
5161
 
@@ -5170,29 +5234,29 @@ var Methods = {
5170
5234
  return this.setRowExpand(this.expandOpts.lazy ? this.tableData : this.tableFullData, expanded);
5171
5235
  },
5172
5236
  handleAsyncRowExpand: function handleAsyncRowExpand(row) {
5173
- var _this39 = this;
5237
+ var _this41 = this;
5174
5238
 
5175
5239
  var rest = this.fullAllDataRowMap.get(row);
5176
5240
  return new Promise(function (resolve) {
5177
- _this39.expandLazyLoadeds.push(row);
5241
+ _this41.expandLazyLoadeds.push(row);
5178
5242
 
5179
- _this39.expandOpts.loadMethod({
5180
- $table: _this39,
5243
+ _this41.expandOpts.loadMethod({
5244
+ $table: _this41,
5181
5245
  row: row,
5182
- rowIndex: _this39.getRowIndex(row),
5183
- $rowIndex: _this39.getVMRowIndex(row)
5246
+ rowIndex: _this41.getRowIndex(row),
5247
+ $rowIndex: _this41.getVMRowIndex(row)
5184
5248
  }).catch(function (e) {
5185
5249
  return e;
5186
5250
  }).then(function () {
5187
5251
  rest.expandLoaded = true;
5188
5252
 
5189
- _xeUtils.default.remove(_this39.expandLazyLoadeds, function (item) {
5253
+ _xeUtils.default.remove(_this41.expandLazyLoadeds, function (item) {
5190
5254
  return item === row;
5191
5255
  });
5192
5256
 
5193
- _this39.rowExpandeds.push(row);
5257
+ _this41.rowExpandeds.push(row);
5194
5258
 
5195
- resolve(_this39.$nextTick().then(_this39.recalculate));
5259
+ resolve(_this41.$nextTick().then(_this41.recalculate));
5196
5260
  });
5197
5261
  });
5198
5262
  },
@@ -5205,7 +5269,7 @@ var Methods = {
5205
5269
  * @param {Boolean} expanded 是否展开
5206
5270
  */
5207
5271
  setRowExpand: function setRowExpand(rows, expanded) {
5208
- var _this40 = this;
5272
+ var _this42 = this;
5209
5273
 
5210
5274
  var fullAllDataRowMap = this.fullAllDataRowMap,
5211
5275
  expandLazyLoadeds = this.expandLazyLoadeds,
@@ -5238,8 +5302,8 @@ var Methods = {
5238
5302
  columnIndex: columnIndex,
5239
5303
  $columnIndex: $columnIndex,
5240
5304
  row: row,
5241
- rowIndex: _this40.getRowIndex(row),
5242
- $rowIndex: _this40.getVMRowIndex(row)
5305
+ rowIndex: _this42.getRowIndex(row),
5306
+ $rowIndex: _this42.getVMRowIndex(row)
5243
5307
  });
5244
5308
  }) : rows;
5245
5309
 
@@ -5250,7 +5314,7 @@ var Methods = {
5250
5314
  var isLoad = lazy && !rest.expandLoaded && expandLazyLoadeds.indexOf(row) === -1;
5251
5315
 
5252
5316
  if (isLoad) {
5253
- lazyRests.push(_this40.handleAsyncRowExpand(row));
5317
+ lazyRests.push(_this42.handleAsyncRowExpand(row));
5254
5318
  } else {
5255
5319
  rowExpandeds.push(row);
5256
5320
  }
@@ -5264,7 +5328,7 @@ var Methods = {
5264
5328
 
5265
5329
  if (reserve) {
5266
5330
  validRows.forEach(function (row) {
5267
- return _this40.handleRowExpandReserve(row, expanded);
5331
+ return _this42.handleRowExpandReserve(row, expanded);
5268
5332
  });
5269
5333
  }
5270
5334
  }
@@ -5285,7 +5349,7 @@ var Methods = {
5285
5349
  * 手动清空展开行状态,数据会恢复成未展开的状态
5286
5350
  */
5287
5351
  clearRowExpand: function clearRowExpand() {
5288
- var _this41 = this;
5352
+ var _this43 = this;
5289
5353
 
5290
5354
  var expandOpts = this.expandOpts,
5291
5355
  rowExpandeds = this.rowExpandeds,
@@ -5296,13 +5360,13 @@ var Methods = {
5296
5360
 
5297
5361
  if (reserve) {
5298
5362
  tableFullData.forEach(function (row) {
5299
- return _this41.handleRowExpandReserve(row, false);
5363
+ return _this43.handleRowExpandReserve(row, false);
5300
5364
  });
5301
5365
  }
5302
5366
 
5303
5367
  return this.$nextTick().then(function () {
5304
5368
  if (isExists) {
5305
- _this41.recalculate();
5369
+ _this43.recalculate();
5306
5370
  }
5307
5371
  });
5308
5372
  },
@@ -5382,7 +5446,7 @@ var Methods = {
5382
5446
  * @param {Row} row 行对象
5383
5447
  */
5384
5448
  reloadTreeExpand: function reloadTreeExpand(row) {
5385
- var _this42 = this;
5449
+ var _this44 = this;
5386
5450
 
5387
5451
  var treeOpts = this.treeOpts,
5388
5452
  treeLazyLoadeds = this.treeLazyLoadeds;
@@ -5392,15 +5456,15 @@ var Methods = {
5392
5456
 
5393
5457
  if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
5394
5458
  this.clearTreeExpandLoaded(row).then(function () {
5395
- return _this42.handleAsyncTreeExpandChilds(row);
5459
+ return _this44.handleAsyncTreeExpandChilds(row);
5396
5460
  }).then(function () {
5397
5461
  if (transform) {
5398
- _this42.handleVirtualTreeToList();
5462
+ _this44.handleVirtualTreeToList();
5399
5463
 
5400
- return _this42.handleTableData();
5464
+ return _this44.handleTableData();
5401
5465
  }
5402
5466
  }).then(function () {
5403
- return _this42.recalculate();
5467
+ return _this44.recalculate();
5404
5468
  });
5405
5469
  }
5406
5470
 
@@ -5478,7 +5542,7 @@ var Methods = {
5478
5542
  }
5479
5543
  },
5480
5544
  handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
5481
- var _this43 = this;
5545
+ var _this45 = this;
5482
5546
 
5483
5547
  var fullAllDataRowMap = this.fullAllDataRowMap,
5484
5548
  treeExpandeds = this.treeExpandeds,
@@ -5492,7 +5556,7 @@ var Methods = {
5492
5556
  return new Promise(function (resolve) {
5493
5557
  treeLazyLoadeds.push(row);
5494
5558
  loadMethod({
5495
- $table: _this43,
5559
+ $table: _this45,
5496
5560
  row: row
5497
5561
  }).catch(function () {
5498
5562
  return [];
@@ -5508,29 +5572,29 @@ var Methods = {
5508
5572
  }
5509
5573
 
5510
5574
  if (childRecords) {
5511
- _this43.loadTreeChildren(row, childRecords).then(function (childRows) {
5575
+ _this45.loadTreeChildren(row, childRecords).then(function (childRows) {
5512
5576
  if (childRows.length && treeExpandeds.indexOf(row) === -1) {
5513
5577
  treeExpandeds.push(row);
5514
5578
  } // 如果当前节点已选中,则展开后子节点也被选中
5515
5579
 
5516
5580
 
5517
- if (!checkStrictly && _this43.isCheckedByCheckboxRow(row)) {
5518
- _this43.setCheckboxRow(childRows, true);
5581
+ if (!checkStrictly && _this45.isCheckedByCheckboxRow(row)) {
5582
+ _this45.setCheckboxRow(childRows, true);
5519
5583
  }
5520
5584
 
5521
- _this43.$nextTick().then(function () {
5585
+ _this45.$nextTick().then(function () {
5522
5586
  if (transform) {
5523
- return _this43.handleTableData();
5587
+ return _this45.handleTableData();
5524
5588
  }
5525
5589
  }).then(function () {
5526
- return _this43.recalculate();
5590
+ return _this45.recalculate();
5527
5591
  }).then(function () {
5528
5592
  return resolve();
5529
5593
  });
5530
5594
  });
5531
5595
  } else {
5532
- _this43.$nextTick().then(function () {
5533
- return _this43.recalculate();
5596
+ _this45.$nextTick().then(function () {
5597
+ return _this45.recalculate();
5534
5598
  }).then(function () {
5535
5599
  return resolve();
5536
5600
  });
@@ -5568,7 +5632,7 @@ var Methods = {
5568
5632
  * @returns
5569
5633
  */
5570
5634
  handleBaseTreeExpand: function handleBaseTreeExpand(rows, expanded) {
5571
- var _this44 = this;
5635
+ var _this46 = this;
5572
5636
 
5573
5637
  var fullAllDataRowMap = this.fullAllDataRowMap,
5574
5638
  tableFullData = this.tableFullData,
@@ -5616,7 +5680,7 @@ var Methods = {
5616
5680
  var isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1; // 是否使用懒加载
5617
5681
 
5618
5682
  if (isLoad) {
5619
- result.push(_this44.handleAsyncTreeExpandChilds(row));
5683
+ result.push(_this46.handleAsyncTreeExpandChilds(row));
5620
5684
  } else {
5621
5685
  if (row[children] && row[children].length) {
5622
5686
  treeExpandeds.push(row);
@@ -5632,7 +5696,7 @@ var Methods = {
5632
5696
 
5633
5697
  if (reserve) {
5634
5698
  validRows.forEach(function (row) {
5635
- return _this44.handleTreeExpandReserve(row, expanded);
5699
+ return _this46.handleTreeExpandReserve(row, expanded);
5636
5700
  });
5637
5701
  }
5638
5702
 
@@ -5646,14 +5710,14 @@ var Methods = {
5646
5710
  * @returns
5647
5711
  */
5648
5712
  handleVirtualTreeExpand: function handleVirtualTreeExpand(rows, expanded) {
5649
- var _this45 = this;
5713
+ var _this47 = this;
5650
5714
 
5651
5715
  return this.handleBaseTreeExpand(rows, expanded).then(function () {
5652
- _this45.handleVirtualTreeToList();
5716
+ _this47.handleVirtualTreeToList();
5653
5717
 
5654
- return _this45.handleTableData();
5718
+ return _this47.handleTableData();
5655
5719
  }).then(function () {
5656
- return _this45.recalculate();
5720
+ return _this47.recalculate();
5657
5721
  });
5658
5722
  },
5659
5723
 
@@ -5698,7 +5762,7 @@ var Methods = {
5698
5762
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
5699
5763
  */
5700
5764
  clearTreeExpand: function clearTreeExpand() {
5701
- var _this46 = this;
5765
+ var _this48 = this;
5702
5766
 
5703
5767
  var treeOpts = this.treeOpts,
5704
5768
  treeExpandeds = this.treeExpandeds,
@@ -5710,19 +5774,19 @@ var Methods = {
5710
5774
 
5711
5775
  if (reserve) {
5712
5776
  _xeUtils.default.eachTree(tableFullData, function (row) {
5713
- return _this46.handleTreeExpandReserve(row, false);
5777
+ return _this48.handleTreeExpandReserve(row, false);
5714
5778
  }, treeOpts);
5715
5779
  }
5716
5780
 
5717
5781
  return this.handleTableData().then(function () {
5718
5782
  if (transform) {
5719
- _this46.handleVirtualTreeToList();
5783
+ _this48.handleVirtualTreeToList();
5720
5784
 
5721
- return _this46.handleTableData();
5785
+ return _this48.handleTableData();
5722
5786
  }
5723
5787
  }).then(function () {
5724
5788
  if (isExists) {
5725
- _this46.recalculate();
5789
+ _this48.recalculate();
5726
5790
  }
5727
5791
  });
5728
5792
  },
@@ -5852,18 +5916,18 @@ var Methods = {
5852
5916
  },
5853
5917
  // 计算可视渲染相关数据
5854
5918
  computeScrollLoad: function computeScrollLoad() {
5855
- var _this47 = this;
5919
+ var _this49 = this;
5856
5920
 
5857
5921
  return this.$nextTick().then(function () {
5858
- var sYOpts = _this47.sYOpts,
5859
- sXOpts = _this47.sXOpts,
5860
- scrollXLoad = _this47.scrollXLoad,
5861
- scrollYLoad = _this47.scrollYLoad,
5862
- scrollXStore = _this47.scrollXStore,
5863
- scrollYStore = _this47.scrollYStore; // 计算 X 逻辑
5922
+ var sYOpts = _this49.sYOpts,
5923
+ sXOpts = _this49.sXOpts,
5924
+ scrollXLoad = _this49.scrollXLoad,
5925
+ scrollYLoad = _this49.scrollYLoad,
5926
+ scrollXStore = _this49.scrollXStore,
5927
+ scrollYStore = _this49.scrollYStore; // 计算 X 逻辑
5864
5928
 
5865
5929
  if (scrollXLoad) {
5866
- var _computeVirtualX3 = computeVirtualX(_this47),
5930
+ var _computeVirtualX3 = computeVirtualX(_this49),
5867
5931
  visibleXSize = _computeVirtualX3.visibleSize;
5868
5932
 
5869
5933
  var offsetXSize = sXOpts.oSize ? _xeUtils.default.toNumber(sXOpts.oSize) : _dom.browse.msie ? 10 : _dom.browse.edge ? 5 : 0;
@@ -5871,13 +5935,13 @@ var Methods = {
5871
5935
  scrollXStore.visibleSize = visibleXSize;
5872
5936
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
5873
5937
 
5874
- _this47.updateScrollXData();
5938
+ _this49.updateScrollXData();
5875
5939
  } else {
5876
- _this47.updateScrollXSpace();
5940
+ _this49.updateScrollXSpace();
5877
5941
  } // 计算 Y 逻辑
5878
5942
 
5879
5943
 
5880
- var _computeVirtualY = computeVirtualY(_this47),
5944
+ var _computeVirtualY = computeVirtualY(_this49),
5881
5945
  rowHeight = _computeVirtualY.rowHeight,
5882
5946
  visibleYSize = _computeVirtualY.visibleSize;
5883
5947
 
@@ -5889,14 +5953,14 @@ var Methods = {
5889
5953
  scrollYStore.visibleSize = visibleYSize;
5890
5954
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
5891
5955
 
5892
- _this47.updateScrollYData();
5956
+ _this49.updateScrollYData();
5893
5957
  } else {
5894
- _this47.updateScrollYSpace();
5958
+ _this49.updateScrollYSpace();
5895
5959
  }
5896
5960
 
5897
- _this47.rowHeight = rowHeight;
5961
+ _this49.rowHeight = rowHeight;
5898
5962
 
5899
- _this47.$nextTick(_this47.updateStyle);
5963
+ _this49.$nextTick(_this49.updateStyle);
5900
5964
  });
5901
5965
  },
5902
5966
  handleTableColumn: function handleTableColumn() {
@@ -6010,7 +6074,7 @@ var Methods = {
6010
6074
  * @param {Number} scrollTop 上距离
6011
6075
  */
6012
6076
  scrollTo: function scrollTo(scrollLeft, scrollTop) {
6013
- var _this48 = this;
6077
+ var _this50 = this;
6014
6078
 
6015
6079
  var $refs = this.$refs;
6016
6080
  var tableBody = $refs.tableBody,
@@ -6031,7 +6095,7 @@ var Methods = {
6031
6095
  if (this.scrollXLoad || this.scrollYLoad) {
6032
6096
  return new Promise(function (resolve) {
6033
6097
  return setTimeout(function () {
6034
- return resolve(_this48.$nextTick());
6098
+ return resolve(_this50.$nextTick());
6035
6099
  }, 50);
6036
6100
  });
6037
6101
  }
@@ -6082,7 +6146,7 @@ var Methods = {
6082
6146
  * @param {Row} row 行对象
6083
6147
  */
6084
6148
  scrollToTreeRow: function scrollToTreeRow(row) {
6085
- var _this49 = this;
6149
+ var _this51 = this;
6086
6150
 
6087
6151
  var tableFullData = this.tableFullData,
6088
6152
  treeConfig = this.treeConfig,
@@ -6097,15 +6161,15 @@ var Methods = {
6097
6161
  if (matchObj) {
6098
6162
  var nodes = matchObj.nodes;
6099
6163
  nodes.forEach(function (row, index) {
6100
- if (index < nodes.length - 1 && !_this49.isTreeExpandByRow(row)) {
6101
- rests.push(_this49.setTreeExpand(row, true));
6164
+ if (index < nodes.length - 1 && !_this51.isTreeExpandByRow(row)) {
6165
+ rests.push(_this51.setTreeExpand(row, true));
6102
6166
  }
6103
6167
  });
6104
6168
  }
6105
6169
  }
6106
6170
 
6107
6171
  return Promise.all(rests).then(function () {
6108
- return _tools.DomTools.rowToVisible(_this49, row);
6172
+ return _tools.DomTools.rowToVisible(_this51, row);
6109
6173
  });
6110
6174
  },
6111
6175
 
@@ -6169,29 +6233,29 @@ var Methods = {
6169
6233
  * 如果单元格配置了校验规则,则会进行校验
6170
6234
  */
6171
6235
  updateStatus: function updateStatus(scope, cellValue) {
6172
- var _this50 = this;
6236
+ var _this52 = this;
6173
6237
 
6174
6238
  var customVal = !_xeUtils.default.isUndefined(cellValue);
6175
6239
  return this.$nextTick().then(function () {
6176
- var $refs = _this50.$refs,
6177
- editRules = _this50.editRules,
6178
- validStore = _this50.validStore;
6240
+ var $refs = _this52.$refs,
6241
+ editRules = _this52.editRules,
6242
+ validStore = _this52.validStore;
6179
6243
 
6180
6244
  if (scope && $refs.tableBody && editRules) {
6181
6245
  var row = scope.row,
6182
6246
  column = scope.column;
6183
6247
  var type = 'change';
6184
6248
 
6185
- if (_this50.hasCellRules(type, row, column)) {
6186
- var cell = _this50.getCell(row, column);
6249
+ if (_this52.hasCellRules(type, row, column)) {
6250
+ var cell = _this52.getCell(row, column);
6187
6251
 
6188
6252
  if (cell) {
6189
- return _this50.validCellRules(type, row, column, cellValue).then(function () {
6253
+ return _this52.validCellRules(type, row, column, cellValue).then(function () {
6190
6254
  if (customVal && validStore.visible) {
6191
6255
  setCellValue(row, column, cellValue);
6192
6256
  }
6193
6257
 
6194
- _this50.clearValidate();
6258
+ _this52.clearValidate();
6195
6259
  }).catch(function (_ref8) {
6196
6260
  var rule = _ref8.rule;
6197
6261
 
@@ -6199,7 +6263,7 @@ var Methods = {
6199
6263
  setCellValue(row, column, cellValue);
6200
6264
  }
6201
6265
 
6202
- _this50.showValidTooltip({
6266
+ _this52.showValidTooltip({
6203
6267
  rule: rule,
6204
6268
  row: row,
6205
6269
  column: column,
@@ -6220,7 +6284,7 @@ var Methods = {
6220
6284
  * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
6221
6285
  */
6222
6286
  setMergeCells: function setMergeCells(merges) {
6223
- var _this51 = this;
6287
+ var _this53 = this;
6224
6288
 
6225
6289
  if (this.spanMethod) {
6226
6290
  _tools.UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
@@ -6228,7 +6292,7 @@ var Methods = {
6228
6292
 
6229
6293
  setMerges(this, merges, this.mergeList, this.afterFullData);
6230
6294
  return this.$nextTick().then(function () {
6231
- return _this51.updateCellAreas();
6295
+ return _this53.updateCellAreas();
6232
6296
  });
6233
6297
  },
6234
6298
 
@@ -6237,7 +6301,7 @@ var Methods = {
6237
6301
  * @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
6238
6302
  */
6239
6303
  removeMergeCells: function removeMergeCells(merges) {
6240
- var _this52 = this;
6304
+ var _this54 = this;
6241
6305
 
6242
6306
  if (this.spanMethod) {
6243
6307
  _tools.UtilTools.error('vxe.error.errConflicts', ['merge-cells', 'span-method']);
@@ -6245,7 +6309,7 @@ var Methods = {
6245
6309
 
6246
6310
  var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
6247
6311
  return this.$nextTick().then(function () {
6248
- _this52.updateCellAreas();
6312
+ _this54.updateCellAreas();
6249
6313
 
6250
6314
  return rest;
6251
6315
  });
@@ -6269,7 +6333,7 @@ var Methods = {
6269
6333
  this.setMergeFooterItems(this.mergeFooterItems);
6270
6334
  },
6271
6335
  setMergeFooterItems: function setMergeFooterItems(merges) {
6272
- var _this53 = this;
6336
+ var _this55 = this;
6273
6337
 
6274
6338
  if (this.footerSpanMethod) {
6275
6339
  _tools.UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
@@ -6277,11 +6341,11 @@ var Methods = {
6277
6341
 
6278
6342
  setMerges(this, merges, this.mergeFooterList, null);
6279
6343
  return this.$nextTick().then(function () {
6280
- return _this53.updateCellAreas();
6344
+ return _this55.updateCellAreas();
6281
6345
  });
6282
6346
  },
6283
6347
  removeMergeFooterItems: function removeMergeFooterItems(merges) {
6284
- var _this54 = this;
6348
+ var _this56 = this;
6285
6349
 
6286
6350
  if (this.footerSpanMethod) {
6287
6351
  _tools.UtilTools.error('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
@@ -6289,7 +6353,7 @@ var Methods = {
6289
6353
 
6290
6354
  var rest = removeMerges(this, merges, this.mergeFooterList, null);
6291
6355
  return this.$nextTick().then(function () {
6292
- _this54.updateCellAreas();
6356
+ _this56.updateCellAreas();
6293
6357
 
6294
6358
  return rest;
6295
6359
  });
@@ -6432,7 +6496,7 @@ var Methods = {
6432
6496
  }
6433
6497
  }; // Module methods
6434
6498
 
6435
- var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
6499
+ var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,clearCopyCellArea,setCellAreas,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
6436
6500
  funcs.forEach(function (name) {
6437
6501
  Methods[name] = function () {
6438
6502
  if (process.env.NODE_ENV === 'development') {