vxe-table 3.14.0-beta.11 → 3.14.0-beta.13

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.
@@ -287,7 +287,7 @@ function cacheColumnMap($xeTable) {
287
287
  fullColumnFieldData[field] = rest;
288
288
  } else {
289
289
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
290
- (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
290
+ (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
291
291
  }
292
292
  }
293
293
  if (!hasFixed && fixed) {
@@ -4713,14 +4713,26 @@ const Methods = {
4713
4713
  }
4714
4714
  },
4715
4715
  getCustomStoreData() {
4716
+ const $xeTable = this;
4717
+ const props = $xeTable;
4718
+ const internalData = $xeTable;
4719
+ const {
4720
+ id
4721
+ } = props;
4722
+ const customOpts = $xeTable.computeCustomOpts;
4716
4723
  const {
4717
- id,
4718
- customOpts,
4719
4724
  collectColumn
4720
- } = this;
4725
+ } = internalData;
4721
4726
  const {
4727
+ storage,
4722
4728
  checkMethod
4723
4729
  } = customOpts;
4730
+ const isAllCustom = storage === true;
4731
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
4732
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
4733
+ const isCustomVisible = isAllCustom || storageOpts.visible;
4734
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
4735
+ const isCustomSort = isAllCustom || storageOpts.sort;
4724
4736
  const resizableData = {};
4725
4737
  const sortData = {};
4726
4738
  const visibleData = {};
@@ -4737,48 +4749,38 @@ const Methods = {
4737
4749
  }
4738
4750
  let hasResizable = 0;
4739
4751
  let hasSort = 0;
4740
- let hasFixedt = 0;
4752
+ let hasFixed = 0;
4741
4753
  let hasVisible = 0;
4742
4754
  _xeUtils.default.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
4755
+ const colKey = column.getKey();
4756
+ if (!colKey) {
4757
+ (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
4758
+ return;
4759
+ }
4743
4760
  // 只支持一级
4744
4761
  if (!parentColumn) {
4745
- collectColumn.forEach(column => {
4746
- const colKey = column.getKey();
4747
- if (colKey) {
4748
- hasSort = 1;
4749
- sortData[colKey] = column.renderSortNumber;
4750
- }
4751
- });
4752
- if (column.fixed !== column.defaultFixed) {
4753
- const colKey = column.getKey();
4754
- if (colKey) {
4755
- hasFixedt = 1;
4756
- fixedData[colKey] = column.fixed;
4757
- }
4762
+ if (isCustomSort) {
4763
+ hasSort = 1;
4764
+ sortData[colKey] = column.renderSortNumber;
4758
4765
  }
4759
- }
4760
- if (column.resizeWidth) {
4761
- const colKey = column.getKey();
4762
- if (colKey) {
4763
- hasResizable = 1;
4764
- resizableData[colKey] = column.renderWidth;
4766
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
4767
+ hasFixed = 1;
4768
+ fixedData[colKey] = column.fixed;
4765
4769
  }
4766
4770
  }
4767
- if (!checkMethod || checkMethod({
4771
+ if (isCustomResizable && column.resizeWidth) {
4772
+ hasResizable = 1;
4773
+ resizableData[colKey] = column.renderWidth;
4774
+ }
4775
+ if (isCustomVisible && (!checkMethod || checkMethod({
4768
4776
  column
4769
- })) {
4777
+ }))) {
4770
4778
  if (!column.visible && column.defaultVisible) {
4771
- const colKey = column.getKey();
4772
- if (colKey) {
4773
- hasVisible = 1;
4774
- visibleData[colKey] = false;
4775
- }
4779
+ hasVisible = 1;
4780
+ visibleData[colKey] = false;
4776
4781
  } else if (column.visible && !column.defaultVisible) {
4777
- const colKey = column.getKey();
4778
- if (colKey) {
4779
- hasVisible = 1;
4780
- visibleData[colKey] = true;
4781
- }
4782
+ hasVisible = 1;
4783
+ visibleData[colKey] = true;
4782
4784
  }
4783
4785
  }
4784
4786
  });
@@ -4788,7 +4790,7 @@ const Methods = {
4788
4790
  if (hasSort) {
4789
4791
  storeData.sortData = sortData;
4790
4792
  }
4791
- if (hasFixedt) {
4793
+ if (hasFixed) {
4792
4794
  storeData.fixedData = fixedData;
4793
4795
  }
4794
4796
  if (hasVisible) {