From c17f75c707598170504ce237dee125c26c8a5ba0 Mon Sep 17 00:00:00 2001 From: xuxin <15279969124@163.com> Date: Fri, 5 Jun 2026 17:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=8F=E5=90=91=E5=AD=97=E6=AE=B5=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E6=94=B9=E6=88=90=E4=BD=BF=E7=94=A8=E6=8B=9B=E8=81=98?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jobs.ts | 11 ++-- src/assets/styles/pages/login.scss | 12 +++- src/components/AgentJobPreviewPanel.vue | 7 +-- src/components/AgentSettingPanel.vue | 8 +-- src/components/AgentSetupWizard.vue | 8 +-- src/components/JobGoalDialog.vue | 12 ++-- src/components/SettingsDialog.vue | 6 +- src/stores/index.ts | 18 +++--- src/views/Jobs.vue | 22 +++---- src/views/Login.vue | 76 ++++++++++--------------- 10 files changed, 85 insertions(+), 95 deletions(-) diff --git a/src/api/jobs.ts b/src/api/jobs.ts index 3c72299..f9d0ceb 100644 --- a/src/api/jobs.ts +++ b/src/api/jobs.ts @@ -75,8 +75,6 @@ export interface JobListParams { categoryIds?: number[] /** 行业 ID 列表 */ industryIds?: number[] - /** 工作类型:0=全职 1=兼职 */ - employmentType?: number /** 指定岗位 ID 列表(用于收藏列表) */ jobIds?: number[] /** 岗位状态过滤(0=有效 1=已下架 2=已过期,可多选,null或空=查所有) */ @@ -100,8 +98,10 @@ export interface JobIntention { regionCodes?: string[] /** 期望行业 ID 列表 */ industryIds?: number[] - /** 就业类型:0=全职,1=实习 */ - employmentType?: number + /** 就业类型:0=校招,1=实习,2=社招 */ + employmentType?: number | null + /** 招聘分类:0=社招,1=校招,2=实习,3=其他 */ + recruitCategory?: number | null } /** @@ -128,9 +128,6 @@ export function saveJobIntention(data: JobIntention) { * @param params 岗位列表查询参数 */ export function fetchJobList(params: JobListParams = {}) { - //兼容旧的数据组件,让招聘分类参数从工作类型那里拿,工作类型不需要传了 - params.recruitCategory = params.employmentType - delete params.employmentType return request.post>('/job/list', { pageNum: params.pageNum ?? 1, pageSize: params.pageSize ?? 15, diff --git a/src/assets/styles/pages/login.scss b/src/assets/styles/pages/login.scss index 89720ad..ab27bd8 100644 --- a/src/assets/styles/pages/login.scss +++ b/src/assets/styles/pages/login.scss @@ -346,11 +346,21 @@ font-weight: 600; font-size: 0.16rem; color: #FFFFFF; - cursor: default; + cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.08rem; + transition: opacity 0.2s; + + &:disabled { + opacity: 0.7; + cursor: not-allowed; + } + + &:not(:disabled):hover { + opacity: 0.9; + } } /* 登录中转圈动画 */ diff --git a/src/components/AgentJobPreviewPanel.vue b/src/components/AgentJobPreviewPanel.vue index dd9f47c..14362a4 100644 --- a/src/components/AgentJobPreviewPanel.vue +++ b/src/components/AgentJobPreviewPanel.vue @@ -109,6 +109,7 @@ import { ref, computed, onMounted, watch } from 'vue' import { fetchJobDetail } from '@/api/jobs' import type { JobDetailData } from '@/api/jobs' +import { formatEmploymentType } from '@/stores/index' /** 组件 Props */ const props = defineProps<{ @@ -150,11 +151,7 @@ const formatTime = computed(() => { return '' }) -/** 工作类型映射 */ -function formatEmploymentType(type: number | undefined): string { - const map: Record = { 0: '全职', 1: '兼职' } - return map[type ?? -1] ?? '' -} +/** 工作类型映射 — 使用全局统一的 formatEmploymentType */ /** 加载岗位详情 */ async function loadDetail() { diff --git a/src/components/AgentSettingPanel.vue b/src/components/AgentSettingPanel.vue index 697d45c..8a6e415 100644 --- a/src/components/AgentSettingPanel.vue +++ b/src/components/AgentSettingPanel.vue @@ -66,7 +66,7 @@ {{ name }} {{ name }} {{ name }} - {{ intentionEmploymentLabel }} + {{ intentionEmploymentLabel }} @@ -282,8 +282,8 @@ const intentionIndustryNames = computed(() => (store.state.jobIntention?.industr /** 求职意向 — 地区名称列表 */ const intentionRegionNames = computed(() => (store.state.jobIntention?.regionCodes || []).map((code: string) => resolveRegionName(code)).filter(Boolean)) -/** 求职意向 — 就业类型文案 */ -const intentionEmploymentLabel = computed(() => formatEmploymentType(store.state.jobIntention?.employmentType)) +/** 求职意向 — 招聘分类文案 */ +const intentionEmploymentLabel = computed(() => formatEmploymentType(store.state.jobIntention?.recruitCategory)) // ==================== 浏览器插件 ==================== @@ -336,7 +336,7 @@ function downloadExtension() { // ==================== 求职助手配置 ==================== /** 是否为实习类型 */ -const isInternship = computed(() => store.state.jobIntention?.employmentType === 1) +const isInternship = computed(() => store.state.jobIntention?.recruitCategory === 2) /** 配置表单数据 */ const configForm = ref({ diff --git a/src/components/AgentSetupWizard.vue b/src/components/AgentSetupWizard.vue index 205a92e..22c719f 100644 --- a/src/components/AgentSetupWizard.vue +++ b/src/components/AgentSetupWizard.vue @@ -403,7 +403,7 @@ const showJobGoalDialog = ref(false) const intentionCategoryNames = computed(() => (store.state.jobIntention.categoryIds || []).map((id: number) => resolveJobCategoryName(id))) const intentionIndustryNames = computed(() => (store.state.jobIntention.industryIds || []).map((id: number) => resolveIndustryName(id))) const intentionRegionNames = computed(() => (store.state.jobIntention.regionCodes || []).map((code: string) => resolveRegionName(code))) -const intentionEmploymentLabel = computed(() => formatEmploymentType(store.state.jobIntention.employmentType)) +const intentionEmploymentLabel = computed(() => formatEmploymentType(store.state.jobIntention.recruitCategory)) interface MatchedJobItem extends JobListItem { feedback: string } const matchedJobs = ref([]) @@ -418,7 +418,7 @@ async function loadMatchedJobs() { loadingMatchJobs.value = true; matchedJobs.value = [] try { const intention = store.state.jobIntention - const res = await fetchJobList({ pageNum: 1, pageSize: 30, regionCodes: intention.regionCodes?.length ? intention.regionCodes : undefined, categoryIds: intention.categoryIds?.length ? intention.categoryIds : undefined, industryIds: intention.industryIds?.length ? intention.industryIds : undefined, employmentType: intention.employmentType ?? undefined }) + const res = await fetchJobList({ pageNum: 1, pageSize: 30, regionCodes: intention.regionCodes?.length ? intention.regionCodes : undefined, categoryIds: intention.categoryIds?.length ? intention.categoryIds : undefined, industryIds: intention.industryIds?.length ? intention.industryIds : undefined, recruitCategory: intention.recruitCategory ?? undefined }) if (res.code === '0' && res.data && res.data.list.length > 0) { const shuffled = [...res.data.list].sort(() => Math.random() - 0.5) matchedJobs.value = shuffled.slice(0, 3).map(item => ({ ...item, feedback: '' })) @@ -434,7 +434,7 @@ function handleDislike(index: number) { } // ==================== 第3步:网申常见问题 ==================== -const isInternship = computed(() => store.state.jobIntention.employmentType === 1) +const isInternship = computed(() => store.state.jobIntention.recruitCategory === 2) const step3Sub = ref(1) const step3Form = reactive({ acceptDeptTransfer: '', acceptLocationTransfer: '', @@ -481,7 +481,7 @@ const setupComplete = ref(false) function handleStep4Complete() { const step4Data = settingsPanelRef.value?.getData() const allSettings = { - jobType: store.state.jobIntention.employmentType === 1 ? 1 : 2, + jobType: store.state.jobIntention.recruitCategory === 2 ? 1 : 2, agentMode: step4Data?.agentMode ?? 1, weeklyTarget: step4Data?.weeklyTarget ?? 2, autoOptimizeResume: step4Data?.autoOptimizeResume ?? 1, diff --git a/src/components/JobGoalDialog.vue b/src/components/JobGoalDialog.vue index 0857368..aec1ef3 100644 --- a/src/components/JobGoalDialog.vue +++ b/src/components/JobGoalDialog.vue @@ -62,10 +62,10 @@ /> - +
-
*工作类型
- +
*招聘分类
+
-
+
类型
{{ intentionEmploymentLabel }} @@ -366,9 +366,9 @@ const intentionRegionNames = computed(() => { return codes.map((code: string) => resolveRegionName(code)) }) -/** 就业类型标签 */ +/** 招聘分类标签 */ const intentionEmploymentLabel = computed(() => { - return formatEmploymentType(store.state.jobIntention.employmentType) + return formatEmploymentType(store.state.jobIntention.recruitCategory) }) /** 编辑目标岗位 — 打开求职目标弹窗 */ diff --git a/src/stores/index.ts b/src/stores/index.ts index 198db3a..5cbaa66 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -10,21 +10,22 @@ import type { JobIntention } from '@/api/jobs' import { fetchUserInfo } from '@/api/auth' import type { UserInfo } from '@/api/auth' -/** 工作类型选项:label → 接口参数 employmentType(0=全职 1=实习) */ +/** 招聘分类选项:label → 接口参数 recruitCategory */ export const JOB_TYPE_OPTIONS: { label: string; value: number }[] = [ { label: '社招', value: 0 }, { label: '校招', value: 1 }, { label: '实习', value: 2 }, ] -/** 工作类型映射:数字 → 中文标签 */ +/** 招聘分类映射:数字 → 中文标签 */ export const JOB_TYPE_MAP: Record = Object.fromEntries( JOB_TYPE_OPTIONS.map(item => [item.value, item.label]), ) -/** 根据 employmentType 值获取中文标签,未匹配返回"未知" */ +/** 根据 recruitCategory 值获取中文标签,未匹配返回空字符串 */ export function formatEmploymentType(type: number | undefined | null): string { - return JOB_TYPE_MAP[type ?? -1] ?? '未知' + if (type === undefined || type === null) return '' + return JOB_TYPE_MAP[type] ?? '' } /** 职位列表页缓存数据(从详情页返回时恢复用) */ @@ -135,7 +136,8 @@ export default createStore({ categoryIds: [], regionCodes: [], industryIds: [], - employmentType: 0, + employmentType: null, + recruitCategory: null, }, userInfo: null, showSettings: false, @@ -189,7 +191,8 @@ export default createStore({ categoryIds: data.categoryIds ?? [], regionCodes: data.regionCodes ?? [], industryIds: data.industryIds ?? [], - employmentType: data.employmentType ?? 0, + employmentType: data.employmentType ?? null, + recruitCategory: data.recruitCategory ?? null, } }, SET_USER_INFO(state, data: UserInfo | null) { @@ -274,7 +277,8 @@ export default createStore({ categoryIds: [], regionCodes: [], industryIds: [], - employmentType: 0, + employmentType: null, + recruitCategory: null, }) }, diff --git a/src/views/Jobs.vue b/src/views/Jobs.vue index d4b790a..218c31d 100644 --- a/src/views/Jobs.vue +++ b/src/views/Jobs.vue @@ -447,18 +447,18 @@ const filters = ref([ { label: '城市', key: 'city', selected: '' }, { label: '岗位', key: 'position', selected: '' }, { label: '行业', key: 'industry', selected: '' }, - { label: '工作类型', key: 'jobType', selected: '' }, + { label: '招聘分类', key: 'jobType', selected: '' }, ]) -/** 工作类型选项映射:从全局 store 常量统一引入 */ +/** 招聘分类选项映射:从全局 store 常量统一引入 */ const jobTypeOptions = JOB_TYPE_OPTIONS -/** 工作类型下拉菜单是否显示 */ +/** 招聘分类下拉菜单是否显示 */ const showJobTypeDropdown = ref(false) -/** 当前选中的工作类型 — 直接读 store.jobIntention.employmentType */ +/** 当前选中的招聘分类 — 直接读 store.jobIntention.recruitCategory */ const selectedEmploymentType = computed( - () => store.state.jobIntention.employmentType ?? null, + () => store.state.jobIntention.recruitCategory ?? null, ) /** 选中的行业 id 数组 — 直接读 store.jobIntention.industryIds */ @@ -500,24 +500,24 @@ function onRegionChange(codes: string[]) { }) } -/** 点击筛选条件按钮 — 仅工作类型展开下拉 */ +/** 点击筛选条件按钮 — 仅招聘分类展开下拉 */ function handleFilterClick(filter: FilterItem) { if (filter.key === 'jobType') { showJobTypeDropdown.value = !showJobTypeDropdown.value } } -/** 选中工作类型选项 */ +/** 选中招聘分类选项 */ function selectJobType(filter: FilterItem, option: { label: string; value: number }) { filter.selected = option.label showJobTypeDropdown.value = false store.dispatch('saveJobIntention', { ...store.state.jobIntention, - employmentType: option.value, + recruitCategory: option.value, }) } -/** 监听 store 中 employmentType 变化,同步工作类型筛选按钮的显示文字 */ +/** 监听 store 中 recruitCategory 变化,同步招聘分类筛选按钮的显示文字 */ watch(selectedEmploymentType, (val) => { const jobTypeFilter = filters.value.find(f => f.key === 'jobType') if (jobTypeFilter && val !== null) { @@ -765,9 +765,9 @@ function buildParams(): JobListParams { if (selectedIndustryIds.value.length) { params.industryIds = selectedIndustryIds.value } - // 工作类型筛选 + // 招聘分类筛选 if (selectedEmploymentType.value !== null) { - params.employmentType = selectedEmploymentType.value + params.recruitCategory = selectedEmploymentType.value } // 搜索关键词 if (keyword.value.trim()) { diff --git a/src/views/Login.vue b/src/views/Login.vue index fcd74ff..671f820 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -109,17 +109,25 @@
- -