添加招聘分类筛选功能
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
import { ref, watch } from 'vue'
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { JOB_TYPE_OPTIONS, formatEmploymentType } from '@/stores/index'
|
||||
import RegionSelector from './tools/RegionSelector.vue'
|
||||
import IndustrySelector from './tools/IndustrySelector.vue'
|
||||
import JobCategorySelector from './tools/JobCategorySelector.vue'
|
||||
@@ -117,8 +118,8 @@ const selectedIndustryIds = ref<number[]>([])
|
||||
const selectedRegionCodes = ref<string[]>([])
|
||||
const selectedJobType = ref('全职')
|
||||
|
||||
/** 工作类型选项列表 */
|
||||
const jobTypes = ['实习', '全职']
|
||||
/** 工作类型选项列表 — 从全局常量提取 label 生成 */
|
||||
const jobTypes = JOB_TYPE_OPTIONS.map(item => item.label)
|
||||
|
||||
/** 弹窗打开时从 store 同步数据到本地编辑副本 */
|
||||
watch(() => props.modelValue, (v) => {
|
||||
@@ -127,7 +128,7 @@ watch(() => props.modelValue, (v) => {
|
||||
selectedCategoryIds.value = [...(intention.categoryIds || [])]
|
||||
selectedIndustryIds.value = [...(intention.industryIds || [])]
|
||||
selectedRegionCodes.value = [...(intention.regionCodes || [])]
|
||||
selectedJobType.value = intention.employmentType === 1 ? '实习' : '全职'
|
||||
selectedJobType.value = formatEmploymentType(intention.employmentType)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -174,7 +175,7 @@ async function handleSave() {
|
||||
categoryIds: [...selectedCategoryIds.value],
|
||||
industryIds: [...selectedIndustryIds.value],
|
||||
regionCodes: [...selectedRegionCodes.value],
|
||||
employmentType: selectedJobType.value === '实习' ? 1 : 0,
|
||||
employmentType: JOB_TYPE_OPTIONS.find(o => o.label === selectedJobType.value)?.value ?? 0,
|
||||
})
|
||||
visible.value = false
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user