vxe-table 3.13.22 → 3.13.24

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.
@@ -269,7 +269,7 @@ function cacheColumnMap($xeTable) {
269
269
  fullColumnFieldData[field] = rest;
270
270
  } else {
271
271
  if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
272
- (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
272
+ (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
273
273
  }
274
274
  }
275
275
  if (!hasFixed && fixed) {
@@ -4624,14 +4624,26 @@ const Methods = {
4624
4624
  }
4625
4625
  },
4626
4626
  getCustomStoreData() {
4627
+ const $xeTable = this;
4628
+ const props = $xeTable;
4629
+ const internalData = $xeTable;
4630
+ const {
4631
+ id
4632
+ } = props;
4633
+ const customOpts = $xeTable.computeCustomOpts;
4627
4634
  const {
4628
- id,
4629
- customOpts,
4630
4635
  collectColumn
4631
- } = this;
4636
+ } = internalData;
4632
4637
  const {
4638
+ storage,
4633
4639
  checkMethod
4634
4640
  } = customOpts;
4641
+ const isAllCustom = storage === true;
4642
+ const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
4643
+ const isCustomResizable = isAllCustom || storageOpts.resizable;
4644
+ const isCustomVisible = isAllCustom || storageOpts.visible;
4645
+ const isCustomFixed = isAllCustom || storageOpts.fixed;
4646
+ const isCustomSort = isAllCustom || storageOpts.sort;
4635
4647
  const resizableData = {};
4636
4648
  const sortData = {};
4637
4649
  const visibleData = {};
@@ -4648,48 +4660,38 @@ const Methods = {
4648
4660
  }
4649
4661
  let hasResizable = 0;
4650
4662
  let hasSort = 0;
4651
- let hasFixedt = 0;
4663
+ let hasFixed = 0;
4652
4664
  let hasVisible = 0;
4653
4665
  _xeUtils.default.eachTree(collectColumn, (column, index, items, path, parentColumn) => {
4666
+ const colKey = column.getKey();
4667
+ if (!colKey) {
4668
+ (0, _log.errLog)('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
4669
+ return;
4670
+ }
4654
4671
  // 只支持一级
4655
4672
  if (!parentColumn) {
4656
- collectColumn.forEach(column => {
4657
- const colKey = column.getKey();
4658
- if (colKey) {
4659
- hasSort = 1;
4660
- sortData[colKey] = column.renderSortNumber;
4661
- }
4662
- });
4663
- if (column.fixed !== column.defaultFixed) {
4664
- const colKey = column.getKey();
4665
- if (colKey) {
4666
- hasFixedt = 1;
4667
- fixedData[colKey] = column.fixed;
4668
- }
4673
+ if (isCustomSort) {
4674
+ hasSort = 1;
4675
+ sortData[colKey] = column.renderSortNumber;
4669
4676
  }
4670
- }
4671
- if (column.resizeWidth) {
4672
- const colKey = column.getKey();
4673
- if (colKey) {
4674
- hasResizable = 1;
4675
- resizableData[colKey] = column.renderWidth;
4677
+ if (isCustomFixed && column.fixed !== column.defaultFixed) {
4678
+ hasFixed = 1;
4679
+ fixedData[colKey] = column.fixed;
4676
4680
  }
4677
4681
  }
4678
- if (!checkMethod || checkMethod({
4682
+ if (isCustomResizable && column.resizeWidth) {
4683
+ hasResizable = 1;
4684
+ resizableData[colKey] = column.renderWidth;
4685
+ }
4686
+ if (isCustomVisible && (!checkMethod || checkMethod({
4679
4687
  column
4680
- })) {
4688
+ }))) {
4681
4689
  if (!column.visible && column.defaultVisible) {
4682
- const colKey = column.getKey();
4683
- if (colKey) {
4684
- hasVisible = 1;
4685
- visibleData[colKey] = false;
4686
- }
4690
+ hasVisible = 1;
4691
+ visibleData[colKey] = false;
4687
4692
  } else if (column.visible && !column.defaultVisible) {
4688
- const colKey = column.getKey();
4689
- if (colKey) {
4690
- hasVisible = 1;
4691
- visibleData[colKey] = true;
4692
- }
4693
+ hasVisible = 1;
4694
+ visibleData[colKey] = true;
4693
4695
  }
4694
4696
  }
4695
4697
  });
@@ -4699,7 +4701,7 @@ const Methods = {
4699
4701
  if (hasSort) {
4700
4702
  storeData.sortData = sortData;
4701
4703
  }
4702
- if (hasFixedt) {
4704
+ if (hasFixed) {
4703
4705
  storeData.fixedData = fixedData;
4704
4706
  }
4705
4707
  if (hasVisible) {