diff --git a/src/components/JobResumeCustomDialog.vue b/src/components/JobResumeCustomDialog.vue index a05babf..10913a9 100644 --- a/src/components/JobResumeCustomDialog.vue +++ b/src/components/JobResumeCustomDialog.vue @@ -268,10 +268,19 @@ >
{{ msg.content }}
- -
+ + +
+ + + + + 已撤销此次简历修改 + +
+ +
- - - - - 已撤销此次简历修改 -
@@ -430,11 +433,37 @@ const isLowMatch = computed(() => props.jobInfo.matchScore < 6) /** 跳转到指定步骤 */ function goToStep(step: number) { + // 从步骤4返回步骤3时,清理步骤4的状态数据(避免下次进入被旧数据影响) + if (currentStep.value === 4 && step === 3) { + resetStep4State() + } if (step === 3) initSkillOptions() if (step === 4) fetchAndLoadCustomResume() else currentStep.value = step } +/** 重置步骤4(预览)的所有状态数据 */ +function resetStep4State() { + aiMessages.value = [] + aiInputText.value = '' + aiLoading.value = false + isShowDiff.value = false + previewTab.value = 'ai' + cachedOptimizedScore.value = 0 + oldResumeTemplateData.value = { + name: '', email: '', mobileNumber: '', wechatNumber: '', summary: '', + educations: [], workExperiences: [], internships: [], projects: [], + competitions: [], skills: [], certificates: [], + } + resumeTemplateData.value = { + name: '', email: '', mobileNumber: '', wechatNumber: '', summary: '', + educations: [], workExperiences: [], internships: [], projects: [], + competitions: [], skills: [], certificates: [], + } + customResumeRawData.value = { resume: {} } + showDownloadMenu.value = false +} + /** 抽屉模式下一步 */ async function handleDrawerNext() { if (currentStep.value >= 4) return @@ -914,6 +943,15 @@ const showRollbackConfirm = ref(false) /** 当前要撤销的消息索引 */ const rollbackMsgIndex = ref(-1) +/** + * 判断该消息是否为消息列表的最后一条 + * 撤销按钮只在最后一条消息恰好是AI修改简历的回答时才显示 + * @param msgIndex 消息在列表中的索引 + */ +function isLastMessage(msgIndex: number): boolean { + return msgIndex === aiMessages.value.length - 1 +} + /** * 点击撤销修改按钮 — 弹出确认弹窗 * @param msgIndex 消息在列表中的索引 diff --git a/src/components/SideNav.vue b/src/components/SideNav.vue index 18565a3..ec8c0ac 100644 --- a/src/components/SideNav.vue +++ b/src/components/SideNav.vue @@ -64,7 +64,10 @@
请选择一条消息查看
@@ -125,6 +128,7 @@ import { useStore } from 'vuex' import SettingsDialog from '@/components/SettingsDialog.vue' import { checkLogin } from '@/api/auth' import { fetchMessageList, fetchUnreadCount, markMessageRead } from '@/api/message' +import { timestampToLocalDateTime } from '@/utils/time' import {userFeedback} from '@/api/setting' import type { MessageDto } from '@/api/message' import navJobsIcon from '@/assets/images/nav/nav-jobs-icon.png'