|
@@ -5,8 +5,8 @@
|
|
|
<v-card style="z-index: 998">
|
|
|
<div class="stickyBox my-3">
|
|
|
<headSearch
|
|
|
- @handleJobClick="val => dealParams('conditionFilterRef', val, 'positionId')"
|
|
|
- @handleSearch="val => dealParams('conditionFilterRef', val, 'content')"
|
|
|
+ @handleJobClick="val => dealParams(val, 'positionId')"
|
|
|
+ @handleSearch="val => dealParams(val, 'content')"
|
|
|
></headSearch>
|
|
|
</div>
|
|
|
<cityFilter class="mx-5 mb-3" ref="cityFilterRef" @updateCheckedInput="updateRouteQuery('cityFilterRef')"></cityFilter>
|
|
@@ -62,15 +62,6 @@ const getPositionList = async () => {
|
|
|
total.value = number
|
|
|
}
|
|
|
|
|
|
-// 刷新后有参数则进行搜索
|
|
|
-if (routeQuery) {
|
|
|
- for (let i in routeQuery) {
|
|
|
- if (routeQuery[i].indexOf('_') !== -1) pageReqVO[i] = routeQuery[i].split('_')
|
|
|
- else pageReqVO[i] = routeQuery[i]
|
|
|
- }
|
|
|
- getPositionList()
|
|
|
-} else getPositionList()
|
|
|
-
|
|
|
const removeEmptyStringsAndReturnNew = (obj) => {
|
|
|
const result = {}
|
|
|
Object.keys(obj).forEach(function(key) {
|
|
@@ -83,13 +74,14 @@ const removeEmptyStringsAndReturnNew = (obj) => {
|
|
|
|
|
|
const updateRouteQuery = (ref, val, key) => {
|
|
|
ref
|
|
|
- const queryObj = { cityFilter: null, conditionFilter: null }
|
|
|
+ const queryObj = { cityFilter: {}, conditionFilter: {} }
|
|
|
if (cityFilterRef.value?.getQuery) {
|
|
|
queryObj.cityFilter = removeEmptyStringsAndReturnNew(cityFilterRef.value?.getQuery())
|
|
|
}
|
|
|
if (conditionFilterRef.value?.getQuery) {
|
|
|
- queryObj.conditionFilter = removeEmptyStringsAndReturnNew(conditionFilterRef.value?.getQuery())
|
|
|
- if (val && key) queryObj.conditionFilter[key] = val
|
|
|
+ const objData = conditionFilterRef.value?.getQuery()
|
|
|
+ if (val && key) objData[key] = val
|
|
|
+ queryObj.conditionFilter = removeEmptyStringsAndReturnNew(objData)
|
|
|
}
|
|
|
let queryArr = []
|
|
|
if (queryObj) {
|
|
@@ -105,22 +97,34 @@ const updateRouteQuery = (ref, val, key) => {
|
|
|
}
|
|
|
const str = queryArr?.join('&')
|
|
|
if (str) router.push(`${route.path}?${str}`)
|
|
|
- handleSearchPosition()
|
|
|
+ handleSearchPosition(val, key)
|
|
|
}
|
|
|
|
|
|
// 职位搜索
|
|
|
const handleSearchPosition = () => {
|
|
|
- const conditionParams = conditionFilterRef.value.params
|
|
|
+ const conditionParams = conditionFilterRef.value?.params
|
|
|
const cityParams = cityFilterRef.value?.getQuery
|
|
|
- pageReqVO = { ...pageReqVO, ...conditionParams, ...cityParams }
|
|
|
+ pageReqVO = { ...pageReqVO, ...conditionParams, ...cityParams, content: pageReqVO.content }
|
|
|
getPositionList()
|
|
|
}
|
|
|
|
|
|
// 职位类型、关键字
|
|
|
-const dealParams = (name, val, key) => {
|
|
|
- updateRouteQuery(name, val, key)
|
|
|
+const dealParams = (val, key) => {
|
|
|
+ pageReqVO[key] = val
|
|
|
updateRouteQuery('cityFilterRef')
|
|
|
+ updateRouteQuery('conditionFilterRef', val, key)
|
|
|
}
|
|
|
+
|
|
|
+// 刷新后有参数则进行搜索
|
|
|
+if (routeQuery) {
|
|
|
+ for (let i in routeQuery) {
|
|
|
+ if (routeQuery[i].indexOf('_') !== -1) pageReqVO[i] = routeQuery[i].split('_')
|
|
|
+ else pageReqVO[i] = routeQuery[i]
|
|
|
+ }
|
|
|
+ if (routeQuery.content) updateRouteQuery('conditionFilterRef', routeQuery.content, 'content')
|
|
|
+ getPositionList()
|
|
|
+} else getPositionList()
|
|
|
+
|
|
|
// 分页
|
|
|
const handleChangePage = (index) => {
|
|
|
pageInfo.pageNo = index
|