AI润色用新加载特效
This commit is contained in:
@@ -22,25 +22,25 @@
|
||||
<el-icon><EditPen /></el-icon><span>编辑</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="profile-page-content__info-name dflex-start aliite-e"><span class="fs28">{{ profile.name }}</span><span class="fs13 color-6 ml10 dflex-start aliite-c pb5"><svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<div class="profile-page-content__info-name dflex-start aliite-e"><span class="fs28">{{ profile.name }}</span><span v-if="profile.regionCode&&profile.regionCode!='null'" class="fs13 color-6 ml10 dflex-start aliite-c pb5"><svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<circle cx="8" cy="6.5" r="2.5" stroke="currentColor" stroke-width="1.2"/>
|
||||
<path d="M8 14s-5-4-5-7.5a5 5 0 0110 0C13 10 8 14 8 14z" stroke="currentColor" stroke-width="1.2"/>
|
||||
</svg> {{ resolveRegionName(profile.regionCode) }}</span></div>
|
||||
<div class="profile-page-content__info-contacts">
|
||||
<span class="profile-page-content__contact-item"><svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<span v-if="profile.phone&&profile.phone!='null'" class="profile-page-content__contact-item"><svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<path d="M4 2h2.5l1.5 3-1.5 1.5a8 8 0 003 3L11 8l3 1.5V12a2 2 0 01-2 2C6.5 14 2 9.5 2 4a2 2 0 012-2z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>
|
||||
</svg> {{ profile.phone }}</span>
|
||||
<span class="profile-page-content__contact-item"><svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<span v-if="profile.email&&profile.email!='null'" class="profile-page-content__contact-item"><svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<rect x="2" y="3" width="12" height="10" rx="1.5" stroke="currentColor" stroke-width="1.2"/>
|
||||
<path d="M2 5.5l6 4 6-4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>{{ profile.email }}</span>
|
||||
|
||||
|
||||
<span class="profile-page-content__info-contacts" v-if="profile.wechat">
|
||||
<span class="profile-page-content__info-contacts" v-if="profile.wechat&&profile.wechat!='null'">
|
||||
<span class="profile-page-content__contact-item"><el-icon class="fs14 color-9"><ChatLineRound /></el-icon> {{ profile.wechat }}</span>
|
||||
</span>
|
||||
<!-- 作品集链接显示在个人信息卡片内 -->
|
||||
<span v-if="profile.portfolioUrl" class="profile-page-content__info-contacts">
|
||||
<span v-if="profile.portfolioUrl&&profile.portfolioUrl!='null'" class="profile-page-content__info-contacts">
|
||||
<span class="profile-page-content__contact-item dib">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="resume-detail__contact-icon mr6" width="0.15rem" height="0.15rem" viewBox="0 0 16 16">
|
||||
<path d="M0 0h16v16H0z" fill="none" />
|
||||
|
||||
@@ -115,6 +115,17 @@
|
||||
</div>
|
||||
<!-- 全屏加载遮罩 -->
|
||||
<FullscreenLoading :visible="fullLoading" :text="fullLoadingText" title="Nova 正在帮您努力处理~" />
|
||||
<!-- AI润色步骤进度遮罩 -->
|
||||
<StepProgressOverlay
|
||||
v-if="showPolishProgress"
|
||||
:title="polishProgressTitle"
|
||||
:subtitle="polishProgressSubtitle"
|
||||
:steps="polishProgressSteps"
|
||||
:durations="polishProgressDurations"
|
||||
:done="polishProgressDone"
|
||||
@finished="handlePolishProgressFinished"
|
||||
@close="handlePolishProgressClose"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -122,6 +133,7 @@ import { ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { polishDiagnosisIssue } from '@/api/resume'
|
||||
import FullscreenLoading from '@/components/FullscreenLoading.vue'
|
||||
import StepProgressOverlay from '@/components/StepProgressOverlay.vue'
|
||||
|
||||
/** 描述段落结构 */
|
||||
interface DescriptionParagraph {
|
||||
@@ -195,25 +207,62 @@ async function handleAiPolish() {
|
||||
return
|
||||
}
|
||||
aiPolishing.value = true
|
||||
fullLoadingText.value = 'AI正在润色中……'
|
||||
fullLoading.value = true
|
||||
// 显示步骤进度遮罩
|
||||
showPolishProgress.value = true
|
||||
polishProgressDone.value = false
|
||||
try {
|
||||
const content = text.split('\n').filter(s => s.trim())
|
||||
const res = await polishDiagnosisIssue(content)
|
||||
if (res.code === 0 && res.data?.content) {
|
||||
aiPolishResult.value = res.data.content.join('\n')
|
||||
ElMessage.success('AI润色完成')
|
||||
pendingPolishResult.value = res.data.content.join('\n')
|
||||
polishProgressDone.value = true
|
||||
} else {
|
||||
showPolishProgress.value = false
|
||||
aiPolishing.value = false
|
||||
ElMessage.error(res.msg || '润色失败')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('请求失败')
|
||||
} finally {
|
||||
showPolishProgress.value = false
|
||||
aiPolishing.value = false
|
||||
fullLoading.value = false
|
||||
ElMessage.error('请求失败')
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== AI润色步骤进度遮罩 ====================
|
||||
|
||||
/** 润色步骤进度遮罩是否显示 */
|
||||
const showPolishProgress = ref(false)
|
||||
/** 润色接口是否已完成 */
|
||||
const polishProgressDone = ref(false)
|
||||
/** 大标题 */
|
||||
const polishProgressTitle = 'Nova正在润色中...'
|
||||
/** 副标题 */
|
||||
const polishProgressSubtitle = '正在根据岗位要求润色简历,突出你的核心优势'
|
||||
/** 4个步骤名称 */
|
||||
const polishProgressSteps = ['提取核心关键词...', '寻找符合的语义...', '排版文字格式...', '最终生成中...']
|
||||
/** 每步时长1400毫秒 */
|
||||
const polishProgressDurations = [1400, 1400, 1400, 1400]
|
||||
/** 缓存润色结果 */
|
||||
const pendingPolishResult = ref('')
|
||||
|
||||
/** 润色进度走完后填充结果 */
|
||||
function handlePolishProgressFinished() {
|
||||
showPolishProgress.value = false
|
||||
aiPolishing.value = false
|
||||
if (pendingPolishResult.value) {
|
||||
aiPolishResult.value = pendingPolishResult.value
|
||||
ElMessage.success('AI润色完成')
|
||||
}
|
||||
pendingPolishResult.value = ''
|
||||
}
|
||||
|
||||
/** 关闭润色进度遮罩 */
|
||||
function handlePolishProgressClose() {
|
||||
showPolishProgress.value = false
|
||||
aiPolishing.value = false
|
||||
pendingPolishResult.value = ''
|
||||
}
|
||||
|
||||
/** 替换为AI润色内容 */
|
||||
function handleReplaceWithAi() {
|
||||
if (aiPolishResult.value) {
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
<div class="resume-detail__card-header color-6">
|
||||
<div class="dflex-start aliite-c">
|
||||
<h3 class="resume-detail__user-name">{{ resumeMain.name || '未填写姓名' }}</h3>
|
||||
<span v-if="resumeMain.city" class="ml10 dflex-start aliite-c fs13">
|
||||
<span v-if="resumeMain.city&&resumeMain.city!='null'" class="ml10 dflex-start aliite-c fs13">
|
||||
<svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<circle cx="8" cy="6.5" r="2.5" stroke="currentColor" stroke-width="1.2"/>
|
||||
<path d="M8 14s-5-4-5-7.5a5 5 0 0110 0C13 10 8 14 8 14z" stroke="currentColor" stroke-width="1.2"/>
|
||||
@@ -193,7 +193,7 @@
|
||||
</div>
|
||||
<div class="resume-detail__contact">
|
||||
<!-- 邮箱 -->
|
||||
<span v-if="resumeMain.email" class="resume-detail__contact-item">
|
||||
<span v-if="resumeMain.email&&resumeMain.email!='null'" class="resume-detail__contact-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<rect x="2" y="3" width="12" height="10" rx="1.5" stroke="currentColor" stroke-width="1.2"/>
|
||||
<path d="M2 5.5l6 4 6-4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
||||
@@ -201,7 +201,7 @@
|
||||
<span>{{ resumeMain.email }}</span>
|
||||
</span>
|
||||
<!-- 手机号 -->
|
||||
<span v-if="resumeMain.mobileNumber" class="resume-detail__contact-item">
|
||||
<span v-if="resumeMain.mobileNumber&&resumeMain.mobileNumber!='null'" class="resume-detail__contact-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" class="resume-detail__contact-icon">
|
||||
<path d="M4 2h2.5l1.5 3-1.5 1.5a8 8 0 003 3L11 8l3 1.5V12a2 2 0 01-2 2C6.5 14 2 9.5 2 4a2 2 0 012-2z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
@@ -209,12 +209,12 @@
|
||||
</span>
|
||||
|
||||
<!-- 微信号 -->
|
||||
<span v-if="resumeMain.wechatNumber" class="resume-detail__contact-item">
|
||||
<span v-if="resumeMain.wechatNumber&&resumeMain.wechatNumber!='null'" class="resume-detail__contact-item">
|
||||
<el-icon class="fs14 color-9"><ChatLineRound /></el-icon>
|
||||
<span>{{ resumeMain.wechatNumber }}</span>
|
||||
</span>
|
||||
<!-- 作品集链接 -->
|
||||
<span v-if="resumeMain.portfolioUrl" class="resume-detail__contact-item dib">
|
||||
<span v-if="resumeMain.portfolioUrl&&resumeMain.portfolioUrl!='null'" class="resume-detail__contact-item dib">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class=" mr6" width="0.15rem" height="0.15rem" viewBox="0 0 16 16">
|
||||
<path d="M0 0h16v16H0z" fill="none" />
|
||||
<path fill="none" stroke="currentColor" d="M14.5 8A6.5 6.5 0 0 1 8 14.5M14.5 8A6.5 6.5 0 0 0 8 1.5M14.5 8c0 1.657-2.91 3-6.5 3S1.5 9.657 1.5 8m13 0c0-1.657-2.91-3-6.5-3S1.5 6.343 1.5 8M8 14.5A6.5 6.5 0 0 1 1.5 8M8 14.5c1.657 0 3-2.91 3-6.5S9.657 1.5 8 1.5m0 13c-1.657 0-3-2.91-3-6.5s1.343-6.5 3-6.5M1.5 8A6.5 6.5 0 0 1 8 1.5" />
|
||||
|
||||
Reference in New Issue
Block a user