vxe-table 3.14.0 → 3.14.1

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 (38) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +92 -63
  3. package/es/table/module/validator/mixin.js +2 -5
  4. package/es/table/src/body.js +6 -7
  5. package/es/table/src/methods.js +291 -278
  6. package/es/table/src/table.js +15 -15
  7. package/es/ui/index.js +1 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/lib/index.umd.js +478 -484
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/style.css +1 -1
  12. package/lib/table/module/edit/mixin.js +106 -98
  13. package/lib/table/module/edit/mixin.min.js +1 -1
  14. package/lib/table/module/validator/mixin.js +3 -9
  15. package/lib/table/module/validator/mixin.min.js +1 -1
  16. package/lib/table/src/body.js +6 -7
  17. package/lib/table/src/body.min.js +1 -1
  18. package/lib/table/src/methods.js +343 -348
  19. package/lib/table/src/methods.min.js +1 -1
  20. package/lib/table/src/table.js +15 -15
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/ui/index.js +1 -1
  23. package/lib/ui/index.min.js +1 -1
  24. package/lib/ui/src/log.js +1 -1
  25. package/lib/ui/src/log.min.js +1 -1
  26. package/package.json +2 -2
  27. package/packages/table/module/edit/mixin.ts +125 -87
  28. package/packages/table/module/validator/mixin.ts +3 -6
  29. package/packages/table/src/body.ts +6 -7
  30. package/packages/table/src/methods.ts +334 -293
  31. package/packages/table/src/table.ts +18 -18
  32. package/packages/table/src/util.ts +2 -2
  33. /package/es/{iconfont.1742955973002.ttf → iconfont.1743045564244.ttf} +0 -0
  34. /package/es/{iconfont.1742955973002.woff → iconfont.1743045564244.woff} +0 -0
  35. /package/es/{iconfont.1742955973002.woff2 → iconfont.1743045564244.woff2} +0 -0
  36. /package/lib/{iconfont.1742955973002.ttf → iconfont.1743045564244.ttf} +0 -0
  37. /package/lib/{iconfont.1742955973002.woff → iconfont.1743045564244.woff} +0 -0
  38. /package/lib/{iconfont.1742955973002.woff2 → iconfont.1743045564244.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.14.0";
2223
+ const version = "3.14.1";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2844,7 +2844,7 @@ function isNodeElement(elem) {
2844
2844
  const {
2845
2845
  log: log_log
2846
2846
  } = core_.VxeUI;
2847
- const log_version = `table v${"3.14.0"}`;
2847
+ const log_version = `table v${"3.14.1"}`;
2848
2848
  const warnLog = log_log.create('warn', log_version);
2849
2849
  const errLog = log_log.create('error', log_version);
2850
2850
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5525,14 +5525,14 @@ const updateScrollYStatus = ($xeTable, fullData) => {
5525
5525
  const {
5526
5526
  treeConfig
5527
5527
  } = props;
5528
- const sYOpts = $xeTable.computeSYOpts;
5528
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
5529
5529
  const treeOpts = $xeTable.computeTreeOpts;
5530
5530
  const {
5531
5531
  transform
5532
5532
  } = treeOpts;
5533
5533
  const allList = fullData || internalData.tableFullData;
5534
5534
  // 如果gt为0,则总是启用
5535
- const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt < allList.length);
5535
+ const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
5536
5536
  reactData.scrollYLoad = scrollYLoad;
5537
5537
  return scrollYLoad;
5538
5538
  };
@@ -5693,7 +5693,6 @@ function updateStyle($xeTable) {
5693
5693
  const reactData = $xeTable;
5694
5694
  const internalData = $xeTable;
5695
5695
  const {
5696
- border,
5697
5696
  showHeaderOverflow: allColumnHeaderOverflow,
5698
5697
  showFooterOverflow: allColumnFooterOverflow,
5699
5698
  mouseConfig,
@@ -5872,36 +5871,6 @@ function updateStyle($xeTable) {
5872
5871
  if (tableElem) {
5873
5872
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
5874
5873
  }
5875
- const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
5876
- if (isGroup && listElem) {
5877
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(listElem.querySelectorAll('.col--group'), thElem => {
5878
- const colNode = $xeTable.getColumnNode(thElem);
5879
- if (colNode) {
5880
- const column = colNode.item;
5881
- const {
5882
- showHeaderOverflow
5883
- } = column;
5884
- const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
5885
- const showEllipsis = cellOverflow === 'ellipsis';
5886
- const showTitle = cellOverflow === 'title';
5887
- const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
5888
- const hasEllipsis = showTitle || showTooltip || showEllipsis;
5889
- let childWidth = 0;
5890
- let countChild = 0;
5891
- if (hasEllipsis) {
5892
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, item => {
5893
- if (!item.children || !column.children.length) {
5894
- countChild++;
5895
- }
5896
- childWidth += item.renderWidth;
5897
- }, {
5898
- children: 'children'
5899
- });
5900
- }
5901
- thElem.style.width = hasEllipsis ? `${childWidth - countChild - (border ? 2 : 0)}px` : '';
5902
- }
5903
- });
5904
- }
5905
5874
  } else if (layout === 'body') {
5906
5875
  if (currScrollElem) {
5907
5876
  currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : '';
@@ -6020,6 +5989,134 @@ function handleChangeCell($xeTable, evnt, params) {
6020
5989
  $xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
6021
5990
  });
6022
5991
  }
5992
+ function handleDefaultSort($xeTable) {
5993
+ const props = $xeTable;
5994
+ const {
5995
+ sortConfig
5996
+ } = props;
5997
+ if (sortConfig) {
5998
+ const sortOpts = $xeTable.computeSortOpts;
5999
+ let {
6000
+ defaultSort
6001
+ } = sortOpts;
6002
+ if (defaultSort) {
6003
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(defaultSort)) {
6004
+ defaultSort = [defaultSort];
6005
+ }
6006
+ if (defaultSort.length) {
6007
+ (sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach((item, index) => {
6008
+ const {
6009
+ field,
6010
+ order
6011
+ } = item;
6012
+ if (field && order) {
6013
+ const column = $xeTable.getColumnByField(field);
6014
+ if (column && column.sortable) {
6015
+ column.order = order;
6016
+ column.sortTime = Date.now() + index;
6017
+ }
6018
+ }
6019
+ });
6020
+ if (!sortOpts.remote) {
6021
+ $xeTable.handleTableData(true).then(updateStyle);
6022
+ }
6023
+ }
6024
+ }
6025
+ }
6026
+ }
6027
+ /**
6028
+ * 处理默认勾选
6029
+ */
6030
+ function handleDefaultSelectionChecked($xeTable) {
6031
+ const props = $xeTable;
6032
+ const internalData = $xeTable;
6033
+ const {
6034
+ checkboxConfig
6035
+ } = props;
6036
+ if (checkboxConfig) {
6037
+ const {
6038
+ fullDataRowIdData
6039
+ } = internalData;
6040
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
6041
+ const {
6042
+ checkAll,
6043
+ checkRowKeys
6044
+ } = checkboxOpts;
6045
+ if (checkAll) {
6046
+ handleCheckedAllCheckboxRow($xeTable, true, true);
6047
+ } else if (checkRowKeys) {
6048
+ const defSelection = [];
6049
+ checkRowKeys.forEach(rowid => {
6050
+ if (fullDataRowIdData[rowid]) {
6051
+ defSelection.push(fullDataRowIdData[rowid].row);
6052
+ }
6053
+ });
6054
+ handleCheckedCheckboxRow($xeTable, defSelection, true, true);
6055
+ }
6056
+ }
6057
+ }
6058
+ /**
6059
+ * 处理单选框默认勾选
6060
+ */
6061
+ function handleDefaultRadioChecked($xeTable) {
6062
+ const props = $xeTable;
6063
+ const internalData = $xeTable;
6064
+ const {
6065
+ radioConfig
6066
+ } = props;
6067
+ if (radioConfig) {
6068
+ const {
6069
+ fullDataRowIdData
6070
+ } = internalData;
6071
+ const radioOpts = $xeTable.computeRadioOpts;
6072
+ const {
6073
+ checkRowKey: rowid,
6074
+ reserve
6075
+ } = radioOpts;
6076
+ if (rowid) {
6077
+ if (fullDataRowIdData[rowid]) {
6078
+ handleCheckedRadioRow(fullDataRowIdData[rowid].row, true);
6079
+ }
6080
+ if (reserve) {
6081
+ const rowkey = getRowkey($xeTable);
6082
+ internalData.radioReserveRow = {
6083
+ [rowkey]: rowid
6084
+ };
6085
+ }
6086
+ }
6087
+ }
6088
+ }
6089
+ /**
6090
+ * 处理默认展开行
6091
+ */
6092
+ function handleDefaultRowExpand($xeTable) {
6093
+ const props = $xeTable;
6094
+ const internalData = $xeTable;
6095
+ const {
6096
+ expandConfig
6097
+ } = props;
6098
+ if (expandConfig) {
6099
+ const {
6100
+ fullDataRowIdData
6101
+ } = internalData;
6102
+ const expandOpts = $xeTable.computeExpandOpts;
6103
+ const {
6104
+ expandAll,
6105
+ expandRowKeys
6106
+ } = expandOpts;
6107
+ if (expandAll) {
6108
+ $xeTable.setAllRowExpand(true);
6109
+ } else if (expandRowKeys) {
6110
+ const defExpandeds = [];
6111
+ expandRowKeys.forEach(rowid => {
6112
+ if (fullDataRowIdData[rowid]) {
6113
+ defExpandeds.push(fullDataRowIdData[rowid].row);
6114
+ }
6115
+ });
6116
+ $xeTable.setRowExpand(defExpandeds, true);
6117
+ }
6118
+ }
6119
+ }
6023
6120
  function handleRadioReserveRow($xeTable, row) {
6024
6121
  const internalData = $xeTable;
6025
6122
  const radioOpts = $xeTable.computeRadioOpts;
@@ -6582,21 +6679,19 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
6582
6679
  }
6583
6680
  }
6584
6681
  function setMerges($xeTable, merges, mList, rowList) {
6585
- const props = $xeTable;
6682
+ // const props = $xeTable
6586
6683
  const internalData = $xeTable;
6587
6684
  if (merges) {
6588
- const {
6589
- treeConfig
6590
- } = props;
6685
+ // const { treeConfig } = props
6591
6686
  const {
6592
6687
  visibleColumn
6593
6688
  } = internalData;
6594
6689
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
6595
6690
  merges = [merges];
6596
6691
  }
6597
- if (treeConfig && merges.length) {
6598
- errLog('vxe.error.noTree', ['merge-cells | merge-footer-items']);
6599
- }
6692
+ // if (treeConfig && merges.length) {
6693
+ // errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
6694
+ // }
6600
6695
  merges.forEach(item => {
6601
6696
  let {
6602
6697
  row,
@@ -6641,22 +6736,20 @@ function setMerges($xeTable, merges, mList, rowList) {
6641
6736
  }
6642
6737
  }
6643
6738
  function removeMerges($xeTable, merges, mList, rowList) {
6644
- const props = $xeTable;
6739
+ // const props = $xeTable
6645
6740
  const internalData = $xeTable;
6646
6741
  const rest = [];
6647
6742
  if (merges) {
6648
- const {
6649
- treeConfig
6650
- } = props;
6743
+ // const { treeConfig } = props
6651
6744
  const {
6652
6745
  visibleColumn
6653
6746
  } = internalData;
6654
6747
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
6655
6748
  merges = [merges];
6656
6749
  }
6657
- if (treeConfig && merges.length) {
6658
- errLog('vxe.error.noTree', ['merge-cells | merge-footer-items']);
6659
- }
6750
+ // if (treeConfig && merges.length) {
6751
+ // errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
6752
+ // }
6660
6753
  merges.forEach(item => {
6661
6754
  let {
6662
6755
  row,
@@ -7192,7 +7285,7 @@ function handleScrollToRowColumn($xeTable, fieldOrColumn, row) {
7192
7285
  }
7193
7286
  return $xeTable.$nextTick();
7194
7287
  }
7195
- const handleRowExpandReserve = ($xeTable, row, expanded) => {
7288
+ function handleRowExpandReserve($xeTable, row, expanded) {
7196
7289
  const internalData = $xeTable;
7197
7290
  const {
7198
7291
  rowExpandedReserveRowMap
@@ -7206,7 +7299,25 @@ const handleRowExpandReserve = ($xeTable, row, expanded) => {
7206
7299
  delete rowExpandedReserveRowMap[rowid];
7207
7300
  }
7208
7301
  }
7209
- };
7302
+ }
7303
+ function handleDefaultMergeCells($xeTable) {
7304
+ const props = $xeTable;
7305
+ const {
7306
+ mergeCells
7307
+ } = props;
7308
+ if (mergeCells) {
7309
+ $xeTable.setMergeCells(mergeCells);
7310
+ }
7311
+ }
7312
+ function handleDefaultMergeFooterItems($xeTable) {
7313
+ const props = $xeTable;
7314
+ const {
7315
+ mergeFooterItems
7316
+ } = props;
7317
+ if (mergeFooterItems) {
7318
+ $xeTable.setMergeFooterItems(mergeFooterItems);
7319
+ }
7320
+ }
7210
7321
  // 计算可视渲染相关数据
7211
7322
  function computeScrollLoad($xeTable) {
7212
7323
  const reactData = $xeTable;
@@ -7304,6 +7415,26 @@ function handleRecalculateLayout($xeTable, reFull) {
7304
7415
  }
7305
7416
  });
7306
7417
  }
7418
+ /**
7419
+ * 处理数据加载默认行为
7420
+ * 默认执行一次,除非被重置
7421
+ */
7422
+ function handleLoadDefaults($xeTable) {
7423
+ handleDefaultSelectionChecked($xeTable);
7424
+ handleDefaultRadioChecked($xeTable);
7425
+ handleDefaultRowExpand($xeTable);
7426
+ handleDefaultTreeExpand($xeTable);
7427
+ handleDefaultMergeCells($xeTable);
7428
+ handleDefaultMergeFooterItems($xeTable);
7429
+ $xeTable.$nextTick(() => setTimeout(() => $xeTable.recalculate()));
7430
+ }
7431
+ /**
7432
+ * 处理初始化的默认行为
7433
+ * 只会执行一次
7434
+ */
7435
+ function handleInitDefaults($xeTable) {
7436
+ handleDefaultSort($xeTable);
7437
+ }
7307
7438
  function handleTableColumn($xeTable) {
7308
7439
  const reactData = $xeTable;
7309
7440
  const internalData = $xeTable;
@@ -7395,7 +7526,7 @@ function parseColumns($xeTable, isReset) {
7395
7526
  isGroup,
7396
7527
  columnStore
7397
7528
  } = reactData;
7398
- const sXOpts = $xeTable.computeSXOpts;
7529
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
7399
7530
  const {
7400
7531
  collectColumn,
7401
7532
  tableFullColumn,
@@ -7456,7 +7587,7 @@ function parseColumns($xeTable, isReset) {
7456
7587
  }
7457
7588
  const visibleColumn = leftList.concat(centerList).concat(rightList);
7458
7589
  // 如果gt为0,则总是启用
7459
- const scrollXLoad = !!sXOpts.enabled && sXOpts.gt > -1 && (sXOpts.gt === 0 || sXOpts.gt < tableFullColumn.length);
7590
+ const scrollXLoad = !!virtualXOpts.enabled && virtualXOpts.gt > -1 && (virtualXOpts.gt === 0 || virtualXOpts.gt < tableFullColumn.length);
7460
7591
  reactData.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
7461
7592
  Object.assign(columnStore, {
7462
7593
  leftList,
@@ -8110,21 +8241,26 @@ const Methods = {
8110
8241
  */
8111
8242
  loadTableData(datas, isReset) {
8112
8243
  const $xeTable = this;
8244
+ const props = $xeTable;
8113
8245
  const reactData = $xeTable;
8114
8246
  const internalData = $xeTable;
8115
8247
  const {
8116
8248
  keepSource,
8117
- treeConfig,
8118
- treeOpts,
8119
- editStore,
8249
+ treeConfig
8250
+ } = props;
8251
+ const {
8252
+ scrollYLoad: oldScrollYLoad
8253
+ } = reactData;
8254
+ const {
8120
8255
  scrollYStore,
8121
8256
  scrollXStore,
8122
8257
  lastScrollLeft,
8123
- lastScrollTop,
8124
- scrollYLoad: oldScrollYLoad,
8125
- sXOpts,
8126
- sYOpts
8127
- } = this;
8258
+ lastScrollTop
8259
+ } = internalData;
8260
+ const treeOpts = $xeTable.computeTreeOpts;
8261
+ const {
8262
+ transform
8263
+ } = treeOpts;
8128
8264
  const childrenField = treeOpts.children || treeOpts.childrenField;
8129
8265
  let treeData = [];
8130
8266
  let fullData = datas ? datas.slice(0) : [];
@@ -8133,7 +8269,7 @@ const Methods = {
8133
8269
  }
8134
8270
  if (treeConfig) {
8135
8271
  // 树结构自动转换
8136
- if (treeOpts.transform) {
8272
+ if (transform) {
8137
8273
  if (!treeOpts.rowField) {
8138
8274
  errLog('vxe.error.reqProp', ['table.tree-config.rowField']);
8139
8275
  }
@@ -8171,8 +8307,8 @@ const Methods = {
8171
8307
  scrollXStore.endIndex = 1;
8172
8308
  reactData.isRowLoading = true;
8173
8309
  reactData.scrollVMLoading = false;
8174
- editStore.insertMaps = {};
8175
- editStore.removeMaps = {};
8310
+ internalData.insertRowMaps = {};
8311
+ internalData.removeRowMaps = {};
8176
8312
  const sYLoad = updateScrollYStatus($xeTable, fullData);
8177
8313
  reactData.isDragColMove = false;
8178
8314
  reactData.isDragRowMove = false;
@@ -8190,15 +8326,15 @@ const Methods = {
8190
8326
  if (keepSource) {
8191
8327
  $xeTable.cacheSourceMap(fullData);
8192
8328
  }
8193
- if (this.clearCellAreas && this.mouseConfig) {
8194
- this.clearCellAreas();
8195
- this.clearCopyCellArea();
8329
+ if ($xeTable.clearCellAreas && props.mouseConfig) {
8330
+ $xeTable.clearCellAreas();
8331
+ $xeTable.clearCopyCellArea();
8196
8332
  }
8197
- this.clearMergeCells();
8198
- this.clearMergeFooterItems();
8199
- this.handleTableData(true);
8200
- this.updateFooter();
8201
- return this.$nextTick().then(() => {
8333
+ $xeTable.clearMergeCells();
8334
+ $xeTable.clearMergeFooterItems();
8335
+ $xeTable.handleTableData(true);
8336
+ $xeTable.updateFooter();
8337
+ return $xeTable.$nextTick().then(() => {
8202
8338
  updateHeight($xeTable);
8203
8339
  updateStyle($xeTable);
8204
8340
  }).then(() => {
@@ -8211,45 +8347,47 @@ const Methods = {
8211
8347
  if (sYLoad) {
8212
8348
  // if (showOverflow) {
8213
8349
  // if (!rowOpts.height) {
8214
- // const errColumn = this.tableFullColumn.find((column: any) => column.showOverflow === false)
8350
+ // const errColumn = internalData.tableFullColumn.find((column: any) => column.showOverflow === false)
8215
8351
  // if (errColumn) {
8216
8352
  // errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
8217
8353
  // }
8218
8354
  // }
8219
8355
  // }
8220
- if (!(this.height || this.maxHeight)) {
8356
+ if (!(props.height || props.maxHeight)) {
8221
8357
  errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
8222
8358
  }
8223
- // if (!this.showOverflow) {
8359
+ // if (!props.showOverflow) {
8224
8360
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
8225
8361
  // }
8226
- if (this.spanMethod) {
8362
+ if (props.spanMethod) {
8227
8363
  errLog('vxe.error.scrollErrProp', ['table.span-method']);
8228
8364
  }
8229
8365
  }
8230
8366
  handleReserveStatus($xeTable);
8231
- this.checkSelectionStatus();
8367
+ $xeTable.checkSelectionStatus();
8232
8368
  return new Promise(resolve => {
8233
- this.$nextTick().then(() => this.recalculate()).then(() => {
8369
+ this.$nextTick().then(() => $xeTable.recalculate()).then(() => {
8234
8370
  let targetScrollLeft = lastScrollLeft;
8235
8371
  let targetScrollTop = lastScrollTop;
8372
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
8373
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
8236
8374
  // 是否在更新数据之后自动滚动重置滚动条
8237
- if (sXOpts.scrollToLeftOnChange) {
8375
+ if (virtualXOpts.scrollToLeftOnChange) {
8238
8376
  targetScrollLeft = 0;
8239
8377
  }
8240
- if (sYOpts.scrollToTopOnChange) {
8378
+ if (virtualYOpts.scrollToTopOnChange) {
8241
8379
  targetScrollTop = 0;
8242
8380
  }
8243
8381
  reactData.isRowLoading = false;
8244
8382
  calcCellHeight($xeTable);
8245
8383
  // 是否变更虚拟滚动
8246
8384
  if (oldScrollYLoad === sYLoad) {
8247
- restoreScrollLocation(this, targetScrollLeft, targetScrollTop).then(() => {
8385
+ restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
8248
8386
  resolve();
8249
8387
  });
8250
8388
  } else {
8251
8389
  setTimeout(() => {
8252
- restoreScrollLocation(this, targetScrollLeft, targetScrollTop).then(() => {
8390
+ restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
8253
8391
  resolve();
8254
8392
  });
8255
8393
  });
@@ -8263,6 +8401,7 @@ const Methods = {
8263
8401
  * @param {Array} datas 数据
8264
8402
  */
8265
8403
  loadData(datas) {
8404
+ const $xeTable = this;
8266
8405
  const {
8267
8406
  initStatus
8268
8407
  } = this;
@@ -8270,7 +8409,7 @@ const Methods = {
8270
8409
  this.inited = true;
8271
8410
  this.initStatus = true;
8272
8411
  if (!initStatus) {
8273
- this.handleLoadDefaults();
8412
+ handleLoadDefaults($xeTable);
8274
8413
  }
8275
8414
  return this.recalculate();
8276
8415
  });
@@ -8280,12 +8419,13 @@ const Methods = {
8280
8419
  * @param {Array} datas 数据
8281
8420
  */
8282
8421
  reloadData(datas) {
8422
+ const $xeTable = this;
8283
8423
  return this.clearAll().then(() => {
8284
8424
  this.inited = true;
8285
8425
  this.initStatus = true;
8286
8426
  return this.loadTableData(datas, true);
8287
8427
  }).then(() => {
8288
- this.handleLoadDefaults();
8428
+ handleLoadDefaults($xeTable);
8289
8429
  return this.recalculate();
8290
8430
  });
8291
8431
  },
@@ -8481,18 +8621,24 @@ const Methods = {
8481
8621
  internalData.tableSourceData = sourceData;
8482
8622
  },
8483
8623
  getParams() {
8484
- return this.params;
8624
+ const $xeTable = this;
8625
+ const props = $xeTable;
8626
+ return props.params;
8485
8627
  },
8486
8628
  loadTreeChildren(row, childRecords) {
8487
8629
  const $xeTable = this;
8630
+ const props = $xeTable;
8631
+ const internalData = $xeTable;
8632
+ const {
8633
+ keepSource
8634
+ } = props;
8488
8635
  const {
8489
- keepSource,
8490
8636
  tableSourceData,
8491
- treeOpts,
8492
8637
  fullDataRowIdData,
8493
8638
  fullAllDataRowIdData,
8494
8639
  sourceDataRowIdData
8495
- } = this;
8640
+ } = internalData;
8641
+ const treeOpts = $xeTable.computeTreeOpts;
8496
8642
  const {
8497
8643
  transform,
8498
8644
  mapChildrenField
@@ -8551,20 +8697,24 @@ const Methods = {
8551
8697
  * @param {Element} tr 元素
8552
8698
  */
8553
8699
  getRowNode(tr) {
8700
+ const $xeTable = this;
8701
+ const internalData = $xeTable;
8554
8702
  if (tr) {
8555
8703
  const {
8556
8704
  fullAllDataRowIdData
8557
- } = this;
8705
+ } = internalData;
8558
8706
  const rowid = tr.getAttribute('rowid');
8559
- const rowRest = fullAllDataRowIdData[rowid];
8560
- if (rowRest) {
8561
- return {
8562
- rowid: rowRest.rowid,
8563
- item: rowRest.row,
8564
- index: rowRest.index,
8565
- items: rowRest.items,
8566
- parent: rowRest.parent
8567
- };
8707
+ if (rowid) {
8708
+ const rowRest = fullAllDataRowIdData[rowid];
8709
+ if (rowRest) {
8710
+ return {
8711
+ rowid: rowRest.rowid,
8712
+ item: rowRest.row,
8713
+ index: rowRest.index,
8714
+ items: rowRest.items,
8715
+ parent: rowRest.parent
8716
+ };
8717
+ }
8568
8718
  }
8569
8719
  }
8570
8720
  return null;
@@ -8574,10 +8724,12 @@ const Methods = {
8574
8724
  * @param {Element} cell 元素
8575
8725
  */
8576
8726
  getColumnNode(cell) {
8727
+ const $xeTable = this;
8728
+ const internalData = $xeTable;
8577
8729
  if (cell) {
8578
8730
  const {
8579
8731
  fullColumnIdData
8580
- } = this;
8732
+ } = internalData;
8581
8733
  const colid = cell.getAttribute('colid');
8582
8734
  if (colid) {
8583
8735
  const colRest = fullColumnIdData[colid];
@@ -8669,20 +8821,23 @@ const Methods = {
8669
8821
  * @param {Row} records 行数据
8670
8822
  */
8671
8823
  defineField(records) {
8824
+ const $xeTable = this;
8825
+ const props = $xeTable;
8826
+ const internalData = $xeTable;
8672
8827
  const {
8673
- radioOpts,
8674
- checkboxOpts,
8675
- treeConfig,
8676
- treeOpts,
8677
- expandOpts
8678
- } = this;
8828
+ treeConfig
8829
+ } = props;
8830
+ const expandOpts = $xeTable.computeExpandOpts;
8831
+ const treeOpts = $xeTable.computeTreeOpts;
8832
+ const radioOpts = $xeTable.computeRadioOpts;
8833
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
8679
8834
  const childrenField = treeOpts.children || treeOpts.childrenField;
8680
- const rowkey = getRowkey(this);
8835
+ const rowkey = getRowkey($xeTable);
8681
8836
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
8682
8837
  records = [records || {}];
8683
8838
  }
8684
8839
  return records.map(record => {
8685
- this.tableFullColumn.forEach(column => {
8840
+ internalData.tableFullColumn.forEach(column => {
8686
8841
  const {
8687
8842
  field,
8688
8843
  editRender
@@ -8726,8 +8881,9 @@ const Methods = {
8726
8881
  * @param {Array} records 新数据
8727
8882
  */
8728
8883
  createData(records) {
8729
- return this.$nextTick().then(() => {
8730
- return this.defineField(records);
8884
+ const $xeTable = this;
8885
+ return $xeTable.$nextTick().then(() => {
8886
+ return $xeTable.defineField(records);
8731
8887
  });
8732
8888
  },
8733
8889
  /**
@@ -8736,11 +8892,12 @@ const Methods = {
8736
8892
  * @param {Array/Object} records 新数据
8737
8893
  */
8738
8894
  createRow(records) {
8895
+ const $xeTable = this;
8739
8896
  const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records);
8740
8897
  if (!isArr) {
8741
8898
  records = [records];
8742
8899
  }
8743
- return this.createData(records).then(rows => isArr ? rows : rows[0]);
8900
+ return $xeTable.createData(records).then(rows => isArr ? rows : rows[0]);
8744
8901
  },
8745
8902
  /**
8746
8903
  * 还原数据
@@ -8758,20 +8915,15 @@ const Methods = {
8758
8915
  keepSource,
8759
8916
  treeConfig
8760
8917
  } = props;
8761
- const {
8762
- editStore
8763
- } = reactData;
8764
8918
  const {
8765
8919
  fullAllDataRowIdData,
8766
8920
  fullDataRowIdData,
8767
8921
  tableSourceData,
8768
8922
  sourceDataRowIdData,
8769
8923
  tableFullData,
8770
- afterFullData
8924
+ afterFullData,
8925
+ removeRowMaps
8771
8926
  } = internalData;
8772
- const removeTempMaps = {
8773
- ...editStore.removeMaps
8774
- };
8775
8927
  const treeOpts = $xeTable.computeTreeOpts;
8776
8928
  const {
8777
8929
  transform
@@ -8809,7 +8961,9 @@ const Methods = {
8809
8961
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
8810
8962
  }
8811
8963
  if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
8812
- delete removeTempMaps[rowid];
8964
+ if (removeRowMaps[rowid]) {
8965
+ delete removeRowMaps[rowid];
8966
+ }
8813
8967
  tableFullData.unshift(row);
8814
8968
  afterFullData.unshift(row);
8815
8969
  reDelFlag = true;
@@ -8821,7 +8975,7 @@ const Methods = {
8821
8975
  }
8822
8976
  if (rows) {
8823
8977
  if (reDelFlag) {
8824
- editStore.removeMaps = removeTempMaps;
8978
+ reactData.removeRowFlag++;
8825
8979
  $xeTable.updateFooter();
8826
8980
  $xeTable.cacheRowMap(false);
8827
8981
  $xeTable.handleTableData(treeConfig && transform);
@@ -8850,10 +9004,12 @@ const Methods = {
8850
9004
  * @param {String} field 字段名
8851
9005
  */
8852
9006
  clearData(rows, field) {
9007
+ const $xeTable = this;
9008
+ const internalData = $xeTable;
8853
9009
  const {
8854
9010
  tableFullData,
8855
9011
  visibleColumn
8856
- } = this;
9012
+ } = internalData;
8857
9013
  if (!arguments.length) {
8858
9014
  rows = tableFullData;
8859
9015
  } else if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
@@ -8870,7 +9026,7 @@ const Methods = {
8870
9026
  });
8871
9027
  });
8872
9028
  }
8873
- return this.$nextTick();
9029
+ return $xeTable.$nextTick();
8874
9030
  },
8875
9031
  getCellElement(row, fieldOrColumn) {
8876
9032
  const $xeTable = this;
@@ -8971,20 +9127,16 @@ const Methods = {
8971
9127
  isInsertByRow(row) {
8972
9128
  const $xeTable = this;
8973
9129
  const reactData = $xeTable;
8974
- const {
8975
- editStore
8976
- } = reactData;
9130
+ const internalData = $xeTable;
8977
9131
  const rowid = getRowid($xeTable, row);
8978
- return !!editStore.insertMaps[rowid];
9132
+ return !!reactData.insertRowFlag && !!internalData.insertRowMaps[rowid];
8979
9133
  },
8980
9134
  isRemoveByRow(row) {
8981
9135
  const $xeTable = this;
8982
9136
  const reactData = $xeTable;
8983
- const {
8984
- editStore
8985
- } = reactData;
9137
+ const internalData = $xeTable;
8986
9138
  const rowid = getRowid($xeTable, row);
8987
- return !!editStore.removeMaps[rowid];
9139
+ return !!reactData.removeRowFlag && !!internalData.removeRowMaps[rowid];
8988
9140
  },
8989
9141
  /**
8990
9142
  * 删除所有新增的临时数据
@@ -8992,11 +9144,8 @@ const Methods = {
8992
9144
  */
8993
9145
  removeInsertRow() {
8994
9146
  const $xeTable = this;
8995
- const reactData = $xeTable;
8996
- const {
8997
- editStore
8998
- } = reactData;
8999
- editStore.insertMaps = {};
9147
+ const internalData = $xeTable;
9148
+ internalData.insertRowMaps = {};
9000
9149
  return $xeTable.remove($xeTable.getInsertRecords());
9001
9150
  },
9002
9151
  /**
@@ -9044,14 +9193,19 @@ const Methods = {
9044
9193
  * @param {Number} columnIndex 索引
9045
9194
  */
9046
9195
  getColumns(columnIndex) {
9047
- const columns = this.visibleColumn;
9048
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(columnIndex) ? columns.slice(0) : columns[columnIndex];
9196
+ const $xeTable = this;
9197
+ const internalData = $xeTable;
9198
+ const {
9199
+ visibleColumn
9200
+ } = internalData;
9201
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(columnIndex) ? visibleColumn.slice(0) : visibleColumn[columnIndex];
9049
9202
  },
9050
9203
  /**
9051
9204
  * 根据列获取列的唯一主键
9052
9205
  */
9053
9206
  getColid(fieldOrColumn) {
9054
- const column = handleFieldOrColumn(this, fieldOrColumn);
9207
+ const $xeTable = this;
9208
+ const column = handleFieldOrColumn($xeTable, fieldOrColumn);
9055
9209
  return column ? column.id : null;
9056
9210
  },
9057
9211
  /**
@@ -9059,7 +9213,11 @@ const Methods = {
9059
9213
  * @param {String} colid 列主键
9060
9214
  */
9061
9215
  getColumnById(colid) {
9062
- const fullColumnIdData = this.fullColumnIdData;
9216
+ const $xeTable = this;
9217
+ const internalData = $xeTable;
9218
+ const {
9219
+ fullColumnIdData
9220
+ } = internalData;
9063
9221
  return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
9064
9222
  },
9065
9223
  /**
@@ -9067,7 +9225,11 @@ const Methods = {
9067
9225
  * @param {String} field 字段名
9068
9226
  */
9069
9227
  getColumnByField(field) {
9070
- const fullColumnFieldData = this.fullColumnFieldData;
9228
+ const $xeTable = this;
9229
+ const internalData = $xeTable;
9230
+ const {
9231
+ fullColumnFieldData
9232
+ } = internalData;
9071
9233
  return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
9072
9234
  },
9073
9235
  getParentColumn(fieldOrColumn) {
@@ -9080,11 +9242,14 @@ const Methods = {
9080
9242
  * 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
9081
9243
  */
9082
9244
  getTableColumn() {
9245
+ const $xeTable = this;
9246
+ const reactData = $xeTable;
9247
+ const internalData = $xeTable;
9083
9248
  return {
9084
- collectColumn: this.collectColumn.slice(0),
9085
- fullColumn: this.tableFullColumn.slice(0),
9086
- visibleColumn: this.visibleColumn.slice(0),
9087
- tableColumn: this.tableColumn.slice(0)
9249
+ collectColumn: internalData.collectColumn.slice(0),
9250
+ fullColumn: internalData.tableFullColumn.slice(0),
9251
+ visibleColumn: internalData.visibleColumn.slice(0),
9252
+ tableColumn: reactData.tableColumn.slice(0)
9088
9253
  };
9089
9254
  },
9090
9255
  /**
@@ -9615,16 +9780,21 @@ const Methods = {
9615
9780
  * 如果存在排序,继续处理
9616
9781
  */
9617
9782
  getTableData() {
9783
+ const $xeTable = this;
9784
+ const props = $xeTable;
9785
+ const reactData = $xeTable;
9786
+ const internalData = $xeTable;
9787
+ const {
9788
+ tableData,
9789
+ footerTableData
9790
+ } = reactData;
9618
9791
  const {
9619
- treeConfig,
9620
9792
  tableFullData,
9621
9793
  afterFullData,
9622
- tableData,
9623
- footerTableData,
9624
9794
  tableFullTreeData
9625
- } = this;
9795
+ } = internalData;
9626
9796
  return {
9627
- fullData: treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0),
9797
+ fullData: props.treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0),
9628
9798
  visibleData: afterFullData.slice(0),
9629
9799
  tableData: tableData.slice(0),
9630
9800
  footerData: footerTableData.slice(0)
@@ -9673,37 +9843,15 @@ const Methods = {
9673
9843
  */
9674
9844
  handleLoadDefaults() {
9675
9845
  const $xeTable = this;
9676
- if (this.checkboxConfig) {
9677
- this.handleDefaultSelectionChecked();
9678
- }
9679
- if (this.radioConfig) {
9680
- this.handleDefaultRadioChecked();
9681
- }
9682
- if (this.expandConfig) {
9683
- this.handleDefaultRowExpand();
9684
- }
9685
- if (this.treeConfig) {
9686
- handleDefaultTreeExpand($xeTable);
9687
- }
9688
- if (this.mergeCells) {
9689
- this.handleDefaultMergeCells();
9690
- }
9691
- if (this.mergeFooterItems) {
9692
- this.handleDefaultMergeFooterItems();
9693
- }
9694
- this.$nextTick(() => setTimeout(this.recalculate));
9846
+ handleLoadDefaults($xeTable);
9695
9847
  },
9696
9848
  /**
9697
9849
  * 处理初始化的默认行为
9698
9850
  * 只会执行一次
9699
9851
  */
9700
9852
  handleInitDefaults() {
9701
- const {
9702
- sortConfig
9703
- } = this;
9704
- if (sortConfig) {
9705
- this.handleDefaultSort();
9706
- }
9853
+ const $xeTable = this;
9854
+ handleInitDefaults($xeTable);
9707
9855
  },
9708
9856
  /**
9709
9857
  * 设置为固定列
@@ -9865,76 +10013,34 @@ const Methods = {
9865
10013
  return this.resetCustom(options);
9866
10014
  },
9867
10015
  handleCustom() {
10016
+ const $xeTable = this;
10017
+ const props = $xeTable;
9868
10018
  const {
9869
- mouseConfig
9870
- } = this;
9871
- if (mouseConfig) {
9872
- if (this.clearSelected) {
9873
- this.clearSelected();
9874
- }
9875
- if (this.clearCellAreas) {
9876
- this.clearCellAreas();
9877
- this.clearCopyCellArea();
9878
- }
9879
- }
9880
- this.analyColumnWidth();
9881
- return this.refreshColumn(true);
9882
- },
9883
- handleCustomRestore(storeData) {
9884
- const $xeTable = this;
9885
- const reactData = $xeTable;
9886
- const internalData = $xeTable;
9887
- let {
9888
- collectColumn
9889
- } = internalData;
9890
- const {
9891
- resizableData,
9892
- sortData,
9893
- visibleData,
9894
- fixedData
9895
- } = storeData;
9896
- let hasCustomSort = false;
9897
- // 处理还原
9898
- if (resizableData || sortData || visibleData || fixedData) {
9899
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentRow) => {
9900
- const colKey = column.getKey();
9901
- // 支持一级
9902
- if (!parentRow) {
9903
- if (fixedData && fixedData[colKey] !== undefined) {
9904
- column.fixed = fixedData[colKey];
9905
- }
9906
- if (sortData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])) {
9907
- hasCustomSort = true;
9908
- column.renderSortNumber = sortData[colKey];
9909
- }
9910
- }
9911
- if (resizableData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])) {
9912
- column.resizeWidth = resizableData[colKey];
9913
- }
9914
- if (visibleData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])) {
9915
- column.visible = visibleData[colKey];
9916
- }
9917
- });
9918
- // 如果自定义了顺序
9919
- if (hasCustomSort) {
9920
- collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(collectColumn, 'renderSortNumber');
9921
- internalData.collectColumn = collectColumn;
9922
- internalData.tableFullColumn = getColumnList(collectColumn);
10019
+ mouseConfig
10020
+ } = props;
10021
+ if (mouseConfig) {
10022
+ if ($xeTable.clearSelected) {
10023
+ $xeTable.clearSelected();
10024
+ }
10025
+ if ($xeTable.clearCellAreas) {
10026
+ $xeTable.clearCellAreas();
10027
+ $xeTable.clearCopyCellArea();
9923
10028
  }
9924
- reactData.isCustomStatus = true;
9925
- } else {
9926
- reactData.isCustomStatus = false;
9927
10029
  }
10030
+ $xeTable.analyColumnWidth();
10031
+ return $xeTable.refreshColumn(true);
9928
10032
  },
9929
10033
  /**
9930
10034
  * 还原自定义列操作状态
9931
10035
  */
9932
10036
  restoreCustomStorage() {
10037
+ const $xeTable = this;
10038
+ const props = $xeTable;
9933
10039
  const {
9934
- tableId,
9935
- customConfig,
9936
- customOpts
9937
- } = this;
10040
+ customConfig
10041
+ } = props;
10042
+ const tableId = $xeTable.computeTableId;
10043
+ const customOpts = $xeTable.computeCustomOpts;
9938
10044
  const {
9939
10045
  storage,
9940
10046
  restoreStore
@@ -9960,10 +10066,10 @@ const Methods = {
9960
10066
  if (!storeData) {
9961
10067
  return;
9962
10068
  }
9963
- return this.handleCustomRestore(storeData);
10069
+ return handleCustomRestore($xeTable, storeData);
9964
10070
  }).catch(e => e);
9965
10071
  } else {
9966
- return this.handleCustomRestore(storeData);
10072
+ return handleCustomRestore($xeTable, storeData);
9967
10073
  }
9968
10074
  }
9969
10075
  },
@@ -11621,31 +11727,6 @@ const Methods = {
11621
11727
  }
11622
11728
  return [];
11623
11729
  },
11624
- /**
11625
- * 处理默认勾选
11626
- */
11627
- handleDefaultSelectionChecked() {
11628
- const $xeTable = this;
11629
- const {
11630
- fullDataRowIdData,
11631
- checkboxOpts
11632
- } = this;
11633
- const {
11634
- checkAll,
11635
- checkRowKeys
11636
- } = checkboxOpts;
11637
- if (checkAll) {
11638
- handleCheckedAllCheckboxRow($xeTable, true, true);
11639
- } else if (checkRowKeys) {
11640
- const defSelection = [];
11641
- checkRowKeys.forEach(rowid => {
11642
- if (fullDataRowIdData[rowid]) {
11643
- defSelection.push(fullDataRowIdData[rowid].row);
11644
- }
11645
- });
11646
- handleCheckedCheckboxRow($xeTable, defSelection, true, true);
11647
- }
11648
- },
11649
11730
  handleCheckedCheckboxRow(rows, value, isForce) {
11650
11731
  const $xeTable = this;
11651
11732
  return handleCheckedCheckboxRow($xeTable, rows, value, isForce);
@@ -12344,31 +12425,6 @@ const Methods = {
12344
12425
  reactData.updateCheckboxFlag++;
12345
12426
  return this.$nextTick();
12346
12427
  },
12347
- /**
12348
- * 处理单选框默认勾选
12349
- */
12350
- handleDefaultRadioChecked() {
12351
- const $xeTable = this;
12352
- const {
12353
- radioOpts,
12354
- fullDataRowIdData
12355
- } = this;
12356
- const {
12357
- checkRowKey: rowid,
12358
- reserve
12359
- } = radioOpts;
12360
- if (rowid) {
12361
- if (fullDataRowIdData[rowid]) {
12362
- handleCheckedRadioRow($xeTable, fullDataRowIdData[rowid].row, true);
12363
- }
12364
- if (reserve) {
12365
- const rowkey = getRowkey(this);
12366
- this.radioReserveRow = {
12367
- [rowkey]: rowid
12368
- };
12369
- }
12370
- }
12371
- },
12372
12428
  /**
12373
12429
  * 单选,行选中事件
12374
12430
  */
@@ -12831,39 +12887,6 @@ const Methods = {
12831
12887
  }
12832
12888
  this.emitEvent('cell-dblclick', params, evnt);
12833
12889
  },
12834
- handleDefaultSort() {
12835
- const $xeTable = this;
12836
- const {
12837
- sortConfig,
12838
- sortOpts
12839
- } = this;
12840
- let {
12841
- defaultSort
12842
- } = sortOpts;
12843
- if (defaultSort) {
12844
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(defaultSort)) {
12845
- defaultSort = [defaultSort];
12846
- }
12847
- if (defaultSort.length) {
12848
- (sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach((item, index) => {
12849
- const {
12850
- field,
12851
- order
12852
- } = item;
12853
- if (field && order) {
12854
- const column = this.getColumnByField(field);
12855
- if (column && column.sortable) {
12856
- column.order = order;
12857
- column.sortTime = Date.now() + index;
12858
- }
12859
- }
12860
- });
12861
- if (!sortOpts.remote) {
12862
- this.handleTableData(true).then(() => updateStyle($xeTable));
12863
- }
12864
- }
12865
- }
12866
- },
12867
12890
  handleColumnSortEvent(evnt, column) {
12868
12891
  const $xeTable = this;
12869
12892
  const props = $xeTable;
@@ -14179,30 +14202,6 @@ const Methods = {
14179
14202
  toggleRowExpand(row) {
14180
14203
  return this.setRowExpand(row, !this.isRowExpandByRow(row));
14181
14204
  },
14182
- /**
14183
- * 处理默认展开行
14184
- */
14185
- handleDefaultRowExpand() {
14186
- const {
14187
- expandOpts,
14188
- fullDataRowIdData
14189
- } = this;
14190
- const {
14191
- expandAll,
14192
- expandRowKeys
14193
- } = expandOpts;
14194
- if (expandAll) {
14195
- this.setAllRowExpand(true);
14196
- } else if (expandRowKeys) {
14197
- const defExpandeds = [];
14198
- expandRowKeys.forEach(rowid => {
14199
- if (fullDataRowIdData[rowid]) {
14200
- defExpandeds.push(fullDataRowIdData[rowid].row);
14201
- }
14202
- });
14203
- this.setRowExpand(defExpandeds, true);
14204
- }
14205
- },
14206
14205
  /**
14207
14206
  * 设置所有行的展开与否
14208
14207
  * @param {Boolean} expanded 是否展开
@@ -14891,8 +14890,8 @@ const Methods = {
14891
14890
  */
14892
14891
  triggerScrollXEvent() {
14893
14892
  const $xeTable = this;
14894
- const sXOpts = $xeTable.computeSXOpts;
14895
- if (sXOpts.immediate) {
14893
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
14894
+ if (virtualXOpts.immediate) {
14896
14895
  loadScrollXData($xeTable);
14897
14896
  } else {
14898
14897
  lazyScrollXData($xeTable);
@@ -14903,8 +14902,8 @@ const Methods = {
14903
14902
  */
14904
14903
  triggerScrollYEvent() {
14905
14904
  const $xeTable = this;
14906
- const sYOpts = $xeTable.computeSYOpts;
14907
- if (sYOpts.immediate) {
14905
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
14906
+ if (virtualYOpts.immediate) {
14908
14907
  loadScrollYData($xeTable);
14909
14908
  } else {
14910
14909
  lazyScrollYData($xeTable);
@@ -15155,8 +15154,8 @@ const Methods = {
15155
15154
  return;
15156
15155
  }
15157
15156
  const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
15158
- const deltaTop = Math.ceil((shiftKey ? deltaX : deltaY) * wheelSpeed);
15159
- const deltaLeft = Math.ceil((shiftKey ? deltaY : deltaX) * wheelSpeed);
15157
+ const deltaTop = shiftKey ? 0 : Math.ceil(deltaY * wheelSpeed);
15158
+ const deltaLeft = Math.ceil((shiftKey ? deltaY || deltaX : deltaX) * wheelSpeed);
15160
15159
  const isTopWheel = deltaTop < 0;
15161
15160
  const currScrollTop = bodyScrollElem.scrollTop;
15162
15161
  // 如果滚动位置已经是顶部或底部,则不需要触发
@@ -15729,9 +15728,6 @@ const Methods = {
15729
15728
  }
15730
15729
  });
15731
15730
  },
15732
- handleDefaultMergeCells() {
15733
- this.setMergeCells(this.mergeCells);
15734
- },
15735
15731
  /**
15736
15732
  * 设置合并单元格
15737
15733
  * @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
@@ -15779,9 +15775,6 @@ const Methods = {
15779
15775
  return updateStyle($xeTable);
15780
15776
  });
15781
15777
  },
15782
- handleDefaultMergeFooterItems() {
15783
- this.setMergeFooterItems(this.mergeFooterItems);
15784
- },
15785
15778
  setMergeFooterItems(merges) {
15786
15779
  const $xeTable = this;
15787
15780
  if (this.footerSpanMethod) {
@@ -16446,9 +16439,12 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
16446
16439
  } = createHandleGetRowId($xeTable);
16447
16440
  tableData.forEach((row, $rowIndex) => {
16448
16441
  const trOn = {};
16442
+ const rowid = handleGetRowId(row);
16443
+ const rowRest = fullAllDataRowIdData[rowid] || {};
16449
16444
  let rowIndex = $rowIndex;
16450
- // 确保任何情况下 rowIndex 都精准指向真实 data 索引
16451
- rowIndex = $xeTable.getRowIndex(row);
16445
+ let rowLevel = 0;
16446
+ let seq = -1;
16447
+ let _rowIndex = -1;
16452
16448
  // 当前行事件
16453
16449
  if (rowOpts.isHover || highlightHoverRow) {
16454
16450
  trOn.mouseenter = evnt => {
@@ -16467,11 +16463,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
16467
16463
  $xeTable.clearHoverRow();
16468
16464
  };
16469
16465
  }
16470
- const rowid = handleGetRowId(row);
16471
- const rowRest = fullAllDataRowIdData[rowid] || {};
16472
- let rowLevel = 0;
16473
- let seq = -1;
16474
- let _rowIndex = 0;
16475
16466
  if (rowRest) {
16476
16467
  rowLevel = rowRest.level;
16477
16468
  if (treeConfig && transform && seqMode === 'increasing') {
@@ -16479,6 +16470,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
16479
16470
  } else {
16480
16471
  seq = rowRest.seq;
16481
16472
  }
16473
+ rowIndex = rowRest.index;
16482
16474
  _rowIndex = rowRest._index;
16483
16475
  }
16484
16476
  const params = {
@@ -21179,14 +21171,15 @@ function syncActivedCell($xeTable) {
21179
21171
  }
21180
21172
  }
21181
21173
  }
21182
- function insertTreeRow(_vm, newRecords, isAppend) {
21174
+ function insertTreeRow($xeTable, newRecords, isAppend) {
21175
+ const internalData = $xeTable;
21183
21176
  const {
21184
21177
  tableFullTreeData,
21185
21178
  afterFullData,
21186
21179
  fullDataRowIdData,
21187
- fullAllDataRowIdData,
21188
- treeOpts
21189
- } = _vm;
21180
+ fullAllDataRowIdData
21181
+ } = internalData;
21182
+ const treeOpts = $xeTable.computeTreeOpts;
21190
21183
  const {
21191
21184
  rowField,
21192
21185
  parentField,
@@ -21196,7 +21189,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21196
21189
  const funcName = isAppend ? 'push' : 'unshift';
21197
21190
  newRecords.forEach(item => {
21198
21191
  const parentRowId = item[parentField];
21199
- const rowid = getRowid(_vm, item);
21192
+ const rowid = getRowid($xeTable, item);
21200
21193
  const matchObj = parentRowId ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, item => parentRowId === item[rowField], {
21201
21194
  children: mapChildrenField
21202
21195
  }) : null;
@@ -21204,7 +21197,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
21204
21197
  const {
21205
21198
  item: parentRow
21206
21199
  } = matchObj;
21207
- const parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
21200
+ const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
21208
21201
  const parentLevel = parentRest ? parentRest.level : 0;
21209
21202
  let parentChilds = parentRow[childrenField];
21210
21203
  let mapChilds = parentRow[mapChildrenField];
@@ -21271,15 +21264,15 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
21271
21264
  treeConfig
21272
21265
  } = props;
21273
21266
  const {
21274
- mergeList,
21275
- editStore
21267
+ mergeList
21276
21268
  } = reactData;
21277
21269
  const {
21278
21270
  tableFullTreeData,
21279
21271
  afterFullData,
21280
21272
  tableFullData,
21281
21273
  fullDataRowIdData,
21282
- fullAllDataRowIdData
21274
+ fullAllDataRowIdData,
21275
+ insertRowMaps
21283
21276
  } = internalData;
21284
21277
  const treeOpts = $xeTable.computeTreeOpts;
21285
21278
  const {
@@ -21484,13 +21477,11 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
21484
21477
  }
21485
21478
  }
21486
21479
  }
21487
- const {
21488
- insertMaps
21489
- } = editStore;
21490
21480
  newRecords.forEach(newRow => {
21491
21481
  const rowid = getRowid($xeTable, newRow);
21492
- insertMaps[rowid] = newRow;
21482
+ insertRowMaps[rowid] = newRow;
21493
21483
  });
21484
+ reactData.insertRowFlag++;
21494
21485
  $xeTable.cacheRowMap(false);
21495
21486
  $xeTable.updateScrollYStatus();
21496
21487
  $xeTable.handleTableData(treeConfig && transform);
@@ -21499,7 +21490,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
21499
21490
  }
21500
21491
  $xeTable.updateFooter();
21501
21492
  $xeTable.checkSelectionStatus();
21502
- if ($xeTable.scrollYLoad) {
21493
+ if (reactData.scrollYLoad) {
21503
21494
  $xeTable.updateScrollYSpace();
21504
21495
  }
21505
21496
  return $xeTable.$nextTick().then(() => {
@@ -21797,7 +21788,9 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
21797
21788
  selectCheckboxMaps,
21798
21789
  afterFullData,
21799
21790
  tableFullData,
21800
- pendingRowMaps
21791
+ pendingRowMaps,
21792
+ insertRowMaps,
21793
+ removeRowMaps
21801
21794
  } = internalData;
21802
21795
  const checkboxOpts = $xeTable.computeCheckboxOpts;
21803
21796
  const treeOpts = $xeTable.computeTreeOpts;
@@ -21807,10 +21800,8 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
21807
21800
  } = treeOpts;
21808
21801
  const childrenField = treeOpts.children || treeOpts.childrenField;
21809
21802
  const {
21810
- actived,
21811
- removeMaps
21803
+ actived
21812
21804
  } = editStore;
21813
- const insertDataRowMaps = Object.assign({}, editStore.insertMaps);
21814
21805
  const {
21815
21806
  checkField
21816
21807
  } = checkboxOpts;
@@ -21824,7 +21815,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
21824
21815
  rows.forEach(row => {
21825
21816
  if (!$xeTable.isInsertByRow(row)) {
21826
21817
  const rowid = getRowid($xeTable, row);
21827
- removeMaps[rowid] = row;
21818
+ removeRowMaps[rowid] = row;
21828
21819
  }
21829
21820
  });
21830
21821
  // 如果绑定了多选属性,则更新状态
@@ -21899,14 +21890,15 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
21899
21890
  // 从新增中移除已删除的数据
21900
21891
  rows.forEach(row => {
21901
21892
  const rowid = getRowid($xeTable, row);
21902
- if (insertDataRowMaps[rowid]) {
21903
- delete insertDataRowMaps[rowid];
21893
+ if (insertRowMaps[rowid]) {
21894
+ delete insertRowMaps[rowid];
21904
21895
  }
21905
21896
  if (pendingRowMaps[rowid]) {
21906
21897
  delete pendingRowMaps[rowid];
21907
21898
  }
21908
21899
  });
21909
- editStore.insertMaps = insertDataRowMaps;
21900
+ reactData.removeRowFlag++;
21901
+ reactData.insertRowFlag++;
21910
21902
  reactData.pendingRowFlag++;
21911
21903
  $xeTable.updateFooter();
21912
21904
  $xeTable.cacheRowMap(false);
@@ -21980,19 +21972,13 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
21980
21972
  */
21981
21973
  _getInsertRecords() {
21982
21974
  const $xeTable = this;
21983
- const reactData = $xeTable;
21984
21975
  const internalData = $xeTable;
21985
21976
  const {
21986
- editStore
21987
- } = reactData;
21988
- const {
21989
- fullAllDataRowIdData
21977
+ fullAllDataRowIdData,
21978
+ insertRowMaps
21990
21979
  } = internalData;
21991
- const {
21992
- insertMaps
21993
- } = editStore;
21994
21980
  const insertRecords = [];
21995
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(insertMaps, (row, rowid) => {
21981
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(insertRowMaps, (row, rowid) => {
21996
21982
  if (fullAllDataRowIdData[rowid]) {
21997
21983
  insertRecords.push(row);
21998
21984
  }
@@ -22004,15 +21990,12 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22004
21990
  */
22005
21991
  _getRemoveRecords() {
22006
21992
  const $xeTable = this;
22007
- const reactData = $xeTable;
22008
- const {
22009
- editStore
22010
- } = reactData;
21993
+ const internalData = $xeTable;
22011
21994
  const {
22012
- removeMaps
22013
- } = editStore;
21995
+ removeRowMaps
21996
+ } = internalData;
22014
21997
  const removeRecords = [];
22015
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(removeMaps, row => {
21998
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(removeRowMaps, row => {
22016
21999
  removeRecords.push(row);
22017
22000
  });
22018
22001
  return removeRecords;
@@ -22024,29 +22007,22 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22024
22007
  */
22025
22008
  _getUpdateRecords() {
22026
22009
  const $xeTable = this;
22010
+ const props = $xeTable;
22011
+ const internalData = $xeTable;
22027
22012
  const {
22028
22013
  keepSource,
22029
- tableFullData,
22030
- isUpdateByRow,
22031
- treeConfig,
22032
- treeOpts,
22033
- editStore
22034
- } = this;
22014
+ treeConfig
22015
+ } = props;
22016
+ const {
22017
+ tableFullData
22018
+ } = internalData;
22019
+ const treeOpts = $xeTable.computeTreeOpts;
22035
22020
  if (keepSource) {
22036
- const {
22037
- actived
22038
- } = editStore;
22039
- const {
22040
- row,
22041
- column
22042
- } = actived;
22043
- if (row || column) {
22044
- syncActivedCell($xeTable);
22045
- }
22021
+ syncActivedCell($xeTable);
22046
22022
  if (treeConfig) {
22047
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(tableFullData, row => isUpdateByRow(row), treeOpts);
22023
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(tableFullData, row => $xeTable.isUpdateByRow(row), treeOpts);
22048
22024
  }
22049
- return tableFullData.filter(row => isUpdateByRow(row));
22025
+ return tableFullData.filter(row => $xeTable.isUpdateByRow(row));
22050
22026
  }
22051
22027
  return [];
22052
22028
  },
@@ -22095,51 +22071,58 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22095
22071
  return handleClearEdit($xeTable, evnt, targetRow);
22096
22072
  },
22097
22073
  _getActiveRecord() {
22074
+ const $xeTable = this;
22098
22075
  if (true) {
22099
22076
  warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
22100
22077
  }
22101
22078
  // 即将废弃
22102
- return this.getEditRecord();
22079
+ return $xeTable.getEditRecord();
22103
22080
  },
22104
22081
  _getEditRecord() {
22082
+ const $xeTable = this;
22083
+ const reactData = $xeTable;
22084
+ const internalData = $xeTable;
22105
22085
  const {
22106
- $el,
22107
- editStore,
22108
- afterFullData
22109
- } = this;
22086
+ editStore
22087
+ } = reactData;
22110
22088
  const {
22111
- actived
22112
- } = editStore;
22089
+ afterFullData
22090
+ } = internalData;
22091
+ const el = $xeTable.$refs.refElem;
22113
22092
  const {
22114
22093
  args,
22115
22094
  row
22116
- } = actived;
22117
- if (args && this.findRowIndexOf(afterFullData, row) > -1 && $el.querySelectorAll('.vxe-body--column.col--active').length) {
22095
+ } = editStore.actived;
22096
+ if (args && $xeTable.findRowIndexOf(afterFullData, row) > -1 && el.querySelectorAll('.vxe-body--column.col--active').length) {
22118
22097
  return Object.assign({}, args);
22119
22098
  }
22120
22099
  return null;
22121
22100
  },
22122
22101
  _isActiveByRow(row) {
22102
+ const $xeTable = this;
22123
22103
  if (true) {
22124
22104
  warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
22125
22105
  }
22126
22106
  // 即将废弃
22127
- return this.isEditByRow(row);
22107
+ return $xeTable.isEditByRow(row);
22128
22108
  },
22129
22109
  /**
22130
22110
  * 判断行是否为激活编辑状态
22131
22111
  * @param {Row} row 行对象
22132
22112
  */
22133
22113
  _isEditByRow(row) {
22134
- return this.editStore.actived.row === row;
22114
+ const $xeTable = this;
22115
+ const reactData = $xeTable;
22116
+ const {
22117
+ editStore
22118
+ } = reactData;
22119
+ return editStore.actived.row === row;
22135
22120
  },
22136
22121
  /**
22137
22122
  * 处理聚焦
22138
22123
  */
22139
22124
  handleFocus(params) {
22140
- const {
22141
- editOpts
22142
- } = this;
22125
+ const $xeTable = this;
22143
22126
  const {
22144
22127
  row,
22145
22128
  column,
@@ -22148,6 +22131,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22148
22131
  const {
22149
22132
  editRender
22150
22133
  } = column;
22134
+ const editOpts = $xeTable.computeEditOpts;
22151
22135
  if (isEnableConf(editRender)) {
22152
22136
  const compRender = edit_mixin_renderer.get(editRender.name);
22153
22137
  let autoFocus = editRender.autofocus || editRender.autoFocus;
@@ -22163,7 +22147,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22163
22147
  }
22164
22148
  // 如果指定了聚焦 class
22165
22149
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(autoFocus)) {
22166
- inputElem = autoFocus.call(this, params);
22150
+ inputElem = autoFocus.call($xeTable, params);
22167
22151
  } else if (autoFocus) {
22168
22152
  if (autoFocus === true) {
22169
22153
  // 自动匹配模式,会自动匹配第一个可输入元素
@@ -22192,18 +22176,19 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22192
22176
  if (editOpts.autoPos) {
22193
22177
  if (!column.fixed) {
22194
22178
  // 显示到可视区中
22195
- this.scrollToRow(row, column);
22179
+ $xeTable.scrollToRow(row, column);
22196
22180
  }
22197
22181
  }
22198
22182
  }
22199
22183
  }
22200
22184
  },
22201
22185
  _setActiveRow(row) {
22186
+ const $xeTable = this;
22202
22187
  if (true) {
22203
22188
  warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
22204
22189
  }
22205
22190
  // 即将废弃
22206
- return this.setEditRow(row);
22191
+ return $xeTable.setEditRow(row);
22207
22192
  },
22208
22193
  /**
22209
22194
  * 激活行编辑
@@ -22215,7 +22200,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22215
22200
  if (fieldOrColumn) {
22216
22201
  isPos = true;
22217
22202
  if (fieldOrColumn !== true) {
22218
- column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
22203
+ column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
22219
22204
  }
22220
22205
  }
22221
22206
  return handleEditCell($xeTable, row, column, isPos);
@@ -22238,39 +22223,44 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22238
22223
  * 只对 trigger=dblclick 有效,选中单元格
22239
22224
  */
22240
22225
  _setSelectCell(row, fieldOrColumn) {
22226
+ const $xeTable = this;
22227
+ const reactData = $xeTable;
22241
22228
  const {
22242
- tableData,
22243
- editOpts,
22244
- visibleColumn
22245
- } = this;
22246
- const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
22229
+ tableData
22230
+ } = reactData;
22231
+ const editOpts = $xeTable.computeEditOpts;
22232
+ const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
22247
22233
  if (row && column && editOpts.trigger !== 'manual') {
22248
- const rowIndex = this.findRowIndexOf(tableData, row);
22234
+ const rowIndex = $xeTable.findRowIndexOf(tableData, row);
22249
22235
  if (rowIndex > -1) {
22250
- const cell = this.getCellElement(row, column);
22236
+ const cell = $xeTable.getCellElement(row, column);
22251
22237
  const params = {
22252
22238
  row,
22253
22239
  rowIndex,
22254
22240
  column,
22255
- columnIndex: visibleColumn.indexOf(column),
22241
+ columnIndex: $xeTable.getColumnIndex(column),
22256
22242
  cell
22257
22243
  };
22258
- this.handleSelected(params, {});
22244
+ $xeTable.handleSelected(params, {});
22259
22245
  }
22260
22246
  }
22261
- return this.$nextTick();
22247
+ return $xeTable.$nextTick();
22262
22248
  },
22263
22249
  /**
22264
22250
  * 处理选中源
22265
22251
  */
22266
22252
  handleSelected(params, evnt) {
22267
22253
  const $xeTable = this;
22254
+ const props = $xeTable;
22255
+ const reactData = $xeTable;
22256
+ const {
22257
+ mouseConfig
22258
+ } = props;
22268
22259
  const {
22269
- mouseConfig,
22270
- mouseOpts,
22271
- editOpts,
22272
22260
  editStore
22273
- } = this;
22261
+ } = reactData;
22262
+ const mouseOpts = $xeTable.computeMouseOpts;
22263
+ const editOpts = $xeTable.computeEditOpts;
22274
22264
  const {
22275
22265
  actived,
22276
22266
  selected
@@ -22284,22 +22274,24 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22284
22274
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
22285
22275
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
22286
22276
  handleClearEdit($xeTable, evnt);
22287
- this.clearSelected(evnt);
22288
- this.clearCellAreas(evnt);
22289
- this.clearCopyCellArea(evnt);
22277
+ $xeTable.clearSelected();
22278
+ if ($xeTable.clearCellAreas) {
22279
+ $xeTable.clearCellAreas();
22280
+ $xeTable.clearCopyCellArea();
22281
+ }
22290
22282
  selected.args = params;
22291
22283
  selected.row = row;
22292
22284
  selected.column = column;
22293
22285
  if (isMouseSelected) {
22294
22286
  this.addCellSelectedClass();
22295
22287
  }
22296
- this.focus();
22288
+ $xeTable.focus();
22297
22289
  if (evnt) {
22298
- this.emitEvent('cell-selected', params, evnt);
22290
+ $xeTable.dispatchEvent('cell-selected', params, evnt);
22299
22291
  }
22300
22292
  }
22301
22293
  }
22302
- return this.$nextTick();
22294
+ return $xeTable.$nextTick();
22303
22295
  };
22304
22296
  return selectMethod();
22305
22297
  },
@@ -22307,10 +22299,15 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22307
22299
  * 获取选中的单元格
22308
22300
  */
22309
22301
  _getSelectedCell() {
22302
+ const $xeTable = this;
22303
+ const reactData = $xeTable;
22304
+ const {
22305
+ editStore
22306
+ } = reactData;
22310
22307
  const {
22311
22308
  args,
22312
22309
  column
22313
- } = this.editStore.selected;
22310
+ } = editStore.selected;
22314
22311
  if (args && column) {
22315
22312
  return Object.assign({}, args);
22316
22313
  }
@@ -22321,14 +22318,17 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
22321
22318
  */
22322
22319
  _clearSelected() {
22323
22320
  const $xeTable = this;
22321
+ const reactData = $xeTable;
22322
+ const {
22323
+ editStore
22324
+ } = reactData;
22324
22325
  const {
22325
22326
  selected
22326
- } = this.editStore;
22327
+ } = editStore;
22327
22328
  selected.row = null;
22328
22329
  selected.column = null;
22329
- this.reColTitleSdCls();
22330
22330
  removeCellSelectedClass($xeTable);
22331
- return this.$nextTick();
22331
+ return $xeTable.$nextTick();
22332
22332
  },
22333
22333
  reColTitleSdCls() {
22334
22334
  const headerElem = this.elemStore['main-header-list'];
@@ -25048,23 +25048,17 @@ function validErrorRuleValue(rule, val) {
25048
25048
  beginValidate(rows, cols, cb, isFull) {
25049
25049
  const $xeTable = this;
25050
25050
  const props = $xeTable;
25051
- const reactData = $xeTable;
25052
25051
  const internalData = $xeTable;
25053
25052
  const validRest = {};
25054
25053
  const {
25055
25054
  editRules,
25056
25055
  treeConfig
25057
25056
  } = props;
25058
- const {
25059
- editStore
25060
- } = reactData;
25061
25057
  const {
25062
25058
  afterFullData,
25063
- pendingRowMaps
25059
+ pendingRowMaps,
25060
+ removeRowMaps
25064
25061
  } = internalData;
25065
- const {
25066
- removeMaps
25067
- } = editStore;
25068
25062
  const treeOpts = $xeTable.computeTreeOpts;
25069
25063
  const childrenField = treeOpts.children || treeOpts.childrenField;
25070
25064
  let validList;
@@ -25090,7 +25084,7 @@ function validErrorRuleValue(rule, val) {
25090
25084
  const handleVaild = row => {
25091
25085
  const rowid = getRowid($xeTable, row);
25092
25086
  // 是否删除
25093
- if (removeMaps[rowid]) {
25087
+ if (removeRowMaps[rowid]) {
25094
25088
  return;
25095
25089
  }
25096
25090
  // 是否标记删除
@@ -26347,9 +26341,7 @@ function renderBody(h, $xeTable) {
26347
26341
  focused: {
26348
26342
  row: null,
26349
26343
  column: null
26350
- },
26351
- insertMaps: {},
26352
- removeMaps: {}
26344
+ }
26353
26345
  },
26354
26346
  // 存放 tooltip 相关信息
26355
26347
  tooltipStore: {
@@ -26469,24 +26461,24 @@ function renderBody(h, $xeTable) {
26469
26461
  }, table_getConfig().table.validConfig, this.validConfig);
26470
26462
  },
26471
26463
  sXOpts() {
26472
- return this.computeSXOpts;
26464
+ return this.computeVirtualXOpts;
26473
26465
  },
26474
26466
  computeSXOpts() {
26475
26467
  return this.computeVirtualXOpts;
26476
26468
  },
26477
26469
  computeScrollXThreshold() {
26478
26470
  const $xeTable = this;
26479
- const sXOpts = $xeTable.computeSXOpts;
26471
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
26480
26472
  const {
26481
26473
  threshold
26482
- } = sXOpts;
26474
+ } = virtualXOpts;
26483
26475
  if (threshold) {
26484
26476
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);
26485
26477
  }
26486
26478
  return 0;
26487
26479
  },
26488
26480
  sYOpts() {
26489
- return this.computeSYOpts;
26481
+ return this.computeVirtualYOpts;
26490
26482
  },
26491
26483
  computeSYOpts() {
26492
26484
  return this.computeVirtualYOpts;
@@ -26518,10 +26510,10 @@ function renderBody(h, $xeTable) {
26518
26510
  },
26519
26511
  computeScrollYThreshold() {
26520
26512
  const $xeTable = this;
26521
- const sYOpts = $xeTable.computeSYOpts;
26513
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
26522
26514
  const {
26523
26515
  threshold
26524
- } = sYOpts;
26516
+ } = virtualYOpts;
26525
26517
  if (threshold) {
26526
26518
  return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);
26527
26519
  }
@@ -27173,11 +27165,11 @@ function renderBody(h, $xeTable) {
27173
27165
  tableFullColumn: [],
27174
27166
  // 渲染所有列
27175
27167
  visibleColumn: [],
27176
- // 缓存数据集
27168
+ // 总的缓存数据集
27177
27169
  fullAllDataRowIdData: {},
27178
- fullDataRowMap: new Map(),
27170
+ // 渲染中缓存数据
27171
+ sourceDataRowIdData: {},
27179
27172
  fullDataRowIdData: {},
27180
- fullColumnMap: new Map(),
27181
27173
  fullColumnIdData: {},
27182
27174
  fullColumnFieldData: {},
27183
27175
  // 已展开的行集合
@@ -27192,6 +27184,10 @@ function renderBody(h, $xeTable) {
27192
27184
  selectCheckboxMaps: {},
27193
27185
  // 已标记的对象集
27194
27186
  pendingRowMaps: {},
27187
+ // 已新增的临时行
27188
+ insertRowMaps: {},
27189
+ // 已删除行
27190
+ removeRowMaps: {},
27195
27191
  swYSize: 0,
27196
27192
  swYInterval: 0,
27197
27193
  swYTotal: 0
@@ -27207,7 +27203,6 @@ function renderBody(h, $xeTable) {
27207
27203
  scrollXStore,
27208
27204
  scrollYStore
27209
27205
  } = internalData;
27210
- const sYOpts = $xeTable.computeSYOpts;
27211
27206
  const editOpts = $xeTable.computeEditOpts;
27212
27207
  const treeOpts = $xeTable.computeTreeOpts;
27213
27208
  const radioOpts = $xeTable.computeRadioOpts;
@@ -27367,8 +27362,7 @@ function renderBody(h, $xeTable) {
27367
27362
  Object.assign(scrollYStore, {
27368
27363
  startIndex: 0,
27369
27364
  endIndex: 1,
27370
- visibleSize: 0,
27371
- adaptive: sYOpts.adaptive !== false
27365
+ visibleSize: 0
27372
27366
  });
27373
27367
  Object.assign(scrollXStore, {
27374
27368
  startIndex: 0,