AI助手引导步骤返回上一步和正式使用AI助手时的再次设置功能,和投递过程的其他地方按钮点击保护

This commit is contained in:
xuxin
2026-05-28 11:09:38 +08:00
parent a9638fc7ec
commit f52a7c56f7
21 changed files with 2296 additions and 47 deletions
+4
View File
@@ -12,8 +12,12 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AgentApplyProgress: typeof import('./src/components/AgentApplyProgress.vue')['default'] AgentApplyProgress: typeof import('./src/components/AgentApplyProgress.vue')['default']
AgentApplyProgressPanel: typeof import('./src/components/AgentApplyProgressPanel.vue')['default']
AgentChatJobList: typeof import('./src/components/AgentChatJobList.vue')['default'] AgentChatJobList: typeof import('./src/components/AgentChatJobList.vue')['default']
AgentJobPreviewPanel: typeof import('./src/components/AgentJobPreviewPanel.vue')['default']
AgentMatchJobAdd: typeof import('./src/components/AgentMatchJobAdd.vue')['default'] AgentMatchJobAdd: typeof import('./src/components/AgentMatchJobAdd.vue')['default']
AgentPendingJobListPanel: typeof import('./src/components/AgentPendingJobListPanel.vue')['default']
AgentSettingPanel: typeof import('./src/components/AgentSettingPanel.vue')['default']
AgentSettingsPanel: typeof import('./src/components/AgentSettingsPanel.vue')['default'] AgentSettingsPanel: typeof import('./src/components/AgentSettingsPanel.vue')['default']
AgentSetupWizard: typeof import('./src/components/AgentSetupWizard.vue')['default'] AgentSetupWizard: typeof import('./src/components/AgentSetupWizard.vue')['default']
AgentTaskListDropdown: typeof import('./src/components/AgentTaskListDropdown.vue')['default'] AgentTaskListDropdown: typeof import('./src/components/AgentTaskListDropdown.vue')['default']
+3
View File
@@ -206,6 +206,8 @@ export interface ApplyListParams {
pageSize?: number pageSize?: number
/** 投递状态筛选(0=已投递 1=面试中 2=有Offer 3=未通过 4=已结束) */ /** 投递状态筛选(0=已投递 1=面试中 2=有Offer 3=未通过 4=已结束) */
status?: number | null status?: number | null
/** 搜索关键词 */
keyword?: string
} }
/** /**
@@ -217,6 +219,7 @@ export function fetchApplyList(params: ApplyListParams = {}) {
pageNum: params.pageNum ?? 1, pageNum: params.pageNum ?? 1,
pageSize: params.pageSize ?? 10, pageSize: params.pageSize ?? 10,
...(params.status !== null && params.status !== undefined ? { status: params.status } : {}), ...(params.status !== null && params.status !== undefined ? { status: params.status } : {}),
...(params.keyword ? { keyword: params.keyword } : {}),
}) })
} }
@@ -0,0 +1,266 @@
@use '../variables' as *;
/* 申请进度面板样式 */
.agent-apply-progress-panel {
display: flex;
flex-direction: column;
height: 100%;
background: $bg-white;
border-radius: 0.2rem;
overflow: hidden;
/* 顶部标题栏 */
&__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.16rem 0.2rem;
}
&__title {
font-size: 0.16rem;
font-weight: 600;
color: $text-dark;
}
/* 关闭按钮 */
&__close-btn {
width: 0.28rem;
height: 0.28rem;
border: none;
background: none;
cursor: pointer;
padding: 0;
svg {
width: 100%;
height: 100%;
}
}
/* 筛选栏 */
&__filter {
display: flex;
align-items: center;
gap: 0.1rem;
padding: 0 0.2rem 0.14rem;
}
/* 下拉选择容器 */
&__select-wrap {
flex-shrink: 0;
}
&__select {
padding: 0.08rem 0.12rem;
border: 1px solid $border-color;
border-radius: 0.06rem;
font-size: 0.13rem;
color: $text-dark;
background: $bg-white;
cursor: pointer;
outline: none;
min-width: 1rem;
&:focus {
border-color: $accent;
}
}
/* 搜索框 */
&__search {
flex: 1;
padding: 0.08rem 0.12rem;
border: 1px solid $border-color;
border-radius: 0.06rem;
font-size: 0.13rem;
color: $text-dark;
outline: none;
&::placeholder {
color: $text-light;
}
&:focus {
border-color: $accent;
}
}
/* 列表区域(可滚动) */
&__list {
flex: 1;
overflow-y: auto;
padding: 0 0.2rem 0.2rem;
}
/* 单个岗位项 */
&__item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.14rem 0.16rem;
background: $bg-main;
border-radius: 0.12rem;
margin-bottom: 0.1rem;
&:last-child {
margin-bottom: 0;
}
}
/* 左侧信息区域 */
&__info {
display: flex;
align-items: center;
gap: 0.12rem;
flex: 1;
min-width: 0;
}
/* 公司 Logo */
&__logo {
width: 0.4rem;
height: 0.4rem;
border-radius: 0.08rem;
background: $bg-middle;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
svg {
width: 0.22rem;
height: 0.22rem;
color: $text-middle;
}
}
/* 岗位详情 */
&__detail {
min-width: 0;
}
&__company {
font-size: 0.13rem;
font-weight: 500;
color: $text-dark;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__position {
font-size: 0.12rem;
color: $text-middle;
margin-top: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 标签 */
&__tags {
display: flex;
gap: 0.06rem;
margin-top: 0.06rem;
flex-wrap: wrap;
}
&__tag {
font-size: 0.11rem;
color: $text-middle;
background: $bg-white;
padding: 0.02rem 0.08rem;
border-radius: 0.04rem;
}
/* 右侧区域 */
&__right {
display: flex;
align-items: center;
gap: 0.1rem;
flex-shrink: 0;
}
/* 匹配度环 */
&__score {
position: relative;
width: 0.4rem;
height: 0.4rem;
}
&__ring {
width: 100%;
height: 100%;
}
&__score-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 0.1rem;
font-weight: 600;
color: $text-dark;
}
/* 状态下拉 */
&__status-select {
padding: 0.05rem 0.1rem;
border: 1px solid $border-color;
border-radius: 0.04rem;
font-size: 0.12rem;
color: $text-dark;
background: $bg-white;
cursor: pointer;
outline: none;
&:focus {
border-color: $accent;
}
}
/* 删除按钮 */
&__delete-btn {
width: 0.2rem;
height: 0.2rem;
border: none;
background: none;
cursor: pointer;
padding: 0;
flex-shrink: 0;
svg {
width: 100%;
height: 100%;
}
&:hover svg circle {
fill: $danger;
}
}
/* 加载中 */
&__loading {
text-align: center;
padding: 0.16rem 0;
font-size: 0.12rem;
color: $text-light;
}
/* 暂无更多数据 */
&__no-more {
text-align: center;
padding: 0.16rem 0;
font-size: 0.12rem;
color: $text-light;
}
/* 空状态 */
&__empty {
text-align: center;
padding: 0.4rem 0;
font-size: 0.13rem;
color: $text-light;
}
}
@@ -25,6 +25,7 @@
border-radius: 0.1rem; border-radius: 0.1rem;
padding: 0.14rem 0.16rem; padding: 0.14rem 0.16rem;
margin-bottom: 0.08rem; margin-bottom: 0.08rem;
cursor: pointer;
&:last-of-type { &:last-of-type {
margin-bottom: 0; margin-bottom: 0;
@@ -0,0 +1,222 @@
@use '../variables' as *;
/* Agent岗位预览面板样式 */
.agent-job-preview-panel {
display: flex;
flex-direction: column;
height: 100%;
background: $bg-white;
border-radius: 0.2rem;
overflow: hidden;
/* 顶部标题栏 */
&__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.16rem 0.2rem;
border-bottom: 1px solid $border-color;
}
/* 返回按钮 */
&__back {
display: flex;
align-items: center;
gap: 0.06rem;
cursor: pointer;
font-size: 0.15rem;
font-weight: 500;
color: $text-dark;
}
&__back-icon {
width: 0.16rem;
height: 0.16rem;
}
/* 添加按钮 */
&__add-btn {
padding: 0.06rem 0.16rem;
background: $btn-dark;
color: $bg-white;
border: none;
border-radius: 0.06rem;
font-size: 0.13rem;
cursor: pointer;
transition: background 0.2s;
&:hover {
background: $btn-dark-hover;
}
&:disabled {
opacity: 0.6;
cursor: not-allowed;
}
}
/* 移出按钮 */
&__remove-btn {
padding: 0.06rem 0.16rem;
background: $bg-white;
color: $text-middle;
border: 1px solid $border-color;
border-radius: 0.06rem;
font-size: 0.13rem;
cursor: pointer;
transition: background 0.2s, color 0.2s;
&:hover {
background: $bg-main;
color: $danger;
}
&:disabled {
opacity: 0.6;
cursor: not-allowed;
}
}
/* 内容区域(可滚动) */
&__body {
flex: 1;
overflow-y: auto;
padding: 0.2rem;
}
/* 岗位卡片 */
&__card {
background: $bg-main;
border-radius: 0.12rem;
padding: 0.2rem;
margin-bottom: 0.16rem;
}
&__card-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
&__card-left {
flex: 1;
min-width: 0;
}
/* 公司行 */
&__company-row {
display: flex;
align-items: center;
gap: 0.08rem;
margin-bottom: 0.08rem;
}
&__company-icon {
width: 0.28rem;
height: 0.28rem;
border-radius: 0.06rem;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: $bg-middle;
flex-shrink: 0;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
svg {
width: 0.18rem;
height: 0.18rem;
color: $text-middle;
}
}
&__company-name {
font-size: 0.14rem;
font-weight: 500;
color: $text-dark;
}
&__time {
font-size: 0.12rem;
color: $text-light;
margin-left: 0.06rem;
}
/* 岗位标题 */
&__job-title {
font-size: 0.17rem;
font-weight: 600;
color: $text-dark;
margin: 0.06rem 0 0.1rem;
}
/* 元信息 */
&__meta {
display: flex;
align-items: center;
gap: 0.16rem;
flex-wrap: wrap;
}
&__meta-item {
display: flex;
align-items: center;
gap: 0.04rem;
font-size: 0.12rem;
color: $text-middle;
}
&__meta-icon {
width: 0.14rem;
height: 0.14rem;
flex-shrink: 0;
}
/* 匹配度环 */
&__match {
position: relative;
width: 0.6rem;
height: 0.6rem;
flex-shrink: 0;
}
&__ring-svg {
width: 100%;
height: 100%;
}
&__match-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 0.13rem;
font-weight: 600;
color: $text-dark;
}
/* 内容段落 */
&__section {
margin-bottom: 0.2rem;
}
&__section-title {
font-size: 0.14rem;
font-weight: 600;
color: $text-dark;
margin-bottom: 0.1rem;
}
&__section-content {
font-size: 0.13rem;
color: $text-middle;
line-height: 1.8;
white-space: pre-wrap;
word-break: break-word;
}
}
@@ -110,6 +110,7 @@
gap: 0.12rem; gap: 0.12rem;
flex: 1; flex: 1;
min-width: 0; min-width: 0;
cursor: pointer;
} }
// 公司 Logo // 公司 Logo
@@ -0,0 +1,203 @@
@use '../variables' as *;
/* 待投递岗位列表面板样式 */
.agent-pending-job-list-panel {
display: flex;
flex-direction: column;
height: 100%;
background: $bg-white;
border-radius: 0.2rem;
overflow: hidden;
/* 顶部标题栏 */
&__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.16rem 0.2rem;
}
&__title {
font-size: 0.16rem;
font-weight: 600;
color: $text-dark;
}
/* 关闭按钮 */
&__close-btn {
width: 0.28rem;
height: 0.28rem;
border: none;
background: none;
cursor: pointer;
padding: 0;
svg {
width: 100%;
height: 100%;
}
}
/* 列表区域(可滚动) */
&__list {
flex: 1;
overflow-y: auto;
padding: 0 0.2rem 0.2rem;
}
/* 单个岗位项 */
&__item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.14rem 0.16rem;
background: $bg-main;
border-radius: 0.12rem;
margin-bottom: 0.1rem;
&:last-child {
margin-bottom: 0;
}
}
/* 左侧信息区域 */
&__info {
display: flex;
align-items: center;
gap: 0.12rem;
flex: 1;
min-width: 0;
}
/* 公司 Logo */
&__logo {
width: 0.4rem;
height: 0.4rem;
border-radius: 0.08rem;
background: $bg-middle;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
svg {
width: 0.22rem;
height: 0.22rem;
color: $text-middle;
}
}
/* 岗位详情 */
&__detail {
min-width: 0;
}
&__company {
font-size: 0.13rem;
font-weight: 500;
color: $text-dark;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__position {
font-size: 0.12rem;
color: $text-middle;
margin-top: 0.02rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 标签 */
&__tags {
display: flex;
gap: 0.06rem;
margin-top: 0.06rem;
flex-wrap: wrap;
}
&__tag {
font-size: 0.11rem;
color: $text-middle;
background: $bg-white;
padding: 0.02rem 0.08rem;
border-radius: 0.04rem;
}
/* 右侧区域 */
&__right {
display: flex;
align-items: center;
gap: 0.14rem;
flex-shrink: 0;
}
/* 匹配度环 */
&__score {
position: relative;
width: 0.4rem;
height: 0.4rem;
}
&__ring {
width: 100%;
height: 100%;
}
&__score-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 0.1rem;
font-weight: 600;
color: $text-dark;
}
/* 移出按钮 */
&__remove-btn {
padding: 0.06rem 0.16rem;
background: $text-dark;
color: $bg-white;
border: none;
border-radius: 0.2rem;
font-size: 0.12rem;
cursor: pointer;
transition: opacity 0.2s;
&:hover {
opacity: 0.85;
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
/* 加载中 */
&__loading {
text-align: center;
padding: 0.16rem 0;
font-size: 0.12rem;
color: $text-light;
}
/* 暂无更多数据 */
&__no-more {
text-align: center;
padding: 0.16rem 0;
font-size: 0.12rem;
color: $text-light;
}
/* 空状态 */
&__empty {
text-align: center;
padding: 0.4rem 0;
font-size: 0.13rem;
color: $text-light;
}
}
@@ -0,0 +1,202 @@
@use '../variables' as *;
/* Agent设置面板样式 */
.agent-setting-panel {
display: flex;
flex-direction: column;
height: 100%;
background: $bg-white;
border-radius: 0.2rem;
overflow: hidden;
/* 顶部标题栏 */
&__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.16rem 0.2rem;
border-bottom: 1px solid $border-color;
}
&__title {
font-size: 0.16rem;
font-weight: 600;
color: $text-dark;
}
/* 关闭按钮 */
&__close-btn {
width: 0.28rem;
height: 0.28rem;
border: none;
background: none;
cursor: pointer;
padding: 0;
svg {
width: 100%;
height: 100%;
}
}
/* 内容区域(可滚动) */
&__body {
flex: 1;
overflow-y: auto;
padding: 0.2rem;
}
/* ========== 设置项区块 ========== */
&__section {
margin-bottom: 0.2rem;
border-bottom: 1px solid $border-color;
padding-bottom: 0.16rem;
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
}
/* 区块标题行 */
&__section-header {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
padding: 0.04rem 0;
}
/* 区块标题 */
&__section-title {
font-size: 0.15rem;
font-weight: 600;
color: $text-dark;
}
/* 编辑按钮区域(文字 + 箭头) */
&__section-action {
display: flex;
align-items: center;
gap: 0.04rem;
}
&__section-action-text {
font-size: 0.12rem;
color: $accent;
}
/* 方向箭头 */
&__arrow {
width: 0.14rem;
height: 0.14rem;
color: $accent;
transition: transform 0.25s ease;
}
/* 展开时箭头朝上 */
&__arrow--up {
transform: rotate(180deg);
}
/* 收起时的简要信息预览 */
&__section-summary {
margin-top: 0.1rem;
font-size: 0.12rem;
color: $text-middle;
line-height: 1.6;
}
&__section-empty {
color: $text-light;
font-style: italic;
}
/* 展开时的内容区域 */
&__section-content {
margin-top: 0.14rem;
}
/* ========== 求职目标标签 ========== */
&__goal-tags {
display: flex;
flex-wrap: wrap;
gap: 0.08rem;
margin-top: 0.1rem;
}
&__goal-tag {
display: inline-block;
padding: 0.04rem 0.12rem;
background: $theme-color;
border: 1px solid $accent;
border-radius: 0.14rem;
font-size: 0.12rem;
color: $accent;
}
/* 编辑图标 */
&__edit-icon {
width: 0.13rem;
height: 0.13rem;
color: $accent;
}
/* ========== 浏览器插件 ========== */
&__browser-btns {
display: flex;
flex-wrap: wrap;
gap: 0.1rem;
margin-top: 0.12rem;
}
&__browser-btn {
padding: 0.08rem 0.18rem;
background: $bg-white;
border: 1px solid $border-color;
border-radius: 0.08rem;
font-size: 0.13rem;
color: $text-dark;
cursor: pointer;
transition: border-color 0.2s, background 0.2s;
&:hover {
border-color: $accent;
background: $theme-color;
}
}
&__download-wrap {
margin-top: 0.16rem;
text-align: center;
}
&__download-btn {
padding: 0.1rem 0.4rem;
background: $gradient-bg;
color: $bg-white;
border: none;
border-radius: 0.24rem;
font-size: 0.14rem;
cursor: pointer;
transition: opacity 0.2s;
&:hover {
opacity: 0.9;
}
}
/* 浏览器安装指引弹窗图片 */
&__guide-slide {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
}
}
+34 -1
View File
@@ -246,11 +246,40 @@
// ==================== 第2步:确认目标 ==================== // ==================== 第2步:确认目标 ====================
// 返回上一步按钮 — 位于每步容器左上角
&__back-btn {
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: center;
gap: 0.04rem;
padding: 0.06rem 0.12rem;
background: transparent;
border: none;
color: $text-middle;
font-size: 0.13rem;
cursor: pointer;
border-radius: 0.04rem;
transition: color 0.2s ease, background 0.2s ease;
&:hover {
color: $text-dark;
background: $bg-middle;
}
svg {
flex-shrink: 0;
}
}
// 第2步整体容器 // 第2步整体容器
&__step2 { &__step2 {
width: 100%; width: 100%;
max-width: 7rem; max-width: 7rem;
margin: 0 auto; margin: 0 auto;
position: relative;
padding-top: 0.36rem;
} }
// 对话区域 // 对话区域
@@ -578,6 +607,8 @@
gap: 0.24rem; gap: 0.24rem;
align-items: flex-start; align-items: flex-start;
width: 100%; width: 100%;
position: relative;
padding-top: 0.36rem;
} }
// 右侧表单包裹 // 右侧表单包裹
@@ -1085,7 +1116,7 @@
// 工具按钮 // 工具按钮
&__tool-btn { &__tool-btn {
width: 0.28rem; width: 0.38rem;
height: 0.28rem; height: 0.28rem;
border: none; border: none;
background: transparent; background: transparent;
@@ -1097,6 +1128,8 @@
color: $text-middle; color: $text-middle;
border-radius: 0.06rem; border-radius: 0.06rem;
transition: all 0.2s ease; transition: all 0.2s ease;
font-weight: 600;
svg { svg {
width: 0.18rem; width: 0.18rem;
+254
View File
@@ -0,0 +1,254 @@
<template>
<!-- 申请进度面板 右侧面板显示已投递岗位列表带筛选搜索滚动分页 -->
<div class="agent-apply-progress-panel">
<!-- 顶部标题栏 -->
<div class="agent-apply-progress-panel__header">
<span class="agent-apply-progress-panel__title">申请进度</span>
<!-- 关闭按钮 -->
<button class="agent-apply-progress-panel__close-btn" @click="emit('close')">
<svg viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="10" fill="#1A1A2E" />
<path d="M8 8l8 8M16 8l-8 8" stroke="#fff" stroke-width="1.5" stroke-linecap="round" />
</svg>
</button>
</div>
<!-- 筛选栏状态下拉 + 搜索框 -->
<div class="agent-apply-progress-panel__filter">
<!-- 状态下拉选择 -->
<div class="agent-apply-progress-panel__select-wrap">
<select v-model="selectedStatus" class="agent-apply-progress-panel__select" @change="handleFilterChange">
<option :value="null">全部</option>
<option :value="0">已投递</option>
<option :value="1">面试中</option>
<option :value="2">有Offer</option>
<option :value="3">未通过</option>
<option :value="4">已结束</option>
</select>
</div>
<!-- 搜索框 -->
<input
v-model="keyword"
class="agent-apply-progress-panel__search"
placeholder="搜索岗位/公司"
@keyup.enter="handleSearch"
/>
</div>
<!-- 列表内容可滚动触底加载更多 -->
<div ref="listRef" class="agent-apply-progress-panel__list" @scroll="handleScroll">
<!-- 岗位项 -->
<div
v-for="job in jobList"
:key="job.id"
class="agent-apply-progress-panel__item"
>
<!-- 左侧信息区域 -->
<div class="agent-apply-progress-panel__info">
<!-- 公司 Logo -->
<div class="agent-apply-progress-panel__logo">
<svg viewBox="0 0 24 24" fill="none">
<rect x="3" y="7" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M7 7V5a2 2 0 012-2h6a2 2 0 012 2v2" stroke="currentColor" stroke-width="1.5"/>
</svg>
</div>
<!-- 岗位详情 -->
<div class="agent-apply-progress-panel__detail">
<div class="agent-apply-progress-panel__company">{{ job.companyShortName || job.companyName }}</div>
<div class="agent-apply-progress-panel__position">{{ job.title }}</div>
<!-- 标签 -->
<div class="agent-apply-progress-panel__tags">
<span v-if="job.regionName" class="agent-apply-progress-panel__tag">{{ job.regionName }}</span>
<span v-if="job.categoryName" class="agent-apply-progress-panel__tag">{{ job.categoryName }}</span>
<span v-for="tag in (job.tags || []).slice(0, 2)" :key="tag" class="agent-apply-progress-panel__tag">{{ tag }}</span>
</div>
</div>
</div>
<!-- 右侧匹配度 + 状态下拉 + 删除按钮 -->
<div class="agent-apply-progress-panel__right">
<!-- 匹配度环形 -->
<div class="agent-apply-progress-panel__score">
<svg class="agent-apply-progress-panel__ring" viewBox="0 0 44 44">
<circle cx="22" cy="22" r="18" fill="none" stroke="#E8E8E8" stroke-width="3" />
<circle
cx="22" cy="22" r="18" fill="none"
stroke="#4FC2C9" stroke-width="3"
stroke-linecap="round"
:stroke-dasharray="2 * Math.PI * 18"
:stroke-dashoffset="2 * Math.PI * 18 * (1 - (job.matchScore || 0) / 100)"
transform="rotate(-90 22 22)"
/>
</svg>
<span class="agent-apply-progress-panel__score-text">{{ job.matchScore || 0 }}%</span>
</div>
<!-- 状态下拉 -->
<select
class="agent-apply-progress-panel__status-select"
:value="job.status"
@change="handleStatusChange(job, $event)"
>
<option :value="0">已投递</option>
<option :value="1">面试中</option>
<option :value="2">有Offer</option>
<option :value="3">未通过</option>
<option :value="4">已结束</option>
</select>
<!-- 删除按钮 -->
<button class="agent-apply-progress-panel__delete-btn" @click="handleDelete(job)">
<svg viewBox="0 0 16 16" fill="none">
<circle cx="8" cy="8" r="7" fill="#BFBFBF" />
<path d="M5.5 5.5l5 5M10.5 5.5l-5 5" stroke="#fff" stroke-width="1.2" stroke-linecap="round" />
</svg>
</button>
</div>
</div>
<!-- 加载更多提示 -->
<div v-if="loadingMore" class="agent-apply-progress-panel__loading">加载中...</div>
<!-- 没有更多数据 -->
<div v-if="noMore && jobList.length > 0" class="agent-apply-progress-panel__no-more">暂无更多数据</div>
<!-- 空状态 -->
<div v-if="!loading && jobList.length === 0 && !loadingMore" class="agent-apply-progress-panel__empty">暂无数据</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { fetchApplyList } from '@/api/jobs'
import { applyJob, cancelApplyJob } from '@/api/agent'
import type { JobListItem } from '@/api/jobs'
/** 事件 */
const emit = defineEmits<{
/** 关闭面板 */
(e: 'close'): void
}>()
/** 岗位列表数据 */
const jobList = ref<JobListItem[]>([])
/** 当前页码 */
const currentPage = ref(1)
/** 每页条数 */
const pageSize = 30
/** 是否正在加载首页 */
const loading = ref(false)
/** 是否正在加载更多 */
const loadingMore = ref(false)
/** 是否没有更多数据 */
const noMore = ref(false)
/** 当前选中的状态筛选 */
const selectedStatus = ref<number | null>(null)
/** 搜索关键词 */
const keyword = ref('')
/** 列表容器 ref */
const listRef = ref<HTMLElement | null>(null)
/** 加载投递列表 */
async function loadList(page: number) {
if (page === 1) {
loading.value = true
} else {
loadingMore.value = true
}
try {
const res = await fetchApplyList({
pageNum: page,
pageSize,
status: selectedStatus.value,
keyword: keyword.value || undefined,
})
if (res.code === '0' && res.data) {
const list = res.data.list || []
if (page === 1) {
jobList.value = list
} else {
jobList.value.push(...list)
}
/* 判断是否还有更多数据 */
const total = Number(res.data.total || 0)
if (jobList.value.length >= total || list.length < pageSize) {
noMore.value = true
}
}
} catch {
console.error('[AgentApplyProgressPanel] 加载投递列表失败')
} finally {
loading.value = false
loadingMore.value = false
}
}
/** 重置列表并重新加载 */
function resetAndLoad() {
currentPage.value = 1
jobList.value = []
noMore.value = false
loadList(1)
}
/** 筛选状态变更 */
function handleFilterChange() {
resetAndLoad()
}
/** 搜索框回车 */
function handleSearch() {
resetAndLoad()
}
/** 滚动触底加载更多 */
function handleScroll() {
if (!listRef.value || loadingMore.value || noMore.value) return
const { scrollTop, scrollHeight, clientHeight } = listRef.value
if (scrollTop + clientHeight >= scrollHeight - 50) {
currentPage.value++
loadList(currentPage.value)
}
}
/** 修改单个岗位的投递状态 */
async function handleStatusChange(job: JobListItem, event: Event) {
const newStatus = Number((event.target as HTMLSelectElement).value)
try {
await applyJob({ jobId: job.id, status: newStatus })
job.status = newStatus
ElMessage.success('状态已更新')
} catch {
ElMessage.error('状态更新失败')
/* 恢复原值 — 触发视图刷新 */
;(event.target as HTMLSelectElement).value = String(job.status)
}
}
/** 删除(取消投递) */
async function handleDelete(job: JobListItem) {
try {
await cancelApplyJob(job.id)
const idx = jobList.value.findIndex(j => j.id === job.id)
if (idx !== -1) {
jobList.value.splice(idx, 1)
}
ElMessage.success('已删除')
} catch {
ElMessage.error('删除失败')
}
}
onMounted(() => {
loadList(1)
})
</script>
<style scoped lang="scss">
@use '../assets/styles/components/agent-apply-progress-panel';
</style>
+8
View File
@@ -10,6 +10,7 @@
:key="job.id" :key="job.id"
class="agent-chat-job-list__item" class="agent-chat-job-list__item"
v-if="displayJobs.length>0" v-if="displayJobs.length>0"
@click="handleClickJob(job)"
> >
<!-- 左侧公司图标 + 岗位信息 --> <!-- 左侧公司图标 + 岗位信息 -->
<div class="agent-chat-job-list__info"> <div class="agent-chat-job-list__info">
@@ -79,6 +80,8 @@ const props = defineProps<{
const emit = defineEmits<{ const emit = defineEmits<{
/** 点击查看全部岗位 */ /** 点击查看全部岗位 */
(e: 'viewAll'): void (e: 'viewAll'): void
/** 点击岗位查看详情 */
(e: 'clickJob', job: AgentRecommendJob): void
}>() }>()
/** 只显示前3个岗位 */ /** 只显示前3个岗位 */
@@ -88,6 +91,11 @@ const displayJobs = computed(() => props.jobs.slice(0, 3))
function handleViewAll() { function handleViewAll() {
emit('viewAll') emit('viewAll')
} }
/** 点击岗位 — 通知父组件打开岗位预览 */
function handleClickJob(job: AgentRecommendJob) {
emit('clickJob', job)
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
+197
View File
@@ -0,0 +1,197 @@
<template>
<!-- Agent岗位预览面板 右侧面板显示岗位详情 -->
<div class="agent-job-preview-panel" v-loading="loading" element-loading-text="加载中...">
<!-- 顶部标题栏 -->
<div class="agent-job-preview-panel__header">
<div class="agent-job-preview-panel__back" @click="handleBack">
<svg viewBox="0 0 16 16" fill="none" class="agent-job-preview-panel__back-icon">
<path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>岗位详情</span>
</div>
<!-- 添加按钮 仅未投递时显示 -->
<button
v-if="jobDetail && (jobDetail.applicationStatus === null || jobDetail.applicationStatus === undefined)"
class="agent-job-preview-panel__add-btn"
:disabled="addLoading"
@click="handleAdd"
>+ 添加</button>
<!-- 移出按钮 仅待投递状态时显示 -->
<button
v-else-if="jobDetail && jobDetail.applicationStatus === -1"
class="agent-job-preview-panel__remove-btn"
:disabled="addLoading"
@click="handleRemove"
>移出</button>
</div>
<!-- 岗位详情内容 -->
<div v-if="jobDetail" class="agent-job-preview-panel__body">
<!-- 岗位卡片 -->
<div class="agent-job-preview-panel__card">
<div class="agent-job-preview-panel__card-top">
<!-- 左侧信息 -->
<div class="agent-job-preview-panel__card-left">
<div class="agent-job-preview-panel__company-row">
<div class="agent-job-preview-panel__company-icon">
<img v-if="jobDetail.companyLogoUrl" :src="jobDetail.companyLogoUrl" :alt="jobDetail.companyShortName" />
<svg v-else viewBox="0 0 24 24" fill="none">
<rect x="3" y="7" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M7 7V5a2 2 0 012-2h6a2 2 0 012 2v2" stroke="currentColor" stroke-width="1.5"/>
</svg>
</div>
<span class="agent-job-preview-panel__company-name">{{ jobDetail.companyShortName || jobDetail.companyName }}</span>
<span class="agent-job-preview-panel__time">{{ formatTime }}</span>
</div>
<h3 class="agent-job-preview-panel__job-title">{{ jobDetail.jobTitle }}</h3>
<!-- 岗位元信息 -->
<div class="agent-job-preview-panel__meta">
<span v-if="jobDetail.regionName" class="agent-job-preview-panel__meta-item">
<svg viewBox="0 0 16 16" fill="none" class="agent-job-preview-panel__meta-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>
{{ jobDetail.regionName }}
</span>
<span class="agent-job-preview-panel__meta-item">
<svg viewBox="0 0 16 16" fill="none" class="agent-job-preview-panel__meta-icon">
<rect x="2" y="3" width="12" height="11" rx="1.5" stroke="currentColor" stroke-width="1.2"/>
<path d="M2 6.5h12" stroke="currentColor" stroke-width="1.2"/>
</svg>
{{ formatEmploymentType(jobDetail.employmentType) }}
</span>
<span v-if="jobDetail.salary" class="agent-job-preview-panel__meta-item">
<svg viewBox="0 0 16 16" fill="none" class="agent-job-preview-panel__meta-icon">
<path d="M8 1v14M4 4h8M3 8h10M5 12h6" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
{{ jobDetail.salary }}
</span>
</div>
</div>
<!-- 右侧匹配度环 -->
<div class="agent-job-preview-panel__match">
<svg viewBox="0 0 60 60" class="agent-job-preview-panel__ring-svg">
<circle cx="30" cy="30" r="25" stroke-width="4" stroke="#E8E8E8" fill="none" />
<circle cx="30" cy="30" r="25" stroke-width="4" fill="none"
stroke="#4FC2C9" stroke-linecap="round"
:stroke-dasharray="2 * Math.PI * 25"
:stroke-dashoffset="2 * Math.PI * 25 * (1 - (jobDetail.matchScore || 0) / 100)"
transform="rotate(-90 30 30)"
/>
</svg>
<span class="agent-job-preview-panel__match-text">{{ jobDetail.matchScore || 0 }}%</span>
</div>
</div>
</div>
<!-- 岗位职责 -->
<div v-if="jobDetail.description" class="agent-job-preview-panel__section">
<h4 class="agent-job-preview-panel__section-title">岗位职责</h4>
<div class="agent-job-preview-panel__section-content">{{ jobDetail.description }}</div>
</div>
<!-- 任职要求 -->
<div v-if="jobDetail.requirement" class="agent-job-preview-panel__section">
<h4 class="agent-job-preview-panel__section-title">任职要求</h4>
<div class="agent-job-preview-panel__section-content">{{ jobDetail.requirement }}</div>
</div>
<!-- 加分项 -->
<div v-if="jobDetail.bonus" class="agent-job-preview-panel__section">
<h4 class="agent-job-preview-panel__section-title">加分项</h4>
<div class="agent-job-preview-panel__section-content">{{ jobDetail.bonus }}</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue'
import { fetchJobDetail } from '@/api/jobs'
import type { JobDetailData } from '@/api/jobs'
/** 组件 Props */
const props = defineProps<{
/** 岗位 ID */
jobId: string
/** 投递状态(用于控制添加按钮显示) */
applicationStatus?: number | null
}>()
/** 事件 */
const emit = defineEmits<{
/** 返回上一个面板模式 */
(e: 'back'): void
/** 添加岗位到待投递 */
(e: 'add', jobId: string): void
/** 从待投递移除岗位 */
(e: 'remove', jobId: string): void
}>()
/** 加载状态 */
const loading = ref(false)
/** 添加按钮加载状态 */
const addLoading = ref(false)
/** 岗位详情数据(扩展 applicationStatus 字段) */
const jobDetail = ref<(JobDetailData & { applicationStatus?: number | null }) | null>(null)
/** 监听 applicationStatus prop 变化,同步到 jobDetail */
watch(() => props.applicationStatus, (newVal) => {
if (jobDetail.value) {
jobDetail.value.applicationStatus = newVal ?? null
}
})
/** 格式化时间显示 */
const formatTime = computed(() => {
// 暂时不显示具体时间,可后续扩展
return ''
})
/** 工作类型映射 */
function formatEmploymentType(type: number | undefined): string {
const map: Record<number, string> = { 0: '全职', 1: '兼职' }
return map[type ?? -1] ?? ''
}
/** 加载岗位详情 */
async function loadDetail() {
if (!props.jobId) return
loading.value = true
try {
const res = await fetchJobDetail(props.jobId)
if (res.code === '0' && res.data) {
jobDetail.value = { ...res.data, applicationStatus: props.applicationStatus ?? null }
}
} catch (e) {
console.error('[AgentJobPreviewPanel] 加载岗位详情失败', e)
} finally {
loading.value = false
}
}
/** 返回按钮 */
function handleBack() {
emit('back')
}
/** 添加到待投递 */
function handleAdd() {
emit('add', props.jobId)
}
/** 从待投递移除 */
function handleRemove() {
emit('remove', props.jobId)
}
onMounted(() => {
loadDetail()
})
</script>
<style scoped lang="scss">
@use '../assets/styles/components/agent-job-preview-panel';
</style>
+8 -1
View File
@@ -27,7 +27,7 @@
class="agent-match-job-add__item" class="agent-match-job-add__item"
> >
<!-- 左侧公司图标 + 岗位信息 --> <!-- 左侧公司图标 + 岗位信息 -->
<div class="agent-match-job-add__info"> <div class="agent-match-job-add__info" @click="handleClickJob(job)">
<!-- 公司 Logo --> <!-- 公司 Logo -->
<div class="agent-match-job-add__logo"> <div class="agent-match-job-add__logo">
<img v-if="job.companyLogoUrl" :src="job.companyLogoUrl" :alt="job.companyShortName" /> <img v-if="job.companyLogoUrl" :src="job.companyLogoUrl" :alt="job.companyShortName" />
@@ -116,6 +116,8 @@ const emit = defineEmits<{
(e: 'toggle', job: AgentRecommendJob): void (e: 'toggle', job: AgentRecommendJob): void
/** 全部添加操作 */ /** 全部添加操作 */
(e: 'addAll'): void (e: 'addAll'): void
/** 点击岗位查看详情 */
(e: 'clickJob', job: AgentRecommendJob): void
}>() }>()
/** 点击添加/移除 — 通知父组件处理 */ /** 点击添加/移除 — 通知父组件处理 */
@@ -123,6 +125,11 @@ function handleToggle(job: AgentRecommendJob) {
emit('toggle', job) emit('toggle', job)
} }
/** 点击岗位 — 通知父组件打开岗位预览 */
function handleClickJob(job: AgentRecommendJob) {
emit('clickJob', job)
}
/** 全部添加 — 通知父组件处理(只传 applicationStatus 为 null 的岗位) */ /** 全部添加 — 通知父组件处理(只传 applicationStatus 为 null 的岗位) */
function handleAddAll() { function handleAddAll() {
emit('addAll') emit('addAll')
+188
View File
@@ -0,0 +1,188 @@
<template>
<!-- 待投递岗位列表面板 右侧面板显示全部待投递岗位滚动分页 -->
<div class="agent-pending-job-list-panel">
<!-- 顶部标题栏 -->
<div class="agent-pending-job-list-panel__header">
<span class="agent-pending-job-list-panel__title">待投递岗位列表</span>
<!-- 关闭按钮 -->
<button class="agent-pending-job-list-panel__close-btn" @click="emit('close')">
<svg viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="10" fill="#1A1A2E" />
<path d="M8 8l8 8M16 8l-8 8" stroke="#fff" stroke-width="1.5" stroke-linecap="round" />
</svg>
</button>
</div>
<!-- 列表内容可滚动触底加载更多 -->
<div ref="listRef" class="agent-pending-job-list-panel__list" @scroll="handleScroll">
<!-- 岗位项 -->
<div
v-for="job in jobList"
:key="job.id"
class="agent-pending-job-list-panel__item"
>
<!-- 左侧信息区域 -->
<div class="agent-pending-job-list-panel__info">
<!-- 公司 Logo -->
<div class="agent-pending-job-list-panel__logo">
<svg viewBox="0 0 24 24" fill="none">
<rect x="3" y="7" width="18" height="14" rx="2" stroke="currentColor" stroke-width="1.5"/>
<path d="M7 7V5a2 2 0 012-2h6a2 2 0 012 2v2" stroke="currentColor" stroke-width="1.5"/>
</svg>
</div>
<!-- 岗位详情 -->
<div class="agent-pending-job-list-panel__detail">
<div class="agent-pending-job-list-panel__company">{{ job.companyShortName || job.companyName }}</div>
<div class="agent-pending-job-list-panel__position">{{ job.title }}</div>
<!-- 标签 -->
<div class="agent-pending-job-list-panel__tags">
<span v-if="job.regionName" class="agent-pending-job-list-panel__tag">{{ job.regionName }}</span>
<span v-if="job.categoryName" class="agent-pending-job-list-panel__tag">{{ job.categoryName }}</span>
<span v-for="tag in (job.tags || []).slice(0, 2)" :key="tag" class="agent-pending-job-list-panel__tag">{{ tag }}</span>
</div>
</div>
</div>
<!-- 右侧匹配度 + 移出按钮 -->
<div class="agent-pending-job-list-panel__right">
<!-- 匹配度环形 -->
<div class="agent-pending-job-list-panel__score">
<svg class="agent-pending-job-list-panel__ring" viewBox="0 0 44 44">
<circle cx="22" cy="22" r="18" fill="none" stroke="#E8E8E8" stroke-width="3" />
<circle
cx="22" cy="22" r="18" fill="none"
stroke="#4FC2C9" stroke-width="3"
stroke-linecap="round"
:stroke-dasharray="2 * Math.PI * 18"
:stroke-dashoffset="2 * Math.PI * 18 * (1 - (job.matchScore || 0) / 100)"
transform="rotate(-90 22 22)"
/>
</svg>
<span class="agent-pending-job-list-panel__score-text">{{ job.matchScore || 0 }}%</span>
</div>
<!-- 移出按钮 -->
<button
class="agent-pending-job-list-panel__remove-btn"
:disabled="removingIds.includes(job.id)"
@click="handleRemove(job)"
>移出</button>
</div>
</div>
<!-- 加载更多提示 -->
<div v-if="loadingMore" class="agent-pending-job-list-panel__loading">加载中...</div>
<!-- 没有更多数据 -->
<div v-if="noMore && jobList.length > 0" class="agent-pending-job-list-panel__no-more">暂无更多数据</div>
<!-- 空状态 -->
<div v-if="!loading && jobList.length === 0" class="agent-pending-job-list-panel__empty">暂无待投递岗位</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { fetchAgentTaskList } from '@/api/jobs'
import { cancelApplyJob } from '@/api/agent'
import type { JobListItem } from '@/api/jobs'
/** 事件 */
const emit = defineEmits<{
/** 关闭面板 */
(e: 'close'): void
/** 移除岗位后通知父组件 */
(e: 'removed', jobId: string): void
}>()
/** 岗位列表数据 */
const jobList = ref<JobListItem[]>([])
/** 当前页码 */
const currentPage = ref(1)
/** 每页条数 */
const pageSize = 30
/** 是否正在加载首页 */
const loading = ref(false)
/** 是否正在加载更多 */
const loadingMore = ref(false)
/** 是否没有更多数据 */
const noMore = ref(false)
/** 正在移除中的岗位 ID 列表 */
const removingIds = ref<string[]>([])
/** 列表容器 ref */
const listRef = ref<HTMLElement | null>(null)
/** 加载待投递列表 */
async function loadList(page: number) {
if (page === 1) {
loading.value = true
} else {
loadingMore.value = true
}
try {
const res = await fetchAgentTaskList({ pageNum: page, pageSize, tab: 1 })
if (res.code === '0' && res.data) {
const list = res.data.list || []
if (page === 1) {
jobList.value = list
} else {
jobList.value.push(...list)
}
/* 判断是否还有更多数据 */
const total = Number(res.data.total || 0)
if (jobList.value.length >= total || list.length < pageSize) {
noMore.value = true
}
}
} catch {
console.error('[AgentPendingJobListPanel] 加载待投递列表失败')
} finally {
loading.value = false
loadingMore.value = false
}
}
/** 滚动触底加载更多 */
function handleScroll() {
if (!listRef.value || loadingMore.value || noMore.value) return
const { scrollTop, scrollHeight, clientHeight } = listRef.value
/* 距离底部 50px 时触发加载 */
if (scrollTop + clientHeight >= scrollHeight - 50) {
currentPage.value++
loadList(currentPage.value)
}
}
/** 移出岗位 */
async function handleRemove(job: JobListItem) {
if (removingIds.value.includes(job.id)) return
removingIds.value.push(job.id)
try {
await cancelApplyJob(job.id)
/* 从列表中移除 */
const idx = jobList.value.findIndex(j => j.id === job.id)
if (idx !== -1) {
jobList.value.splice(idx, 1)
}
emit('removed', job.id)
ElMessage.success('已移除')
} catch {
ElMessage.error('移除失败,请重试')
} finally {
removingIds.value = removingIds.value.filter(id => id !== job.id)
}
}
onMounted(() => {
loadList(1)
})
</script>
<style scoped lang="scss">
@use '../assets/styles/components/agent-pending-job-list-panel';
</style>
+438
View File
@@ -0,0 +1,438 @@
<template>
<!-- Agent设置面板 右侧面板 -->
<div class="agent-setting-panel">
<!-- 顶部标题栏 -->
<div class="agent-setting-panel__header">
<span class="agent-setting-panel__title">设置</span>
<!-- 关闭按钮 -->
<button class="agent-setting-panel__close-btn" @click="emit('close')">
<svg viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="10" fill="#1A1A2E" />
<path d="M8 8l8 8M16 8l-8 8" stroke="#fff" stroke-width="1.5" stroke-linecap="round" />
</svg>
</button>
</div>
<!-- 内容区域可滚动 -->
<div class="agent-setting-panel__body">
<!-- ========== 个人资料设置项 ========== -->
<div class="agent-setting-panel__section">
<!-- 个人资料标题行标题 + 编辑按钮含展开/收起箭头 -->
<div class="agent-setting-panel__section-header" @click="toggleProfileExpand">
<span class="agent-setting-panel__section-title">个人资料</span>
<div class="agent-setting-panel__section-action">
<span class="agent-setting-panel__section-action-text">{{ profileExpanded ? '收起' : '编辑' }}</span>
<!-- 方向箭头展开时朝上收起时朝下 -->
<svg
viewBox="0 0 16 16"
fill="none"
class="agent-setting-panel__arrow"
:class="{ 'agent-setting-panel__arrow--up': profileExpanded }"
>
<path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</div>
<!-- 收起时的简要信息预览 -->
<div v-if="!profileExpanded" class="agent-setting-panel__section-summary">
<span v-if="profile.name">{{ profile.name }}</span>
<span v-if="profile.phone"> · {{ profile.phone }}</span>
<span v-if="profile.email"> · {{ profile.email }}</span>
<span v-if="!profile.name && !profile.phone && !profile.email" class="agent-setting-panel__section-empty">暂未填写个人资料</span>
</div>
<!-- 展开时显示 ProfilePageContent 组件 -->
<div v-if="profileExpanded" class="agent-setting-panel__section-content">
<ProfilePageContent :profile="profile" @edit="handleEdit" />
</div>
</div>
<!-- ========== 其他设置项待设计稿补充 ========== -->
<div class="agent-setting-panel__section">
<!-- 求职目标标题行 + 编辑按钮 -->
<div class="agent-setting-panel__section-header" @click="showJobGoalDialog = true">
<span class="agent-setting-panel__section-title">求职目标</span>
<div class="agent-setting-panel__section-action">
<span class="agent-setting-panel__section-action-text">编辑</span>
<svg viewBox="0 0 16 16" fill="none" class="agent-setting-panel__edit-icon">
<path d="M11.5 2.5l2 2L5 13H3v-2l8.5-8.5z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>
</svg>
</div>
</div>
<!-- 求职意向标签展示 -->
<div class="agent-setting-panel__goal-tags">
<span v-for="name in intentionCategoryNames" :key="'cat-' + name" class="agent-setting-panel__goal-tag">{{ name }}</span>
<span v-for="name in intentionIndustryNames" :key="'ind-' + name" class="agent-setting-panel__goal-tag">{{ name }}</span>
<span v-for="name in intentionRegionNames" :key="'reg-' + name" class="agent-setting-panel__goal-tag">{{ name }}</span>
<span class="agent-setting-panel__goal-tag">{{ intentionEmploymentLabel }}</span>
<!-- 无意向时的空状态 -->
</div>
</div>
<div class="agent-setting-panel__section">
<div class="agent-setting-panel__section-header">
<span class="agent-setting-panel__section-title">浏览器插件</span>
</div>
<!-- 浏览器按钮列表 -->
<div class="agent-setting-panel__browser-btns">
<button
v-for="b in browserList"
:key="b.key"
class="agent-setting-panel__browser-btn"
@click="openBrowserGuide(b.key)"
>{{ b.label }}</button>
</div>
<!-- 下载插件按钮 -->
<div class="agent-setting-panel__download-wrap">
<button class="agent-setting-panel__download-btn" @click="downloadExtension">下载插件</button>
</div>
</div>
<div class="agent-setting-panel__section">
<div class="agent-setting-panel__section-header">
<span class="agent-setting-panel__section-title">求职助手配置</span>
</div>
</div>
</div>
<!-- 个人资料编辑抽屉 -->
<ProfileEditDrawer
v-model="showEditDrawer"
:module="editModule"
:initial-data="editInitialData"
:saving="saving"
@save="handleSaveEdit"
/>
<!-- 求职目标设置弹窗 -->
<JobGoalDialog v-model="showJobGoalDialog" />
<!-- 浏览器安装指引弹窗 -->
<el-dialog v-model="showBrowserGuide" :title="currentBrowserLabel + ' 安装指引'" width="80%" top="5vh" destroy-on-close>
<el-carousel :autoplay="false" indicator-position="outside" height="70vh" arrow="always">
<el-carousel-item v-for="(img, i) in currentBrowserImages" :key="i">
<div class="agent-setting-panel__guide-slide">
<img :src="img" :alt="currentBrowserLabel + ' 安装步骤 ' + (i + 1)" />
</div>
</el-carousel-item>
</el-carousel>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { useStore } from 'vuex'
import ProfilePageContent from '@/components/ProfilePageContent.vue'
import ProfileEditDrawer from '@/components/ProfileEditDrawer.vue'
import JobGoalDialog from '@/components/JobGoalDialog.vue'
import {
saveProfile, saveEducation, saveWork, saveInternship, saveProject, saveCompetition,
fetchProfile, fetchEducation, fetchWork, fetchInternship, fetchProject, fetchCompetition
} from '@/api/profile'
import type { SaveEducationItem, SaveWorkItem, SaveProjectItem, SaveCompetitionItem } from '@/api/profile'
import { resolveRegionName } from '@/utils/region'
import { resolveIndustryName } from '@/utils/industry'
import { resolveJobCategoryName } from '@/utils/jobCategory'
/** 事件 */
const emit = defineEmits<{
/** 关闭面板 */
(e: 'close'): void
}>()
const store = useStore()
// ==================== 个人资料展开/收起状态 ====================
/** 个人资料区域是否展开 */
const profileExpanded = ref(false)
/** 切换个人资料展开/收起 */
function toggleProfileExpand() {
profileExpanded.value = !profileExpanded.value
}
// ==================== 求职目标 ====================
/** 求职目标设置弹窗显隐 */
const showJobGoalDialog = ref(false)
/** 求职意向 — 岗位类型名称列表 */
const intentionCategoryNames = computed(() => (store.state.jobIntention?.categoryIds || []).map((id: number) => resolveJobCategoryName(id)).filter(Boolean))
/** 求职意向 — 行业名称列表 */
const intentionIndustryNames = computed(() => (store.state.jobIntention?.industryIds || []).map((id: number) => resolveIndustryName(id)).filter(Boolean))
/** 求职意向 — 地区名称列表 */
const intentionRegionNames = computed(() => (store.state.jobIntention?.regionCodes || []).map((code: string) => resolveRegionName(code)).filter(Boolean))
/** 求职意向 — 就业类型文案 */
const intentionEmploymentLabel = computed(() => store.state.jobIntention?.employmentType === 1 ? '实习' : '全职')
// ==================== 浏览器插件 ====================
/** 插件下载地址 */
const extensionDownloadUrl = 'https://offerpie.oss-cn-guangzhou.aliyuncs.com/extension/chrome-mv3-prod.rar'
/** 浏览器列表 */
const browserList = [
{ key: 'chrome', label: 'Chrome浏览器' },
{ key: 'edge', label: 'Edge浏览器' },
{ key: 'safari', label: 'Safari浏览器' },
{ key: '360', label: '360浏览器' },
{ key: 'qq', label: 'QQ浏览器' },
]
/** 每个浏览器的指引图片数量 */
const browserImageCount: Record<string, number> = { chrome: 3, edge: 3, safari: 3, '360': 3, qq: 3 }
/** 指引图片 OSS 基础路径 */
const guidanceImageBase = 'http://offerpie.oss-cn-guangzhou.aliyuncs.com/extension/guidance_image'
/** 浏览器安装指引弹窗显隐 */
const showBrowserGuide = ref(false)
/** 当前选中的浏览器 key */
const currentBrowserKey = ref('')
/** 当前浏览器名称 */
const currentBrowserLabel = computed(() => browserList.find(b => b.key === currentBrowserKey.value)?.label || '')
/** 当前浏览器的指引图片列表 */
const currentBrowserImages = computed(() => {
const key = currentBrowserKey.value
if (!key) return []
const count = browserImageCount[key] || 3
return Array.from({ length: count }, (_, i) => `${guidanceImageBase}/guidance-image-${key}-${String(i + 1).padStart(2, '0')}.png`)
})
/** 打开浏览器安装指引弹窗 */
function openBrowserGuide(key: string) {
currentBrowserKey.value = key
showBrowserGuide.value = true
}
/** 下载插件 */
function downloadExtension() {
window.open(extensionDownloadUrl, '_blank')
}
// ==================== 个人资料数据 ====================
/** 个人档案响应式数据 */
const profile = ref({
name: '', phone: '', email: '', idNumber: '', regionCode: '', portfolioUrl: '', wechat: '',
skills: [] as string[], certificates: [] as string[],
education: [] as Array<{ school: string; major: string; studyType: number; degree: number; startDate: string; endDate: string; description: Array<{ id: string; text: string }> }>,
works: [] as Array<{ companyName: string; position: string; startDate: string; endDate: string; description: Array<{ id: string; text: string }> }>,
internships: [] as Array<{ companyName: string; position: string; startDate: string; endDate: string; description: Array<{ id: string; text: string }> }>,
projects: [] as Array<{ projectName: string; companyName: string; role: string; startDate: string; endDate: string; description: Array<{ id: string; text: string }> }>,
competitions: [] as Array<{ competitionName: string; award: string; awardDate: string; description: Array<{ id: string; text: string }> }>,
})
// ==================== 加载个人资料 ====================
onMounted(async () => {
if (!store.state.regions.length) store.dispatch('loadCommonData')
store.dispatch('loadJobIntention')
await loadProfile()
await loadEducation()
await loadWork()
await loadInternship()
await loadProject()
await loadCompetition()
})
/** 加载基本信息 */
async function loadProfile() {
try {
const res = await fetchProfile()
if (res.code === '0' && res.data) {
const d = res.data
profile.value.name = d.name || ''
profile.value.phone = d.mobileNumber || ''
profile.value.email = d.email || ''
profile.value.idNumber = d.idCard || ''
profile.value.regionCode = d.regionCode || ''
profile.value.wechat = d.wechatNumber || ''
profile.value.skills = d.skills || []
profile.value.certificates = d.certificates || []
profile.value.portfolioUrl = d.portfolioUrl || ''
}
} catch { console.error('[AgentSettingPanel] 加载个人资料失败') }
}
/** 加载教育经历 */
async function loadEducation() {
try {
const res = await fetchEducation()
if (res.code === '0' && res.data) {
profile.value.education = res.data.map(item => ({
school: item.school || '', major: item.major || '', studyType: item.studyType ?? 0,
degree: item.degree ?? 2, startDate: item.startDate || '', endDate: item.endDate || '',
description: (item.description || []).map(d => ({ id: d.id || '', text: d.text || '' }))
}))
}
} catch { console.error('[AgentSettingPanel] 加载教育经历失败') }
}
/** 加载工作经历 */
async function loadWork() {
try {
const res = await fetchWork()
if (res.code === '0' && res.data) {
profile.value.works = res.data.map(item => ({
companyName: item.companyName || '', position: item.position || '',
startDate: item.startDate || '', endDate: item.endDate || '',
description: (item.description || []).map(d => ({ id: d.id || '', text: d.text || '' }))
}))
}
} catch { console.error('[AgentSettingPanel] 加载工作经历失败') }
}
/** 加载实习经历 */
async function loadInternship() {
try {
const res = await fetchInternship()
if (res.code === '0' && res.data) {
profile.value.internships = res.data.map(item => ({
companyName: item.companyName || '', position: item.position || '',
startDate: item.startDate || '', endDate: item.endDate || '',
description: (item.description || []).map(d => ({ id: d.id || '', text: d.text || '' }))
}))
}
} catch { console.error('[AgentSettingPanel] 加载实习经历失败') }
}
/** 加载项目经历 */
async function loadProject() {
try {
const res = await fetchProject()
if (res.code === '0' && res.data) {
profile.value.projects = res.data.map(item => ({
projectName: item.projectName || '', companyName: item.companyName || '',
role: item.role || '', startDate: item.startDate || '', endDate: item.endDate || '',
description: (item.description || []).map(d => ({ id: d.id || '', text: d.text || '' }))
}))
}
} catch { console.error('[AgentSettingPanel] 加载项目经历失败') }
}
/** 加载竞赛经历 */
async function loadCompetition() {
try {
const res = await fetchCompetition()
if (res.code === '0' && res.data) {
profile.value.competitions = res.data.map(item => ({
competitionName: item.competitionName || '', award: item.award || '',
awardDate: item.awardDate || '',
description: (item.description || []).map(d => ({ id: d.id || '', text: d.text || '' }))
}))
}
} catch { console.error('[AgentSettingPanel] 加载竞赛经历失败') }
}
// ==================== 编辑抽屉 ====================
/** 编辑抽屉显隐 */
const showEditDrawer = ref(false)
/** 当前编辑的模块名 */
const editModule = ref('info')
/** 编辑抽屉初始数据 */
const editInitialData = ref<Record<string, any>>({})
/** 保存中状态 */
const saving = ref(false)
/** ProfilePageContent 点击编辑 — 打开对应模块的编辑抽屉 */
function handleEdit(section: string) {
editModule.value = section
if (section === 'info') {
editInitialData.value = { name: profile.value.name, email: profile.value.email, phone: profile.value.phone, location: profile.value.regionCode, wechat: profile.value.wechat }
} else if (section === 'education') {
editInitialData.value = { education: profile.value.education.map(edu => ({ ...edu, description: edu.description.map(d => ({ ...d })) })) }
} else if (section === 'work') {
editInitialData.value = { works: profile.value.works.map(exp => ({ ...exp, description: exp.description.map(d => ({ ...d })) })) }
} else if (section === 'internship') {
editInitialData.value = { internships: (profile.value.internships || []).map(exp => ({ ...exp, description: exp.description.map(d => ({ ...d })) })) }
} else if (section === 'project') {
editInitialData.value = { projects: (profile.value.projects || []).map(proj => ({ ...proj, description: proj.description.map(d => ({ ...d })) })) }
} else if (section === 'competition') {
editInitialData.value = { competitions: profile.value.competitions.map(comp => ({ ...comp, description: comp.description.map(d => ({ ...d })) })) }
} else if (section === 'portfolio') {
editInitialData.value = { portfolioUrl: profile.value.portfolioUrl }
} else if (section === 'skills') {
editInitialData.value = { skills: [...profile.value.skills] }
} else if (section === 'certificate') {
editInitialData.value = { certificates: [...(profile.value.certificates || [])] }
} else {
editInitialData.value = {}
}
showEditDrawer.value = true
}
/** 保存编辑数据 — 调用接口持久化 */
async function handleSaveEdit(data: Record<string, any>) {
saving.value = true
try {
if (editModule.value === 'info') {
await saveProfile({ name: data.name, email: data.email, mobileNumber: data.phone, regionCode: data.location, wechatNumber: data.wechat })
profile.value.name = data.name; profile.value.email = data.email
profile.value.phone = data.phone; profile.value.wechat = data.wechat
profile.value.regionCode = data.location || ''
ElMessage.success('个人信息保存成功')
} else if (editModule.value === 'education') {
const payload: SaveEducationItem[] = data.education.map((edu: any) => ({ school: edu.school, major: edu.major, degree: edu.degree, studyType: edu.studyType, startDate: edu.startDate, endDate: edu.endDate, description: edu.description.map((d: any) => ({ id: d.id, text: d.text })) }))
await saveEducation(payload)
profile.value.education = data.education.map((edu: any) => ({ school: edu.school, major: edu.major, studyType: edu.studyType, degree: edu.degree, startDate: edu.startDate, endDate: edu.endDate, description: edu.description.map((d: any) => ({ ...d })) }))
ElMessage.success('教育经历保存成功')
} else if (editModule.value === 'work') {
const payload: SaveWorkItem[] = data.works.map((w: any) => ({ companyName: w.companyName, position: w.position, startDate: w.startDate, endDate: w.endDate || '', description: w.description.map((d: any) => ({ id: d.id, text: d.text })) }))
await saveWork(payload)
profile.value.works = data.works.map((w: any) => ({ companyName: w.companyName, position: w.position, startDate: w.startDate, endDate: w.endDate, description: w.description.map((d: any) => ({ ...d })) }))
ElMessage.success('工作经历保存成功')
} else if (editModule.value === 'internship') {
const payload: SaveWorkItem[] = data.internships.map((i: any) => ({ companyName: i.companyName, position: i.position, startDate: i.startDate, endDate: i.endDate || '', description: i.description.map((d: any) => ({ id: d.id, text: d.text })) }))
await saveInternship(payload)
profile.value.internships = data.internships.map((i: any) => ({ companyName: i.companyName, position: i.position, startDate: i.startDate, endDate: i.endDate, description: i.description.map((d: any) => ({ ...d })) }))
ElMessage.success('实习经历保存成功')
} else if (editModule.value === 'project') {
const payload: SaveProjectItem[] = data.projects.map((p: any) => ({ projectName: p.projectName, companyName: p.companyName || '', role: p.role || '', startDate: p.startDate, endDate: p.endDate || '', description: p.description.map((d: any) => ({ id: d.id, text: d.text })) }))
await saveProject(payload)
profile.value.projects = data.projects.map((p: any) => ({ projectName: p.projectName, companyName: p.companyName, role: p.role, startDate: p.startDate, endDate: p.endDate, description: p.description.map((d: any) => ({ ...d })) }))
ElMessage.success('项目经历保存成功')
} else if (editModule.value === 'competition') {
const payload: SaveCompetitionItem[] = data.competitions.map((c: any) => ({ competitionName: c.competitionName, award: c.award || '', awardDate: c.awardDate || '', description: c.description.map((d: any) => ({ id: d.id, text: d.text })) }))
await saveCompetition(payload)
profile.value.competitions = data.competitions.map((c: any) => ({ competitionName: c.competitionName, award: c.award, awardDate: c.awardDate, description: c.description.map((d: any) => ({ ...d })) }))
ElMessage.success('竞赛经历保存成功')
} else if (editModule.value === 'portfolio') {
await saveProfile({ name: profile.value.name, email: profile.value.email, mobileNumber: profile.value.phone, regionCode: profile.value.regionCode, wechatNumber: profile.value.wechat, skills: profile.value.skills, certificates: profile.value.certificates, portfolioUrl: data.portfolioUrl })
profile.value.portfolioUrl = data.portfolioUrl
ElMessage.success('作品集保存成功')
} else if (editModule.value === 'skills') {
await saveProfile({ name: profile.value.name, email: profile.value.email, mobileNumber: profile.value.phone, regionCode: profile.value.regionCode, wechatNumber: profile.value.wechat, skills: [...data.skills], certificates: profile.value.certificates })
profile.value.skills = [...data.skills]
ElMessage.success('技能保存成功')
} else if (editModule.value === 'certificate') {
await saveProfile({ name: profile.value.name, email: profile.value.email, mobileNumber: profile.value.phone, regionCode: profile.value.regionCode, wechatNumber: profile.value.wechat, skills: profile.value.skills, certificates: [...data.certificates] })
profile.value.certificates = [...data.certificates]
ElMessage.success('证书保存成功')
}
} catch {
ElMessage.error('保存失败,请重试')
} finally {
saving.value = false
}
}
</script>
<style scoped lang="scss">
@use '../assets/styles/components/agent-setting-panel';
</style>
+34
View File
@@ -62,6 +62,11 @@
<!-- ========== 第2步确认目标 ========== --> <!-- ========== 第2步确认目标 ========== -->
<template v-if="currentStep === 2"> <template v-if="currentStep === 2">
<div class="agent-page__step2"> <div class="agent-page__step2">
<!-- 返回上一步按钮 -->
<button class="agent-page__back-btn" @click="handleBack">
<svg viewBox="0 0 24 24" fill="none" width="16" height="16"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span>返回上一步</span>
</button>
<div class="agent-page__chat"> <div class="agent-page__chat">
<div class="agent-page__chat-row"> <div class="agent-page__chat-row">
<div class="agent-page__chat-avatar"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div> <div class="agent-page__chat-avatar"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div>
@@ -119,6 +124,11 @@
<template v-if="currentStep === 3"> <template v-if="currentStep === 3">
<!-- 上半部分网申常见问题 --> <!-- 上半部分网申常见问题 -->
<div v-if="step3Sub === 1" class="agent-page__step3"> <div v-if="step3Sub === 1" class="agent-page__step3">
<!-- 返回上一步按钮 -->
<button class="agent-page__back-btn" @click="handleBack">
<svg viewBox="0 0 24 24" fill="none" width="16" height="16"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span>返回上一步</span>
</button>
<div class="agent-page__left"> <div class="agent-page__left">
<div class="agent-page__intro-card"> <div class="agent-page__intro-card">
<div class="agent-page__intro-header"><div class="agent-page__intro-icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div><h2 class="agent-page__intro-title">现在我们来开启自动投递吧</h2></div> <div class="agent-page__intro-header"><div class="agent-page__intro-icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div><h2 class="agent-page__intro-title">现在我们来开启自动投递吧</h2></div>
@@ -143,6 +153,11 @@
</div> </div>
<!-- 下半部分插件安装 --> <!-- 下半部分插件安装 -->
<div v-if="step3Sub === 2" class="agent-page__step3"> <div v-if="step3Sub === 2" class="agent-page__step3">
<!-- 返回上一阶段按钮 -->
<button class="agent-page__back-btn" @click="handleBack">
<svg viewBox="0 0 24 24" fill="none" width="16" height="16"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span>返回上一步</span>
</button>
<div class="agent-page__left"> <div class="agent-page__left">
<div class="agent-page__intro-card"> <div class="agent-page__intro-card">
<div class="agent-page__intro-header"><div class="agent-page__intro-icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div><h2 class="agent-page__intro-title">现在我们来开启自动投递吧</h2></div> <div class="agent-page__intro-header"><div class="agent-page__intro-icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div><h2 class="agent-page__intro-title">现在我们来开启自动投递吧</h2></div>
@@ -173,6 +188,11 @@
<!-- ========== 第4步配置求职助手 ========== --> <!-- ========== 第4步配置求职助手 ========== -->
<template v-if="currentStep === 4"> <template v-if="currentStep === 4">
<div v-if="!setupComplete" class="agent-page__step3"> <div v-if="!setupComplete" class="agent-page__step3">
<!-- 返回上一步按钮 -->
<button class="agent-page__back-btn" @click="handleBack">
<svg viewBox="0 0 24 24" fill="none" width="16" height="16"><path d="M15 18l-6-6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span>返回上一步</span>
</button>
<div class="agent-page__left"> <div class="agent-page__left">
<div class="agent-page__intro-card"> <div class="agent-page__intro-card">
<div class="agent-page__intro-header"><div class="agent-page__intro-icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div><h2 class="agent-page__intro-title">马上就好啦请选择你想要的投递模式</h2></div> <div class="agent-page__intro-header"><div class="agent-page__intro-icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v2h20v-2c0-3.3-6.7-5-10-5z" fill="currentColor"/></svg></div><h2 class="agent-page__intro-title">马上就好啦请选择你想要的投递模式</h2></div>
@@ -240,6 +260,20 @@ function handleNext() {
if (currentStep.value < steps.length) currentStep.value++ if (currentStep.value < steps.length) currentStep.value++
} }
/** 返回上一步(含子阶段判断) */
function handleBack() {
if (currentStep.value === 3 && step3Sub.value === 2) {
// 第3步的第2阶段 → 回到第3步第1阶段
step3Sub.value = 1
} else if (currentStep.value === 4) {
// 第4步 → 回到第3步第2阶段(插件安装)
currentStep.value = 3
step3Sub.value = 2
} else if (currentStep.value > 1) {
currentStep.value--
}
}
// ==================== 编辑抽屉状态 ==================== // ==================== 编辑抽屉状态 ====================
const showEditDrawer = ref(false) const showEditDrawer = ref(false)
const editModule = ref('info') const editModule = ref('info')
+14 -3
View File
@@ -44,7 +44,7 @@
</template> </template>
</div> </div>
<!-- 查看全部 --> <!-- 查看全部 -->
<div class="agent-main__task-view-all" @click="emit('viewAll')">查看全部</div> <div class="agent-main__task-view-all" @click="handleViewAll">查看全部</div>
</div> </div>
</template> </template>
@@ -66,8 +66,10 @@ const props = defineProps<{
const emit = defineEmits<{ const emit = defineEmits<{
/** 移除岗位后通知父组件刷新列表 */ /** 移除岗位后通知父组件刷新列表 */
(e: 'removed', jobId: string): void (e: 'removed', jobId: string): void
/** 查看全部 */ /** 查看全部(进行中 tab */
(e: 'viewAll'): void (e: 'viewAll'): void
/** 查看全部(已完成 tab — 申请进度) */
(e: 'viewAllCompleted'): void
}>() }>()
// ==================== 状态 ==================== // ==================== 状态 ====================
@@ -102,7 +104,7 @@ function switchTab(tab: number) {
async function loadCompletedList() { async function loadCompletedList() {
loading.value = true loading.value = true
try { try {
const res = await fetchAgentTaskList({ pageNum: 1, pageSize: 100, tab: 2 }) const res = await fetchAgentTaskList({ pageNum: 1, pageSize: 30, tab: 2 })
if (res.code === '0' && res.data) { if (res.code === '0' && res.data) {
completedList.value = res.data.list || [] completedList.value = res.data.list || []
} }
@@ -123,4 +125,13 @@ async function removeJob(job: JobListItem) {
ElMessage.error('移除失败') ElMessage.error('移除失败')
} }
} }
/** 查看全部 — 根据当前 tab 触发不同事件 */
function handleViewAll() {
if (activeTab.value === 1) {
emit('viewAll')
} else {
emit('viewAllCompleted')
}
}
</script> </script>
@@ -155,7 +155,7 @@ import { cancelAccount } from '@/api/auth'
const props = defineProps<{ modelValue: boolean }>() const props = defineProps<{ modelValue: boolean }>()
/** 组件 Emits */ /** 组件 Emits */
const emit = defineEmits<{ (e: 'update:modelValue', value: boolean): void }>() const emit = defineEmits<{ (e: 'update:modelValue', value: boolean): void; (e: 'deleted'): void }>()
const router = useRouter() const router = useRouter()
const store = useStore() const store = useStore()
@@ -225,9 +225,10 @@ const handleConfirmDelete = async () => {
} }
} }
/** 完成 — 关闭弹窗并退出登录 */ /** 完成 — 关闭弹窗,通知父组件注销完成,跳转首页 */
const handleFinish = () => { const handleFinish = () => {
emit('update:modelValue', false) emit('update:modelValue', false)
emit('deleted')
store.commit('SET_AUTHENTICATED', false) store.commit('SET_AUTHENTICATED', false)
router.push('/') router.push('/')
} }
+6 -1
View File
@@ -240,7 +240,7 @@
<JobGoalDialog v-model="showGoalDialog" /> <JobGoalDialog v-model="showGoalDialog" />
<!-- 注销账号弹窗 --> <!-- 注销账号弹窗 -->
<SettingsDeleteAccountDialog v-model="showDeleteAccount" /> <SettingsDeleteAccountDialog v-model="showDeleteAccount" @deleted="onAccountDeleted" />
<!-- 邀请注册送会员弹窗 --> <!-- 邀请注册送会员弹窗 -->
<SettingsInviteDialog v-model="showInviteDialog" /> <SettingsInviteDialog v-model="showInviteDialog" />
@@ -385,6 +385,11 @@ const handleDeleteAccount = () => {
showDeleteAccount.value = true showDeleteAccount.value = true
} }
/** 注销完成回调 — 关闭设置弹窗 */
const onAccountDeleted = () => {
emit('update:modelValue', false)
}
/** 管理订阅 */ /** 管理订阅 */
const handleManageSubscription = () => { const handleManageSubscription = () => {
ElMessage.info('管理订阅功能开发中') ElMessage.info('管理订阅功能开发中')
+204 -10
View File
@@ -50,15 +50,13 @@
v-if="showTaskListDropdown" v-if="showTaskListDropdown"
:pending-list="applyJobList" :pending-list="applyJobList"
@removed="handleTaskRemoved" @removed="handleTaskRemoved"
@view-all="showTaskListDropdown = false" @view-all="handleOpenPendingListPanel"
@view-all-completed="handleOpenApplyProgressPanel"
/> />
<!-- 齿轮按钮 --> <!-- 设置按钮 -->
<!-- <button class="agent-main__tool-btn" title="配置">--> <button class="agent-main__tool-btn" title="配置" @click="handleOpenSettingsPanel">
<!-- <svg viewBox="0 0 24 24" fill="none">--> 设置
<!-- <circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="1.5" />--> </button>
<!-- <path d="M12 1v2m0 18v2m-9-11h2m18 0h2m-3.3-7.7-1.4 1.4M4.7 19.3l1.4-1.4m0-11.8L4.7 4.7m14.6 14.6-1.4-1.4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />-->
<!-- </svg>-->
<!-- </button>-->
</div> </div>
</div> </div>
@@ -83,6 +81,7 @@
:summary="getRecommendSummaryFromExtra(msg.extra)" :summary="getRecommendSummaryFromExtra(msg.extra)"
:jobs="getRecommendJobsFromExtra(msg.extra)" :jobs="getRecommendJobsFromExtra(msg.extra)"
@view-all="handleOpenRecommendPanel(msg.id)" @view-all="handleOpenRecommendPanel(msg.id)"
@click-job="handleChatJobClick"
/> />
</div> </div>
@@ -138,6 +137,7 @@
@view-more="handleViewMoreJobs" @view-more="handleViewMoreJobs"
@toggle="handleToggleJobApply" @toggle="handleToggleJobApply"
@add-all="handleAddAllJobs" @add-all="handleAddAllJobs"
@click-job="handleMatchJobClick"
/> />
<!-- 模式2简历生成进度 --> <!-- 模式2简历生成进度 -->
<div v-else-if="rightPanelMode === 'generating'" class="agent-resume-generating"> <div v-else-if="rightPanelMode === 'generating'" class="agent-resume-generating">
@@ -154,6 +154,32 @@
<div v-else-if="rightPanelMode === 'resume'" class="agent-main__right-resume"> <div v-else-if="rightPanelMode === 'resume'" class="agent-main__right-resume">
<JobResumeTemplate :resume-data="applyResumeData" /> <JobResumeTemplate :resume-data="applyResumeData" />
</div> </div>
<!-- 模式4岗位预览 -->
<AgentJobPreviewPanel
v-else-if="rightPanelMode === 'jobPreview'"
:job-id="previewJobId"
:application-status="previewJobApplicationStatus"
@back="handleJobPreviewBack"
@add="handleJobPreviewAdd"
@remove="handleJobPreviewRemove"
/>
<!-- 模式5全部的待投递列表 -->
<AgentPendingJobListPanel
v-else-if="rightPanelMode === 'pendingList'"
@close="handleClosePendingListPanel"
@removed="handlePendingListRemoved"
/>
<!-- 模式6全部的已投递进度 -->
<AgentApplyProgressPanel
v-else-if="rightPanelMode === 'applyProgress'"
@close="handleCloseApplyProgressPanel"
/>
<!-- 模式7设置面板 -->
<AgentSettingPanel
v-else-if="rightPanelMode === 'settings'"
@close="handleCloseSettingsPanel"
/>
<!-- 模式7AI助手设置 -->
</div> </div>
</div> </div>
</div> </div>
@@ -172,6 +198,10 @@ import AgentMatchJobAdd from '@/components/AgentMatchJobAdd.vue'
import AgentApplyProgress from '@/components/AgentApplyProgress.vue' import AgentApplyProgress from '@/components/AgentApplyProgress.vue'
import AgentTaskListDropdown from '@/components/AgentTaskListDropdown.vue' import AgentTaskListDropdown from '@/components/AgentTaskListDropdown.vue'
import JobResumeTemplate from '@/components/JobResumeTemplate.vue' import JobResumeTemplate from '@/components/JobResumeTemplate.vue'
import AgentJobPreviewPanel from '@/components/AgentJobPreviewPanel.vue'
import AgentPendingJobListPanel from '@/components/AgentPendingJobListPanel.vue'
import AgentApplyProgressPanel from '@/components/AgentApplyProgressPanel.vue'
import AgentSettingPanel from '@/components/AgentSettingPanel.vue'
import type { ResumeTemplateData } from '@/components/JobResumeTemplate.vue' import type { ResumeTemplateData } from '@/components/JobResumeTemplate.vue'
import { fetchAgentConfig, saveAgentConfig, fetchAgentRecommend, fetchAgentChatMessages, addAgentChatMessage, applyJob, cancelApplyJob, fetchApplyByJobIds, sendAgentChat, optimizeAgentResume } from '@/api/agent' import { fetchAgentConfig, saveAgentConfig, fetchAgentRecommend, fetchAgentChatMessages, addAgentChatMessage, applyJob, cancelApplyJob, fetchApplyByJobIds, sendAgentChat, optimizeAgentResume } from '@/api/agent'
import type { AgentConfig, AgentRecommendJob, AgentChatMessage, AgentChatHistoryItem } from '@/api/agent' import type { AgentConfig, AgentRecommendJob, AgentChatMessage, AgentChatHistoryItem } from '@/api/agent'
@@ -370,6 +400,11 @@ async function loadApplyList() {
/** 切换待投递列表下拉弹窗显隐 */ /** 切换待投递列表下拉弹窗显隐 */
function toggleTaskListDropdown() { function toggleTaskListDropdown() {
/* 投递流程进行中时禁止打开待投递列表 */
if (isApplying.value) {
ElMessage.warning('请完成或取消投递流程后再打开编辑待投递列表')
return
}
showTaskListDropdown.value = !showTaskListDropdown.value showTaskListDropdown.value = !showTaskListDropdown.value
if (showTaskListDropdown.value) { if (showTaskListDropdown.value) {
loadApplyList() loadApplyList()
@@ -564,6 +599,11 @@ function handleViewMoreJobs() {
/** 打开右侧匹配岗位面板 — 先查询投递记录更新岗位状态再显示 */ /** 打开右侧匹配岗位面板 — 先查询投递记录更新岗位状态再显示 */
async function handleOpenRecommendPanel(msgId: number) { async function handleOpenRecommendPanel(msgId: number) {
/* 投递流程进行中(模式2简历生成 / 模式3简历预览)时禁止打开推荐面板 */
if (rightPanelMode.value === 'generating' || rightPanelMode.value === 'resume') {
ElMessage.warning('请完成或退出投递流程后再添加岗位')
return
}
activeRecommendMsgId.value = msgId activeRecommendMsgId.value = msgId
showRightPanel.value = true showRightPanel.value = true
panelLoading.value = true panelLoading.value = true
@@ -618,10 +658,137 @@ function handleCloseRecommendPanel() {
rightPanelMode.value = 'recommend' rightPanelMode.value = 'recommend'
} }
// ==================== 岗位预览(模式4 ====================
/** 当前预览的岗位 ID */
const previewJobId = ref('')
/** 当前预览岗位的投递状态 */
const previewJobApplicationStatus = ref<number | null>(null)
/** 进入岗位预览前记录的面板模式(用于返回) */
const prevPanelMode = ref<'recommend' | 'generating' | 'resume' | 'jobPreview' | 'pendingList' | 'applyProgress' | 'settings'>('recommend')
/** 打开岗位预览面板 */
function handleOpenJobPreview(jobId: string | number, applicationStatus?: number | null) {
previewJobId.value = String(jobId)
previewJobApplicationStatus.value = applicationStatus ?? null
prevPanelMode.value = rightPanelMode.value
rightPanelMode.value = 'jobPreview'
showRightPanel.value = true
}
/** 岗位预览返回 — 回到之前的面板模式 */
function handleJobPreviewBack() {
/* 如果之前是 recommend 模式且有选中的消息,回到推荐面板 */
if (prevPanelMode.value === 'recommend' && activeRecommendMsgId.value !== null) {
rightPanelMode.value = 'recommend'
} else {
/* 否则关闭面板 */
showRightPanel.value = false
rightPanelMode.value = 'recommend'
}
}
/** 岗位预览中点击添加 — 添加到待投递 */
async function handleJobPreviewAdd(jobId: string) {
try {
await applyJob({ jobId, status: -1 })
/* 更新对话消息中的岗位状态 */
updateJobStatusInMessages(Number(jobId), -1)
previewJobApplicationStatus.value = -1
await loadApplyList()
ElMessage.success('岗位已添加到待投递')
} catch {
ElMessage.error('操作失败,请重试')
}
}
/** 岗位预览中点击移出 — 从待投递移除 */
async function handleJobPreviewRemove(jobId: string) {
try {
await cancelApplyJob(jobId)
/* 更新对话消息中的岗位状态 */
updateJobStatusInMessages(Number(jobId), null)
previewJobApplicationStatus.value = null
await loadApplyList()
ElMessage.success('岗位已从待投递移除')
} catch {
ElMessage.error('操作失败,请重试')
}
}
/** AgentMatchJobAdd 中点击岗位 — 打开岗位预览 */
function handleMatchJobClick(job: AgentRecommendJob) {
handleOpenJobPreview(job.id, job.applicationStatus)
}
/** AgentChatJobList 中点击岗位 — 打开岗位预览 */
function handleChatJobClick(job: AgentRecommendJob) {
/* 投递流程进行中时禁止打开岗位详情 */
if (isApplying.value) {
ElMessage.warning('请完成或取消投递流程后再查看岗位详情')
return
}
handleOpenJobPreview(job.id, job.applicationStatus)
}
// ==================== 待投递列表面板(模式5 ====================
/** 打开待投递列表面板 */
function handleOpenPendingListPanel() {
showTaskListDropdown.value = false
rightPanelMode.value = 'pendingList'
showRightPanel.value = true
}
/** 关闭待投递列表面板 */
function handleClosePendingListPanel() {
showRightPanel.value = false
rightPanelMode.value = 'recommend'
}
/** 待投递列表面板中移除岗位后同步父组件数据 */
function handlePendingListRemoved(jobId: string) {
const idx = applyJobList.value.findIndex(j => j.id === jobId)
if (idx !== -1) {
applyJobList.value.splice(idx, 1)
}
}
// ==================== 申请进度面板(模式6 ====================
/** 打开申请进度面板 */
function handleOpenApplyProgressPanel() {
showTaskListDropdown.value = false
rightPanelMode.value = 'applyProgress'
showRightPanel.value = true
}
/** 关闭申请进度面板 */
function handleCloseApplyProgressPanel() {
showRightPanel.value = false
rightPanelMode.value = 'recommend'
}
// ==================== 设置面板(模式7 ====================
/** 打开设置面板 */
function handleOpenSettingsPanel() {
rightPanelMode.value = 'settings'
showRightPanel.value = true
}
/** 关闭设置面板 */
function handleCloseSettingsPanel() {
showRightPanel.value = false
rightPanelMode.value = 'recommend'
}
// ==================== 投递进度流程 ==================== // ==================== 投递进度流程 ====================
/** 右侧面板显示模式recommend-岗位推荐 / generating-简历生成中 / resume-简历预览 */ /** 右侧面板显示模式 */
const rightPanelMode = ref<'recommend' | 'generating' | 'resume'>('recommend') const rightPanelMode = ref<'recommend' | 'generating' | 'resume' | 'jobPreview' | 'pendingList' | 'applyProgress' | 'settings'>('recommend')
/** 简历生成进度百分比(0-100) */ /** 简历生成进度百分比(0-100) */
const generateProgress = ref(0) const generateProgress = ref(0)
@@ -770,6 +937,7 @@ async function handleStartApply() {
// 打开右侧面板,显示生成进度 // 打开右侧面板,显示生成进度
rightPanelMode.value = 'generating' rightPanelMode.value = 'generating'
showRightPanel.value = true showRightPanel.value = true
applyCancelled.value = false
startProgressSimulation() startProgressSimulation()
try { try {
@@ -778,12 +946,18 @@ async function handleStartApply() {
jobId: targetJob.id, jobId: targetJob.id,
}) })
// 如果在等待期间已取消,直接退出
if (applyCancelled.value) return
// 接口返回后涨满进度条 // 接口返回后涨满进度条
finishProgress() finishProgress()
// 等待 1 秒让用户看到 100% // 等待 1 秒让用户看到 100%
await new Promise(resolve => setTimeout(resolve, 1000)) await new Promise(resolve => setTimeout(resolve, 1000))
// 再次检查取消状态
if (applyCancelled.value) return
// 解析简历数据 — 映射接口返回格式到 ResumeTemplateData // 解析简历数据 — 映射接口返回格式到 ResumeTemplateData
const apiData = res?.data || res const apiData = res?.data || res
if (apiData) { if (apiData) {
@@ -801,6 +975,8 @@ async function handleStartApply() {
rightPanelMode.value = 'resume' rightPanelMode.value = 'resume'
} }
} catch (e) { } catch (e) {
// 取消导致的异常不提示
if (applyCancelled.value) return
console.error('[Agent] 优化简历失败', e) console.error('[Agent] 优化简历失败', e)
ElMessage.error('简历优化失败,请重试') ElMessage.error('简历优化失败,请重试')
finishProgress() finishProgress()
@@ -895,8 +1071,20 @@ function handleTogglePause() {
isPaused.value = !isPaused.value isPaused.value = !isPaused.value
} }
/** 标记当前投递流程是否已被取消(防止异步回调覆盖状态) */
const applyCancelled = ref(false)
/** 取消投递流程 */ /** 取消投递流程 */
function handleCancelApply(msg: AgentChatMessage) { function handleCancelApply(msg: AgentChatMessage) {
// 标记已取消,阻止进行中的异步回调继续操作
applyCancelled.value = true
// 清除进度条定时器
if (progressTimer) {
clearInterval(progressTimer)
progressTimer = null
}
// 重置暂停状态
isPaused.value = false
// 从消息列表中移除该条 apply_progress // 从消息列表中移除该条 apply_progress
const idx = chatMessages.value.findIndex(m => m.id === msg.id) const idx = chatMessages.value.findIndex(m => m.id === msg.id)
if (idx !== -1) { if (idx !== -1) {
@@ -1029,6 +1217,7 @@ async function autoStartNextApply() {
// 第1步:优化简历 // 第1步:优化简历
rightPanelMode.value = 'generating' rightPanelMode.value = 'generating'
showRightPanel.value = true showRightPanel.value = true
applyCancelled.value = false
startProgressSimulation() startProgressSimulation()
try { try {
@@ -1037,9 +1226,13 @@ async function autoStartNextApply() {
jobId: targetJob.id, jobId: targetJob.id,
}) })
if (applyCancelled.value) return
finishProgress() finishProgress()
await new Promise(resolve => setTimeout(resolve, 1000)) await new Promise(resolve => setTimeout(resolve, 1000))
if (applyCancelled.value) return
const apiData = res?.data || res const apiData = res?.data || res
if (apiData) { if (apiData) {
const resumeResult = mapOptimizeResumeToTemplate(apiData) const resumeResult = mapOptimizeResumeToTemplate(apiData)
@@ -1053,6 +1246,7 @@ async function autoStartNextApply() {
rightPanelMode.value = 'resume' rightPanelMode.value = 'resume'
} }
} catch (e) { } catch (e) {
if (applyCancelled.value) return
console.error('[Agent] 优化简历失败', e) console.error('[Agent] 优化简历失败', e)
ElMessage.error('简历优化失败,请重试') ElMessage.error('简历优化失败,请重试')
finishProgress() finishProgress()
+6 -29
View File
@@ -259,8 +259,7 @@
<!-- 职位问题反馈弹窗 --> <!-- 职位问题反馈弹窗 -->
<JobFeedbackDialog ref="feedbackDialogRef" v-model="showFeedbackDialog" :job-id="feedbackJobId" /> <JobFeedbackDialog ref="feedbackDialogRef" v-model="showFeedbackDialog" :job-id="feedbackJobId" />
<!-- 欢迎上传简历弹窗 -->
<ProfileWelcomeDialog v-model="showWelcomeDialog" />
</div> </div>
</template> </template>
@@ -276,8 +275,8 @@ import JobFeedbackDialog from '@/components/JobFeedbackDialog.vue'
import IndustrySelector from '@/components/tools/IndustrySelector.vue' import IndustrySelector from '@/components/tools/IndustrySelector.vue'
import JobCategorySelector from '@/components/tools/JobCategorySelector.vue' import JobCategorySelector from '@/components/tools/JobCategorySelector.vue'
import RegionSelector from '@/components/tools/RegionSelector.vue' import RegionSelector from '@/components/tools/RegionSelector.vue'
import ProfileWelcomeDialog from '@/components/ProfileWelcomeDialog.vue'
import { fetchProfile } from '@/api/profile'
import { fetchJobList, fetchFavoriteList, toggleJobFavorite, removeJobFavorite, fetchFavoriteCount, fetchApplyList, fetchApplyCount, removeJobFromList } from '@/api/jobs' import { fetchJobList, fetchFavoriteList, toggleJobFavorite, removeJobFavorite, fetchFavoriteCount, fetchApplyList, fetchApplyCount, removeJobFromList } from '@/api/jobs'
import type { JobListItem, JobListParams, FavoriteListParams, ApplyListParams, ApplyCountData } from '@/api/jobs' import type { JobListItem, JobListParams, FavoriteListParams, ApplyListParams, ApplyCountData } from '@/api/jobs'
@@ -332,8 +331,7 @@ const feedbackJobId = ref<string | null>(null)
/** 当前问助手的岗位 ID(传给 AiChat 组件) */ /** 当前问助手的岗位 ID(传给 AiChat 组件) */
const currentAskJobId = ref<string>('') const currentAskJobId = ref<string>('')
/** 欢迎弹窗的显示状态 */
const showWelcomeDialog = ref(false)
/** 点击"问助手"按钮,传入岗位 ID 给 AiChat */ /** 点击"问助手"按钮,传入岗位 ID 给 AiChat */
function askAssistant(job: JobItem) { function askAssistant(job: JobItem) {
@@ -552,15 +550,7 @@ onMounted(async () => {
// 加载用户个人信息到全局 store // 加载用户个人信息到全局 store
store.dispatch('loadUserInfo') store.dispatch('loadUserInfo')
// 检查个人资料是否存在,不存在则弹出欢迎弹窗
// try {
// const profileRes = await fetchProfile()
// if (profileRes.code === '0' && (!profileRes.data || profileRes.data === null)) {
// showWelcomeDialog.value = true
// }
// } catch {
// // 接口异常不阻塞页面加载
// }
// 加载收藏统计(用于 Tab 标签显示) // 加载收藏统计(用于 Tab 标签显示)
loadFavoriteCount() loadFavoriteCount()
@@ -907,20 +897,7 @@ watch(
{ deep: true }, { deep: true },
) )
// 监听登录状态变化 — 登录成功后检查个人资料是否存在
watch(isAuthenticated, async (newVal, oldVal) => {
if (newVal && !oldVal) {
// 从未登录变为已登录,检查个人资料
try {
const profileRes = await fetchProfile()
if (profileRes.code === '0' && (!profileRes.data || profileRes.data === null)) {
showWelcomeDialog.value = true
}
} catch {
// 接口异常不阻塞
}
}
})
// 监听 Tab 切换,重置列表状态并加载对应数据 // 监听 Tab 切换,重置列表状态并加载对应数据
watch(activeTab, (newTab, oldTab) => { watch(activeTab, (newTab, oldTab) => {