vxe-table 3.12.2 → 3.12.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.
@@ -212,6 +212,54 @@ function cacheColumnMap($xeTable) {
212
212
  reactData.expandColumn = expandColumn;
213
213
  reactData.isAllOverflow = isAllOverflow;
214
214
  }
215
+ const updateScrollYStatus = ($xeTable, fullData) => {
216
+ const props = $xeTable;
217
+ const reactData = $xeTable;
218
+ const internalData = $xeTable;
219
+ const { treeConfig } = props;
220
+ const sYOpts = $xeTable.computeSYOpts;
221
+ const treeOpts = $xeTable.computeTreeOpts;
222
+ const { transform } = treeOpts;
223
+ const allList = fullData || internalData.tableFullData;
224
+ // 如果gt为0,则总是启用
225
+ const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt < allList.length);
226
+ reactData.scrollYLoad = scrollYLoad;
227
+ return scrollYLoad;
228
+ };
229
+ /**
230
+ * 如果为虚拟树,将树结构拍平
231
+ * @returns
232
+ */
233
+ function handleVirtualTreeToList($xeTable) {
234
+ const props = $xeTable;
235
+ const reactData = $xeTable;
236
+ const internalData = $xeTable;
237
+ const { treeConfig } = props;
238
+ const { treeExpandedMaps } = reactData;
239
+ const { fullAllDataRowIdData } = internalData;
240
+ const treeOpts = $xeTable.computeTreeOpts;
241
+ const childrenField = treeOpts.children || treeOpts.childrenField;
242
+ if (treeConfig && treeOpts.transform) {
243
+ const fullData = [];
244
+ const expandMaps = {};
245
+ XEUtils.eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
246
+ const rowid = getRowid($xeTable, row);
247
+ const parentRowid = getRowid($xeTable, parentRow);
248
+ if (!parentRow || (expandMaps[parentRowid] && treeExpandedMaps[parentRowid])) {
249
+ const rowRest = fullAllDataRowIdData[rowid];
250
+ if (rowRest) {
251
+ rowRest._index = fullData.length;
252
+ }
253
+ expandMaps[rowid] = 1;
254
+ fullData.push(row);
255
+ }
256
+ }, { children: childrenField });
257
+ internalData.afterFullData = fullData;
258
+ updateScrollYStatus($xeTable, fullData);
259
+ return fullData;
260
+ }
261
+ return internalData.afterFullData;
262
+ }
215
263
  function computeRowHeight($xeTable) {
216
264
  const tableHeader = $xeTable.$refs.tableHeader;
217
265
  const tableBody = $xeTable.$refs.tableBody;
@@ -1102,6 +1150,7 @@ const Methods = {
1102
1150
  });
1103
1151
  },
