Browse Source

推荐职位

Xiao_123 11 months ago
parent
commit
686597c05b

+ 71 - 65
src/components/PositionLongStrip/item.vue

@@ -1,51 +1,44 @@
 <!-- 搜索页面的职位详情-长条 -->
 <template>
   <v-card class="positionItem" v-for="(item, index) in list" :key="index" @mouseenter="item.active = true" @mouseleave="item.active = false">
-    <!-- 职位、公司 -->
-    <div class="position-and-company" @click="handlePosition(item)">
-      <div class="position" @mouseenter="item.positionActive = true" @mouseleave="item.positionActive = false">
-        <p :class="['title1', {'default-active': item.positionActive }]">{{ item.job.name }}{{ item.job.pos ? ' [' + item.job.pos + '] ' : '' }}</p>
-        <div class="d-flex row2">
-          <div class="salary">
-            <span>16-18K</span>
-            <span>·13薪</span>
-          </div>
-          <template v-if="item.job?.tagList?.length">
-            <v-chip class="tipClsss" size="x-small" label v-for="(tip, i) in item.job.tagList" :key="i" color="#666">{{ tip }}</v-chip>
-            <v-chip v-bind="props" class="tipClsss" prepend-icon="mdi-message-processing" size="x-small" label color="secondary" variant="outlined">
-              <span v-if="item.active">立即沟通</span>
-              <template v-else>
-                <span class="textColor666">{{ item.contact.name }}</span>
-                <span style="margin: 0 2px;">|</span>
-                <span class="textColor666">{{ item.contact.postNameCn }}</span>
-              </template>
-            </v-chip>
-            <v-chip v-if="item.contact.status === 1" size="x-small" label color="green" variant="outlined">在线</v-chip>
-          </template>
+    <div class="position-and-company">
+      <!-- 职位 -->
+      <div class="position" @mouseenter="item.positionActive = true" @mouseleave="item.positionActive = false" @click="handlePosition(item)">
+        <div class="d-flex">
+          <p :class="['title1', {'default-active': item.positionActive }]">{{ item.job.name }}{{ item.job.pos ? ' [' + item.job.pos + '] ' : '' }}</p>
+          <p class="salary ml-1">{{ item.job.payFrom }}-{{ item.job.payTo }}/{{ item.job.payName }}</p>
+        </div>
+        <div class="mt-2">
+          <v-chip size="x-small" label v-for="(j, i) in desc" :key="i" class="mr-1" color="#666" :prepend-icon="j.mdi">{{ item.job[j.value] }}</v-chip>
         </div>
       </div>
-      <div class="company">
-        <v-img  class="companyLogo" :src="item.enterprise.logoUrl" />
-        <div>
+      <!-- 公司 -->
+      <div class="company" @click="handleEnterprise(item)">
+        <div class="float-left">
+          <v-img :src="item.enterprise.logoUrl" :alt="item.enterprise.anotherName" :width="40" style="height: 40px;border-radius: 4px;"/>
+        </div>
+        <div class="company-info">
           <v-hover>
             <template v-slot:default="{ isHovering, props }">
-              <p v-bind="props" :class="['title1', {'default-active': isHovering }]">{{ item.enterprise.anotherName }}</p>
+              <h3 v-bind="props" :class="{'default-active': isHovering }" class="title1">{{ item.enterprise.anotherName }}</h3>
             </template>
           </v-hover>
-          <v-chip  class="tipClsss" size="x-small" label v-for="(tip, i) in item.enterprise.tags" :key="i" color="#666">{{ tip }}</v-chip>
+          <p class="mt-2">{{ item.enterprise.financingName }}<span class="mx-2">|</span>{{ item.enterprise.scaleName }}<span class="mx-2">|</span>{{ item.enterprise.industryName }}</p>
         </div>
       </div>
     </div>
     <!-- 底部 -->
     <div class="footer">
       <div class="footer-left">
-        <template v-for="(jobTag, jobTagsIndex) in item.enterprise.tags1" :key="jobTagsIndex">
+        <template v-for="(jobTag, jobTagsIndex) in item.job.tagList" :key="jobTagsIndex">
           <span class="textColor666 mx-1" v-if="jobTagsIndex">|</span>
-          <span class="textColor666">{{ jobTag }}</span>
+          <span class="textColor666 dis">{{ jobTag }}</span>
         </template>
       </div>
-      <div class="footer-right" v-if="item.enterprise.welfareList?.length">
-        {{ item.enterprise.welfareList.join('、') }}
+      <div class="footer-right">
+        <v-avatar size="x-small" :image="item.contact.avatar"></v-avatar>
+        <span class="mx-2 textColor666">{{ item.contact.name }} | {{ item.contact.postNameCn }}</span>
+        <v-chip color="primary" label size="x-small">当前在线</v-chip>
       </div>
     </div>
   </v-card>
@@ -70,16 +63,50 @@ watch(
   { deep: true }
 )
 
