Commit c711b22a authored by jingnan's avatar jingnan 👀

通用试验申请可以进行多架次选择

parent a98a42c3
...@@ -11,6 +11,14 @@ export default { ...@@ -11,6 +11,14 @@ export default {
defaultValue: 'airModel', defaultValue: 'airModel',
name: 'el-input' name: 'el-input'
} }
},
{
key: 'component.multiple',
title: '多选',
disabled: false,
component: {
name: 'el-switch'
}
} }
] ]
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
<template> <template>
<div class="getSorties-select"> <div class="getSorties-select">
<el-select v-model="selVal" placeholder="请选择" size="mini" :disabled="disabledVal" @change="changeVal"> <el-select v-model="selVal" placeholder="请选择" size="mini" :multiple="isMultiple" :disabled="disabledVal" @change="changeVal">
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
default: () => {} default: () => {}
}, },
value: { value: {
type: [Number, String, Object], type: [Number, String, Object, Array],
default: () => '' default: () => ''
} }
}, },
...@@ -49,7 +49,11 @@ export default { ...@@ -49,7 +49,11 @@ export default {
linkageValue: '' linkageValue: ''
} }
}, },
computed: {}, computed: {
isMultiple() {
return this.itemObj.multiple || this.$utils._get(this.itemObj, 'component.multiple') || false
}
},
watch: { watch: {
form: { form: {
immediate: true, immediate: true,
...@@ -82,7 +86,11 @@ export default { ...@@ -82,7 +86,11 @@ export default {
deep: true, deep: true,
handler(v) { handler(v) {
if (v) { if (v) {
this.selVal = this.value if (this.isMultiple) {
this.selVal = this.value && this.value.split(',')
} else {
this.selVal = this.value
}
} }
} }
} }
...@@ -110,7 +118,11 @@ export default { ...@@ -110,7 +118,11 @@ export default {
} }
}, },
changeVal() { changeVal() {
this.$emit('input', this.selVal) if (this.isMultiple) {
this.$emit('input', this.selVal && this.selVal.length > 1 && this.selVal.join(',') || this.selVal[0])
} else {
this.$emit('input', this.selVal)
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment