OperatorSelect.vue 816 Bytes
Newer Older
姜雷 committed
1 2 3 4 5 6 7 8
<template>
  <el-select
    clearable
    filterable
    :value="value"
    @change="changeHandle"
  >
    <el-option
姜雷 committed
9
      v-for="(item, index) in optionsList"
姜雷 committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
      :key="index"
      :value="item.id"
      :label="item.operateName"
    ></el-option>
  </el-select>
</template>

<script>
import operatorMixin from './mixin.js';

export default {
  name: 'operator-select',
  props: {
    size: {
      type: String,
      default: '',
    },
    value: {
      type: Number,
      default: null,
    },
  },
姜雷 committed
32 33 34 35 36 37

  computed: {
    optionsList() {
      return this[`operatorOptionList${this.accessType}`];
    },
  },
姜雷 committed
38 39 40 41 42 43 44 45 46 47 48 49 50
  mixins: [operatorMixin],
  methods: {
    changeHandle(val) {
      if (!val) {
        this.$emit('input', null);
      } else {
        this.$emit('input', val);
      }
    },
  },
};
</script>