vxe-table 4.11.5 → 4.11.6

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.
@@ -2653,15 +2653,11 @@ export default defineComponent({
2653
2653
  internalData.tableFullData = fullData;
2654
2654
  internalData.tableFullTreeData = treeData;
2655
2655
  // 缓存数据
2656
- $xeTable.cacheRowMap(true, isReset);
2656
+ $xeTable.cacheRowMap(true);
2657
2657
  // 原始数据
2658
2658
  internalData.tableSynchData = datas;
2659
2659
  if (isReset) {
2660
2660
  internalData.isResizeCellHeight = false;
2661
- reactData.rowExpandedMaps = {};
2662
- reactData.rowExpandLazyLoadedMaps = {};
2663
- reactData.treeExpandedMaps = {};
2664
- reactData.treeExpandLazyLoadedMaps = {};
2665
2661
  }
2666
2662
  // 克隆原数据,用于显示编辑状态,与编辑值做对比
2667
2663
  if (keepSource) {
@@ -3979,7 +3975,7 @@ export default defineComponent({
3979
3975
  */
3980
3976
  getTreeRowChildren(rowOrRowid) {
3981
3977
  const { treeConfig } = props;
3982
- const { fullDataRowIdData } = internalData;
3978
+ const { fullAllDataRowIdData } = internalData;
3983
3979
  const treeOpts = computeTreeOpts.value;
3984
3980
  const { transform, mapChildrenField } = treeOpts;
3985
3981
  const childrenField = treeOpts.children || treeOpts.childrenField;
@@ -3992,7 +3988,7 @@ export default defineComponent({
3992
3988
  rowid = getRowid($xeTable, rowOrRowid);
3993
3989
  }
3994
3990
  if (rowid) {
3995
- const rest = fullDataRowIdData[rowid];
3991
+ const rest = fullAllDataRowIdData[rowid];
3996
3992
  const row = rest ? rest.row : null;
3997
3993
  if (row) {
3998
3994
  return row[transform ? mapChildrenField : childrenField] || [];
@@ -4006,7 +4002,7 @@ export default defineComponent({
4006
4002
  */
4007
4003
  getTreeParentRow(rowOrRowid) {
4008
4004
  const { treeConfig } = props;
4009
- const { fullDataRowIdData } = internalData;
4005
+ const { fullAllDataRowIdData } = internalData;
4010
4006
  if (rowOrRowid && treeConfig) {
4011
4007
  let rowid;
4012
4008
  if (XEUtils.isString(rowOrRowid)) {
@@ -4016,7 +4012,7 @@ export default defineComponent({
4016
4012
  rowid = getRowid($xeTable, rowOrRowid);
4017
4013
  }
4018
4014
  if (rowid) {
4019
- const rest = fullDataRowIdData[rowid];
4015
+ const rest = fullAllDataRowIdData[rowid];
4020
4016
  return rest ? rest.parent : null;
4021
4017
  }
4022
4018
  }
@@ -4031,9 +4027,9 @@ export default defineComponent({
4031
4027
  * @param {String/Number} rowid 行主键
4032
4028
  */
4033
4029
  getRowById(cellValue) {
4034
- const { fullDataRowIdData } = internalData;
4030
+ const { fullAllDataRowIdData } = internalData;
4035
4031
  const rowid = XEUtils.eqNull(cellValue) ? '' : encodeURIComponent(cellValue || '');
4036
- return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
4032
+ return fullAllDataRowIdData[rowid] ? fullAllDataRowIdData[rowid].row : null;
4037
4033
  },
4038
4034
  /**
4039
4035
  * 根据行获取行的唯一主键
@@ -5216,11 +5212,12 @@ export default defineComponent({
5216
5212
  return rowRest && !!rowRest.treeLoaded;
5217
5213
  },
5218
5214
  clearTreeExpandLoaded(rows) {
5219
- const tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
5220
5215
  const { fullAllDataRowIdData } = internalData;
5221
5216
  const treeOpts = computeTreeOpts.value;
5222
5217
  const { transform } = treeOpts;
5218
+ let tExpandedMaps = {};
5223
5219
  if (rows) {
5220
+ tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
5224
5221
  if (!XEUtils.isArray(rows)) {
5225
5222
  rows = [rows];
5226
5223
  }
@@ -5235,10 +5232,15 @@ export default defineComponent({
5235
5232
  }
5236
5233
  });
5237
5234
  }
5238
- reactData.treeExpandedMaps = tExpandedMaps;
5235
+ else {
5236
+ XEUtils.each(fullAllDataRowIdData, (rowRest) => {
5237
+ rowRest.treeLoaded = false;
5238
+ });
5239
+ }
5240
+ reactData.treeExpandedMaps = {};
5239
5241
  if (transform) {
5240
5242
  handleVirtualTreeToList();
5241
- return tablePrivateMethods.handleTableData();
5243
+ return $xeTable.handleTableData();
5242
5244
  }
5243
5245
  return nextTick();
5244
5246
  },
@@ -6631,7 +6633,7 @@ export default defineComponent({
6631
6633
  /**
6632
6634
  * 更新数据行的 Map
6633
6635
  */
6634
- cacheRowMap(isReset, isSource) {
6636
+ cacheRowMap() {
6635
6637
  const { treeConfig } = props;
6636
6638
  const treeOpts = computeTreeOpts.value;
6637
6639
  const { fullAllDataRowIdData, tableFullData, tableFullTreeData } = internalData;
@@ -6652,23 +6654,19 @@ export default defineComponent({
6652
6654
  if (isLazy && row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
6653
6655
  row[childrenField] = null;
6654
6656
  }
6655
- let cacheItem = fullAllDataRowIdData[rowid];
6656
- if (isReset || !cacheItem) {
6657
- cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
6658
- }
6659
- cacheItem.row = row;
6660
- cacheItem.items = items;
6661
- cacheItem.parent = parentRow;
6662
- cacheItem.level = level;
6663
- cacheItem.index = treeConfig && parentRow ? -1 : index;
6664
- if (isSource) {
6665
- fullDataRowIdMaps[rowid] = cacheItem;
6666
- }
6667
- fullAllDataRowIdMaps[rowid] = cacheItem;
6657
+ let rowRest = fullAllDataRowIdData[rowid];
6658
+ if (!rowRest) {
6659
+ rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
6660
+ }
6661
+ rowRest.row = row;
6662
+ rowRest.items = items;
6663
+ rowRest.parent = parentRow;
6664
+ rowRest.level = level;
6665
+ rowRest.index = treeConfig && parentRow ? -1 : index;
6666
+ fullDataRowIdMaps[rowid] = rowRest;
6667
+ fullAllDataRowIdMaps[rowid] = rowRest;
6668
6668
  };
6669
- if (isSource) {
6670
- internalData.fullDataRowIdData = fullDataRowIdMaps;
6671
- }
6669
+ internalData.fullDataRowIdData = fullDataRowIdMaps;
6672
6670
  internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
6673
6671
  if (treeConfig) {
6674
6672
  XEUtils.eachTree(tableFullTreeData, handleRow, { children: childrenField });
@@ -9796,7 +9794,7 @@ export default defineComponent({
9796
9794
  if (value && value.length >= 50000) {
9797
9795
  warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
9798
9796
  }
9799
- loadTableData(value, true).then(() => {
9797
+ loadTableData(value, false).then(() => {
9800
9798
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
9801
9799
  const expandOpts = computeExpandOpts.value;
9802
9800
  internalData.inited = true;
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 = "4.11.5";
3
+ export const version = "4.11.6";
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${"4.11.5"}`;
3
+ const version = `table v${"4.11.6"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);