Commit 218251e1 authored by jingnan's avatar jingnan 👀

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

parent 0f9923ea
......@@ -11,6 +11,14 @@ export default {
defaultValue: 'airModel',
name: 'el-input'
}
},
{
key: 'component.multiple',
title: '多选',
disabled: false,
component: {
name: 'el-switch'
}
}
]
}
......
......@@ -5,7 +5,7 @@
*/
<template>
<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
v-for="item in options"
:key="item.value"
......@@ -37,7 +37,7 @@ export default {
default: () => {}
},
value: {
type: [Number, String, Object],
type: [Number, String, Object, Array],
default: () => ''
}
},
......@@ -49,7 +49,11 @@ export default {
linkageValue: ''
}
},
computed: {},
computed: {
isMultiple() {
return this.itemObj.multiple || this.$utils._get(this.itemObj, 'component.multiple') || false
}
},
watch: {
form: {
immediate: true,
......@@ -81,7 +85,11 @@ export default {
deep: true,
handler(v) {
if (v) {
this.selVal = this.value
if (this.isMultiple) {
this.selVal = this.value && this.value.split(',')
} else {
this.selVal = this.value
}
}
}
}
......@@ -109,7 +117,11 @@ export default {
}
},
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