=【职业图谱】用户求职岗位更新

This commit is contained in:
2026-04-15 19:22:04 +08:00
parent 8b3523f645
commit 9d0881e6d1
3 changed files with 85 additions and 55 deletions

View File

@@ -1,34 +1,44 @@
import { computed, ref, watch } from 'vue';
import { defineStore } from 'pinia';
import { defineStore, storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import { getCurrentPosition, getPath } from '@/apiRc/service/careerPath';
import { getCareerPath, getSkillResult } from '@/apiRc/service/skillDevelopment';
export const useSkillDevelopmentStore = defineStore('skill-development', () => {
const { userInfo: ui } = storeToRefs(useUserStore());
const userInfo = ref({
userName: '',
professions: [],
skills: []
});
try {
const data = uni.getStorageSync('userInfo');
watch(() => ui.value, () => {
if (!ui.value) {
return;
}
try {
const { jobTitle, appSkillsList } = ui.value;
userInfo.value.professions = data.jobTitle.map((d) => {
return {
label: d,
value: d
};
});
userInfo.value.skills = data.appSkillsList.map((d) => {
return {
label: d.name,
value: d.name
};
});
} catch (e) {
console.warn(e);
}
userInfo.value.professions = jobTitle.map((d) => {
return {
label: d,
value: d
};
});
userInfo.value.skills = appSkillsList.map((d) => {
return {
label: d.name,
value: d.name
};
});
} catch (e) {
console.warn(e);
}
}, {
immediate: true,
deep: true
});
const professionIndex = ref(0);
const profession = ref('');