Compare commits

2 Commits

Author SHA1 Message Date
冯辉
dcec3cf154 样式优化 2026-03-13 14:52:43 +08:00
冯辉
2d5aca569a 初始化数据优化 2026-03-13 14:46:29 +08:00

View File

@@ -125,7 +125,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, onBeforeMount } from 'vue'; import { ref, reactive, onBeforeMount, watch } from 'vue';
import useDictStore from '@/stores/useDictStore'; import useDictStore from '@/stores/useDictStore';
const { getTransformChildren } = useDictStore(); const { getTransformChildren } = useDictStore();
@@ -174,12 +174,24 @@ const jobTypeOptions = ref([]);
const areaOptions = ref([]); const areaOptions = ref([]);
// 初始化获取数据 // 初始化获取数据
onBeforeMount(() => { const initData = () => {
educationOptions.value = getTransformChildren('education', '学历要求').options || []; educationOptions.value = getTransformChildren('education', '学历要求').options || [];
experienceOptions.value = getTransformChildren('experience', '工作经验').options || []; experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
scaleOptions.value = getTransformChildren('scale', '公司规模').options || []; scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
jobTypeOptions.value = getJobTypeData(); jobTypeOptions.value = getJobTypeData();
areaOptions.value = getTransformChildren('area', '地区').options || []; areaOptions.value = getTransformChildren('area', '地区').options || [];
};
// 组件挂载时初始化数据
onBeforeMount(() => {
initData();
});
// 监听组件显示状态,当显示时重新初始化数据
watch(() => props.show, (newVal) => {
if (newVal) {
initData();
}
}); });
// 处理选项选择 // 处理选项选择
@@ -313,6 +325,7 @@ const handleClose = () => {
.content-section { .content-section {
padding: 0 4%; padding: 0 4%;
overflow-y: auto; overflow-y: auto;
flex: 12;
.radio-item { .radio-item {
display: flex; display: flex;
align-items: center; align-items: center;