瀏覽代碼

职位和公司的检索分开,公司检索不跳转到职位

lifanagju_citu 11 月之前
父節點
當前提交
b680529922

+ 14 - 9
src/components/headSearch/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="search d-flex align-center">
-    <v-menu :close-delay="1" :open-delay="0" v-bind="$attrs">
+    <v-menu v-if="defineProps.text" :close-delay="1" :open-delay="0" v-bind="$attrs">
       <template v-slot:activator="{ isActive, props }">
         <v-btn
           style="height: 100%; font-size: 16px;"
@@ -24,7 +24,7 @@
     </div> -->
     <v-text-field
       v-model="value"
-      placeholder="搜索职位/公司"
+      :placeholder="defineProps.placeholder"
       color="primary"
       variant="plain"
       density="compact"
@@ -47,9 +47,13 @@ const route = useRoute(); const router = useRouter()
 const emits = defineEmits(['update:modelValue', 'handleSearch', 'handleJobClick'])// 定义一个或多个自定义事件
 const defineProps = defineProps({
   modelValue: [String, Number],
+  placeholder: {
+    type: String,
+    default: '搜索职位/公司'
+  },
   text: {
     type: String,
-    default: '职位类型'
+    default: ''
   },
 })
 
@@ -67,16 +71,17 @@ watch(() => sharedState.layoutClickCount, () => {
 });
 
 const handleSearch = () => {
-  // 职位搜索页传参,其它的跳转到职位搜索页
-  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)
+  // // 职位搜索页传参,其它的跳转到职位搜索页
+  // 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)
+  emits('handleSearch', value.value)
 }
 
 const handleClickJob = (val) => {
   // 职位搜索页点击传参, 其它的跳转到职位搜索页
-  if (route.path !== '/recruit/position') router.push(`/recruit/position?positionId=${val.id}`)
+  if (route.path !== '/recruit/position') router.push(`/recruit/position?positionId=${val[0]}`)
   else emits('handleJobClick', val)
 }
 

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

@@ -2,7 +2,7 @@
   <div>
     <headCarousel></headCarousel>
     <div class="stickyBox py-5">
-      <headSearch></headSearch>
+      <headSearch text="职位类型" @handleSearch="handleSearch"></headSearch>
     </div>
     <hotJobs></hotJobs>
     <div class="default-width">
@@ -22,7 +22,13 @@ import hotJobs from './components/hotJobs.vue'
 import homeJobTypeCard from './components/homeJobTypeCard'
 import hotPromotedPositions from './components/hotPromotedPositions.vue'
 import PopularEnterprises from './components/popularEnterprises.vue'
+import { useRouter } from 'vue-router'
+const router = useRouter()
 defineOptions({ name:'personal-index'})
+
+const handleSearch = (val) => {
+  if (val) router.push(`/recruit/position?content=${val}`)
+}
 </script>
 
 <style lang="scss" scoped>

+ 4 - 1
src/views/enterprise/personnelManagement/index.vue

@@ -1,5 +1,8 @@
+<!-- 牛人管理 -->
 <template>
-  <div>牛人管理</div>
+  <div class="white-bgc">
+    牛人管理
+  </div>
 </template>
 
 <script setup>

+ 1 - 0
src/views/login/index.vue

@@ -39,6 +39,7 @@
             <v-tab :value="2">{{ $t('login.passwordLogin') }}</v-tab>
           </v-tabs>
           <div v-if="loginType" class="mt-9">
+            <!-- 企业选择 -->
             <companySelect ref="companySelectRef" v-model="enterpriseId"></companySelect>
           </div>
           <v-window v-model="tab" :class="{'mt-9': !loginType}">

+ 1 - 1
src/views/recruit/company/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="default-width">
     <div class="white-bgc py-3">
-      <headSearch></headSearch>
+      <headSearch placeholder="搜索公司" @handleSearch="val => handleSearch(val, 'name')"></headSearch>
       <div class="px-5 mt-3 clear-parent">
         <areaType class="mb-3" :isClear="clear" @handleClick="handleSearch"></areaType>
         <industryType :isClear="clear" @handleClick="handleSearch"></industryType>

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

@@ -106,6 +106,7 @@ const updateRouter = () => {
     return res
   }, '') : ''
   router.push(`${route.path}?${str}`)
+  pageInfo.pageNo = 1
   getData()
 }