feat: 查询组件数据存储到store

This commit is contained in:
fit2cloud-chenyw
2021-05-20 12:02:12 +08:00
parent 6659beae03
commit 3f33dc38db
5 changed files with 93 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<template>
<el-select v-if="options!== null && options.attrs!==null" v-model="values" :multiple="options.attrs.multiple" :placeholder="options.attrs.placeholder" @change="changeValue">
<el-select v-if="options!== null && options.attrs!==null" v-model="options.value" clearable :multiple="options.attrs.multiple" :placeholder="options.attrs.placeholder" @change="changeValue">
<el-option
v-for="item in options.attrs.datas"
:key="item[options.attrs.key]"
@@ -52,6 +52,7 @@ export default {
},
methods: {
changeValue(value) {
this.inDraw && this.$store.dispatch('conditions/add', { component: this.element, value: [this.options.value], operator: this.operator })
this.inDraw && this.$emit('set-condition-value', { component: this.element, value: [value], operator: this.operator })
}
}