eoss-ui 0.7.88 → 0.7.89

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/select.js CHANGED
@@ -4716,7 +4716,7 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
4716
4716
  },
4717
4717
  symbol: {
4718
4718
  type: String,
4719
- default: ''
4719
+ default: ','
4720
4720
  },
4721
4721
  plain: Boolean,
4722
4722
  where: Object,
@@ -5185,8 +5185,12 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
5185
5185
  if (!this.hide) {
5186
5186
  if (this.readonly) {
5187
5187
  var dom = [];
5188
- if (Array.isArray(this.models)) {
5189
- dom = this.models.map(function (item) {
5188
+ var models = JSON.parse(JSON.stringify(this.models));
5189
+ if (models.includes(',')) {
5190
+ models = models.split(',');
5191
+ }
5192
+ if (Array.isArray(models)) {
5193
+ dom = models.map(function (item) {
5190
5194
  if (util["a" /* default */].isObject(item)) {
5191
5195
  if (!item[_this8.label] && !item.label) {
5192
5196
  return _this8.getLabel(value[_this8.valKey], data);
@@ -5195,15 +5199,16 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
5195
5199
  }
5196
5200
  return _this8.getLabel(item, _this8.results);
5197
5201
  });
5198
- } else if (util["a" /* default */].isObject(this.models)) {
5199
- if (!this.models[this.label] && !this.models.label) {
5200
- dom = [this.getLabel(this.models[this.valKey], this.results)];
5202
+ } else if (util["a" /* default */].isObject(models)) {
5203
+ if (!models[this.label] && !models.label) {
5204
+ dom = [this.getLabel(models[this.valKey], this.results)];
5201
5205
  } else {
5202
- dom = [this.models[this.label] || this.models.label];
5206
+ dom = [models[this.label] || models.label];
5203
5207
  }
5204
5208
  } else {
5205
- dom = [this.getLabel(this.models, this.results)];
5209
+ dom = [this.getLabel(models, this.results)];
5206
5210
  }
5211
+ console.log('dom', dom);
5207
5212
  return h('div', {
5208
5213
  class: [{
5209
5214
  'es-plain': this.plain,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.7.88",
3
+ "version": "0.7.89",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -660,6 +660,7 @@ export default {
660
660
  },
661
661
  isForm() {
662
662
  let type = this.type ? this.type.toLowerCase() : '';
663
+ console.log('type', type);
663
664
  let flag =
664
665
  (this.form &&
665
666
  [
@@ -799,6 +800,7 @@ export default {
799
800
  return Array.isArray(types) ? types.includes(type) : type == types;
800
801
  },
801
802
  getOptions(config) {
803
+ console.log('getOptions config', config);
802
804
  let option = config && config[this.field || this.prop];
803
805
  return option && typeof option == 'object'
804
806
  ? { ...this.formOption, ...option }
@@ -816,14 +818,19 @@ export default {
816
818
  const field = this.field || this.prop;
817
819
  let data = this.option;
818
820
  let str = '';
819
- if (util.isObject(rows[field])) {
821
+ console.log('rows[field]', rows[field]);
822
+ let column = rows[field]?JSON.parse(JSON.stringify(rows[field])):'';
823
+ if(column.includes(',')){
824
+ column = column.split(',');
825
+ }
826
+ if (util.isObject(column)) {
820
827
  str =
821
- rows[field][this.labelKey] ||
822
- rows[field]['name'] ||
823
- rows[field]['label'] ||
824
- rows[field]['shortName'];
825
- } else if (Array.isArray(rows[field])) {
826
- const vals = rows[field].map((item) => {
828
+ column[this.labelKey] ||
829
+ column['name'] ||
830
+ column['label'] ||
831
+ column['shortName'];
832
+ } else if (Array.isArray(column)) {
833
+ const vals = column.map((item) => {
827
834
  if (util.isObject(item)) {
828
835
  return (
829
836
  item[this.labelKey] ||
@@ -838,21 +845,21 @@ export default {
838
845
  return item;
839
846
  }
840
847
  });
841
- str = vals.join(this.symbol ? this.symbol : '-');
848
+ str = vals.join(this.symbol ? this.symbol : ',');
842
849
  } else {
843
850
  if (this.valueToString) {
844
- const vals = rows[field].split(',').map((item) => {
851
+ const vals = column.split(',').map((item) => {
845
852
  if (data && data.length && util.isObject(data[0])) {
846
853
  return this.getLabel(data, item);
847
854
  }
848
855
  return item;
849
856
  });
850
- str = vals.join(this.symbol ? this.symbol : '-');
857
+ str = vals.join(this.symbol ? this.symbol : ',');
851
858
  } else {
852
859
  if (data && data.length && util.isObject(data[0])) {
853
- str = this.getLabel(data, rows[field]);
860
+ str = this.getLabel(data, column);
854
861
  } else {
855
- str = rows[field];
862
+ str = column;
856
863
  }
857
864
  }
858
865
  }