<!-- 评估管理-创建评估页面 -->
<template>
  <a-select
      :getPopupContainer="
                          (triggerNode) => {
                            return triggerNode.parentNode || document.body;
                          }
                        "
      v-model:value="id"
      placeholder="请选择分类"
      style="width: 100%"
      :options="options"
      allowClear
      @change="change"
      :disabled="disabled"
  >
  </a-select>
</template>
<script setup>
import {computed, defineEmits, defineProps, onMounted, ref} from "vue";
import {useStore} from "vuex";

const store = useStore();

const props = defineProps({
  value: String,
  disabled: String
})
const emit = defineEmits({})

const options = ref([])

const id = computed(() => {
  return props.value
})

onMounted(() => {
  options.value = store.state.projectClass.map(e => ({value: parseInt(e.dictCode), label: e.dictName}))
})

function change(key, obj) {
  emit('update:name', obj[0])
  emit('update:value', key)
}

</script>
