<template>
  <el-select
    v-model="localActivityField"
    prop="localActivityField"
    :placeholder="placeholder"
    style="width: 100% !important;"
    :disabled="disabled"
    :multiple="multiple"
    filterable
    clearable
  >
    <el-option
      v-for="item in dict.type[DictType.ACTIVITY_BASE_FIELD]"
      :key="item.value"
      :label="item.label"
      :value="item.value"
      :disabled="fieldRange && fieldRange.length > 0 ? !fieldRange.includes(item.value) : false"
    />
  </el-select>
</template>

<script>
import DictType from '@/utils/dict/DictType'

export default {
  name: 'SelectActivityField',
  dicts: [DictType.ACTIVITY_BASE_FIELD],
  model: {
    prop: 'value',
    event: 'update:value'
  },
  props: {
    value: {
      type: String,
      default: null
    },
    placeholder: {
      type: String,
      default: '请选择活动领域'
    },
    disabled: {
      type: Boolean,
      default: () => false
    },
    multiple: {
      type: Boolean,
      default: () => false
    },
    fieldRange: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      DictType
    }
  },
  computed: {
    localActivityField: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('update:value', val)
      }
    }
  }
}
</script>

<style scoped>

</style>
