gyyg-components 0.2.17 → 0.2.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gyyg-components",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  </template>
11
11
 
12
- <el-descriptions-item v-for="(item, index) in detailsData" :key="index" :label="item.label">
12
+ <el-descriptions-item v-for="(item, index) in detailsData" :key="index" :label="item.label" :span="item.span || 1">
13
13
  <div v-if="item.type === 'img'">
14
14
  <el-image
15
15
  v-for="(url, index) in item.value"
@@ -93,4 +93,7 @@ export default {
93
93
  /deep/ .el-descriptions-item__label {
94
94
  white-space: nowrap;
95
95
  }
96
+ /deep/ .el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
97
+ white-space: pre-wrap;
98
+ }
96
99
  </style>
@@ -76,7 +76,7 @@ export default {
76
76
  watch: {
77
77
  value: {
78
78
  handler (val) {
79
- this.checkbox = [].concat(val);
79
+ this.checkbox = [].concat(val)
80
80
  },
81
81
  immediate: true
82
82
  },
@@ -85,6 +85,10 @@ export default {
85
85
  //判断options是否为promise
86
86
  if (typeof val !== 'function' && val && !val.then) {
87
87
  this.option = this.options;
88
+ let nameList = this.getNameListByIds(this.value, this.option)
89
+ this.inputDisabled = nameList.filter(item => {
90
+ return item.includes(this.checkText)
91
+ }).length == 0
88
92
  }
89
93
  },
90
94
  deep: true,
@@ -93,7 +97,9 @@ export default {
93
97
  otherValue: {
94
98
  handler(val) {
95
99
  this.inputValue = val;
96
- }
100
+ console.log(val, 'otherValue')
101
+ },
102
+ immediate: true
97
103
  }
98
104
  },
99
105
  mounted() {
@@ -101,17 +107,26 @@ export default {
101
107
  if(this.options instanceof Promise) {
102
108
  this.options.then(val => {
103
109
  this.option = val.data || val;
110
+ let nameList = this.getNameListByIds(this.value, this.option)
111
+ this.inputDisabled = nameList.filter(item => {
112
+ return item.includes(this.checkText)
113
+ }).length == 0
104
114
  });
105
115
  }
106
116
  if(typeof this.options == 'function') {
107
117
  this.options().then(val => {
108
118
  this.option = val.data || val;
119
+ let nameList = this.getNameListByIds(this.value, this.option)
120
+ this.inputDisabled = nameList.filter(item => {
121
+ return item.includes(this.checkText)
122
+ }).length == 0
109
123
  });
110
124
  }
111
125
 
112
126
  } else {
113
127
  this.option = this.options;
114
128
  }
129
+
115
130
  },
116
131
  computed: {
117
132
  checkboxAll () {
@@ -135,6 +150,7 @@ export default {
135
150
  this.inputDisabled = nameList.filter(item => {
136
151
  return item.includes(this.checkText)
137
152
  }).length == 0
153
+ console.log(this.inputDisabled, 'this.inputDisabledthis.inputDisabledthis.inputDisabled')
138
154
  },
139
155
  // 根据 id 数组获取对应的 name 列表
140
156
  getNameListByIds(ids, array) {
@@ -94,11 +94,14 @@
94
94
  },
95
95
  // 文本域行数(当type为'textarea'时有效)
96
96
  rows: {
97
- default: 1
97
+ default: 2
98
98
  },
99
99
  // 文本域是否自适应大小(当type为'textarea'时有效)
100
100
  autosize: {
101
- default: false
101
+ type: [Boolean, Object],
102
+ default: () => {
103
+ return { minRows: 2 }
104
+ }
102
105
  },
103
106
  prependText: {
104
107
  type: String,