登陆页左侧新广告特效

This commit is contained in:
2026-06-28 19:23:54 +08:00
parent 0888d9fa31
commit 0aebde7bd3
15 changed files with 452 additions and 133 deletions
+106 -1
View File
@@ -33,7 +33,7 @@
<template v-if="currentStep === 1">
<div class="agent-page__right">
<div class="agent-page__profile-wrapper">
<ProfilePageContent :profile="profile" @edit="handleEdit" />
<ProfilePageContent :profile="profile" @edit="handleEdit" @save="handleInlineSave" @exp-update="handleExpUpdate" @exp-add="handleExpAdd" @exp-delete="handleExpDelete" />
</div>
</div>
<div class="agent-page__left">
@@ -433,6 +433,111 @@ async function handleSaveEdit(data: Record<string, any>) {
}
}
/** 内联保存处理(个人信息/技能/证书模块从组件内直接保存) */
async function handleInlineSave(section: string, data: Record<string, any>) {
editModule.value = section
await handleSaveEdit(data)
}
/** 单条经历更新 — 替换到完整列表后整体保存 */
async function handleExpUpdate(moduleType: string, index: number, data: Record<string, any>) {
try {
if (moduleType === 'education') {
const list = profile.value.education.map((item, i) => i === index ? data : item) as any[]
await saveEducation(list)
profile.value.education = list
} else if (moduleType === 'work') {
const list = profile.value.works.map((item, i) => i === index ? data : item) as any[]
await saveWork(list)
profile.value.works = list
} else if (moduleType === 'internship') {
const list = profile.value.internships.map((item, i) => i === index ? data : item) as any[]
await saveInternship(list)
profile.value.internships = list
} else if (moduleType === 'project') {
const list = profile.value.projects.map((item, i) => i === index ? data : item) as any[]
await saveProject(list)
profile.value.projects = list
} else if (moduleType === 'competition') {
const list = profile.value.competitions.map((item, i) => i === index ? data : item) as any[]
await saveCompetition(list)
profile.value.competitions = list
}
ElMessage.success('保存成功')
} catch {
ElMessage.error('保存失败')
}
}
/** 新增经历 */
async function handleExpAdd(moduleType: string, data: Record<string, any>) {
try {
if (moduleType === 'education') {
const list = [...profile.value.education, data] as any[]
await saveEducation(list)
profile.value.education = list
} else if (moduleType === 'work') {
const list = [...profile.value.works, data] as any[]
await saveWork(list)
profile.value.works = list
} else if (moduleType === 'internship') {
const list = [...profile.value.internships, data] as any[]
await saveInternship(list)
profile.value.internships = list
} else if (moduleType === 'project') {
const list = [...profile.value.projects, data] as any[]
await saveProject(list)
profile.value.projects = list
} else if (moduleType === 'competition') {
const list = [...profile.value.competitions, data] as any[]
await saveCompetition(list)
profile.value.competitions = list
}
ElMessage.success('添加成功')
} catch {
ElMessage.error('添加失败')
}
}
/** 删除单条经历 — 确认后从列表移除并全量保存 */
async function handleExpDelete(moduleType: string, index: number) {
try {
await ElMessageBox.confirm('确定要删除这条经历吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
try {
if (moduleType === 'education') {
const list = profile.value.education.filter((_, i) => i !== index) as any[]
await saveEducation(list)
profile.value.education = list
} else if (moduleType === 'work') {
const list = profile.value.works.filter((_, i) => i !== index) as any[]
await saveWork(list)
profile.value.works = list
} else if (moduleType === 'internship') {
const list = profile.value.internships.filter((_, i) => i !== index) as any[]
await saveInternship(list)
profile.value.internships = list
} else if (moduleType === 'project') {
const list = profile.value.projects.filter((_, i) => i !== index) as any[]
await saveProject(list)
profile.value.projects = list
} else if (moduleType === 'competition') {
const list = profile.value.competitions.filter((_, i) => i !== index) as any[]
await saveCompetition(list)
profile.value.competitions = list
}
ElMessage.success('删除成功')
} catch {
ElMessage.error('删除失败')
}
}
// ==================== 第2步:确认目标 ====================
const showJobGoalDialog = ref(false)
const intentionEmploymentLabel = computed(() => formatEmploymentType(store.state.jobIntention.recruitCategory))