Browse Source

职位&企业搜索

Xiao_123 4 months ago
parent
commit
50e7d69898

+ 3 - 3
src/components/Enterprise/hotPromoted.vue

@@ -106,9 +106,9 @@ const handleClickPosition = (k) => {
 // 查看更多职位
 const handleMoreEnterprise = (item) => {
   if (!item.enterprise.id) return
-  window.open(`/recruit/personal/company/details/${item.enterprise.id}?key=recruitmentPositions`)
-  // const name = formatName('天津鹏瑞利明宇酒店群&天津')
-  // window.open(`/recruit/personal/position?content=${name}`)
+  // window.open(`/recruit/personal/company/details/${item.enterprise.id}?key=recruitmentPositions`)
+  const name = formatName(item.enterprise.anotherName || item.enterprise.name)
+  window.open(`/recruit/personal/position?content=${name.includes('&') ? encodeURIComponent(name) : name}`)
 }
 </script>
 

+ 3 - 8
src/components/headSearch/index.vue

@@ -66,12 +66,11 @@ const defineProps = defineProps({
     default: ''
   }
 })
-
 // const value = ref('')
 const value = ref(defineProps.modelValue)
 let drawer = ref(false)
 
-if (route.query && route.query?.content) value.value = route.query.content
+if (route.query && route.query?.content) value.value = route.query.content.includes('%') ? decodeURIComponent(route.query.content) : route.query.content
 
 // 点击外部关闭职位下拉
 const sharedState = useSharedState()