-const emits = defineEmits(['position', 'enterprise'])
+const desc = [
+  { mdi: 'mdi-map-marker-outline', value: 'areaName' },
+  { mdi: 'mdi-school-outline', value: 'eduName' },
+  { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
+]
+
 const handlePosition = (item) => {
-  emits('position', item)
+  window.open(`/recruit/position/details/${item.job.positionId}`)
+}
+const handleEnterprise = (item) => {
+  window.open(`/enterprise/details/${item.enterprise.enterpriseId}?key=briefIntroduction`)
 }
 </script>
 
 <style lang="scss" scoped>
-
-.tipClsss { margin-right: 4px; }
-.title1 { font-size: 16px; font-weight: 500; line-height: 28px;}
+.title1 {
+  position: relative;
+  max-width: 200px;
+  margin-right: 8px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  font-size: 16px;
+  font-weight: 600;
+  &:hover {
+    color: var(--v-primary-base);
+  }
+}
+.company {
+  flex: 1;
+  display: flex;
+  justify-content: end;
+}
+.company-info {
+  float: left;
+  margin-left: 16px;
+  // width: 282px;
+}
+.company-info p {
+  height: 18px;
+  font-size: 13px;
+  font-weight: 400;
+  color: #999;
+}
 .textColor666 { color: #666; }
 .positionItem {
   width: 884px;
@@ -98,37 +125,8 @@ const handlePosition = (item) => {
     padding: 16px 20px;
     width: 100%;
     .position {
-      width: 440px;
+      width: 484px;
       padding-right: 12px;
-      .row2 {
-        display: flex;
-        align-items: center;
-        flex-wrap: wrap; /* 允许换行 */
-        width: 100%; /* 设置容器宽度 */
-        .salary {
-          display: inline;
-          font-size: 16px;
-          font-weight: 500;
-          color: #fe574a;
-          line-height: 32px;
-          float: left;
-          margin-right: 16px;
-        }
-      }
-    }
-    .company {
-      flex: 1;
-      display: flex;
-      .companyLogo {
-        height: 54px;
-        width: 54px;
-        min-width: 54px;
-        min-height: 54px;
-        max-width: 54px;
-        max-height: 54px;
-        margin-right: 20px;
-        border-radius: 8px;
-      }
     }
   }
   .footer {
@@ -144,6 +142,7 @@ const handlePosition = (item) => {
     }
     .footer-right {
       flex: 1;
+      text-align: right;
     }
     div {
       overflow: hidden;
@@ -157,4 +156,11 @@ const handlePosition = (item) => {
     white-space: nowrap;
   }
 }
+.salary {
+  font-size: 16px;
+  font-weight: 700;
+  color: #fe574a;
+  line-height: 22px;
+  flex: none;
+}
 </style>

+ 1 - 1
src/views/Home/personal/components/popularEnterprises.vue

@@ -42,7 +42,7 @@ const getHotEnterpriseList = async () => {
       if (item.isEnter) {
         const valueKey = item.nameKey ? item.nameKey : 'label'
         const idKey = item.valueKey ? item.valueKey : 'value'
-        e[item.label] = dictObj[item.value].find(k => Number(k[idKey]) === e.enterprise[item.key])[valueKey]
+        e[item.label] = dictObj[item.value].find(k => Number(k[idKey]) === Number(e.enterprise[item.key]))[valueKey]
       }
       const list = e.jobList
       if (!item.isEnter) {

+ 77 - 91
src/views/recruit/position/components/rightRecommend.vue

@@ -1,16 +1,13 @@
 <template>
-  <v-card class="box">
-    <h4 class="h4">推荐职位</h4>
-    <div class="content">
-      <div v-for="item, index in list " :key="index" class="itemBox">
-        <div class="left">
-          <div>{{ item.aaa }}</div>
-          <div class="textColor666 size14">{{ item.bbb }}</div>
-        </div>
-        <div class="right">
-          <div style="color: #fe574a;">{{ item.ccc }}</div>
-          <div class="textColor666 size14">{{ item.ddd }}</div>
-        </div>
+  <v-card class="position-box">
+    <h4 class="h4 mb-3">推荐职位</h4>
+    <div v-for="(item, index) in list" :key="index" class="mb-2 cursor-pointer" @click="handlePosition(item)">
+      <p class="recruit-name">{{ item.name }}</p>
+      <span class="recruit-salary">{{ item.payFrom }}-{{ item.payTo }}k/{{ item.payName }}</span>
+      <div :class="['enterprise', {'border-bottom-dashed': index !== list.length - 1}]">
+        <v-img class="float-left" :src="item.logoUrl" :width="30" :height="30"></v-img>
+        <span class="float-left enterprise-name">{{ item.anotherName }}</span>
+        <span class="float-right enterprise-address">{{ item.areaName }}</span>
       </div>
     </div>
   </v-card>
@@ -20,94 +17,83 @@
 defineOptions({name: 'retrieval-components-recommendedPositions'})
 const list = [
   {
-    aaa: '职位名称',
-    bbb: '公司名称',
-    ccc: '9-12K',
-    ddd: '广州·越秀区',
+    name: '项目经历',
+    payFrom: 11,
+    payTo: 13,
+    payName: '月',
+    logoUrl: 'https://cdn.vuetifyjs.com/images/john.jpg',
+    anotherName: '广州辞图科技有限公司',
+    areaName: '广州·越秀'
   },
   {
-    aaa: '职位名称职位名称职位名称职位名称职位名称',
-    bbb: '公司名称公司名称公司名称公司名称公司名称',
-    ccc: '9-12K',
-    ddd: '广州·越秀区-广州·越秀区广州·越秀区',
+    name: '项目经历',
+    payFrom: 11,
+    payTo: 13,
+    payName: '月',
+    logoUrl: 'https://cdn.vuetifyjs.com/images/john.jpg',
+    anotherName: '广州辞图科技有限公司',
+    areaName: '广州·越秀'
   },
-  // {
-  //   aaa: '职位名称',
-  //   bbb: '公司名称',
-  //   ccc: '9-12K',
-  //   ddd: '广州·越秀区',
-  // },
-  // {
-  //   aaa: '职位名称',
-  //   bbb: '公司名称',
-  //   ccc: '9-12K',
-  //   ddd: '广州·越秀区',
-  // },
-  // {
-  //   aaa: '职位名称',
-  //   bbb: '公司名称',
-  //   ccc: '9-12K',
-  //   ddd: '广州·越秀区',
-  // },
-  // {
-  //   aaa: '职位名称',
-  //   bbb: '公司名称',
-  //   ccc: '9-12K',
-  //   ddd: '广州·越秀区',
-  // },
-  // {
-  //   aaa: '职位名称',
-  //   bbb: '公司名称',
-  //   ccc: '9-12K',
-  //   ddd: '广州·越秀区',
-  // },
   {
-    aaa: '职位名称',
-    bbb: '公司名称',
-    ccc: '9-12K',
-    ddd: '广州·越秀区',
-  }
+    name: '项目经历',
+    payFrom: 11,
+    payTo: 13,
+    payName: '月',
+    logoUrl: 'https://cdn.vuetifyjs.com/images/john.jpg',
+    anotherName: '广州辞图科技有限公司',
+    areaName: '广州·越秀'
+  },
 ]
 </script>
 <style lang="scss" scoped>
-.textColor666 { color: #666; }
-.size14 { font-size: 14px; }
-.box {
-  width: 100%;
-  min-height: 100px;
+.position-box {
+  position: relative;
+  width: 284px;
   border-radius: 8px;
-  .h4 {
-    padding: 12px 16px;
-    background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
+  padding: 20px 15px;
+}
+.recruit-name {
+  width: 95px;
+  font-weight: 500;
+  display: inline-block;
+  max-width: 95px;
+  vertical-align: middle;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  &:hover {
+    color: var(--v-primary-base);
   }
-  .content {
-    padding: 0 8px;
-    .itemBox {
-      &:hover {
-        background-color: #f3f3f3;
-      }
-      display: flex;
-      justify-content: space-between;
-      padding: 8px 16px;
-      margin: 4px 0;
-      border-radius: 8px;
-      cursor: pointer;
-      .left {
-        width: 148px;
-        margin-right: 12px;
-      }
-      .right {
-        width: calc(100% - 160px);
-        text-align: right;
-      }
-      .left, .right {
-        div {
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-        }
-      }
-    }
+}
+.recruit-salary {
+  float: right;
+  color: var(--v-error-base);
+  font-weight: 500;
+  height: auto;
+  vertical-align: sub;
+}
+.enterprise {
+  height: 40px;
+  line-height: 30px;
+  margin-top: 8px;
+}
+.enterprise-name {
+  width: 120px;
+  display: inline-block;
+  max-width: 120px;
+  vertical-align: middle;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  color: #666;
+  font-size: 13px;
+  margin-left: 5px;
+  &:hover {
+    color: var(--v-primary-base);
   }
 }
+.enterprise-address {
+  color: #555;
+  font-size: 13px;
+}
 </style>

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

@@ -39,6 +39,7 @@ import Empty from '@/components/Empty'
 import { getJobAdvertisedSearch } from '@/api/position'
 import CtPagination from '@/components/CtPagination'
 import { provide, reactive, ref } from 'vue'
+import { dealDictData } from '@/views/recruit/position/components/dict'
 
 import { useRoute, useRouter } from 'vue-router'
 defineOptions({name: 'retrieval-position-page'})
@@ -58,7 +59,11 @@ let pageReqVO = reactive({
 // 职位搜索
 const getPositionList = async () => {
   const { list, total: number } = await getJobAdvertisedSearch(pageReqVO)
-  items.value = list
+  items.value = list.map(e => {
+    e.job = { ...e.job, ...dealDictData({}, e.job) }
+    e.enterprise = { ...e.enterprise, ...dealDictData({}, e.enterprise) }
+    return e
+  })
   total.value = number
 }