1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
| <template>
| <div>
| <el-form-item :label="label" :prop="prop">
| <el-select v-model="svalue" filterable :multiple="multiple" :collapse-tags="multiple" placeholder="请选择">
| <el-option v-for="item in options" :key="item.value" :label="item.valueDesc" :value="item.value"> </el-option>
| </el-select>
| </el-form-item>
| </div>
| </template>
|
| <script>
| import { projectQrycondition } from '@/api/area'
| export default {
| props: ['multiple', 'value', 'codeNo', 'label', 'prop'],
| data: function() {
| return {
| options: []
| }
| },
| created() {
| this.selectLoad()
| },
| computed: {
| svalue: {
| get() {
| if (this.multiple) {
| let arr = this.value.split(',').filter(Boolean)
| return arr
| } else {
| return this.value
| }
| },
| set(newVal) {
| if (this.multiple) {
| this.$emit('input', newVal.join())
| } else {
| this.$emit('input', newVal)
| }
| }
| }
| },
| methods: {
| selectLoad() {
| projectQrycondition({ conditionName: this.codeNo }).then(res => {
| this.options = res.result
| })
| }
| }
| }
| </script>
|
| <style scoped></style>
|
|