vxe-table 4.11.21 → 4.11.22

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.
@@ -1351,7 +1351,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
1351
1351
  fullColumnFieldData[field] = rest;
1352
1352
  } else {
1353
1353
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
1354
- (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
1354
+ (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
1355
1355
  }
1356
1356
  }
1357
1357
  if (!hasFixed && fixed) {
@@ -6686,8 +6686,15 @@ var _default = exports.default = (0, _vue.defineComponent)({
6686
6686
  collectColumn
6687
6687
  } = internalData;
6688
6688
  const {
6689
+ storage,
6689
6690
  checkMethod
6690
6691
  } = customOpts;
6692
+ const isAllCustom = storage === true;
6693
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
6694
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
6695
+ const isCustomVisible = isAllCustom || storageOpts.visible;
6696
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
6697
+ const isCustomSort = isAllCustom || storageOpts.sort;
6691
6698
  const resizableData = {};
6692
6699
  const sortData = {};
6693
6700
  const visibleData = {};
@@ -6707,45 +6714,35 @@ var _default = exports.default = (0, _vue.defineComponent)({
6707
6714
  let hasFixed = 0;
6708
6715
  let hasVisible = 0;
6709
6716
  _xeUtils.default.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
6717
+ const colKey = column.getKey();
6718
+ if (!colKey) {
6719
+ (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
6720
+ return;
6721
+ }
6710
6722
  // 只支持一级
6711
6723
  if (!parentColumn) {
6712
- collectColumn.forEach(column => {
6713
- const colKey = column.getKey();
6714
- if (colKey) {
6715
- hasSort = 1;
6716
- sortData[colKey] = column.renderSortNumber;
6717
- }
6718
- });
6719
- if (column.fixed !== column.defaultFixed) {
6720
- const colKey = column.getKey();
6721
- if (colKey) {
6722
- hasFixed = 1;
6723
- fixedData[colKey] = column.fixed;
6724
- }
6724
+ if (isCustomSort) {
6725
+ hasSort = 1;
6726
+ sortData[colKey] = column.renderSortNumber;
6725
6727
  }
6726
- }
6727
- if (column.resizeWidth) {
6728
- const colKey = column.getKey();
6729
- if (colKey) {
6730
- hasResizable = 1;
6731
- resizableData[colKey] = column.renderWidth;
6728
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
6729
+ hasFixed = 1;
6730
+ fixedData[colKey] = column.fixed;
6732
6731
  }
6733
6732
  }
6734
- if (!checkMethod || checkMethod({
6733
+ if (isCustomResizable && column.resizeWidth) {
6734
+ hasResizable = 1;
6735
+ resizableData[colKey] = column.renderWidth;
6736
+ }
6737
+ if (isCustomVisible && (!checkMethod || checkMethod({
6735
6738
  column
6736
- })) {
6739
+ }))) {
6737
6740
  if (!column.visible && column.defaultVisible) {
6738
- const colKey = column.getKey();
6739
- if (colKey) {
6740
- hasVisible = 1;
6741
- visibleData[colKey] = false;
6742
- }
6741
+ hasVisible = 1;
6742
+ visibleData[colKey] = false;
6743
6743
  } else if (column.visible && !column.defaultVisible) {
6744
- const colKey = column.getKey();
6745
- if (colKey) {
6746
- hasVisible = 1;
6747
- visibleData[colKey] = true;
6748
- }
6744
+ hasVisible = 1;
6745
+ visibleData[colKey] = true;
6749
6746
  }
6750
6747
  }
6751
6748
  });