Xiao_123 11 ماه پیش
والد
کامیت
08c9be227f

+ 13 - 5
src/components/headSearch/index.vue

@@ -14,7 +14,7 @@
           {{ text }}
         </v-btn>
       </template>
-      <jobTypeCard class="jobTypeCardBox"></jobTypeCard>
+      <jobTypeCard class="jobTypeCardBox" @handleJobClick="handleClickJob"></jobTypeCard>
     </v-menu>
     <!-- <div style="position: relative;">
       <div class="jobBox d-flex pl-5" :class="{'drawer': drawer}" @click.stop="drawer = !drawer">
@@ -44,7 +44,7 @@ import { ref, watch } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 defineOptions({ name:'common-components-headSearch'})
 const route = useRoute(); const router = useRouter()
-const emits = defineEmits(['handleSearch'])// 定义一个或多个自定义事件
+const emits = defineEmits(['handleSearch', 'handleJobClick'])// 定义一个或多个自定义事件
 
 const text = ref('职位类型')
 const value = ref('')
@@ -57,9 +57,17 @@ watch(() => sharedState.layoutClickCount, () => {
 });
 
 const handleSearch = () => {
-  const path = '/recruit/position'
-  if (path === route.path) emits('handleSearch', {})
-  else router.push({ path: '/recruit/position',query: {} })
+  // 职位搜索页传参,其它的跳转到职位搜索页
+  if (route.path !== '/recruit/position') {
+    if (value.value) router.push(`/recruit/position?content=${value.value}`)
+    else router.push('/recruit/position')
+  } else emits('handleSearch', value.value)
+}
+
+const handleClickJob = (val) => {
+  // 职位搜索页点击传参, 其它的跳转到职位搜索页
+  if (route.path !== '/recruit/position') router.push(`/recruit/position?positionId=${val[0]}`)
+  else emits('handleJobClick', val)
 }
 
 </script>

+ 27 - 14
src/components/jobTypeCard/index.vue

@@ -40,7 +40,14 @@
             <div class="categoryName2">{{ item.nameCn }}</div>
             <div class="rightContent">
               <div v-if="!item.children?.length"></div>
-              <div v-else class="jobItem" v-for="val in item.children" :key="val.id" @click="handleJobClick(val)">{{ val.nameCn }}</div>
+              <div 
+                v-else 
+                :class="['jobItem', {'active': selectItems.includes(val.id)}]" 
+                v-for="val in item.children" 
+                :key="val.id" 
+                @click="handleJobClick(val)"
+              >
+              {{ val.nameCn }}</div>
             </div>
           </div>
         </div>
@@ -62,31 +69,30 @@
 import { getPositionTreeClick } from '@/api/common/index'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { reactive, ref, defineEmits } from 'vue';
-import { useRoute, useRouter } from 'vue-router'
 defineOptions({ name:'common-components-jobTypeCard'})
 
