vxe-table 4.10.6-beta.4 → 4.10.6-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.10.6-beta.4";
3141
+ const version = "4.10.6-beta.5";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3568,7 +3568,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3568
3568
  const {
3569
3569
  log: log_log
3570
3570
  } = core_.VxeUI;
3571
- const log_version = `table v${"4.10.6-beta.4"}`;
3571
+ const log_version = `table v${"4.10.6-beta.5"}`;
3572
3572
  const warnLog = log_log.create('warn', log_version);
3573
3573
  const errLog = log_log.create('error', log_version);
3574
3574
  ;// ./packages/table/src/columnInfo.ts
@@ -11900,6 +11900,41 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11900
11900
  return cellValue;
11901
11901
  };
11902
11902
  };
11903
+ const updateAfterListIndex = () => {
11904
+ const {
11905
+ afterFullData,
11906
+ fullDataRowIdData,
11907
+ fullAllDataRowIdData
11908
+ } = internalData;
11909
+ const fullMaps = {};
11910
+ afterFullData.forEach((row, index) => {
11911
+ const rowid = getRowid($xeTable, row);
11912
+ const rowRest = fullAllDataRowIdData[rowid];
11913
+ const seq = index + 1;
11914
+ if (rowRest) {
11915
+ rowRest.seq = seq;
11916
+ rowRest._index = index;
11917
+ } else {
11918
+ const rest = {
11919
+ row,
11920
+ rowid,
11921
+ seq,
11922
+ index: -1,
11923
+ $index: -1,
11924
+ _index: index,
11925
+ items: [],
11926
+ parent: null,
11927
+ level: 0,
11928
+ height: 0,
11929
+ oTop: 0
11930
+ };
11931
+ fullAllDataRowIdData[rowid] = rest;
11932
+ fullDataRowIdData[rowid] = rest;
11933
+ }
11934
+ fullMaps[rowid] = row;
11935
+ });
11936
+ internalData.afterFullRowMaps = fullMaps;
11937
+ };
11903
11938
  /**
11904
11939
  * 预编译
11905
11940
  * 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
@@ -11909,72 +11944,55 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11909
11944
  treeConfig
11910
11945
  } = props;
11911
11946
  const {
11912
- afterFullData,
11913
11947
  fullDataRowIdData,
11914
11948
  fullAllDataRowIdData,
11915
11949
  afterTreeFullData
11916
11950
  } = internalData;
11917
11951
  const treeOpts = computeTreeOpts.value;
11952
+ const {
11953
+ transform
11954
+ } = treeOpts;
11918
11955
  const childrenField = treeOpts.children || treeOpts.childrenField;
11919
11956
  const fullMaps = {};
11920
11957
  if (treeConfig) {
11921
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
11922
- const rowid = getRowid($xeTable, row);
11923
- const rowRest = fullAllDataRowIdData[rowid];
11924
- const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
11925
- if (rowRest) {
11926
- rowRest.seq = seq;
11927
- rowRest._index = index;
11928
- } else {
11929
- const rest = {
11930
- row,
11931
- rowid,
11932
- seq,
11933
- index: -1,
11934
- $index: -1,
11935
- _index: -1,
11936
- items: [],
11937
- parent: null,
11938
- level: 0,
11939
- height: 0,
11940
- oTop: 0
11941
- };
11942
- fullAllDataRowIdData[rowid] = rest;
11943
- fullDataRowIdData[rowid] = rest;
11944
- }
11945
- fullMaps[rowid] = row;
11946
- }, {
11947
- children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
11948
- });
11958
+ if (transform) {
11959
+ updateAfterListIndex();
11960
+ } else {
11961
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
11962
+ const rowid = getRowid($xeTable, row);
11963
+ const rowRest = fullAllDataRowIdData[rowid];
11964
+ const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
11965
+ if (rowRest) {
11966
+ rowRest.seq = seq;
11967
+ if (!transform) {
11968
+ rowRest._index = index;
11969
+ }
11970
+ } else {
11971
+ const rest = {
11972
+ row,
11973
+ rowid,
11974
+ seq,
11975
+ index: -1,
11976
+ $index: -1,
11977
+ _index: -1,
11978
+ items: [],
11979
+ parent: null,
11980
+ level: 0,
11981
+ height: 0,
11982
+ oTop: 0
11983
+ };
11984
+ fullAllDataRowIdData[rowid] = rest;
11985
+ fullDataRowIdData[rowid] = rest;
11986
+ }
11987
+ fullMaps[rowid] = row;
11988
+ }, {
11989
+ children: transform ? treeOpts.mapChildrenField : childrenField
11990
+ });
11991
+ internalData.afterFullRowMaps = fullMaps;
11992
+ }
11949
11993
  } else {
11950
- afterFullData.forEach((row, index) => {
11951
- const rowid = getRowid($xeTable, row);
11952
- const rowRest = fullAllDataRowIdData[rowid];
11953
- const seq = index + 1;
11954
- if (rowRest) {
11955
- rowRest.seq = seq;
11956
- rowRest._index = index;
11957
- } else {
11958
- const rest = {
11959
- row,
11960
- rowid,
11961
- seq,
11962
- index: -1,
11963
- $index: -1,
11964
- _index: index,
11965
- items: [],
11966
- parent: null,
11967
- level: 0,
11968
- height: 0,
11969
- oTop: 0
11970
- };
11971
- fullAllDataRowIdData[rowid] = rest;
11972
- fullDataRowIdData[rowid] = rest;
11973
- }
11974
- fullMaps[rowid] = row;
11975
- });
11994
+ updateAfterListIndex();
11976
11995
  }
11977
- internalData.afterFullRowMaps = fullMaps;
11978
11996
  };
11979
11997
  /**
11980
11998
  * 如果为虚拟树,将树结构拍平