简历优化和岗位简历

This commit is contained in:
2026-04-13 21:34:40 +08:00
parent a39835be01
commit 1c91818494
32 changed files with 3850 additions and 320 deletions
+31 -10
View File
@@ -275,7 +275,7 @@
<JobFeedbackDialog ref="feedbackDialogRef" v-model="showFeedbackDialog" :job-id="jobId" />
<!-- 岗位专属简历定制弹窗 -->
<JobResumeCustomDialog v-model="showResumeCustomDialog" :job-info="resumeCustomJobInfo" @skip="handleSkipToApply" />
<JobResumeCustomDialog v-model="showResumeCustomDialog" :job-info="resumeCustomJobInfo" :job-id="jobId" @skip="handleSkipToApply" />
</div>
</template>
@@ -289,8 +289,8 @@ import JobPageHeader from '@/components/JobPageHeader.vue'
import JobDislikeDialog from '@/components/JobDislikeDialog.vue'
import JobFeedbackDialog from '@/components/JobFeedbackDialog.vue'
import JobResumeCustomDialog from '@/components/JobResumeCustomDialog.vue'
import { fetchJobDetail, toggleJobFavorite, removeJobFavorite } from '@/api/jobs'
import type { JobDetailData } from '@/api/jobs'
import { fetchJobDetail, toggleJobFavorite, removeJobFavorite, fetchSkillGap } from '@/api/jobs'
import type { JobDetailData, SkillGapData } from '@/api/jobs'
// ==================== 路由相关 ====================
@@ -554,20 +554,41 @@ function handleReport() {
/** 简历定制弹窗显隐 */
const showResumeCustomDialog = ref(false)
/** 传递给简历定制弹窗的岗位信息 */
/** 技能差距分析数据 */
const skillGapData = ref<SkillGapData | null>(null)
/** 传递给简历定制弹窗的岗位信息(从 skill-gap 接口获取) */
const resumeCustomJobInfo = computed(() => ({
title: job.title,
title: skillGapData.value?.job?.title || job.title,
company: job.company,
companyLogoUrl: job.companyLogoUrl,
location: job.location,
matchScore: +(job.matchScore / 10).toFixed(1),
missingSkills: job.requiredSkills.filter(s => !s.matched).map(s => s.name),
keywords: job.requiredSkills.map(s => s.name),
matchScore: skillGapData.value?.score ?? +(job.matchScore / 10).toFixed(1),
missingSkills: skillGapData.value?.missingSkills || [],
keywords: skillGapData.value?.job?.skillTags || job.requiredSkills.map(s => s.name),
sourceUrl: job.sourceUrl,
/** 默认简历信息(来自 skill-gap 接口) */
defaultResume: skillGapData.value?.resume || null,
}))
/** 生成岗位专属简历 — 打开定制弹窗 */
function handleGenerateResume() {
/** 生成岗位专属简历 — 调用 skill-gap 接口后打开定制弹窗 */
async function handleGenerateResume() {
const loadingInstance = ElLoading.service({
text: '正在分析岗位匹配度...',
background: 'rgba(0, 0, 0, 0.5)',
})
try {
const res = await fetchSkillGap(jobId)
if (res.code === 0 && res.data) {
skillGapData.value = res.data
}
} catch (e) {
console.error('技能差距分析失败', e)
ElMessage.error('分析失败,请稍后重试')
return
} finally {
loadingInstance.close()
}
showResumeCustomDialog.value = true
}