wente
2024-01-12 c21bf35f523ee1430fc5fa02ab1b4171492009b6
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
<template>
  <zt-select v-model="selectValue" url="sys/repairer/listTingTeamByCriteria" :multiple="multiple" :placeholder="placeholder"
           :disabled="disabled"  @change="onSelected"/>
</template>
<script>
 
  export default {
    name: 'TingteamSelector',
    components: {},
    props: {
      value: [String, Array],
      multiple: {
        type: Boolean,
        default: false
      },
      placeholder: String,
      disabled: {
        type: Boolean,
        default: false
      },
    },
    data() {
      return {
        selectValue: this.value || ''
      }
    },
    watch: {
      value(val, oldval) {
        this.selectValue = val
      }
    },
    mounted() {
      this.onSelected()
    },
    methods: {
      onSelected(data) {
        if (this.multiple) {
          this.$emit('input', (this.selectValue || []).join(','))
        } else {
          this.$emit('input', this.selectValue)
        }
      }
    }
  }
</script>