定制简历AI编辑撤回修改按钮展示逻辑,和消息通知显示时间
This commit is contained in:
@@ -268,10 +268,19 @@
|
||||
>
|
||||
<div class="job-resume-custom-dialog__ai-msg-bubble">{{ msg.content }}</div>
|
||||
</div>
|
||||
<!-- 撤销修改气泡(仅 type=updated 的 assistant 消息显示) -->
|
||||
<div v-if="msg.canRollback" class="job-resume-custom-dialog__ai-rollback">
|
||||
<!-- 撤销修改气泡 -->
|
||||
<!-- 已撤销状态:所有历史中已撤销的消息都显示 -->
|
||||
<div v-if="msg.canRollback && msg.rollbackStatus === 'done'" class="job-resume-custom-dialog__ai-rollback">
|
||||
<span class="job-resume-custom-dialog__ai-rollback-done">
|
||||
<svg viewBox="0 0 16 16" fill="none" class="job-resume-custom-dialog__ai-rollback-icon">
|
||||
<path d="M3 8.5l3 3 7-7" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
已撤销此次简历修改
|
||||
</span>
|
||||
</div>
|
||||
<!-- 撤销按钮:仅当该消息是列表最后一条且为AI修改简历的回答且未撤销时显示 -->
|
||||
<div v-if="msg.canRollback && msg.rollbackStatus !== 'done' && isLastMessage(i)" class="job-resume-custom-dialog__ai-rollback">
|
||||
<button
|
||||
v-if="msg.rollbackStatus !== 'done'"
|
||||
class="job-resume-custom-dialog__ai-rollback-btn"
|
||||
@click="handleRollbackClick(i)"
|
||||
>
|
||||
@@ -280,12 +289,6 @@
|
||||
</svg>
|
||||
撤销修改
|
||||
</button>
|
||||
<span v-else class="job-resume-custom-dialog__ai-rollback-done">
|
||||
<svg viewBox="0 0 16 16" fill="none" class="job-resume-custom-dialog__ai-rollback-icon">
|
||||
<path d="M3 8.5l3 3 7-7" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
已撤销此次简历修改
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- AI正在回复的加载指示器 -->
|
||||
@@ -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 消息在列表中的索引
|
||||
|
||||
@@ -64,7 +64,10 @@
|
||||
<div class="side-nav__message-detail">
|
||||
<template v-if="currentMessage">
|
||||
<div class="side-nav__message-detail-title">{{ currentMessage.title }}</div>
|
||||
<div class="side-nav__message-detail-content">{{ currentMessage.content }}</div>
|
||||
<div class="dflex aliite-e">
|
||||
<div class="side-nav__message-detail-content">{{ currentMessage.content }}</div>
|
||||
<div class="fs12 color-8 w200 tar">{{timestampToLocalDateTime(currentMessage.createTime, 'returnSecond')}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="side-nav__message-detail-empty">请选择一条消息查看</div>
|
||||
</div>
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user