|
@@ -49,14 +49,10 @@ const cityFilterRef = ref(); const conditionFilterRef = ref()
|
|
|
const pageInfo = { pageNo: 1, pageSize: 20}
|
|
|
const items = ref([])
|
|
|
const total = ref(0)
|
|
|
-// const routeQuery = (route?.query && route.query && Object.keys(route?.query).length) ? route.query : null
|
|
|
let routeQuery = (route?.query && route.query && Object.keys(route?.query).length) ? reactive(route.query) : reactive({})
|
|
|
provide('routeQuery', routeQuery)
|
|
|
|
|
|
const headSearchText = ref(routeQuery?.content || '')
|
|
|
-// let pageReqVO = reactive({
|
|
|
-// ...pageInfo
|
|
|
-// })
|
|
|
|
|
|
// 职位搜索
|
|
|
const getData = async () => {
|
|
@@ -81,7 +77,7 @@ const getData = async () => {
|
|
|
else pageReqVO[key] = routeQuery[key].split('_') // 传给后端Arr
|
|
|
})
|
|
|
}
|
|
|
- // console.log('pageReqVO', pageReqVO)
|
|
|
+ // console.log('getData参数pageReqVO', pageReqVO)
|
|
|
const { list, total: number } = await getJobAdvertisedSearch(pageReqVO)
|
|
|
items.value = list.map(e => {
|
|
|
e.job = { ...e.job, ...dealDictObjData({}, e.job) }
|
|
@@ -90,47 +86,26 @@ const getData = async () => {
|
|
|
})
|
|
|
total.value = number
|
|
|
}
|
|
|
-getData()
|
|
|
|
|
|
-// 刷新路由
|
|
|
+// 页面刷新
|
|
|
+if (routeQuery && Object.keys(routeQuery).length) getData()
|
|
|
+
|
|
|
+// 参数改变后刷新路由,触发数据刷新
|
|
|
const updateRouter = () => {
|
|
|
const str = Object.keys(routeQuery).length ? Object.keys(routeQuery).reduce((res, _key) => {
|
|
|
if (routeQuery[_key] !== '') res += `${res ? '&' : ''}${_key}=${routeQuery[_key]}`
|
|
|
return res
|
|
|
}, '') : ''
|
|
|
- // console.log('route.path', str)
|
|
|
- // const str1 = "city=1__140000__140300__140321_140322_140303&jobType=1_3_0"
|
|
|
router.push(`${route.path}?${str}`)
|
|
|
- // router.push(`${route.path}?${str1}`)
|
|
|
getData()
|
|
|
}
|
|
|
|
|
|
+// 参数改变
|
|
|
const handleQueryChange = (key, val) => { // val为字符串,数组的话用_下划线分隔
|
|
|
routeQuery[key] = val
|
|
|
- // console.log('routeQuery', key, val)
|
|
|
updateRouter()
|
|
|
}
|
|
|
|
|
|
-// // 职位搜索
|
|
|
-// const handleSearchPosition = () => {
|
|
|
-// // const conditionParams = conditionFilterRef.value?.params
|
|
|
-// // const cityParams = cityFilterRef.value?.getQuery
|
|
|
-// // pageReqVO = { ...pageReqVO, ...conditionParams, ...cityParams, content: pageReqVO.content }
|
|
|
-// pageReqVO = { ...pageReqVO }
|
|
|
-// getData()
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-// // 刷新后有参数则进行搜索
|
|
|
-// 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) handleQueryChange(routeQuery.content, 'content')
|
|
|
-// getData()
|
|
|
-// } else getData()
|
|
|
-
|
|
|
// 分页
|
|
|
const handleChangePage = (index) => {
|
|
|
pageInfo.pageNo = index
|