1104
1152
  handleTableData(force) {
1153
+ const $xeTable = this;
1105
1154
  const { scrollYLoad, scrollYStore, fullDataRowIdData, afterFullData } = this;
1106
1155
  let fullList = afterFullData;
1107
1156
  // 是否进行数据处理
@@ -1109,7 +1158,7 @@ const Methods = {
1109
1158
  // 更新数据,处理筛选和排序
1110
1159
  this.updateAfterFullData();
1111
1160
  // 如果为虚拟树,将树结构拍平
1112
- fullList = this.handleVirtualTreeToList();
1161
+ fullList = handleVirtualTreeToList($xeTable);
1113
1162
  }
1114
1163
  const tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
1115
1164
  tableData.forEach((row, $index) => {
@@ -1122,15 +1171,6 @@ const Methods = {
1122
1171
  this.tableData = tableData;
1123
1172
  return this.$nextTick();
1124
1173
  },
1125
- updateScrollYStatus(fullData) {
1126
- const { treeConfig, treeOpts, sYOpts } = this;
1127
- const { transform } = treeOpts;
1128
- const allList = fullData || this.tableFullData;
1129
- // 如果gt为0,则总是启用
1130
- const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= allList.length);
1131
- this.scrollYLoad = scrollYLoad;
1132
- return scrollYLoad;
1133
- },
1134
1174
  /**
1135
1175
  * 加载表格数据
1136
1176
  * @param {Array} datas 数据
@@ -1186,7 +1226,7 @@ const Methods = {
1186
1226
  editStore.insertMaps = {};
1187
1227
  editStore.removeList = [];
1188
1228
  editStore.removeMaps = {};
1189
- const sYLoad = this.updateScrollYStatus(fullData);
1229
+ const sYLoad = updateScrollYStatus($xeTable, fullData);
1190
1230
  this.isDragRowMove = false;
1191
1231
  // 全量数据
1192
1232
  this.tableFullData = fullData;
@@ -2069,37 +2109,6 @@ const Methods = {
2069
2109
  }
2070
2110
  return rowList;
2071
2111
  },
2072
- /**
2073
- * 如果为虚拟树,将树结构拍平
2074
- * @returns
2075
- */
2076
- handleVirtualTreeToList() {
2077
- const $xeTable = this;
2078
- const internalData = $xeTable;
2079
- const { fullAllDataRowIdData } = internalData;
2080
- const { treeOpts, treeConfig, treeExpandedMaps, afterTreeFullData, afterFullData } = this;
2081
- const childrenField = treeOpts.children || treeOpts.childrenField;
2082
- if (treeConfig && treeOpts.transform) {
2083
- const fullData = [];
2084
- const expandMaps = {};
2085
- XEUtils.eachTree(afterTreeFullData, (row, index, items, path, parentRow) => {
2086
- const rowid = getRowid(this, row);
2087
- const parentRowid = getRowid(this, parentRow);
2088
- if (!parentRow || (expandMaps[parentRowid] && treeExpandedMaps[parentRowid])) {
2089
- const rowRest = fullAllDataRowIdData[rowid];
2090
- if (rowRest) {
2091
- rowRest._index = fullData.length;
2092
- }
2093
- expandMaps[rowid] = 1;
2094
- fullData.push(row);
2095
- }
2096
- }, { children: childrenField });
2097
- this.afterFullData = fullData;
2098
- this.updateScrollYStatus(fullData);
2099
- return fullData;
2100
- }
2101
- return afterFullData;
2102
- },
2103
2112
  /**
2104
2113
  * 获取处理后全量的表格数据
2105
2114
  * 如果存在筛选条件,继续处理
@@ -5547,7 +5556,7 @@ const Methods = {
5547
5556
  reactData.isDragRowMove = true;
5548
5557
  $xeTable.handleTableData(treeConfig && transform);
5549
5558
  $xeTable.cacheRowMap();
5550
- $xeTable.updateScrollYStatus();
5559
+ updateScrollYStatus($xeTable);
5551
5560
  if (!(treeConfig && transform)) {
5552
5561
  $xeTable.updateAfterDataIndex();
5553
5562
  }
@@ -6214,19 +6223,20 @@ const Methods = {
6214
6223
  },
6215
6224
  clearRowExpandLoaded(row) {
6216
6225
  const $xeTable = this;
6217
- const { expandOpts, rowExpandLazyLoadedMaps, fullAllDataRowIdData } = this;
6226
+ const reactData = $xeTable;
6227
+ const internalData = $xeTable;
6228
+ const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
6229
+ const { fullAllDataRowIdData } = internalData;
6230
+ const expandOpts = $xeTable.computeExpandOpts;
6218
6231
  const { lazy } = expandOpts;
6219
6232
  const rowid = getRowid($xeTable, row);
6220
6233
  const rowRest = fullAllDataRowIdData[rowid];
6221
6234
  if (lazy && rowRest) {
6222
6235
  rowRest.expandLoaded = false;
6223
- const rowTempExpandLazyLoadedMaps = Object.assign({}, rowExpandLazyLoadedMaps);
6224
- if (rowTempExpandLazyLoadedMaps[rowid]) {
6225
- delete rowTempExpandLazyLoadedMaps[rowid];
6226
- }
6227
- this.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
6236
+ delete rExpandLazyLoadedMaps[rowid];
6228
6237
  }
6229
- return this.$nextTick();
6238
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
6239
+ return $xeTable.$nextTick();
6230
6240
  },
6231
6241
  /**
6232
6242
  * 重新懒加载展开行,并展开内容
@@ -6314,30 +6324,36 @@ const Methods = {
6314
6324
  },
6315
6325
  handleAsyncRowExpand(row) {
6316
6326
  const $xeTable = this;
6327
+ const reactData = $xeTable;
6328
+ const internalData = $xeTable;
6317
6329
  return new Promise(resolve => {
6318
6330
  const { expandOpts } = this;
6319
6331
  const { loadMethod } = expandOpts;
6320
6332
  if (loadMethod) {
6321
- const { rowExpandLazyLoadedMaps, fullAllDataRowIdData } = this;
6333
+ const { fullAllDataRowIdData } = internalData;
6334
+ const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
6322
6335
  const rowid = getRowid($xeTable, row);
6323
6336
  const rowRest = fullAllDataRowIdData[rowid];
6324
- rowExpandLazyLoadedMaps[rowid] = row;
6325
- loadMethod({ $table: $xeTable, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) }).then(() => {
6326
- const { rowExpandedMaps } = this;
6337
+ rExpandLazyLoadedMaps[rowid] = row;
6338
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
6339
+ loadMethod({ $table: $xeTable, row, rowIndex: $xeTable.getRowIndex(row), $rowIndex: $xeTable.getVMRowIndex(row) }).then(() => {
6340
+ const rExpandedMaps = Object.assign({}, reactData.rowExpandedMaps);
6327
6341
  if (rowRest) {
6328
6342
  rowRest.expandLoaded = true;
6329
6343
  }
6330
- rowExpandedMaps[rowid] = row;
6344
+ rExpandedMaps[rowid] = row;
6345
+ reactData.rowExpandedMaps = rExpandedMaps;
6331
6346
  }).catch(() => {
6332
6347
  if (rowRest) {
6333
6348
  rowRest.expandLoaded = false;
6334
6349
  }
6335
6350
  }).finally(() => {
6336
- const { rowExpandLazyLoadedMaps } = this;
6337
- if (rowExpandLazyLoadedMaps[rowid]) {
6338
- delete rowExpandLazyLoadedMaps[rowid];
6351
+ const rExpandLazyLoadedMaps = Object.assign({}, reactData.rowExpandLazyLoadedMaps);
6352
+ if (rExpandLazyLoadedMaps[rowid]) {
6353
+ delete rExpandLazyLoadedMaps[rowid];
6339
6354
  }
6340
- this.$nextTick().then(() => this.recalculate()).then(() => resolve());
6355
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
6356
+ $xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve());
6341
6357
  });
6342
6358
  }
6343
6359
  else {
@@ -6490,7 +6506,11 @@ const Methods = {
6490
6506
  },
6491
6507
  clearTreeExpandLoaded(rows) {
6492
6508
  const $xeTable = this;
6493
- const { treeOpts, treeExpandedMaps, fullAllDataRowIdData } = this;
6509
+ const reactData = $xeTable;
6510
+ const internalData = $xeTable;
6511
+ const tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
6512
+ const { fullAllDataRowIdData } = internalData;
6513
+ const treeOpts = $xeTable.computeTreeOpts;
6494
6514
  const { transform } = treeOpts;
6495
6515
  if (rows) {
6496
6516
  if (!XEUtils.isArray(rows)) {
@@ -6501,23 +6521,25 @@ const Methods = {
6501
6521
  const rowRest = fullAllDataRowIdData[rowid];
6502
6522
  if (rowRest) {
6503
6523
  rowRest.treeLoaded = false;
6504
- if (treeExpandedMaps[rowid]) {
6505
- delete treeExpandedMaps[rowid];
6524
+ if (tExpandedMaps[rowid]) {
6525
+ delete tExpandedMaps[rowid];
6506
6526
  }
6507
6527
  }
6508
6528
  });
6509
6529
  }
6530
+ reactData.treeExpandedMaps = tExpandedMaps;
6510
6531
  if (transform) {
6511
- this.handleVirtualTreeToList();
6512
- return this.handleTableData();
6532
+ handleVirtualTreeToList($xeTable);
6533
+ return $xeTable.handleTableData();
6513
6534
  }
6514
- return this.$nextTick();
6535
+ return $xeTable.$nextTick();
6515
6536
  },
6516
6537
  /**
6517
6538
  * 重新懒加载树节点,并展开该节点
6518
6539
  * @param {Row} row 行对象
6519
6540
  */
6520
6541
  reloadTreeExpand(row) {
6542
+ const $xeTable = this;
6521
6543
  const { treeOpts, treeExpandLazyLoadedMaps } = this;
6522
6544
  const { transform, lazy } = treeOpts;
6523
6545
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
@@ -6527,7 +6549,7 @@ const Methods = {
6527
6549
  return this.handleAsyncTreeExpandChilds(row);
6528
6550
  }).then(() => {
6529
6551
  if (transform) {
6530
- this.handleVirtualTreeToList();
6552
+ handleVirtualTreeToList($xeTable);
6531
6553
  return this.handleTableData();
6532
6554
  }
6533
6555
  }).then(() => {
@@ -6739,8 +6761,9 @@ const Methods = {
6739
6761
  * @returns
6740
6762
  */
6741
6763
  handleVirtualTreeExpand(rows, expanded) {
6764
+ const $xeTable = this;
6742
6765
  return this.handleBaseTreeExpand(rows, expanded).then(() => {
6743
- this.handleVirtualTreeToList();
6766
+ handleVirtualTreeToList($xeTable);
6744
6767
  this.handleTableData();
6745
6768
  this.updateTreeDataIndex();
6746
6769
  }).then(() => {
@@ -6789,6 +6812,7 @@ const Methods = {
6789
6812
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
6790
6813
  */
6791
6814
  clearTreeExpand() {
6815
+ const $xeTable = this;
6792
6816
  const { treeOpts, tableFullData } = this;
6793
6817
  const { transform, reserve } = treeOpts;
6794
6818
  const childrenField = treeOpts.children || treeOpts.childrenField;
@@ -6799,7 +6823,7 @@ const Methods = {
6799
6823
  }
6800
6824
  return this.handleTableData().then(() => {
6801
6825
  if (transform) {
6802
- this.handleVirtualTreeToList();
6826
+ handleVirtualTreeToList($xeTable);
6803
6827
  return this.handleTableData();
6804
6828
  }
6805
6829
  }).then(() => {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.12.2";
3
+ export const version = "3.12.3";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.12.2"}`;
3
+ const version = `table v${"3.12.3"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
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.12.2";
2223
+ const version = "3.12.3";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2814,7 +2814,7 @@ function isNodeElement(elem) {
2814
2814
  const {
2815
2815
  log: log_log
2816
2816
  } = core_.VxeUI;
2817
- const log_version = `table v${"3.12.2"}`;
2817
+ const log_version = `table v${"3.12.3"}`;
2818
2818
  const warnLog = log_log.create('warn', log_version);
2819
2819
  const errLog = log_log.create('error', log_version);
2820
2820
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5252,6 +5252,66 @@ function cacheColumnMap($xeTable) {
5252
5252
  reactData.expandColumn = expandColumn;
5253
5253
  reactData.isAllOverflow = isAllOverflow;
5254
5254
  }
5255
+ const updateScrollYStatus = ($xeTable, fullData) => {
5256
+ const props = $xeTable;
5257
+ const reactData = $xeTable;
5258
+ const internalData = $xeTable;
5259
+ const {
5260
+ treeConfig
5261
+ } = props;
5262
+ const sYOpts = $xeTable.computeSYOpts;
5263
+ const treeOpts = $xeTable.computeTreeOpts;
5264
+ const {
5265
+ transform
5266
+ } = treeOpts;
5267
+ const allList = fullData || internalData.tableFullData;
5268
+ // 如果gt为0,则总是启用
5269
+ const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt < allList.length);
5270
+ reactData.scrollYLoad = scrollYLoad;
5271
+ return scrollYLoad;
5272
+ };
5273
+ /**
5274
+ * 如果为虚拟树,将树结构拍平
5275
+ * @returns
5276
+ */
5277
+ function handleVirtualTreeToList($xeTable) {
5278
+ const props = $xeTable;
5279
+ const reactData = $xeTable;
5280
+ const internalData = $xeTable;
5281
+ const {
5282
+ treeConfig
5283
+ } = props;
5284
+ const {
5285
+ treeExpandedMaps
5286
+ } = reactData;
5287
+ const {
5288
+ fullAllDataRowIdData
5289
+ } = internalData;
5290
+ const treeOpts = $xeTable.computeTreeOpts;
5291
+ const childrenField = treeOpts.children || treeOpts.childrenField;
5292
+ if (treeConfig && treeOpts.transform) {
5293
+ const fullData = [];
5294
+ const expandMaps = {};
5295
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeFullData, (row, index, items, path, parentRow) => {
5296
+ const rowid = getRowid($xeTable, row);
5297
+ const parentRowid = getRowid($xeTable, parentRow);
5298
+ if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
5299
+ const rowRest = fullAllDataRowIdData[rowid];
5300
+ if (rowRest) {
5301
+ rowRest._index = fullData.length;
5302
+ }
5303
+ expandMaps[rowid] = 1;
5304
+ fullData.push(row);
5305
+ }
5306
+ }, {
5307
+ children: childrenField
5308
+ });
5309
+ internalData.afterFullData = fullData;
5310
+ updateScrollYStatus($xeTable, fullData);
5311
+ return fullData;
5312
+ }
5313
+ return internalData.afterFullData;
5314
+ }
5255
5315
  function computeRowHeight($xeTable) {
5256
5316
  const tableHeader = $xeTable.$refs.tableHeader;
5257
5317
  const tableBody = $xeTable.$refs.tableBody;
@@ -6269,6 +6329,7 @@ const Methods = {
6269
6329
  });
6270
6330
  },
6271
6331
  handleTableData(force) {
6332
+ const $xeTable = this;
6272
6333
  const {
6273
6334
  scrollYLoad,
6274
6335
  scrollYStore,
@@ -6281,7 +6342,7 @@ const Methods = {
6281
6342
  // 更新数据,处理筛选和排序
6282
6343
  this.updateAfterFullData();
6283
6344
  // 如果为虚拟树,将树结构拍平
6284
- fullList = this.handleVirtualTreeToList();
6345
+ fullList = handleVirtualTreeToList($xeTable);
6285
6346
  }
6286
6347
  const tableData = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
6287
6348
  tableData.forEach((row, $index) => {
@@ -6294,21 +6355,6 @@ const Methods = {
6294
6355
  this.tableData = tableData;
6295
6356
  return this.$nextTick();
6296
6357
  },
6297
- updateScrollYStatus(fullData) {
6298
- const {
6299
- treeConfig,
6300
- treeOpts,
6301
- sYOpts
6302
- } = this;
6303
- const {
6304
- transform
6305
- } = treeOpts;
6306
- const allList = fullData || this.tableFullData;
6307
- // 如果gt为0,则总是启用
6308
- const scrollYLoad = (transform || !treeConfig) && !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= allList.length);
6309
- this.scrollYLoad = scrollYLoad;
6310
- return scrollYLoad;
6311
- },
6312
6358
  /**
6313
6359
  * 加载表格数据
6314
6360
  * @param {Array} datas 数据
@@ -6376,7 +6422,7 @@ const Methods = {
6376
6422
  editStore.insertMaps = {};
6377
6423
  editStore.removeList = [];
6378
6424
  editStore.removeMaps = {};
6379
- const sYLoad = this.updateScrollYStatus(fullData);
6425
+ const sYLoad = updateScrollYStatus($xeTable, fullData);
6380
6426
  this.isDragRowMove = false;
6381
6427
  // 全量数据
6382
6428
  this.tableFullData = fullData;
@@ -7385,47 +7431,6 @@ const Methods = {
7385
7431
  }
7386
7432
  return rowList;
7387
7433
  },
7388
- /**
7389
- * 如果为虚拟树,将树结构拍平
7390
- * @returns
7391
- */
7392
- handleVirtualTreeToList() {
7393
- const $xeTable = this;
7394
- const internalData = $xeTable;
7395
- const {
7396
- fullAllDataRowIdData
7397
- } = internalData;
7398
- const {
7399
- treeOpts,
7400
- treeConfig,
7401
- treeExpandedMaps,
7402
- afterTreeFullData,
7403
- afterFullData
7404
- } = this;
7405
- const childrenField = treeOpts.children || treeOpts.childrenField;
7406
- if (treeConfig && treeOpts.transform) {
7407
- const fullData = [];
7408
- const expandMaps = {};
7409
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path, parentRow) => {
7410
- const rowid = getRowid(this, row);
7411
- const parentRowid = getRowid(this, parentRow);
7412
- if (!parentRow || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
7413
- const rowRest = fullAllDataRowIdData[rowid];
7414
- if (rowRest) {
7415
- rowRest._index = fullData.length;
7416
- }
7417
- expandMaps[rowid] = 1;
7418
- fullData.push(row);
7419
- }
7420
- }, {
7421
- children: childrenField
7422
- });
7423
- this.afterFullData = fullData;
7424
- this.updateScrollYStatus(fullData);
7425
- return fullData;
7426
- }
7427
- return afterFullData;
7428
- },
7429
7434
  /**
7430
7435
  * 获取处理后全量的表格数据
7431
7436
  * 如果存在筛选条件,继续处理
@@ -11564,7 +11569,7 @@ const Methods = {
11564
11569
  reactData.isDragRowMove = true;
11565
11570
  $xeTable.handleTableData(treeConfig && transform);
11566
11571
  $xeTable.cacheRowMap();
11567
- $xeTable.updateScrollYStatus();
11572
+ updateScrollYStatus($xeTable);
11568
11573
  if (!(treeConfig && transform)) {
11569
11574
  $xeTable.updateAfterDataIndex();
11570
11575
  }
@@ -12324,11 +12329,15 @@ const Methods = {
12324
12329
  },
12325
12330
  clearRowExpandLoaded(row) {
12326
12331
  const $xeTable = this;
12332
+ const reactData = $xeTable;
12333
+ const internalData = $xeTable;
12334
+ const rExpandLazyLoadedMaps = {
12335
+ ...reactData.rowExpandLazyLoadedMaps
12336
+ };
12327
12337
  const {
12328
- expandOpts,
12329
- rowExpandLazyLoadedMaps,
12330
12338
  fullAllDataRowIdData
12331
- } = this;
12339
+ } = internalData;
12340
+ const expandOpts = $xeTable.computeExpandOpts;
12332
12341
  const {
12333
12342
  lazy
12334
12343
  } = expandOpts;
@@ -12336,15 +12345,10 @@ const Methods = {
12336
12345
  const rowRest = fullAllDataRowIdData[rowid];
12337
12346
  if (lazy && rowRest) {
12338
12347
  rowRest.expandLoaded = false;
12339
- const rowTempExpandLazyLoadedMaps = {
12340
- ...rowExpandLazyLoadedMaps
12341
- };
12342
- if (rowTempExpandLazyLoadedMaps[rowid]) {
12343
- delete rowTempExpandLazyLoadedMaps[rowid];
12344
- }
12345
- this.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
12348
+ delete rExpandLazyLoadedMaps[rowid];
12346
12349
  }
12347
- return this.$nextTick();
12350
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
12351
+ return $xeTable.$nextTick();
12348
12352
  },
12349
12353
  /**
12350
12354
  * 重新懒加载展开行,并展开内容
@@ -12464,6 +12468,8 @@ const Methods = {
12464
12468
  },
12465
12469
  handleAsyncRowExpand(row) {
12466
12470
  const $xeTable = this;
12471
+ const reactData = $xeTable;
12472
+ const internalData = $xeTable;
12467
12473
  return new Promise(resolve => {
12468
12474
  const {
12469
12475
  expandOpts
@@ -12473,37 +12479,42 @@ const Methods = {
12473
12479
  } = expandOpts;
12474
12480
  if (loadMethod) {
12475
12481
  const {
12476
- rowExpandLazyLoadedMaps,
12477
12482
  fullAllDataRowIdData
12478
- } = this;
12483
+ } = internalData;
12484
+ const rExpandLazyLoadedMaps = {
12485
+ ...reactData.rowExpandLazyLoadedMaps
12486
+ };
12479
12487
  const rowid = getRowid($xeTable, row);
12480
12488
  const rowRest = fullAllDataRowIdData[rowid];
12481
- rowExpandLazyLoadedMaps[rowid] = row;
12489
+ rExpandLazyLoadedMaps[rowid] = row;
12490
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
12482
12491
  loadMethod({
12483
12492
  $table: $xeTable,
12484
12493
  row,
12485
- rowIndex: this.getRowIndex(row),
12486
- $rowIndex: this.getVMRowIndex(row)
12494
+ rowIndex: $xeTable.getRowIndex(row),
12495
+ $rowIndex: $xeTable.getVMRowIndex(row)
12487
12496
  }).then(() => {
12488
- const {
12489
- rowExpandedMaps
12490
- } = this;
12497
+ const rExpandedMaps = {
12498
+ ...reactData.rowExpandedMaps
12499
+ };
12491
12500
  if (rowRest) {
12492
12501
  rowRest.expandLoaded = true;
12493
12502
  }
12494
- rowExpandedMaps[rowid] = row;
12503
+ rExpandedMaps[rowid] = row;
12504
+ reactData.rowExpandedMaps = rExpandedMaps;
12495
12505
  }).catch(() => {
12496
12506
  if (rowRest) {
12497
12507
  rowRest.expandLoaded = false;
12498
12508
  }
12499
12509
  }).finally(() => {
12500
- const {
12501
- rowExpandLazyLoadedMaps
12502
- } = this;
12503
- if (rowExpandLazyLoadedMaps[rowid]) {
12504
- delete rowExpandLazyLoadedMaps[rowid];
12510
+ const rExpandLazyLoadedMaps = {
12511
+ ...reactData.rowExpandLazyLoadedMaps
12512
+ };
12513
+ if (rExpandLazyLoadedMaps[rowid]) {
12514
+ delete rExpandLazyLoadedMaps[rowid];
12505
12515
  }
12506
- this.$nextTick().then(() => this.recalculate()).then(() => resolve());
12516
+ reactData.rowExpandLazyLoadedMaps = rExpandLazyLoadedMaps;
12517
+ $xeTable.$nextTick().then(() => $xeTable.recalculate()).then(() => resolve());
12507
12518
  });
12508
12519
  } else {
12509
12520
  resolve();
@@ -12685,11 +12696,15 @@ const Methods = {
12685
12696
  },
12686
12697
  clearTreeExpandLoaded(rows) {
12687
12698
  const $xeTable = this;
12699
+ const reactData = $xeTable;
12700
+ const internalData = $xeTable;
12701
+ const tExpandedMaps = {
12702
+ ...reactData.treeExpandedMaps
12703
+ };
12688
12704
  const {
12689
- treeOpts,
12690
- treeExpandedMaps,
12691
12705
  fullAllDataRowIdData
12692
- } = this;
12706
+ } = internalData;
12707
+ const treeOpts = $xeTable.computeTreeOpts;
12693
12708
  const {
12694
12709
  transform
12695
12710
  } = treeOpts;
@@ -12702,23 +12717,25 @@ const Methods = {
12702
12717
  const rowRest = fullAllDataRowIdData[rowid];
12703
12718
  if (rowRest) {
12704
12719
  rowRest.treeLoaded = false;
12705
- if (treeExpandedMaps[rowid]) {
12706
- delete treeExpandedMaps[rowid];
12720
+ if (tExpandedMaps[rowid]) {
12721
+ delete tExpandedMaps[rowid];
12707
12722
  }
12708
12723
  }
12709
12724
  });
12710
12725
  }
12726
+ reactData.treeExpandedMaps = tExpandedMaps;
12711
12727
  if (transform) {
12712
- this.handleVirtualTreeToList();
12713
- return this.handleTableData();
12728
+ handleVirtualTreeToList($xeTable);
12729
+ return $xeTable.handleTableData();
12714
12730
  }
12715
- return this.$nextTick();
12731
+ return $xeTable.$nextTick();
12716
12732
  },
12717
12733
  /**
12718
12734
  * 重新懒加载树节点,并展开该节点
12719
12735
  * @param {Row} row 行对象
12720
12736
  */
12721
12737
  reloadTreeExpand(row) {
12738
+ const $xeTable = this;
12722
12739
  const {
12723
12740
  treeOpts,
12724
12741
  treeExpandLazyLoadedMaps
@@ -12734,7 +12751,7 @@ const Methods = {
12734
12751
  return this.handleAsyncTreeExpandChilds(row);
12735
12752
  }).then(() => {
12736
12753
  if (transform) {
12737
- this.handleVirtualTreeToList();
12754
+ handleVirtualTreeToList($xeTable);
12738
12755
  return this.handleTableData();
12739
12756
  }
12740
12757
  }).then(() => {
@@ -13013,8 +13030,9 @@ const Methods = {
13013
13030
  * @returns
13014
13031
  */
13015
13032
  handleVirtualTreeExpand(rows, expanded) {
13033
+ const $xeTable = this;
13016
13034
  return this.handleBaseTreeExpand(rows, expanded).then(() => {
13017
- this.handleVirtualTreeToList();
13035
+ handleVirtualTreeToList($xeTable);
13018
13036
  this.handleTableData();
13019
13037
  this.updateTreeDataIndex();
13020
13038
  }).then(() => {
@@ -13068,6 +13086,7 @@ const Methods = {
13068
13086
  * 手动清空树形节点的展开状态,数据会恢复成未展开的状态
13069
13087
  */
13070
13088
  clearTreeExpand() {
13089
+ const $xeTable = this;
13071
13090
  const {
13072
13091
  treeOpts,
13073
13092
  tableFullData
@@ -13086,7 +13105,7 @@ const Methods = {
13086
13105
  }
13087
13106
  return this.handleTableData().then(() => {
13088
13107
  if (transform) {
13089
- this.handleVirtualTreeToList();
13108
+ handleVirtualTreeToList($xeTable);
13090
13109
  return this.handleTableData();
13091
13110
  }
13092
13111
  }).then(() => {