|
@@ -9,8 +9,8 @@
|
|
|
@handleSearch="val => dealParams(val, 'content')"
|
|
|
></headSearch>
|
|
|
</div>
|
|
|
- <cityFilter class="mx-5 mb-3" ref="cityFilterRef" @updateCheckedInput="updateRouteQuery('cityFilterRef')"></cityFilter>
|
|
|
- <conditionFilter class="mx-5 mb-3" ref="conditionFilterRef" @conditionFilterChange="updateRouteQuery('conditionFilterRef')"></conditionFilter>
|
|
|
+ <cityFilter class="mx-5 mb-3" ref="cityFilterRef" @updateCheckedInput="handleMounted"></cityFilter>
|
|
|
+ <conditionFilter class="mx-5 mb-3" ref="conditionFilterRef" @conditionFilterChange="handleMounted"></conditionFilter>
|
|
|
</v-card>
|
|
|
<div class="d-flex mt-3">
|
|
|
<div class="mr-3" style="min-width: 884px;">
|
|
@@ -38,7 +38,7 @@ import PositionLongStrip from '@/components/PositionLongStrip/item.vue'
|
|
|
import Empty from '@/components/Empty'
|
|
|
import { getJobAdvertisedSearch } from '@/api/position'
|
|
|
import CtPagination from '@/components/CtPagination'
|
|
|
-import { provide, reactive, ref } from 'vue'
|
|
|
+import { provide, reactive, ref, nextTick } from 'vue'
|
|
|
import { dealDictData } from '@/views/recruit/position/components/dict'
|
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
@@ -76,9 +76,7 @@ const removeEmptyStringsAndReturnNew = (obj) => {
|
|
|
})
|
|
|
return result
|
|
|
}
|
|
|
-
|
|
|
-const updateRouteQuery = (ref, val, key) => {
|
|
|
- ref
|
|
|
+const updateRouteQuery = (val, key) => {
|
|
|
const queryObj = { cityFilter: {}, conditionFilter: {} }
|
|
|
if (cityFilterRef.value?.getQuery) {
|
|
|
queryObj.cityFilter = removeEmptyStringsAndReturnNew(cityFilterRef.value?.getQuery())
|
|
@@ -105,6 +103,12 @@ const updateRouteQuery = (ref, val, key) => {
|
|
|
handleSearchPosition(val, key)
|
|
|
}
|
|
|
|
|
|
+const handleMounted = (key, val) => {
|
|
|
+ nextTick(() => {
|
|
|
+ updateRouteQuery(key, val)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 职位搜索
|
|
|
const handleSearchPosition = () => {
|
|
|
const conditionParams = conditionFilterRef.value?.params
|
|
@@ -116,8 +120,7 @@ const handleSearchPosition = () => {
|
|
|
// 职位类型、关键字
|
|
|
const dealParams = (val, key) => {
|
|
|
pageReqVO[key] = val
|
|
|
- updateRouteQuery('cityFilterRef')
|
|
|
- updateRouteQuery('conditionFilterRef', val, key)
|
|
|
+ handleMounted(val, key)
|
|
|
}
|
|
|
|
|
|
// 刷新后有参数则进行搜索
|
|
@@ -126,7 +129,7 @@ if (routeQuery) {
|
|
|
if (routeQuery[i].indexOf('_') !== -1) pageReqVO[i] = routeQuery[i].split('_')
|
|
|
else pageReqVO[i] = routeQuery[i]
|
|
|
}
|
|
|
- if (routeQuery.content) updateRouteQuery('conditionFilterRef', routeQuery.content, 'content')
|
|
|
+ if (routeQuery.content) handleMounted(routeQuery.content, 'content')
|
|
|
getPositionList()
|
|
|
} else getPositionList()
|
|
|
|