<script lang="ts" setup name="ModelObjectOAMSelector">
const props = withDefaults(defineProps<{
  modelValue: number
}>(), {
  modelValue: 0,
})
const emit = defineEmits(['update:modelValue'])
interface ObjectOAM {
  oamId: number
  oamTitle: string
}
const oamId = computed({
  get: () => {
    return props.modelValue
  },
  set: (val) => {
    emit('update:modelValue', val)
  },
})
const state = reactive({
  loading: false,
  dataList: [
    { oamId: 1, oamTitle: '新增' },
    { oamId: 2, oamTitle: '修改' },
    { oamId: 3, oamTitle: '删除' },
  ] as ObjectOAM[],
})

const getData = async () => {

}
onMounted(() => {
})
</script>

<template>
  <el-select v-model="oamId" v-loading="state.loading" style="width: 100%" placeholder="请选择数据模型" value-key="oamId">
    <el-option key="0" label="请选择" :value="0" disabled />
    <el-option
      v-for="item in state.dataList"
      :key="item.oamId"
      :label="item.oamTitle"
      :value="item.oamId"
    />
  </el-select>
</template>