@@ -81,12 +80,8 @@ watch(() => sharedState.layoutClickCount, () => {
 });
 
 const handleSearch = () => {
-  // // 职位搜索页传参,其它的跳转到职位搜索页
-  // if (route.path !== '/recruit/personal/position') {
-  //   if (value.value) router.push(`/recruit/personal/position?content=${value.value}`)
-  //   else router.push('/recruit/personal/position')
-  // } else emits('handleSearch', value.value)
-  emits('handleSearch', value.value)
+  const name = value.value ? value.value.includes('&') ? encodeURIComponent(value.value) : value.value : ''
+  emits('handleSearch', name)
 }
 
 const handleClickJob = (val) => {

+ 4 - 6
src/styles/recruit/company.css

@@ -33,9 +33,9 @@
 
 .sub-li {
   position: relative;
-  width: calc((100% - 36px) / 4);
-  min-width: calc((100% - 36px) / 4);
-  max-width: calc((100% - 36px) / 4);
+  width: calc((100% - 24px) / 3);
+  min-width: calc((100% - 24px) / 3);
+  max-width: calc((100% - 24px) / 3);
   margin: 0 12px 12px 0;
   height: 160px;
   border-radius: 12px;
@@ -46,7 +46,7 @@
   cursor: pointer;
 }
 
-.sub-li:nth-child(4n) {
+.sub-li:nth-child(3n) {
   margin-right: 0;
 }
 
@@ -92,9 +92,7 @@
 }
 
 .company-info-bottom {
-  width: 100%;
   height: 70px;
-  padding: 10px 15px;
 }
 
 .name {

+ 1 - 1
src/styles/recruit/company.min.css

@@ -1 +1 @@
-.label-title{width:64px;font-weight:500;margin-right:24px;color:var(--color-222)}.label-content{flex:1}.label-color{color:var(--color-222);font-size:14px;margin-right:24px;display:inline-block;cursor:pointer}.label-color:hover{color:var(--v-primary-base)}.actives{color:var(--v-primary-base);font-weight:600}.company-box{display:flex;flex-wrap:wrap}.sub-li{position:relative;width:calc((100% - 36px) / 4);min-width:calc((100% - 36px) / 4);max-width:calc((100% - 36px) / 4);margin:0 12px 12px 0;height:160px;border-radius:12px;padding:0;overflow:hidden;transition:all .2s linear;background-color:#fff;cursor:pointer}.sub-li:nth-child(4n){margin-right:0}.sub-li:hover{box-shadow:0 16px 40px 0 rgba(153,153,153,0.3)}.company-info{float:left;margin-left:16px;width:282px}.company-info-top{display:flex;height:90px;line-height:90px;padding:0 20px;align-items:center;overflow:hidden}.company-info h3{height:22px;font-size:18px;font-weight:700;color:var(--color-333);line-height:22px;margin:0 0 4px 0;padding:0;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.company-info p{height:18px;font-size:13px;font-weight:400;color:var(--color-999);line-height:18px}.company-info-bottom{width:100%;height:70px;padding:10px 15px}.name{position:relative;line-height:22px;color:#404040;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all linear .2s}.salary{font-size:16px;float:right;color:var(--v-error-base);line-height:22px;max-width:none;text-align:right;flex:1}.job-hover:hover{color:var(--v-primary-base);background-color:#f2f4f7}
+.label-title{width:64px;font-weight:500;margin-right:24px;color:var(--color-222)}.label-content{flex:1}.label-color{color:var(--color-222);font-size:14px;margin-right:24px;display:inline-block;cursor:pointer}.label-color:hover{color:var(--v-primary-base)}.actives{color:var(--v-primary-base);font-weight:600}.company-box{display:flex;flex-wrap:wrap}.sub-li{position:relative;width:calc((100% - 24px) / 3);min-width:calc((100% - 24px) / 3);max-width:calc((100% - 24px) / 3);margin:0 12px 12px 0;height:160px;border-radius:12px;padding:0;overflow:hidden;transition:all .2s linear;background-color:#fff;cursor:pointer}.sub-li:nth-child(3n){margin-right:0}.sub-li:hover{box-shadow:0 16px 40px 0 rgba(153,153,153,0.3)}.company-info{float:left;margin-left:16px;width:282px}.company-info-top{display:flex;height:90px;line-height:90px;padding:0 20px;align-items:center;overflow:hidden}.company-info h3{height:22px;font-size:18px;font-weight:700;color:var(--color-333);line-height:22px;margin:0 0 4px 0;padding:0;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.company-info p{height:18px;font-size:13px;font-weight:400;color:var(--color-999);line-height:18px}.company-info-bottom{height:70px}.name{position:relative;line-height:22px;color:#404040;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all linear .2s}.salary{font-size:16px;float:right;color:var(--v-error-base);line-height:22px;max-width:none;text-align:right;flex:1}.job-hover:hover{color:var(--v-primary-base);background-color:#f2f4f7}

+ 6 - 6
src/styles/recruit/company.scss

@@ -32,9 +32,9 @@
 
 .sub-li {
   position: relative;
-  width: calc((100% - 36px) / 4);
-  min-width: calc((100% - 36px) / 4);
-  max-width: calc((100% - 36px) / 4);
+  width: calc((100% - 24px) / 3);
+  min-width: calc((100% - 24px) / 3);
+  max-width: calc((100% - 24px) / 3);
   margin: 0 12px 12px 0;
   height: 160px;
   border-radius: 12px;
@@ -43,7 +43,7 @@
   transition: all .2s linear;
   background-color: #fff;
   cursor: pointer;
-  &:nth-child(4n) {
+  &:nth-child(3n) {
     margin-right: 0;
   }
   &:hover {
@@ -84,9 +84,9 @@
   line-height: 18px;
 }
 .company-info-bottom {
-  width: 100%;
+  // width: 100%;
   height: 70px;
-  padding: 10px 15px;
+  // margin: 10px 15px;
 }
 .name {
   position: relative;

+ 3 - 4
src/views/recruit/personal/company/components/companyItem.vue

@@ -6,15 +6,15 @@
           <v-img :src="item.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" :alt="item.enterprise.anotherName" :width="40" style="height: 40px;border-radius: 4px;"/>
         </div>
         <div class="company-info">
-          <h3 :class="{'default-active': item.active }" style="width: 200px;">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3>
+          <h3 :class="{'default-active': item.active }">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3>
           <p>{{ item.enterprise.industryName }}</p>
         </div>
       </div>
       <v-divider class="mx-4"></v-divider>
-      <div class="company-info-bottom">
+      <div class="company-info-bottom mx-4 mt-2">
         <div v-if="item?.job && Object.keys(item.job).length" class="job-hover" @click.stop="handleClickPosition(item.job)">
           <div class="mb-1 d-flex">
-            <p :class="['mr-3', 'cursor-pointer', 'name']" :style="{'max-width': !item.job.payFrom && !item.job.payTo ? '200px' : '120px'}">{{ formatName(item.job.name) }}</p>
+            <p :class="['mr-3', 'cursor-pointer', 'name']" :style="{'max-width': !item.job.payFrom && !item.job.payTo ? '270px' : '220px'}">{{ formatName(item.job.name) }}</p>
             <span v-if="!item.job.payFrom && !item.job.payTo" class="salary">面议</span>
             <span v-else class="salary">{{ item.job.payFrom ? item.job.payFrom + '-' : '' }}{{ item.job.payTo }}{{ item.job.payName ? '/' + item.job.payName : '' }}</span>
           </div>
@@ -22,7 +22,6 @@
             <span v-for="(j, index) in desc" :key="index">
               <span v-if="item.job[j] || j === 'areaName'" class="mr-1 font-size-13">
                 {{ j === 'areaName' ? !item.job.areaId ? '全国' : item.job.area.str : item.job[j] }}
-                <!-- {{ (j === 'areaName' && !item.job.areaId) ? '全国' : item.job[j] }} -->
               </span>
               <span v-if="index !== desc.length - 1 && (item.job[desc[index + 1]] || j === 'areaName')" class="septal-line ml-1"></span>
             </span>

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

@@ -48,7 +48,7 @@ const total = ref(0)
 const items = ref([])
 const pages = ref({
   pageNo: 1,
-  pageSize: 12
+  pageSize: 9
 })
 const query = ref({})
 

+ 7 - 8
src/views/recruit/personal/position/index.vue

@@ -45,7 +45,6 @@ import { dealDictObjData } from '@/utils/position'
 import { useRoute, useRouter } from 'vue-router'
 defineOptions({name: 'retrieval-position-page'})
 const route = useRoute(); const router = useRouter()
-// const cityFilterRef = ref()
 const conditionFilterRef = ref()
 const showFilterList = [
   { key: 'positionId', isSingle: true },
@@ -54,20 +53,16 @@ const showFilterList = [
   { key: 'eduType' },
   { key: 'jobType' },
   { key: 'scale' },
-  { key: 'industryIds' },
-  // { key: 'financingStatus' },
+  { key: 'industryIds' }
 ]
 
 const pageInfo = { pageNo: 1, pageSize: 20}
 const items = ref([])
 const total = ref(0)
 let routeQuery = (route?.query && route.query && Object.keys(route?.query).length) ? reactive(route.query) : reactive({})
-// routeQuery.date = new Date().getTime()
-// router.push({ path: route.path, routeQuery })
-// if (routeQuery?.length) router.replace({ path: route.path, routeQuery })
 
 const noParams = ref(true)
-const headSearchText = ref(routeQuery?.content || '')
+const headSearchText = ref(routeQuery?.content ? routeQuery?.content.includes('&') ? decodeURIComponent(routeQuery.content) : routeQuery.content : '')
 
 // 职位搜索
 const getData = async () => {
@@ -79,7 +74,10 @@ const getData = async () => {
     const passingOneId = ['positionId'] // 单选且传递整型
     Object.keys(routeQuery).forEach(key => {
       if (routeQuery[key] === '' || key === 'date') return
-      else if (passingStrings.includes(key)) routerParams[key] = routeQuery[key] // 传给后端字符串
+      else if (passingStrings.includes(key)) { // 传给后端字符串
+        if (key === 'content') routerParams[key] = decodeURIComponent(routeQuery[key])
+        else routerParams[key] = routeQuery[key]
+      }
       else if (passingOneId.includes(key)) routerParams[key] = +routeQuery[key] // 传给后端单选且传递整型
       else routerParams[key] = routeQuery[key].split('_') // 传给后端Arr
     })
@@ -117,6 +115,7 @@ const updateRouter = () => {
     }, {})
   }
   query.date = new Date().getTime() // 用于前端刷新路由参数
+  if (query?.content && query.content.includes('%')) query.content = decodeURIComponent(query.content)
   router.push({ path: route.path, query })
   pageInfo.pageNo = 1
   // getData()