From 809e57347aa79827dcf813775207ad02cee6f35e Mon Sep 17 00:00:00 2001 From: Apcallover <1503963513@qq.com> Date: Wed, 1 Jul 2026 14:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=3D=E3=80=90=E9=A6=96=E9=A1=B5=E3=80=91?= =?UTF-8?q?=E5=B2=97=E4=BD=8D=E7=AD=9B=E9=80=89=20-=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8C=89=E8=96=AA=E8=B5=84=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?(minSalary/maxSalary)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .../new-filter-page/new-filter-page.vue | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/components/new-filter-page/new-filter-page.vue b/components/new-filter-page/new-filter-page.vue index 2694d2f..f47565e 100644 --- a/components/new-filter-page/new-filter-page.vue +++ b/components/new-filter-page/new-filter-page.vue @@ -53,6 +53,24 @@ + + + + + + + @@ -143,6 +161,7 @@ const getJobTypeData = () => { const tabs = [ { key: 'education', label: '学历要求' }, { key: 'experience', label: '工作经验' }, + { key: 'salary', label: '薪资' }, { key: 'scale', label: '公司规模' }, { key: 'jobType', label: '岗位类型' }, { key: 'area', label: '地区' } @@ -155,6 +174,7 @@ const activeTab = ref('education'); const selectedValues = reactive({ education: '', experience: '', + salary: '', scale: '', area: '', jobType: '' @@ -167,6 +187,16 @@ const scaleOptions = ref([]); const areaOptions = ref([]); const jobTypeOptions = ref([]); +// 薪资区间数据(单位:元/月),min/max 为空表示该侧不设限 +const salaryOptions = ref([ + { label: '3K以下', value: '0-3000', min: '', max: 3000 }, + { label: '3-5K', value: '3000-5000', min: 3000, max: 5000 }, + { label: '5-10K', value: '5000-10000', min: 5000, max: 10000 }, + { label: '10-20K', value: '10000-20000', min: 10000, max: 20000 }, + { label: '20-50K', value: '20000-50000', min: 20000, max: 50000 }, + { label: '50K以上', value: '50000-0', min: 50000, max: '' }, +]); + // 加载状态 const loading = ref(true); @@ -202,8 +232,23 @@ const handleClear = () => { // 确认筛选 const handleConfirm = () => { - console.log('selectedValues:', selectedValues); - emit('confirm', selectedValues); + const payload = { ...selectedValues }; + // 将选中的薪资区间转换为 minSalary / maxSalary 参数 + // 始终带上 minSalary / maxSalary(含空值),便于父组件在清除时移除旧值 + let minSalary = ''; + let maxSalary = ''; + if (payload.salary) { + const selected = salaryOptions.value.find((item) => item.value === payload.salary); + if (selected) { + minSalary = selected.min; + maxSalary = selected.max; + } + } + payload.minSalary = minSalary; + payload.maxSalary = maxSalary; + delete payload.salary; + console.log('selectedValues:', payload); + emit('confirm', payload); handleClose(); };