vxe-table 3.4.7-beta.2 → 3.4.10-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.js CHANGED
@@ -10851,9 +10851,14 @@ function getColMinWidth(params) {
10851
10851
  }
10852
10852
 
10853
10853
  function countTreeExpand(prevRow, params) {
10854
+ var count = 1;
10855
+
10856
+ if (!prevRow) {
10857
+ return count;
10858
+ }
10859
+
10854
10860
  var $table = params.$table;
10855
10861
  var rowChildren = prevRow[$table.treeOpts.children];
10856
- var count = 1;
10857
10862
 
10858
10863
  if ($table.isTreeExpandByRow(prevRow)) {
10859
10864
  for (var index = 0; index < rowChildren.length; index++) {
@@ -10867,16 +10872,15 @@ function countTreeExpand(prevRow, params) {
10867
10872
  function getOffsetSize($xetable) {
10868
10873
  return lineOffsetSizes[$xetable.vSize] || 0;
10869
10874
  }
10870
- function calcTreeLine(params, items) {
10871
- var $table = params.$table,
10872
- $rowIndex = params.$rowIndex;
10875
+ function calcTreeLine(params, items, rIndex) {
10876
+ var $table = params.$table;
10873
10877
  var expandSize = 1;
10874
10878
 
10875
- if ($rowIndex) {
10876
- expandSize = countTreeExpand(items[$rowIndex - 1], params);
10879
+ if (rIndex) {
10880
+ expandSize = countTreeExpand(items[rIndex - 1], params);
10877
10881
  }
10878
10882
 
10879
- return $table.rowHeight * expandSize - ($rowIndex ? 1 : 12 - getOffsetSize($table));
10883
+ return $table.rowHeight * expandSize - (rIndex ? 1 : 12 - getOffsetSize($table));
10880
10884
  }
10881
10885
  function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
10882
10886
  for (var mIndex = 0; mIndex < mergeList.length; mIndex++) {
@@ -10970,12 +10974,25 @@ function isOperateMouse($xetable) {
10970
10974
  return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
10971
10975
  }
10972
10976
 
10973
- function renderLine(h, _vm, $xetable, rowLevel, items, params) {
10974
- var column = params.column;
10977
+ function renderLine(h, _vm, $xetable, params) {
10978
+ var row = params.row,
10979
+ column = params.column;
10975
10980
  var treeOpts = $xetable.treeOpts,
10976
- treeConfig = $xetable.treeConfig;
10981
+ treeConfig = $xetable.treeConfig,
10982
+ fullAllDataRowIdData = $xetable.fullAllDataRowIdData;
10977
10983
  var slots = column.slots,
10978
10984
  treeNode = column.treeNode;
10985
+ var rowid = UtilTools.getRowid($xetable, row);
10986
+ var rest = fullAllDataRowIdData[rowid];
10987
+ var rLevel = 0;
10988
+ var rIndex = 0;
10989
+ var items = [];
10990
+
10991
+ if (rest) {
10992
+ rLevel = rest.level;
10993
+ rIndex = rest._index;
10994
+ items = rest.items;
10995
+ }
10979
10996
 
10980
10997
  if (slots && slots.line) {
10981
10998
  return $xetable.callSlot(slots.line, params, h);
@@ -10987,8 +11004,8 @@ function renderLine(h, _vm, $xetable, rowLevel, items, params) {
10987
11004
  }, [h('div', {
10988
11005
  class: 'vxe-tree--line',
10989
11006
  style: {
10990
- height: "".concat(calcTreeLine(params, items), "px"),
10991
- left: "".concat(rowLevel * treeOpts.indent + (rowLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
11007
+ height: "".concat(calcTreeLine(params, items, rIndex), "px"),
11008
+ left: "".concat(rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xetable) : 0) + 16, "px")
10992
11009
  }
10993
11010
  })])];
10994
11011
  }
@@ -11223,7 +11240,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
11223
11240
  }));
11224
11241
  } else {
11225
11242
  // 渲染单元格
11226
- tdVNs.push.apply(tdVNs, _toConsumableArray(renderLine(h, _vm, $xetable, rowLevel, items, params)).concat([h('div', {
11243
+ tdVNs.push.apply(tdVNs, _toConsumableArray(renderLine(h, _vm, $xetable, params)).concat([h('div', {
11227
11244
  class: ['vxe-cell', {
11228
11245
  'c--title': showTitle,
11229
11246
  'c--tooltip': showTooltip,
@@ -11279,7 +11296,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
11279
11296
  checkboxOpts = $xetable.checkboxOpts,
11280
11297
  expandColumn = $xetable.expandColumn,
11281
11298
  hasFixedColumn = $xetable.hasFixedColumn,
11282
- fullDataRowIdData = $xetable.fullDataRowIdData,
11299
+ fullAllDataRowIdData = $xetable.fullAllDataRowIdData,
11283
11300
  rowOpts = $xetable.rowOpts;
11284
11301
  var rows = [];
11285
11302
  tableData.forEach(function (row, $rowIndex) {
@@ -11313,7 +11330,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
11313
11330
  }
11314
11331
 
11315
11332
  var rowid = UtilTools.getRowid($xetable, row);
11316
- var rest = fullDataRowIdData[rowid];
11333
+ var rest = fullAllDataRowIdData[rowid];
11317
11334
  var rowLevel = rest ? rest.level : 0;
11318
11335
  var seq = rest ? rest.seq : -1;
11319
11336
  var params = {
@@ -13216,7 +13233,7 @@ var Methods = {
13216
13233
  },
13217
13234
 
13218
13235
  /**
13219
- * 同步 data 数据
13236
+ * 同步 data 数据(即将废弃)
13220
13237
  * 如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑
13221
13238
  * 对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到
13222
13239
  */
@@ -13241,31 +13258,17 @@ var Methods = {
13241
13258
  handleTableData: function handleTableData(force) {
13242
13259
  var _this2 = this;
13243
13260
 
13244
- var treeConfig = this.treeConfig,
13245
- scrollYLoad = this.scrollYLoad,
13261
+ var scrollYLoad = this.scrollYLoad,
13246
13262
  scrollYStore = this.scrollYStore,
13247
13263
  fullDataRowIdData = this.fullDataRowIdData,
13248
- treeExpandeds = this.treeExpandeds,
13249
- treeOpts = this.treeOpts;
13250
- var fullList = []; // 是否进行数据处理
13264
+ afterFullData = this.afterFullData;
13265
+ var fullList = afterFullData; // 是否进行数据处理
13251
13266
 
13252
13267
  if (force) {
13253
- this.updateAfterFullData();
13254
- } // 如果为虚拟树,将树结构拍平
13255
-
13268
+ // 更新数据,处理筛选和排序
13269
+ this.updateAfterFullData(); // 如果为虚拟树,将树结构拍平
13256
13270
 
13257
- if (treeConfig && treeOpts.transform) {
13258
- var expandMaps = new Map();
13259
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(this.afterTreeFullData, function (row, index, items, path, parent) {
13260
- if (!parent || expandMaps.has(parent) && treeExpandeds.indexOf(parent) > -1) {
13261
- expandMaps.set(row, 1);
13262
- fullList.push(row);
13263
- }
13264
- }, {
13265
- children: treeOpts.mapChildren
13266
- });
13267
- } else {
13268
- fullList = this.afterFullData;
13271
+ fullList = this.handleVirtualTreeToList();
13269
13272
  }
13270
13273
 
13271
13274
  var tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
@@ -14244,6 +14247,36 @@ var Methods = {
14244
14247
  return rowList;
14245
14248
  },
14246
14249
 
14250
+ /**
14251
+ * 如果为虚拟树,将树结构拍平
14252
+ * @returns
14253
+ */
14254
+ handleVirtualTreeToList: function handleVirtualTreeToList() {
14255
+ var treeOpts = this.treeOpts,
14256
+ treeConfig = this.treeConfig,
14257
+ treeExpandeds = this.treeExpandeds,
14258
+ afterTreeFullData = this.afterTreeFullData,
14259
+ afterFullData = this.afterFullData;
14260
+
14261
+ if (treeConfig && treeOpts.transform) {
14262
+ var fullData = [];
14263
+ var expandMaps = new Map();
14264
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterTreeFullData, function (row, index, items, path, parent) {
14265
+ if (!parent || expandMaps.has(parent) && treeExpandeds.indexOf(parent) > -1) {
14266
+ expandMaps.set(row, 1);
14267
+ fullData.push(row);
14268
+ }
14269
+ }, {
14270
+ children: treeOpts.mapChildren
14271
+ });
14272
+ this.afterFullData = fullData;
14273
+ this.updateScrollYStatus(fullData);
14274
+ return fullData;
14275
+ }
14276
+
14277
+ return afterFullData;
14278
+ },
14279
+
14247
14280
  /**
14248
14281
  * 获取处理后全量的表格数据
14249
14282
  * 如果存在筛选条件,继续处理
@@ -14367,58 +14400,91 @@ var Methods = {
14367
14400
  };
14368
14401
 
14369
14402
  if (treeConfig && transform) {
14403
+ // 筛选虚拟树
14370
14404
  tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(tableFullTreeData, handleFilter, _objectSpread2(_objectSpread2({}, treeOpts), {}, {
14371
14405
  original: true
14372
14406
  }));
14407
+ tableData = tableTree;
14373
14408
  } else {
14374
14409
  tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
14375
14410
  tableTree = tableData;
14376
14411
  }
14377
14412
  } else {
14378
- tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
14379
- tableTree = tableData;
14413
+ if (treeConfig && transform) {
14414
+ // 还原虚拟树
14415
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.searchTree(tableFullTreeData, function () {
14416
+ return true;
14417
+ }, _objectSpread2(_objectSpread2({}, treeOpts), {}, {
14418
+ original: true
14419
+ }));
14420
+ tableData = tableTree;
14421
+ } else {
14422
+ tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
14423
+ tableTree = tableData;
14424
+ }
14380
14425
  }
14381
14426
 
14382
14427
  var firstOrderColumn = orderColumns[0];
14383
14428
 
14384
14429
  if (!allRemoteSort && firstOrderColumn) {
14385
- if (allSortMethod) {
14386
- var sortRests = allSortMethod({
14387
- data: tableData,
14388
- column: firstOrderColumn.column,
14389
- property: firstOrderColumn.property,
14390
- order: firstOrderColumn.order,
14391
- sortList: orderColumns,
14392
- $table: this
14393
- });
14394
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortRests) ? sortRests : tableData;
14395
- } else {
14396
- // 兼容 v4
14397
- if (sortMultiple) {
14398
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, orderColumns.map(function (_ref2) {
14430
+ if (treeConfig && transform) {
14431
+ // 虚拟树和列表一样,只能排序根级节点
14432
+ if (allSortMethod) {
14433
+ var sortRests = allSortMethod({
14434
+ data: tableTree,
14435
+ sortList: orderColumns,
14436
+ $table: this
14437
+ });
14438
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(sortRests) ? sortRests : tableTree;
14439
+ } else {
14440
+ tableTree = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableTree, orderColumns.map(function (_ref2) {
14399
14441
  var column = _ref2.column,
14400
14442
  order = _ref2.order;
14401
14443
  return [getOrderField(_this16, column), order];
14402
14444
  }));
14445
+ }
14446
+
14447
+ tableData = tableTree;
14448
+ } else {
14449
+ if (allSortMethod) {
14450
+ var _sortRests = allSortMethod({
14451
+ data: tableData,
14452
+ column: firstOrderColumn.column,
14453
+ property: firstOrderColumn.property,
14454
+ order: firstOrderColumn.order,
14455
+ sortList: orderColumns,
14456
+ $table: this
14457
+ });
14458
+
14459
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(_sortRests) ? _sortRests : tableData;
14403
14460
  } else {
14404
- // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
14405
- var sortByConfs;
14461
+ // 兼容 v4
14462
+ if (sortMultiple) {
14463
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, orderColumns.map(function (_ref3) {
14464
+ var column = _ref3.column,
14465
+ order = _ref3.order;
14466
+ return [getOrderField(_this16, column), order];
14467
+ }));
14468
+ } else {
14469
+ // 兼容 v2,在 v4 中废弃, sortBy 不能为数组
14470
+ var sortByConfs;
14406
14471
 
14407
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(firstOrderColumn.sortBy)) {
14408
- sortByConfs = firstOrderColumn.sortBy.map(function (item) {
14409
- return [item, firstOrderColumn.order];
14410
- });
14411
- }
14472
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isArray(firstOrderColumn.sortBy)) {
14473
+ sortByConfs = firstOrderColumn.sortBy.map(function (item) {
14474
+ return [item, firstOrderColumn.order];
14475
+ });
14476
+ }
14412
14477
 
14413
- tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref3) {
14414
- var column = _ref3.column,
14415
- order = _ref3.order;
14416
- return [getOrderField(_this16, column), order];
14417
- }));
14478
+ tableData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.orderBy(tableData, sortByConfs || [firstOrderColumn].map(function (_ref4) {
14479
+ var column = _ref4.column,
14480
+ order = _ref4.order;
14481
+ return [getOrderField(_this16, column), order];
14482
+ }));
14483
+ }
14418
14484
  }
14419
- }
14420
14485
 
14421
- tableTree = tableData;
14486
+ tableTree = tableData;
14487
+ }
14422
14488
  }
14423
14489
 
14424
14490
  this.afterFullData = tableData;
@@ -14444,30 +14510,15 @@ var Methods = {
14444
14510
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eachTree(afterTreeFullData, function (row, index, items, path) {
14445
14511
  var rowid = methods_getRowid(_this17, row);
14446
14512
  var allrest = fullAllDataRowIdData[rowid];
14447
- var fullrest = fullDataRowIdData[rowid];
14448
14513
  var seq = path.map(function (num, i) {
14449
14514
  return i % 2 === 0 ? Number(num) + 1 : '.';
14450
14515
  }).join('');
14451
14516
 
14452
14517
  if (allrest) {
14453
14518
  allrest.seq = seq;
14454
- }
14455
-
14456
- if (fullrest) {
14457
- fullrest.seq = seq;
14519
+ allrest._index = index;
14458
14520
  } else {
14459
- fullAllDataRowIdData[rowid] = {
14460
- row: row,
14461
- rowid: rowid,
14462
- seq: seq,
14463
- index: -1,
14464
- $index: -1,
14465
- _index: index,
14466
- items: [],
14467
- parent: null,
14468
- level: 0
14469
- };
14470
- fullDataRowIdData[rowid] = {
14521
+ var rest = {
14471
14522
  row: row,
14472
14523
  rowid: rowid,
14473
14524
  seq: seq,
@@ -14478,35 +14529,23 @@ var Methods = {
14478
14529
  parent: null,
14479
14530
  level: 0
14480
14531
  };
14532
+ fullAllDataRowIdData[rowid] = rest;
14533
+ fullDataRowIdData[rowid] = rest;
14481
14534
  }
14482
- }, treeOpts);
14535
+ }, {
14536
+ children: treeOpts.mapChildren
14537
+ });
14483
14538
  } else {
14484
14539
  afterFullData.forEach(function (row, index) {
14485
14540
  var rowid = methods_getRowid(_this17, row);
14486
14541
  var allrest = fullAllDataRowIdData[rowid];
14487
- var fullrest = fullDataRowIdData[rowid];
14488
14542
  var seq = index + 1;
14489
14543
 
14490
14544
  if (allrest) {
14491
14545
  allrest.seq = seq;
14492
- }
14493
-
14494
- if (fullrest) {
14495
- fullrest.seq = seq;
14496
- fullrest._index = index;
14546
+ allrest._index = index;
14497
14547
  } else {
14498
- fullAllDataRowIdData[rowid] = {
14499
- row: row,
14500
- rowid: rowid,
14501
- seq: seq,
14502
- index: -1,
14503
- $index: -1,
14504
- _index: index,
14505
- items: [],
14506
- parent: null,
14507
- level: 0
14508
- };
14509
- fullDataRowIdData[rowid] = {
14548
+ var rest = {
14510
14549
  row: row,
14511
14550
  rowid: rowid,
14512
14551
  seq: seq,
@@ -14517,6 +14556,8 @@ var Methods = {
14517
14556
  parent: null,
14518
14557
  level: 0
14519
14558
  };
14559
+ fullAllDataRowIdData[rowid] = rest;
14560
+ fullDataRowIdData[rowid] = rest;
14520
14561
  }
14521
14562
  });
14522
14563
  }
@@ -14740,9 +14781,9 @@ var Methods = {
14740
14781
  keyMap[colKey] = column;
14741
14782
  }
14742
14783
  });
14743
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(customMap, function (_ref4, field) {
14744
- var visible = _ref4.visible,
14745
- resizeWidth = _ref4.resizeWidth;
14784
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.each(customMap, function (_ref5, field) {
14785
+ var visible = _ref5.visible,
14786
+ resizeWidth = _ref5.resizeWidth;
14746
14787
  var column = keyMap[field];
14747
14788
 
14748
14789
  if (column) {
@@ -16353,10 +16394,10 @@ var Methods = {
16353
16394
  * 多选,行选中事件
16354
16395
  * value 选中true 不选false 半选-1
16355
16396
  */
16356
- handleSelectRow: function handleSelectRow(_ref5, value) {
16397
+ handleSelectRow: function handleSelectRow(_ref6, value) {
16357
16398
  var _this30 = this;
16358
16399
 
16359
- var row = _ref5.row;
16400
+ var row = _ref6.row;
16360
16401
  var selection = this.selection,
16361
16402
  afterFullData = this.afterFullData,
16362
16403
  treeConfig = this.treeConfig,
@@ -17172,8 +17213,8 @@ var Methods = {
17172
17213
  /**
17173
17214
  * 行 hover 事件
17174
17215
  */
17175
- triggerHoverEvent: function triggerHoverEvent(evnt, _ref6) {
17176
- var row = _ref6.row;
17216
+ triggerHoverEvent: function triggerHoverEvent(evnt, _ref7) {
17217
+ var row = _ref7.row;
17177
17218
  this.setHoverRow(row);
17178
17219
  },
17179
17220
  setHoverRow: function setHoverRow(row) {
@@ -17937,7 +17978,8 @@ var Methods = {
17937
17978
  var treeOpts = this.treeOpts,
17938
17979
  treeExpandeds = this.treeExpandeds,
17939
17980
  fullAllDataRowMap = this.fullAllDataRowMap;
17940
- var lazy = treeOpts.lazy;
17981
+ var transform = treeOpts.transform,
17982
+ lazy = treeOpts.lazy;
17941
17983
  var rest = fullAllDataRowMap.get(row);
17942
17984
 
17943
17985
  if (lazy && rest) {
@@ -17947,6 +17989,11 @@ var Methods = {
17947
17989
  });
17948
17990
  }
17949
17991
 
17992
+ if (transform) {
17993
+ this.handleVirtualTreeToList();
17994
+ return this.handleTableData();
17995
+ }
17996
+
17950
17997
  return this.$nextTick();
17951
17998
  },
17952
17999
 
@@ -17968,6 +18015,8 @@ var Methods = {
17968
18015
  return _this42.handleAsyncTreeExpandChilds(row);
17969
18016
  }).then(function () {
17970
18017
  if (transform) {
18018
+ _this42.handleVirtualTreeToList();
18019
+
17971
18020
  return _this42.handleTableData();
17972
18021
  }
17973
18022
  }).then(function () {
@@ -18215,6 +18264,8 @@ var Methods = {
18215
18264
  var _this45 = this;
18216
18265
 
18217
18266
  return this.handleBaseTreeExpand(rows, expanded).then(function () {
18267
+ _this45.handleVirtualTreeToList();
18268
+
18218
18269
  return _this45.handleTableData();
18219
18270
  }).then(function () {
18220
18271
  return _this45.recalculate();
@@ -18267,7 +18318,8 @@ var Methods = {
18267
18318
  var treeOpts = this.treeOpts,
18268
18319
  treeExpandeds = this.treeExpandeds,
18269
18320
  tableFullData = this.tableFullData;
18270
- var reserve = treeOpts.reserve;
18321
+ var transform = treeOpts.transform,
18322
+ reserve = treeOpts.reserve;
18271
18323
  var isExists = treeExpandeds.length;
18272
18324
  this.treeExpandeds = [];
18273
18325
 
@@ -18278,6 +18330,12 @@ var Methods = {
18278
18330
  }
18279
18331
 
18280
18332
  return this.handleTableData().then(function () {
18333
+ if (transform) {
18334
+ _this46.handleVirtualTreeToList();
18335
+
18336
+ return _this46.handleTableData();
18337
+ }
18338
+ }).then(function () {
18281
18339
  if (isExists) {
18282
18340
  _this46.recalculate();
18283
18341
  }
@@ -18749,8 +18807,8 @@ var Methods = {
18749
18807
  }
18750
18808
 
18751
18809
  _this50.clearValidate();
18752
- }).catch(function (_ref7) {
18753
- var rule = _ref7.rule;
18810
+ }).catch(function (_ref8) {
18811
+ var rule = _ref8.rule;
18754
18812
 
18755
18813
  if (customVal) {
18756
18814
  methods_setCellValue(row, column, cellValue);
@@ -21572,10 +21630,14 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21572
21630
 
21573
21631
  (_editStore$insertList = editStore.insertList).unshift.apply(_editStore$insertList, _toConsumableArray(newRecords));
21574
21632
 
21575
- this.handleTableData(treeConfig && treeOpts.transform);
21633
+ this.handleTableData(treeConfig && transform);
21634
+
21635
+ if (!(treeConfig && transform)) {
21636
+ this.updateAfterDataIndex();
21637
+ }
21638
+
21576
21639
  this.updateFooter();
21577
21640
  this.cacheRowMap();
21578
- this.updateAfterDataIndex();
21579
21641
  this.checkSelectionStatus();
21580
21642
 
21581
21643
  if (this.scrollYLoad) {
@@ -21711,10 +21773,14 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21711
21773
  insertList.splice(iIndex, 1);
21712
21774
  }
21713
21775
  });
21714
- this.handleTableData(treeConfig && treeOpts.transform);
21776
+ this.handleTableData(treeConfig && transform);
21777
+
21778
+ if (!(treeConfig && transform)) {
21779
+ this.updateAfterDataIndex();
21780
+ }
21781
+
21715
21782
  this.updateFooter();
21716
21783
  this.cacheRowMap();
21717
- this.updateAfterDataIndex();
21718
21784
  this.checkSelectionStatus();
21719
21785
 
21720
21786
  if (this.scrollYLoad) {
@@ -27898,7 +27964,7 @@ function hasTreeChildren($xetable, row) {
27898
27964
  return row[treeOpts.children] && row[treeOpts.children].length > 0;
27899
27965
  }
27900
27966
 
27901
- function getSeq($xetable, row, rowIndex, column, columnIndex, path) {
27967
+ function getSeq($xetable, row, rowIndex, column, columnIndex) {
27902
27968
  var seqOpts = $xetable.seqOpts;
27903
27969
  var seqMethod = seqOpts.seqMethod || column.seqMethod;
27904
27970
 
@@ -27911,11 +27977,7 @@ function getSeq($xetable, row, rowIndex, column, columnIndex, path) {
27911
27977
  });
27912
27978
  }
27913
27979
 
27914
- if (path) {
27915
- return toTreePathSeq(path);
27916
- }
27917
-
27918
- return seqOpts.startIndex + rowIndex + 1;
27980
+ return $xetable.getRowSeq(row);
27919
27981
  }
27920
27982
 
27921
27983
  function defaultFilterExportColumn(column) {
@@ -27988,7 +28050,7 @@ function getLabelData($xetable, opts, columns, datas) {
27988
28050
  } else {
27989
28051
  switch (column.type) {
27990
28052
  case 'seq':
27991
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex, path);
28053
+ cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
27992
28054
  break;
27993
28055
 
27994
28056
  case 'checkbox':
@@ -28064,7 +28126,7 @@ function getLabelData($xetable, opts, columns, datas) {
28064
28126
  } else {
28065
28127
  switch (column.type) {
28066
28128
  case 'seq':
28067
- cellValue = getSeq($xetable, row, rowIndex, column, columnIndex, null);
28129
+ cellValue = getSeq($xetable, row, rowIndex, column, columnIndex);
28068
28130
  break;
28069
28131
 
28070
28132
  case 'checkbox':
@@ -30254,6 +30316,7 @@ var Keyboard = {
30254
30316
 
30255
30317
 
30256
30318
 
30319
+
30257
30320
  /**
30258
30321
  * 校验规则
30259
30322
  */
@@ -30452,7 +30515,7 @@ function validErrorRuleValue(rule, val) {
30452
30515
  var ruleProps = Object.keys(validRest);
30453
30516
  return _this2.$nextTick().then(function () {
30454
30517
  if (ruleProps.length) {
30455
- return validRest[ruleProps[0]][0];
30518
+ return Promise.reject(validRest[ruleProps[0]][0]);
30456
30519
  }
30457
30520
 
30458
30521
  if (cb) {
@@ -30460,14 +30523,19 @@ function validErrorRuleValue(rule, val) {
30460
30523
  }
30461
30524
  });
30462
30525
  }).catch(function (firstErrParams) {
30463
- return new Promise(function (resolve) {
30526
+ return new Promise(function (resolve, reject) {
30464
30527
  var finish = function finish() {
30465
30528
  _this2.$nextTick(function () {
30466
30529
  if (cb) {
30467
30530
  cb(validRest);
30468
30531
  resolve();
30469
30532
  } else {
30470
- resolve(validRest);
30533
+ if (conf.validToReject) {
30534
+ // 已废弃,校验失败将不会执行catch
30535
+ reject(validRest);
30536
+ } else {
30537
+ resolve(validRest);
30538
+ }
30471
30539
  }
30472
30540
  });
30473
30541
  };