<template>
    <div class="p-3">
        <div class="bg-fff flex1 ov-hd d-flex flex-cln">
            <div class="d-flex a-c pd-16 border-bottom">
                <div class="f-s-20 c-333 f-w-7 mr-10">抽取专家审核</div>
                <el-button @click="router.go(-1)" type="primary" text>
                    <el-icon>
                        <Back />
                    </el-icon>
                    返回上一级
                </el-button>
            </div>
            <div class="flex1 over-auto"></div>
            <div class="d-flex a-c j-c pd-16">
                <el-button @click="router.go(-1)">取消</el-button>
                <!-- <el-button @click="save" type="primary">提交</el-button> -->
            </div>
        </div>
    </div>
</template>

<script setup name="authority-input" lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { debounce } from 'lodash';
import { useRouter } from 'vue-router';
import { expertPersonAdd, expertPersonUpdate, expertPersonDetail } from '@/api/authority';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_sex_type, dm_educational_type, dm_person_type, dm_position_status } = toRefs<any>(proxy?.useDict('sys_sex_type', 'dm_educational_type', 'dm_person_type', 'dm_position_status'));
const router = useRouter();
const route = useRoute();
const form = ref<any>({
    id: undefined,
    avatar: '',
    name: '',
    sex: '0',
    status: '1',
    attachment: []
});

// 获取专家详情
const getExpertDetail = async () => {
    if (route.query?.id) {
        const res = await expertPersonDetail(route.query.id);
        if (!res || res.code !== 200) return;
        form.value = res.data;
    }
};
onMounted(() => {
    getExpertDetail();
});
</script>
