bug处理
This commit is contained in:
+129
-1
@@ -216,6 +216,8 @@
|
||||
</div>
|
||||
<!-- 不再显示 -->
|
||||
<span v-if="isRecommendTab" class="jobs-page__hide-btn" @click.stop="openDislikeDialog(job)">不再显示</span>
|
||||
<!-- 查看简历快照(仅已投递列表显示) -->
|
||||
<span v-if="activeTab === 'applied'" class="jobs-page__hide-btn" @click.stop="handleViewResumeSnapshot(job)">查看简历快照</span>
|
||||
</div>
|
||||
|
||||
<!-- 最右侧:匹配度 -->
|
||||
@@ -328,6 +330,35 @@
|
||||
<!-- 会员购买弹窗 -->
|
||||
<MemberDialog v-model="showMemberDialog" />
|
||||
|
||||
<!-- 简历快照预览抽屉(从右侧弹出) -->
|
||||
<Teleport to="body">
|
||||
<Transition name="jobs-resume-drawer">
|
||||
<div v-if="showResumeSnapshotDrawer" class="jobs-resume-drawer-mask" @click.self="closeResumeSnapshotDrawer">
|
||||
<div class="jobs-resume-drawer">
|
||||
<!-- 顶部标题栏 -->
|
||||
<div class="jobs-resume-drawer__header">
|
||||
<div class="jobs-resume-drawer__header-left">
|
||||
<div class="jobs-resume-drawer__close" @click="closeResumeSnapshotDrawer">
|
||||
<svg viewBox="0 0 24 24" fill="none" class="jobs-resume-drawer__close-icon">
|
||||
<path d="M18 6L6 18M6 6l12 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="jobs-resume-drawer__title">简历快照</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 简历内容 -->
|
||||
<div class="jobs-resume-drawer__body">
|
||||
<div v-if="resumeSnapshotLoading" class="jobs-resume-drawer__loading">
|
||||
<div class="jobs-page__loading-spinner"></div>
|
||||
<span>加载中...</span>
|
||||
</div>
|
||||
<JobResumeTemplate v-else-if="resumeSnapshotData" :resume-data="resumeSnapshotData" mode="preview" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -347,13 +378,15 @@ import JobCategorySelector from '@/components/tools/JobCategorySelector.vue'
|
||||
import RegionSelector from '@/components/tools/RegionSelector.vue'
|
||||
|
||||
|
||||
import { fetchJobList, fetchFavoriteList, toggleJobFavorite, removeJobFavorite, fetchFavoriteCount, fetchApplyList, fetchApplyCount, removeJobFromList } from '@/api/jobs'
|
||||
import { fetchJobList, fetchFavoriteList, toggleJobFavorite, removeJobFavorite, fetchFavoriteCount, fetchApplyList, fetchApplyCount, removeJobFromList, fetchCustomizeResume } from '@/api/jobs'
|
||||
import type { JobListItem, JobListParams, FavoriteListParams, ApplyListParams, ApplyCountData } from '@/api/jobs'
|
||||
import { getTimeEvent, setTimeEvent, timestampToLocalDateTime } from '@/utils/time'
|
||||
import { fetchIndustryTree, fetchJobCategoryTree } from '@/api/common'
|
||||
import type { IndustryItem, JobCategoryItem } from '@/api/common'
|
||||
import { fetchAgentConfig, applyJob } from '@/api/agent'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import JobResumeTemplate from '@/components/JobResumeTemplate.vue'
|
||||
import type { ResumeTemplateData } from '@/components/JobResumeTemplate.vue'
|
||||
|
||||
|
||||
// 2. 注意:这里的字符串不需要再手动转义双引号了
|
||||
@@ -1524,4 +1557,99 @@ function openFeedbackDialog(job: JobItem) {
|
||||
feedbackDialogRef.value?.resetForm()
|
||||
showFeedbackDialog.value = true
|
||||
}
|
||||
|
||||
// ==================== 简历快照抽屉 ====================
|
||||
|
||||
/** 简历快照抽屉是否显示 */
|
||||
const showResumeSnapshotDrawer = ref(false)
|
||||
|
||||
/** 简历快照加载状态 */
|
||||
const resumeSnapshotLoading = ref(false)
|
||||
|
||||
/** 简历快照数据 */
|
||||
const resumeSnapshotData = ref<ResumeTemplateData | null>(null)
|
||||
|
||||
/** 学历文字转数字 */
|
||||
function degreeToNumber(degree?: string): number {
|
||||
const map: Record<string, number> = { '大专': 1, '本科': 2, '硕士': 3, '博士': 4 }
|
||||
return map[degree || ''] || 2
|
||||
}
|
||||
|
||||
/** 将匹配度接口返回的简历数据映射为 ResumeTemplateData */
|
||||
function mapResumeToTemplate(data: any): ResumeTemplateData {
|
||||
const r = data.resume || {}
|
||||
return {
|
||||
name: r.name || '未填写姓名',
|
||||
email: r.email || '',
|
||||
mobileNumber: r.mobileNumber || '',
|
||||
wechatNumber: r.wechatNumber || '',
|
||||
summary: r.summary || '',
|
||||
educations: (data.education || []).map((e: any) => ({
|
||||
school: e.school || '',
|
||||
major: e.major || '',
|
||||
degree: degreeToNumber(e.degree),
|
||||
startDate: e.startDate || '',
|
||||
endDate: e.endDate || '',
|
||||
description: (e.description || []).map((d: any) => ({ id: d.id, text: d.text || '' })),
|
||||
})),
|
||||
workExperiences: (data.work || []).map((w: any) => ({
|
||||
companyName: w.companyName || '',
|
||||
position: w.position || '',
|
||||
startDate: w.startDate || '',
|
||||
endDate: w.endDate || '',
|
||||
description: (w.description || []).map((d: any) => ({ id: d.id, text: d.text || '' })),
|
||||
})),
|
||||
internships: (data.internship || []).map((i: any) => ({
|
||||
companyName: i.companyName || '',
|
||||
position: i.position || '',
|
||||
startDate: i.startDate || '',
|
||||
endDate: i.endDate || '',
|
||||
description: (i.description || []).map((d: any) => ({ id: d.id, text: d.text || '' })),
|
||||
})),
|
||||
projects: (data.project || []).map((p: any) => ({
|
||||
projectName: p.projectName || '',
|
||||
companyName: p.companyName || '',
|
||||
role: p.role || '',
|
||||
startDate: p.startDate || '',
|
||||
endDate: p.endDate || '',
|
||||
description: (p.description || []).map((d: any) => ({ id: d.id, text: d.text || '' })),
|
||||
})),
|
||||
competitions: (data.competition || []).map((c: any) => ({
|
||||
competitionName: c.competitionName || '',
|
||||
award: c.award || '',
|
||||
awardDate: c.awardDate || '',
|
||||
description: (c.description || []).map((d: any) => ({ id: d.id, text: d.text || '' })),
|
||||
})),
|
||||
skills: r.skills || [],
|
||||
certificates: r.certificates || [],
|
||||
}
|
||||
}
|
||||
|
||||
/** 点击查看简历快照按钮 */
|
||||
async function handleViewResumeSnapshot(job: JobItem) {
|
||||
showResumeSnapshotDrawer.value = true
|
||||
resumeSnapshotLoading.value = true
|
||||
resumeSnapshotData.value = null
|
||||
try {
|
||||
const res = await fetchCustomizeResume(String(job.id))
|
||||
if (res.code === 0 && res.data) {
|
||||
resumeSnapshotData.value = mapResumeToTemplate(res.data)
|
||||
} else {
|
||||
ElMessage.error('获取简历快照失败')
|
||||
showResumeSnapshotDrawer.value = false
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取简历快照失败', e)
|
||||
ElMessage.error('获取简历快照失败')
|
||||
showResumeSnapshotDrawer.value = false
|
||||
} finally {
|
||||
resumeSnapshotLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 关闭简历快照抽屉 */
|
||||
function closeResumeSnapshotDrawer() {
|
||||
showResumeSnapshotDrawer.value = false
|
||||
resumeSnapshotData.value = null
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user