|
@@ -70,24 +70,17 @@ const headSearchText = ref(routeQuery?.content || '')
|
|
|
|
|
|
// 职位搜索
|
|
|
const getData = async () => {
|
|
|
- const pageReqVO = { ...pageInfo }
|
|
|
+ const pageReqVO = { ...pageInfo, areaIds: [] }
|
|
|
// route.query参数
|
|
|
if (routeQuery && Object.keys(routeQuery).length) {
|
|
|
const passingStrings = ['content', 'payScope'] // 单选且传递字符串
|
|
|
const passingOneId = ['positionId'] // 单选且传递整型
|
|
|
Object.keys(routeQuery).forEach(key => {
|
|
|
if (routeQuery[key] === '') return
|
|
|
- if (key === 'city') { // 工作地区id集合,示例值([])
|
|
|
- const city = routeQuery[key]
|
|
|
- const areaIds = []
|
|
|
- const levelCountArr = city.split('__')
|
|
|
- levelCountArr?.forEach(levelIds => {
|
|
|
- const idArr = levelIds.split('_')
|
|
|
- if (idArr?.length) {
|
|
|
- idArr.forEach(idItem => {if (idItem) areaIds.push(idItem)})
|
|
|
- }
|
|
|
- })
|
|
|
- if (areaIds?.length) pageReqVO.areaIds = areaIds
|
|
|
+ if (key.includes('cityId_')) { // 工作地区id集合,示例值([])
|
|
|
+ const cityArr = routeQuery[key].split('_')
|
|
|
+ if (cityArr?.length) pageReqVO.areaIds = [...pageReqVO.areaIds, ...cityArr]
|
|
|
+ if (!pageReqVO.areaIds?.length) delete pageReqVO.areaIds
|
|
|
}
|
|
|
else if (passingStrings.includes(key)) pageReqVO[key] = routeQuery[key] // 传给后端字符串
|
|
|
else if (passingOneId.includes(key)) pageReqVO[key] = +routeQuery[key] // 传给后端单选且传递整型
|