意向字段全部改成使用招聘分类
This commit is contained in:
+11
-11
@@ -447,18 +447,18 @@ const filters = ref<FilterItem[]>([
|
||||
{ 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<number | null>(
|
||||
() => 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()) {
|
||||
|
||||
Reference in New Issue
Block a user