This commit is contained in:
冯辉
2026-03-12 23:23:18 +08:00
parent 06a92f2e97
commit 94439fddaa
2 changed files with 64 additions and 40 deletions

View File

@@ -108,7 +108,8 @@
<script setup>
import { ref, reactive, onBeforeMount } from 'vue';
import useDictStore from '@/stores/useDictStore';
const { getTransformChildren } = useDictStore();
const dictStore = useDictStore();
const { getTransformChildren } = dictStore;
const props = defineProps({
show: Boolean,
@@ -151,12 +152,24 @@ const experienceOptions = ref([]);
const scaleOptions = ref([]);
const jobTypeOptions = ref([]);
// 加载状态
const loading = ref(true);
// 初始化获取数据
onBeforeMount(() => {
educationOptions.value = getTransformChildren('education', '学历要求').options || [];
experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
jobTypeOptions.value = getJobTypeData();
onBeforeMount(async () => {
try {
// 先获取字典数据
await dictStore.getDictData();
// 再初始化选项数据
educationOptions.value = getTransformChildren('education', '学历要求').options || [];
experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
jobTypeOptions.value = getJobTypeData();
} catch (error) {
console.error('获取字典数据失败:', error);
} finally {
loading.value = false;
}
});
// 处理选项选择