Commit c711b22a authored by jingnan's avatar jingnan 👀

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

parent a98a42c3
......@@ -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,
......@@ -82,10 +86,14 @@ export default {
deep: true,
handler(v) {
if (v) {
if (this.isMultiple) {
this.selVal = this.value && this.value.split(',')
} else {
this.selVal = this.value
}
}
}
}
},
created() {
// 初始化数据
......@@ -110,9 +118,13 @@ export default {
}
},
changeVal() {
if (this.isMultiple) {
this.$emit('input', this.selVal && this.selVal.length > 1 && this.selVal.join(',') || this.selVal[0])
} else {
this.$emit('input', this.selVal)
}
}
}
}
</script>
<style lang='scss'>
......
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