新版交互调整

This commit is contained in:
2026-06-24 19:03:41 +08:00
parent 065553f53e
commit 8143a89dab
37 changed files with 4929 additions and 4409 deletions
+71 -19
View File
@@ -10,7 +10,7 @@
@save="handleSaveEdit"
/>
<!-- 欢迎上传简历弹窗无个人资料时自动弹出 -->
<!-- 欢迎上传简历弹窗无个人资料主表记录时自动弹出 -->
<ResumeUploadDialog v-model="showWelcomeDialog" @confirm="handleWelcomeUpload" />
<!-- 页面标题 -->
@@ -27,27 +27,12 @@
<ProfilePageContent
:profile="profile"
@edit="handleEdit"
@save="handleInlineSave"
@exp-update="handleExpUpdate"
@exp-add="handleExpAdd"
/>
<!-- 右侧入口 -->
<div class="profile-page__sidebar">
<!-- 提示卡片 -->
<div class="profile-page__tip-card">
<p class="profile-page__tip-text">
非常棒你的个人资料已经被完善了自动填写信息也已变换现在可以轻松开始投递简历啦
</p>
<button class="profile-page__tip-btn" @click="goToJobs">去投递</button>
</div>
<!-- 管理简历入口 -->
<div class="profile-page__nav-entry" @click="goToResume">
<span class="profile-page__nav-entry-icon">📄</span>
<span class="profile-page__nav-entry-text">管理我的简历</span>
<svg viewBox="0 0 16 16" fill="none" class="profile-page__nav-arrow">
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</div>
</div>
</div>
</div>
@@ -658,4 +643,71 @@ function goToJobs() {
function goToResume() {
router.push('/resume')
}
/** 内联保存处理(个人信息/技能/证书模块从组件内直接保存) */
async function handleInlineSave(section: string, data: Record<string, any>) {
// 复用已有的 handleSaveEdit 逻辑
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)
await loadEducation()
} else if (moduleType === 'work') {
const list = profile.value.works.map((item, i) => i === index ? data : item) as any[]
await saveWork(list)
await loadWork()
} else if (moduleType === 'internship') {
const list = profile.value.internships.map((item, i) => i === index ? data : item) as any[]
await saveInternship(list)
await loadInternship()
} else if (moduleType === 'project') {
const list = profile.value.projects.map((item, i) => i === index ? data : item) as any[]
await saveProject(list)
await loadProject()
} else if (moduleType === 'competition') {
const list = profile.value.competitions.map((item, i) => i === index ? data : item) as any[]
await saveCompetition(list)
await loadCompetition()
}
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)
await loadEducation()
} else if (moduleType === 'work') {
const list = [...profile.value.works, data] as any[]
await saveWork(list)
await loadWork()
} else if (moduleType === 'internship') {
const list = [...profile.value.internships, data] as any[]
await saveInternship(list)
await loadInternship()
} else if (moduleType === 'project') {
const list = [...profile.value.projects, data] as any[]
await saveProject(list)
await loadProject()
} else if (moduleType === 'competition') {
const list = [...profile.value.competitions, data] as any[]
await saveCompetition(list)
await loadCompetition()
}
ElMessage.success('添加成功')
} catch {
ElMessage.error('添加失败')
}
}
</script>