n20-common-lib 2.5.52 → 2.5.55
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
|
@@ -117,6 +117,9 @@ export default {
|
|
|
117
117
|
const calcWidth = (value, type) => {
|
|
118
118
|
let W = null
|
|
119
119
|
if (!value) {
|
|
120
|
+
if (type) {
|
|
121
|
+
return w + 100 + 'px'
|
|
122
|
+
}
|
|
120
123
|
return w + 'px'
|
|
121
124
|
}
|
|
122
125
|
if (getWidth(value, type) > w) {
|
|
@@ -126,22 +129,31 @@ export default {
|
|
|
126
129
|
W = getWidth(value, type)
|
|
127
130
|
}
|
|
128
131
|
} else {
|
|
129
|
-
|
|
132
|
+
if (type) {
|
|
133
|
+
W = w ? w : asciiWidth(item.placeholder || typeEnum[item.type]) + 40 + 100
|
|
134
|
+
} else {
|
|
135
|
+
W = w ? w : asciiWidth(item.placeholder || typeEnum[item.type]) + 40
|
|
136
|
+
}
|
|
130
137
|
}
|
|
131
138
|
return W + 'px'
|
|
132
139
|
}
|
|
133
140
|
|
|
134
|
-
const calcSelectWidth = (value) => {
|
|
141
|
+
const calcSelectWidth = (value, type) => {
|
|
135
142
|
let W = null
|
|
136
143
|
if (!value) {
|
|
137
144
|
return w + 'px'
|
|
138
145
|
} else {
|
|
139
146
|
let label = item.options.find((res) => (res.value || res[item.props.valueKey]) === value)?.label
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
const width = getWidth(label)
|
|
148
|
+
if (width > w) {
|
|
149
|
+
if (width > MAX_WIDTH) {
|
|
142
150
|
W = MAX_WIDTH
|
|
143
151
|
} else {
|
|
144
|
-
|
|
152
|
+
if (type) {
|
|
153
|
+
W = width + 45
|
|
154
|
+
} else {
|
|
155
|
+
W = width
|
|
156
|
+
}
|
|
145
157
|
}
|
|
146
158
|
} else {
|
|
147
159
|
W = w
|
|
@@ -257,7 +269,7 @@ export default {
|
|
|
257
269
|
collapseTags: true
|
|
258
270
|
},
|
|
259
271
|
style: {
|
|
260
|
-
width: calcSelectWidth(form[item.value])
|
|
272
|
+
width: calcSelectWidth(form[item.value], item.multiple)
|
|
261
273
|
},
|
|
262
274
|
props: selectProps,
|
|
263
275
|
|
|
@@ -120,6 +120,9 @@ export default {
|
|
|
120
120
|
let item = this.GroupData.find((f) => f[this.onlyKey] === id)
|
|
121
121
|
if (item) {
|
|
122
122
|
item.options = opts || []
|
|
123
|
+
} else {
|
|
124
|
+
item = this.GroupData.find((f) => f.value === id)
|
|
125
|
+
item.options = opts || []
|
|
123
126
|
}
|
|
124
127
|
},
|
|
125
128
|
filter() {
|
|
@@ -195,6 +198,7 @@ export default {
|
|
|
195
198
|
},
|
|
196
199
|
|
|
197
200
|
check(keys) {
|
|
201
|
+
this.$emit('check')
|
|
198
202
|
// 保存当前选择的过滤条件
|
|
199
203
|
this.checkList = keys
|
|
200
204
|
let saveCheckArr = []
|
|
@@ -166,7 +166,6 @@
|
|
|
166
166
|
</div>
|
|
167
167
|
</dialogWrap>
|
|
168
168
|
<div slot="footer" class="text-c">
|
|
169
|
-
<el-button type="primary" v-has="isHas" @click="handleInitialize">{{ '初始化' | $lc }}</el-button>
|
|
170
169
|
<el-button type="primary" @click="setChange">{{ '确定' | $lc }}</el-button>
|
|
171
170
|
<el-button plain @click="reset">{{ '恢复默认' | $lc }}</el-button>
|
|
172
171
|
</div>
|