-const route = useRoute(); const router = useRouter()
-const emits = defineEmits(['handleJobClick'])// 定义一个或多个自定义事件
+const emits = defineEmits(['handleJobClick', 'jobClick'])// 定义一个或多个自定义事件
 
 const props = defineProps({
   page: { // 左侧数据是否分页(首页有分页)
     type: Boolean,
     default: false
   },
-  isCustomer: {
-    type: Boolean,
-    default: false
+  params: {
+    Object,
+    default: () => {}
   }
 })
 const isPage = props.page
+const selectItems = ref([])
 
 // 职位点击
 const handleJobClick = async (val) => {
-  await getPositionTreeClick({ id: val.id })
-  if (props.isCustomer) return emits('handleJobClick', val)
-  const path = '/recruit/position'
-  if (path === route.path) emits('jobClick', val)
-  else router.push({ path, query: { ...val, jumpType: 1 } })
+  await getPositionTreeClick({ id: val.id }) // 埋点
+  if (selectItems.value.includes(val.id)) {
+    selectItems.value = selectItems.value.filter(e => e.id !== val.id)
+  } else selectItems.value.push(val.id)
+  emits('handleJobClick', selectItems.value)
 }
 
 // 翻页数据
@@ -94,7 +100,7 @@ const pageInfo = reactive({ current: 1, size: 8 })
 let pageCount = ref(0)
 let defaultItems = ref()
 
-let items = ref()
+let items = ref([])
 // 翻页
 const getPageItems = () => {
   const startIndex = (pageInfo.current - 1) * pageInfo.size
@@ -125,6 +131,10 @@ const rightObj = reactive({ show: false, data: {} })
 const handleMouseOver = (val, index) => { // 鼠标移入
   leftIndex.value = index
   rightObj.data = val
+  // 回显
+  if (props.params &&  props.params.positionId && props.params.positionId.length) {
+    selectItems.value = props.params.positionId.split('_').map(e => Number(e))
+  }
   rightObj.show = true
 }
 const handleMouseLeave = () => { // 鼠标移出
@@ -136,10 +146,13 @@ const carouselList = ref([
   { src: 'https://img.kinpan.com/Files/design/detailimages/20161228/6361853956839262507798973.jpg', },
   { src: 'https://img0.baidu.com/it/u=3769341087,3426515789&fm=253&fmt=auto&app=138&f=JPEG?w=1180&h=472', },
 ])
-
 </script>
 
 <style lang="scss" scoped>
+.active {
+  color: var(--v-primary-base) !important;
+  font-weight: 700;
+}
 :deep(.v-window) {
   height: 392px !important;
 }

+ 1 - 1
src/views/Home/personal/index.vue

@@ -6,7 +6,7 @@
     </div>
     <hotJobs></hotJobs>
     <div class="default-width">
-      <jobTypeCard  class="mb-5" page ></jobTypeCard>
+      <jobTypeCard  class="mb-5"></jobTypeCard>
       <hotPromotedPositions></hotPromotedPositions>
       <PopularEnterprises class="mt-10"></PopularEnterprises>
     </div>

+ 1 - 1
src/views/recruit/position/components/areaCascader/index.vue

@@ -33,7 +33,7 @@ import { getDict } from '@/hooks/web/useDictionaries'
 import { inject, reactive, ref } from 'vue'
 import { useRoute } from 'vue-router'
 defineOptions({ name:'common-components-areaTree'})
-const emits = defineEmits('checkedInput')
+const emits = defineEmits(['checkedInput'])
 const route = useRoute()
 
 const props = defineProps({

+ 2 - 2
src/views/recruit/position/components/cityFilter.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-      <v-tabs v-model="tab" align-tabs="start" color="primary" @click="tabClick">
+      <v-tabs v-model="tab" align-tabs="start" color="primary" @update:model-value="tabClick">
         <v-tab :value="1">城市和区域</v-tab>
       </v-tabs>
       <v-window v-model="tab" class="mt-3">
@@ -15,7 +15,7 @@ import areaTree from './areaCascader'
 import { reactive, ref } from 'vue'
 
 defineOptions({name: 'retrieval-components-cityFilter'})
-const emits = defineEmits('updateCheckedInput')
+const emits = defineEmits(['updateCheckedInput'])
 let query = reactive({})
 const checkedInputChange = (idChecked) => {
   if (idChecked?.length) {

+ 8 - 15
src/views/recruit/position/components/conditionFilter.vue

@@ -4,8 +4,8 @@
     <positionType @inputChange="val => inputChange('positionId', val)"></positionType>
     <JobType @inputChange="val => inputChange('jobType', val)"></JobType>
     <expType :isSingle="false" @inputChange="val => inputChange('expType', val)"></expType>
-    <payScope @inputChange="val => inputChange('payScope', val)"></payScope>
-    <educationType :isSingle="false" @inputChange="val => inputChange('educationType', val)"></educationType>
+    <payScope @inputChange="val => inputChange('payType', val)"></payScope>
+    <educationType :isSingle="false" @inputChange="val => inputChange('eduType', val)"></educationType>
     <scale @inputChange="val => inputChange('scale', val)"></scale>
     <financingStatus @inputChange="val => inputChange('financingStatus', val)"></financingStatus>
   </div>
@@ -21,7 +21,7 @@ import scale from './conditionFilter/scale.vue'
 import financingStatus from './conditionFilter/financingStatus.vue'
 import { reactive } from 'vue'
 defineOptions({name: 'retrieval-components-conditionFilter'})
-const emits = defineEmits('inputChangeEmits')
+const emits = defineEmits(['conditionFilterChange'])
 
 const removeEmptyStringsAndReturnNew = (obj) => {
   const result = {}
@@ -32,18 +32,11 @@ const removeEmptyStringsAndReturnNew = (obj) => {
   })
   return result
 }
-  
-let query = reactive({
-  industryIds: '',
-  positionId: '',
-  jobType: '',
-  expType: '',
-  payScope: '',
-  scale: '',
-  financingStatus: '',
-})
-console.log('query', query)
+ 
+const params = reactive({})
+let query = reactive({})
 const inputChange = (key, { values, isEmit}) => {
+  params[key] = values
   query[key] = values.join('_')
   query = removeEmptyStringsAndReturnNew(query)
   if (isEmit) emits('conditionFilterChange', query.value)
@@ -51,5 +44,5 @@ const inputChange = (key, { values, isEmit}) => {
 const getQuery = () => {
   return query
 }
-defineExpose({ getQuery })
+defineExpose({ getQuery, params })
 </script>

+ 13 - 5
src/views/recruit/position/components/conditionFilter/JobType.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle btnTitle="求职类型" :close-on-content-click="false" v-if="show">
+  <commonStyle :btnTitle="title" :close-on-content-click="false" v-if="show">
     <v-list>
       <v-list-item
         color="primary"
@@ -7,6 +7,9 @@
         v-for="item in items" :key="item.id" :value="item.value"
         @click="handle(item.value)"
       >
+        <template v-if="selectedItems.includes(item.value)" v-slot:append>
+          <v-icon icon="mdi-check"></v-icon>
+        </template>
         <v-list-item-title>{{ item.label }}</v-list-item-title>
       </v-list-item>
     </v-list>
@@ -22,18 +25,18 @@ const emits = defineEmits(['inputChange'])
 let show = ref(false)
 let items = ref()
 const selectedItems = ref([])
-
+const title = ref('求职类型')
 const query = inject('routeQuery')
 
 getDict('menduner_job_type').then(({ data }) => {
   data = data?.length && data || []
   items.value = data
-  // selectedItems.value = ['2', '3']
   // 刷新回显
   if (query && query.jobType) {
     const str = query.jobType.split(',')[0]
     const arr = str.split('_')
     if (arr?.length) {
+      title.value = `求职类型(${arr.length})`
       selectedItems.value = arr
       emits('inputChange', { values: selectedItems.value, isEmit: false })
     }
@@ -41,8 +44,13 @@ getDict('menduner_job_type').then(({ data }) => {
   show.value = true
 })
 const handle = (val) => {
-  if (selectedItems.value.includes(val)) selectedItems.value = selectedItems.value.filter(i => i !== val)
-  else selectedItems.value.push(val)
+  if (selectedItems.value.includes(val)) {
+    title.value = '求职类型'
+    selectedItems.value = selectedItems.value.filter(i => i !== val)
+  } else {
+    title.value = '求职类型(1)'
+    selectedItems.value.push(val)
+  }
   emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>

+ 1 - 1
src/views/recruit/position/components/conditionFilter/commonStyle.vue

@@ -10,7 +10,7 @@
   >
     <template v-slot:activator="{ isActive, props }">
       <v-btn
-        class="mr-3"
+        class="mr-3 py-0 px-2"
         density="comfortable"
         :append-icon="isActive ? 'mdi mdi-menu-up' : 'mdi mdi-menu-down'"
         color="primary" variant="tonal"

+ 4 - 3
src/views/recruit/position/components/conditionFilter/educationType.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle v-if="show" :btnTitle="title" :closeOnContentClick="isSingle">
+  <commonStyle v-if="show" :btnTitle="title" :closeOnContentClick="props.isSingle">
     <v-list>
       <v-list-item
         color="primary"
@@ -42,7 +42,7 @@ getDict('menduner_education_type').then(({ data }) => {
     const arr = str.split('_')
     if (arr?.length) {
       selectedItems.value = arr
-      title.value = props.isSingle ? '学历要求(1)' : `学历要求(${selectedItems.value.length})`
+      title.value = `学历要求(${arr.length})`
       emits('inputChange', { values: selectedItems.value, isEmit: false })
     }
   }
@@ -52,14 +52,15 @@ const handle = (val) => {
   const obj = selectedItems.value.find(e => e === val)
   if (props.isSingle) {
     // 单选
+    title.value = (obj || val === '2') ? '学历要求' : '学历要求(1)'
     selectedItems.value = obj ? [] : [val]
   } else {
     // 多选 
     if (obj) {
       selectedItems.value = selectedItems.value.filter(i => i !== val)
     } else selectedItems.value.push(val)
+    title.value = selectedItems.value.length ? `学历要求(${selectedItems.value.length})` : '学历要求'
   }
-  title.value = props.isSingle ? '学历要求(1)' : `学历要求(${selectedItems.value.length})`
   emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>

+ 3 - 2
src/views/recruit/position/components/conditionFilter/expType.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle v-if="show" :btnTitle="title" :closeOnContentClick="isSingle">
+  <commonStyle v-if="show" :btnTitle="title" :closeOnContentClick="props.isSingle">
     <v-list>
       <v-list-item
         color="primary"
@@ -53,6 +53,7 @@ const handle = (val) => {
   if (props.isSingle) {
     // 单选
     selectedItems.value = obj ? [] : [val]
+    title.value = (obj || val === '2') ? '工作经验' : '工作经验(1)'
   } else {
     // 多选 
     if (obj) {
@@ -65,8 +66,8 @@ const handle = (val) => {
       // 当经验不限已存在时还选中其它项,把经验不限给清掉
       if (val !== '2' && selectedItems.value.find(k => k === '2')) selectedItems.value = selectedItems.value.filter(i => i !== '2')
     }
+    title.value = val === '2' ? '工作经验' : (selectedItems.value.length ? `工作经验(${selectedItems.value.length})` : '工作经验')
   }
-  title.value = val === '2' ? '工作经验' : (props.isSingle ? '工作经验(1)' : `工作经验(${selectedItems.value.length})`)
   emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>

+ 23 - 5
src/views/recruit/position/components/conditionFilter/financingStatus.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle btnTitle="融资阶段" :close-on-content-click="false">
+  <commonStyle v-if="show" :btnTitle="title" :close-on-content-click="false">
     <v-list>
       <v-list-item
         color="primary"
@@ -7,6 +7,9 @@
         v-for="item in items" :key="item.id" :value="item.value"
         @click="handle(item.value)"
       >
+        <template v-if="selectedItems.includes(item.value)" v-slot:append>
+          <v-icon icon="mdi-check"></v-icon>
+        </template>
         <v-list-item-title>{{ item.label }}</v-list-item-title>
       </v-list-item>
     </v-list>
@@ -15,20 +18,35 @@
 <script setup>
 import commonStyle from './commonStyle.vue'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { ref, defineEmits } from 'vue';
-
+import { ref, defineEmits, inject } from 'vue';
 defineOptions({name: 'conditionFilter-financingStatus'})
-const emits = defineEmits(['selectedItems'])
+
+const emits = defineEmits(['inputChange'])
 let items = ref()
+const show = ref(false)
+const query = inject('routeQuery')
+const title = ref('融资阶段')
 const selectedItems = ref([])
+
 getDict('menduner_financing_status').then(({ data }) => {
   data = data?.length && data || []
   items.value = data
+  if (query && query.financingStatus	) {
+    const str = query.financingStatus	.split(',')[0]
+    const arr = str.split('_')
+    if (arr?.length) {
+      selectedItems.value = arr
+      title.value = `融资阶段(${arr.length})`
+      emits('inputChange', { values: selectedItems.value, isEmit: false })
+    }
+  }
+  show.value = true
 })
 const handle = (val) => {
   if (selectedItems.value.includes(val)) selectedItems.value = selectedItems.value.filter(i => i !== val)
   else selectedItems.value.push(val)
-  emits('selectedItems', selectedItems.value)
+  title.value = selectedItems.value.length ? `融资阶段(${selectedItems.value.length})` : '融资阶段'
+  emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>
 <style lang="scss" scoped>

+ 7 - 2
src/views/recruit/position/components/conditionFilter/payScope.vue

@@ -38,8 +38,13 @@ getDict('menduner_pay_scope').then(({ data }) => {
   show.value = true
 })
 const handle = (val) => {
-  title.value = val.id === 0 ? '薪资待遇' : '薪资待遇(1)'
-  selectedItems.value = [val]
+  if (selectedItems.value.includes(val)) {
+    title.value = '薪资待遇'
+    selectedItems.value = selectedItems.value.filter(i => i !== val)
+  } else {
+    title.value = '薪资待遇(1)'
+    selectedItems.value = [val]
+  }
   emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>

+ 19 - 3
src/views/recruit/position/components/conditionFilter/positionType.vue

@@ -1,13 +1,29 @@
 <template>
-  <commonStyle btnTitle="职位类型" :close-on-content-click="false">
-    <jobTypeCard></jobTypeCard>
+  <commonStyle :btnTitle="title" :close-on-content-click="false">
+    <jobTypeCard @handleJobClick="handleClick" :params="params"></jobTypeCard>
   </commonStyle>
 </template>
+
 <script setup>
 import commonStyle from './commonStyle.vue'
 import jobTypeCard from '@/components/jobTypeCard'
-
 defineOptions({name: 'conditionFilter-company-industry'})
+import { ref, inject } from 'vue'
+
+const params = inject('routeQuery')
+
+const emits = defineEmits(['inputChange'])
+const title = ref('职位类型')
+if (params && params.positionId) {
+  const arr = params.positionId.split('_')
+  title.value = `职位类型(${arr.length})`
+}
+
+const handleClick = (val) => {
+  title.value = val.length ? `职位类型(${val.length})` : '职位类型'
+  emits('inputChange', { values: val, isEmit: true })
+}
 </script>
+
 <style lang="scss" scoped>
 </style>

+ 24 - 5
src/views/recruit/position/components/conditionFilter/scale.vue

@@ -1,5 +1,5 @@
 <template>
-  <commonStyle btnTitle="公司规模" :close-on-content-click="false">
+  <commonStyle v-if="show" :btnTitle="title" :closeOnContentClick="false">
     <v-list>
       <v-list-item
         color="primary"
@@ -7,28 +7,47 @@
         v-for="item in items" :key="item.id" :value="item.value"
         @click="handle(item.value)"
       >
+        <template v-if="selectedItems.includes(item.value)" v-slot:append>
+          <v-icon icon="mdi-check"></v-icon>
+        </template>
         <v-list-item-title>{{ item.label }}</v-list-item-title>
       </v-list-item>
     </v-list>
   </commonStyle>
 </template>
+
 <script setup>
 import commonStyle from './commonStyle.vue'
 import { getDict } from '@/hooks/web/useDictionaries'
-import { ref, defineEmits } from 'vue';
-
+import { ref, defineEmits, inject } from 'vue';
 defineOptions({name: 'conditionFilter-scale'})
-const emits = defineEmits(['selectedItems'])
+const emits = defineEmits(['inputChange'])
+
+const show = ref(false)
+const query = inject('routeQuery')
+const title = ref('公司规模')
 let items = ref()
 const selectedItems = ref([])
+
 getDict('menduner_scale').then(({ data }) => {
   data = data?.length && data || []
   items.value = data
+  if (query && query.scale) {
+    const str = query.scale.split(',')[0]
+    const arr = str.split('_')
+    if (arr?.length) {
+      selectedItems.value = arr
+      title.value = `公司规模(${arr.length})`
+      emits('inputChange', { values: selectedItems.value, isEmit: false })
+    }
+  }
+  show.value = true
 })
 const handle = (val) => {
   if (selectedItems.value.includes(val)) selectedItems.value = selectedItems.value.filter(i => i !== val)
   else selectedItems.value.push(val)
-  emits('selectedItems', selectedItems.value)
+  title.value = selectedItems.value.length ? `公司规模(${selectedItems.value.length})` : '公司规模'
+  emits('inputChange', { values: selectedItems.value, isEmit: true })
 }
 </script>
 <style lang="scss" scoped>

+ 46 - 78
src/views/recruit/position/index.vue

@@ -4,14 +4,17 @@
     <div style="width: 100%; height: 20px;"></div>
     <v-card style="z-index: 998">
       <div class="stickyBox my-3">
-        <headSearch></headSearch>
+        <headSearch 
+          @handleJobClick="val => dealParams('conditionFilterRef', val, 'positionId')" 
+          @handleSearch="val => dealParams('conditionFilterRef', 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>
     </v-card>
     <div class="d-flex mt-3">
       <div class="mr-3" style="min-width: 884px;">
-        <div v-if="!items?.length" style="text-align: center;">暂无数据</div>
+        <Empty v-if="!items?.length"></Empty>
         <PositionLongStrip v-else :items="items"></PositionLongStrip>
       </div>
       <rightRecommend></rightRecommend>
@@ -25,23 +28,22 @@
     ></CtPagination>
   </div>
 </template>
+
 <script setup>
 import rightRecommend from './components/rightRecommend'
 import cityFilter from './components/cityFilter'
 import conditionFilter from './components/conditionFilter'
 import headSearch from '@/components/headSearch'
 import PositionLongStrip from '@/components/PositionLongStrip/item.vue'
+import Empty from '@/components/Empty'
 import { getJobAdvertisedSearch } from '@/api/position'
 import CtPagination from '@/components/CtPagination'
-// import { dealDictData } from '@/views/recruit/position/components/dict'
-import { provide, ref } from 'vue'
+import { provide, reactive, ref } from 'vue'
 
 import { useRoute, useRouter } from 'vue-router'
 defineOptions({name: 'retrieval-position-page'})
-// const route = useRoute()
 const route = useRoute(); const router = useRouter()
 const cityFilterRef = ref(); const conditionFilterRef = ref()
-console.log('to:/recruit/position-> query', route.query)
 
 const pageInfo = { pageNo: 1, pageSize: 20}
 const items = ref([])
@@ -49,79 +51,25 @@ const total = ref(0)
 const routeQuery = (route?.query && route.query && Object.keys(route?.query).length) ? route.query : null
 provide('routeQuery', routeQuery)
 
-// 测试数据
-const test = {
-  job: {
-    id: 1, 
-    pos: "广州", 
-    name: "测试数据", 
-    positionId: 1, 
-    payFrom: 5000, 
-    payTo: 12000, 
-    payUnit: 1, 
-    areaId: 110000, 
-    expType: 0, 
-    eduType: 0, 
-    tagList: [
-      "无经验要求", 
-      "金融产品", 
-    ]
-  }, 
-  enterprise: {
-    id: 1, 
-    name: "广州门墩儿科技有限公司", 
-    anotherName: "门墩儿科技", 
-    industryId: 1, 
-    scale: 0, 
-    financingStatus: 0, 
-    logoUrl: "https://img.bosszhipin.com/beijin/mcs/chatphoto/20171009/8b09998594701c82c6d9932c6f5d3ea293cf1c0a52480018916865cbf3ed2c2f.jpg?x-oss-process=image/resize,w_120,limit_0", 
-    tags: [ "培训/辅导机构",  "天使轮",   "100-499人"],
-    tags1: [ '就近分配', '室内清洁', '系统接单', '无需坐班', '日常保洁', '简单易上手', '日常保洁', '简单易上手'],
-    welfareList: ['周末双休', '五险一金', '包餐', '节日福利', '员工旅游', '定期体检', '全勤奖', '带薪年假,年底双薪等福利多多']
-  }, 
-  contact: {
-    enterpriseId: 1, 
-    userId: 1, 
-    avatar: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F5bbef4cc-6268-46d9-87b3-3aa7d2168aad%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1718339519&t=6ff0d47abd90d209ca81b671e898deb8", 
-    name: "ces女士", 
-    status: 1, 
-    postNameCn: "人事经理", 
-    postNameEn: "uman resources", 
-    postCode: "HR"
-  }
-}
-// 测试数据
+let pageReqVO = reactive({
+  ...pageInfo
+})
 
 // 职位搜索
 const getPositionList = async () => {
-  const pageReqVO = {
-    ...pageInfo,
-    // content: '', // 搜索内容,示例值(xx科技/xx经理)
-    // areaIds: [], //工作地区id集合,示例值([])
-    // expType: 0, // 工作经验(menduner_exp_type),示例值(1)
-    // eduType: 0, // 	学历要求(menduner_education_type),示例值(1)
-    // payType: 0, // 薪酬待遇范围(menduner_pay_scope),示例值(12)
-    // jobType: 0, // 求职类型(menduner_job_type),示例值(2)
-    // positionId: 0, // 职位类型,示例值(2)
-    // enterpriseType: 0, // 企业类型(menduner_enterprise_type)
-    // industryIds: [], // 行业信息id集合,示例值([])
-    // scale: 0, // 人员规模(0-20人,20-99人)示例值(1)
-    // financingStatus: 0 // 融资阶段(未融资,天使轮,A轮,不需要融资),示例值(1)
-  }
-  const res = await getJobAdvertisedSearch(pageReqVO)
-  // items.value = res.list
-  // total.value = res.total
-  // 测试数据
-  items.value = [test, ...res.list]
-  total.value = res.total + 1
+  const { list, total: number } = await getJobAdvertisedSearch(pageReqVO)
+  items.value = list
+  total.value = number
 }
-// items.value = [test]
-getPositionList()
 
-const handleChangePage = (index) => {
-  pageInfo.pageNo = index
+// 刷新后有参数则进行搜索
+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 = {}
@@ -133,7 +81,7 @@ const removeEmptyStringsAndReturnNew = (obj) => {
   return result
 }
 
-const updateRouteQuery = (ref) => {
+const updateRouteQuery = (ref, val, key) => {
   ref
   const queryObj = { cityFilter: null, conditionFilter: null }
   if (cityFilterRef.value?.getQuery) {
@@ -141,21 +89,41 @@ const updateRouteQuery = (ref) => {
   }
   if (conditionFilterRef.value?.getQuery) {
     queryObj.conditionFilter = removeEmptyStringsAndReturnNew(conditionFilterRef.value?.getQuery())
+    if (val && key) queryObj.conditionFilter[key] = val
   }
   let queryArr = []
   if (queryObj) {
-    Object.keys(queryObj)?.forEach((_k, outIndex) => {
+    Object.keys(queryObj)?.forEach(_k => {
       const newObj = queryObj[_k]
       if (newObj) {
-        const arr = Object.keys(newObj).map((itemKey, index) => {
-          return `${(index || outIndex) ? '&' : ''}${itemKey}=${newObj[itemKey]}`
+        const arr = Object.keys(newObj).map(itemKey => {
+          return `${itemKey}=${newObj[itemKey]}`
         })
         if (arr?.length) queryArr = [ ...queryArr, ...arr]
       }
     })
   }
-  const str = queryArr?.join()
+  const str = queryArr?.join('&')
   if (str) router.push(`${route.path}?${str}`)
+  handleSearchPosition()
 }
 
+// 职位搜索
+const handleSearchPosition = () => {
+  const conditionParams = conditionFilterRef.value.params
+  const cityParams = cityFilterRef.value?.getQuery
+  pageReqVO = { ...pageReqVO, ...conditionParams, ...cityParams }
+  getPositionList()
+}
+
+// 职位类型、关键字
+const dealParams = (name, val, key) => {
+  updateRouteQuery(name, val, key)
+  updateRouteQuery('cityFilterRef')
+}
+// 分页
+const handleChangePage = (index) => {
+  pageInfo.pageNo = index
+  getPositionList()
+}
 </script>

+ 1 - 1
src/views/resume/components/jobIntention.vue

@@ -151,7 +151,7 @@ const items = ref({
 
 // 期望职位
 const handleJobClickItem = (val) => {
-  items.value.options.find(e => e.key === 'positionId').value = val.nameCn
+  items.value.options.find(e => e.key === 'positionId').value = val[0].nameCn
 }
 
 const handleIndustry = (list) => {