lifanagju_citu 1 سال پیش
والد
کامیت
76f972c41a
3فایلهای تغییر یافته به همراه16 افزوده شده و 8 حذف شده
  1. 7 6
      src/components/headSearch/index.vue
  2. 6 2
      src/components/jobTypeCard/index.vue
  3. 3 0
      src/views/recruit/position/index.vue

+ 7 - 6
src/components/headSearch/index.vue

@@ -24,23 +24,24 @@
 <script setup>
 import { useSharedState } from '@/store/sharedState'
 import jobTypeCard from '@/components/jobTypeCard'
-
-import { ref, watch } from 'vue';
-
+import { ref, watch } from 'vue'
+// import { useRouter } from 'vue-router'
 defineOptions({ name:'common-components-headSearch'})
+// const router = useRouter()
 
 const value = ref('')
 let drawer = ref(false)
-
 // 点击外部关闭职位下拉
 const sharedState = useSharedState()
-
 // 监听 layoutClickCount 变化
 watch(() => sharedState.layoutClickCount, () => {
-  // console.log('layoutClickCount', newValue)
   if (drawer.value) drawer.value = false
 });
 
+// const jobClick = (jobInfo) => {
+//   router.push({ path: '/recruit/position',query: jobInfo })
+// }
+
 </script>
 
 <style lang="scss" scoped>

+ 6 - 2
src/components/jobTypeCard/index.vue

@@ -63,8 +63,10 @@
 // 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 props = defineProps({
@@ -77,7 +79,9 @@ const isPage = props.page
 
 // 职位点击
 const handleJobClick = async (val) => {
-  emits('jobClick', 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 })
 }
 

+ 3 - 0
src/views/recruit/position/index.vue

@@ -14,5 +14,8 @@
   </div>
 </template>
 <script setup>
+import { useRoute } from 'vue-router'
 defineOptions({name: 'retrieval-position-page'})
+const route = useRoute()
+console.log(route.query)
 </script>