意向字段全部改成使用招聘分类
This commit is contained in:
@@ -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<number, string> = { 0: '全职', 1: '兼职' }
|
||||
return map[type ?? -1] ?? ''
|
||||
}
|
||||
/** 工作类型映射 — 使用全局统一的 formatEmploymentType */
|
||||
|
||||
/** 加载岗位详情 */
|
||||
async function loadDetail() {
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<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>
|
||||
<span v-if="intentionEmploymentLabel" class="agent-setting-panel__goal-tag">{{ intentionEmploymentLabel }}</span>
|
||||
<!-- 无意向时的空状态 -->
|
||||
|
||||
</div>
|
||||
@@ -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({
|
||||
|
||||
@@ -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<MatchedJobItem[]>([])
|
||||
@@ -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,
|
||||
|
||||
@@ -62,10 +62,10 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 工作类型选择模块 -->
|
||||
<!-- 招聘分类选择模块 -->
|
||||
<div class="job-goal-dialog__section ">
|
||||
<div class="job-goal-dialog__label">*工作类型</div>
|
||||
<!-- 工作类型按钮组 -->
|
||||
<div class="job-goal-dialog__label">*招聘分类</div>
|
||||
<!-- 招聘分类按钮组 -->
|
||||
<div class="job-goal-dialog__type-group">
|
||||
<button
|
||||
v-for="t in jobTypes"
|
||||
@@ -118,7 +118,7 @@ const selectedIndustryIds = ref<number[]>([])
|
||||
const selectedRegionCodes = ref<string[]>([])
|
||||
const selectedJobType = ref('全职')
|
||||
|
||||
/** 工作类型选项列表 — 从全局常量提取 label 生成 */
|
||||
/** 招聘分类选项列表 — 从全局常量提取 label 生成 */
|
||||
const jobTypes = JOB_TYPE_OPTIONS.map(item => item.label)
|
||||
|
||||
/** 弹窗打开时从 store 同步数据到本地编辑副本 */
|
||||
@@ -128,7 +128,7 @@ watch(() => props.modelValue, (v) => {
|
||||
selectedCategoryIds.value = [...(intention.categoryIds || [])]
|
||||
selectedIndustryIds.value = [...(intention.industryIds || [])]
|
||||
selectedRegionCodes.value = [...(intention.regionCodes || [])]
|
||||
selectedJobType.value = formatEmploymentType(intention.employmentType)
|
||||
selectedJobType.value = formatEmploymentType(intention.recruitCategory)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -175,7 +175,7 @@ async function handleSave() {
|
||||
categoryIds: [...selectedCategoryIds.value],
|
||||
industryIds: [...selectedIndustryIds.value],
|
||||
regionCodes: [...selectedRegionCodes.value],
|
||||
employmentType: JOB_TYPE_OPTIONS.find(o => o.label === selectedJobType.value)?.value ?? 0,
|
||||
recruitCategory: JOB_TYPE_OPTIONS.find(o => o.label === selectedJobType.value)?.value ?? 0,
|
||||
})
|
||||
visible.value = false
|
||||
} catch (e) {
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<span class="settings-dialog__reminder-tag" v-for="name in intentionRegionNames" :key="name">{{ name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-dialog__reminder-group">
|
||||
<div v-if="intentionEmploymentLabel" class="settings-dialog__reminder-group">
|
||||
<span class="settings-dialog__reminder-group-label">类型</span>
|
||||
<div class="settings-dialog__reminder-tags">
|
||||
<span class="settings-dialog__reminder-tag">{{ intentionEmploymentLabel }}</span>
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
/** 编辑目标岗位 — 打开求职目标弹窗 */
|
||||
|
||||
Reference in New Issue
Block a user