个人资料,简历
This commit is contained in:
@@ -345,6 +345,17 @@
|
||||
</div>
|
||||
<!-- 全屏加载遮罩 -->
|
||||
<FullscreenLoading :visible="fullLoading" :text="fullLoadingText" title="Nova 正在帮您努力处理~" />
|
||||
<!-- 简历定制步骤进度遮罩 -->
|
||||
<StepProgressOverlay
|
||||
v-if="showCustomStepProgress"
|
||||
:title="customStepTitle"
|
||||
:subtitle="customStepSubtitle"
|
||||
:steps="customStepNames"
|
||||
:durations="customStepDurations"
|
||||
:done="customStepDone"
|
||||
@finished="handleCustomStepFinished"
|
||||
@close="handleCustomStepClose"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -359,6 +370,7 @@ import { fetchCustomizeResume, generateCustomizeResume, aiEditResume, rollbackCu
|
||||
import type { CustomizeResumeData, AiEditChatMessage } from '@/api/jobs'
|
||||
import AiThinkingIndicator from '@/components/tools/AiThinkingIndicator.vue'
|
||||
import FullscreenLoading from '@/components/FullscreenLoading.vue'
|
||||
import StepProgressOverlay from '@/components/StepProgressOverlay.vue'
|
||||
|
||||
// ==================== 类型定义 ====================
|
||||
|
||||
@@ -428,6 +440,38 @@ const fullLoading = ref(false)
|
||||
/** 全屏加载文案 */
|
||||
const fullLoadingText = ref('')
|
||||
|
||||
// ==================== 简历定制步骤进度遮罩 ====================
|
||||
|
||||
/** 步骤进度遮罩是否显示 */
|
||||
const showCustomStepProgress = ref(false)
|
||||
/** 接口是否已完成 */
|
||||
const customStepDone = ref(false)
|
||||
/** 大标题 */
|
||||
const customStepTitle = '简历定制中,请耐心等待'
|
||||
/** 副标题 */
|
||||
const customStepSubtitle = '根据STAR法则,快速定制补齐你的简历缺失部分'
|
||||
/** 4个步骤名称 */
|
||||
const customStepNames = ['个人概述优化...', '岗位技能优化...', '工作经验优化...', '最终简历生成中...']
|
||||
/** 每步时长 */
|
||||
const customStepDurations = [2000, 2000, 2000, 2000]
|
||||
/** 缓存的定制简历数据(等进度走完后填充) */
|
||||
const pendingCustomResumeData = ref<any>(null)
|
||||
|
||||
/** 步骤进度走完后填充数据并跳转预览 */
|
||||
function handleCustomStepFinished() {
|
||||
showCustomStepProgress.value = false
|
||||
if (pendingCustomResumeData.value) {
|
||||
fillCustomResumeData(pendingCustomResumeData.value)
|
||||
currentStep.value = 4
|
||||
pendingCustomResumeData.value = null
|
||||
}
|
||||
}
|
||||
|
||||
/** 关闭步骤进度遮罩 */
|
||||
function handleCustomStepClose() {
|
||||
showCustomStepProgress.value = false
|
||||
}
|
||||
|
||||
/** 当前步骤:2-差距分析(右侧抽屉) 3-定制简历 4-预览 */
|
||||
const currentStep = ref(2)
|
||||
|
||||
@@ -504,17 +548,15 @@ async function handleDrawerNext() {
|
||||
* 流程:先 GET 查询 → 有数据直接用 → 无数据则 POST 生成 → 再 GET 查询
|
||||
*/
|
||||
async function fetchAndLoadCustomResume() {
|
||||
fullLoadingText.value = '正在生成定制简历...'
|
||||
fullLoading.value = true
|
||||
// 显示步骤进度遮罩
|
||||
showCustomStepProgress.value = true
|
||||
customStepDone.value = false
|
||||
// 缓存数据用于进度完成后填充
|
||||
let resumeData: CustomizeResumeData | null = null
|
||||
|
||||
try {
|
||||
// 第一步:查询是否已有定制简历
|
||||
let queryRes = await fetchCustomizeResume(props.jobId)
|
||||
// if (queryRes.code === 0 && queryRes.data) {
|
||||
// // 已有定制简历,直接填充数据并跳转预览
|
||||
// fillCustomResumeData(queryRes.data)
|
||||
// currentStep.value = 4
|
||||
// return
|
||||
// }
|
||||
|
||||
// 第二步:没有定制简历,调用生成接口
|
||||
const genRes = await generateCustomizeResume({
|
||||
@@ -525,6 +567,7 @@ async function fetchAndLoadCustomResume() {
|
||||
})
|
||||
|
||||
if (genRes.code !== 0 || !genRes.data?.success) {
|
||||
showCustomStepProgress.value = false
|
||||
ElMessage.error('生成定制简历失败,请稍后重试')
|
||||
return
|
||||
}
|
||||
@@ -532,16 +575,19 @@ async function fetchAndLoadCustomResume() {
|
||||
// 第三步:生成成功后再次查询获取简历数据
|
||||
queryRes = await fetchCustomizeResume(props.jobId)
|
||||
if (queryRes.code === 0 && queryRes.data) {
|
||||
fillCustomResumeData(queryRes.data)
|
||||
currentStep.value = 4
|
||||
resumeData = queryRes.data
|
||||
// 通知步骤进度组件接口已完成
|
||||
customStepDone.value = true
|
||||
// 缓存数据,等进度走完后再填充
|
||||
pendingCustomResumeData.value = resumeData
|
||||
} else {
|
||||
showCustomStepProgress.value = false
|
||||
ElMessage.error('获取定制简历数据失败')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[JobResumeCustomDialog] 定制简历流程失败', e)
|
||||
showCustomStepProgress.value = false
|
||||
ElMessage.error('定制简历失败,请稍后重试')
|
||||
} finally {
|
||||
fullLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user