<template>
    <!-- <mx-form-item v-if="disabled" v-model="model.examType" label="考生类别"/> -->
    <mx-form-item prop="examType" label="考生类别">
        <mx-picker :disabled="disabled" v-model="model.examType" :data="examTypeOptions" label-prop="dictLabel" value-prop="dictValue" placeholder="请选择考生类别"/>
    </mx-form-item>
    <template v-if="isModelCultural">
        <mx-form-item v-if="disabled" v-model="model.examMajorName" label="专业类别" disabled/>
        <mx-form-item v-else prop="examMajor" label="专业类别">
            <mx-picker v-model="model.examMajor" :data="examMajorOptions" label-prop="name" value-prop="code"
                       placeholder="请选择专业类别" @change="model.examMajorName=$event.name"/>
        </mx-form-item>
    </template>
</template>

<script setup>
import {useInjectFormData} from "@/pagesOther/pages/login/components/hooks/useFormDataInjection";
import {useExamTypeService} from "@/pagesOther/pages/login/components/hooks/useExamTypeService";
import {createPropDefine} from "@/utils";

const props = defineProps({
    // examType,examMajor一般同时起效，定义一个disabled属性即可
    disabled: createPropDefine(false, Boolean)
})

const [model] = useInjectFormData()
const {isModelCultural, examTypeOptions, examMajorOptions} = useExamTypeService(props)
console.log(examTypeOptions, props, 12)
</script>

<style scoped>

</style>