瀏覽代碼

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 7 月之前
父節點
當前提交
0ae22136b1

+ 13 - 18
src/components/jobTypeCard/index.vue

@@ -1,4 +1,3 @@
-<!-- 三级结构 -->
 <template>
   <div class="floatCard d-flex" style="z-index: 999" @mouseleave="handleMouseLeave">
     <v-card class="card">
@@ -19,23 +18,19 @@
     </v-card>
     <v-card v-if="rightObj.show" class="card rightCardBox">
       <div class="rightCard">
-        <div class="categoryName">{{ rightObj.data.nameCn }}</div>
-        <div v-for="(item, index) in rightObj.data.children" :key="item.id">
-          <v-divider v-if="index" class="divider"></v-divider>
-          <div class="rowItem d-flex">
-            <div class="categoryName2">{{ item.nameCn }}</div>
-            <div class="rightContent">
-              <div v-if="!item.children?.length"></div>
-              <div 
-                v-else 
-                :class="['jobItem', {'active': selectItems.includes(val.id)}]"
-                v-for="val in item.children" 
-                :key="val.id" 
-                @click="handleClick(val)"
-              >
-              {{ val.nameCn }}</div>
-            </div>
-          </div>
+        <div class="rightContent">
+          <div
+            v-if="!rightObj.data.children?.length"
+            style="width: 100%; text-align: center; color: gray; margin-top: 100px;"
+          >暂无数据</div>
+          <div 
+            v-else 
+            :class="['jobItem', {'active': selectItems.includes(val.id)}]"
+            v-for="val in rightObj.data.children" 
+            :key="val.id" 
+            @click="handleClick(val)"
+          >
+          {{ val.nameCn }}</div>
         </div>
       </div>
     </v-card>

+ 17 - 21
src/views/recruit/personal/home/components/homeJobTypeCard/index.vue

@@ -9,12 +9,12 @@
           @mouseover="handleMouseOver(item, index)"
         >
           <div class="rowItem d-flex">
-            <span class="categoryName">{{ item.nameCn }}</span>
-            <div class="jobItemsBox">
+            <div class="categoryName" style="width: 100%; text-align: center; cursor: pointer;">{{ item.nameCn }}</div>
+            <!-- <div class="jobItemsBox">
               <div class="outerCovering" v-if="item.children?.length && item.children[0].children.length">
                 <div class="jobItems" v-for="val in item.children[0].children" :key="val.id" @click="handleJobClick(val)">{{ val.nameCn }}</div>
               </div>
-            </div>
+            </div> -->
             <span class="mdi mdi-menu-right"></span>
           </div>
         </div>
@@ -34,23 +34,19 @@
     </v-card>
     <v-card v-if="rightObj.show" class="card rightCardBox">
       <div class="rightCard">
-        <div class="categoryName">{{ rightObj.data.nameCn }}</div>
-        <div v-for="(item, index) in rightObj.data.children" :key="item.id">
-          <v-divider v-if="index" class="divider"></v-divider>
-          <div class="rowItem d-flex">
-            <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>
-          </div>
+        <div class="rightContent">
+          <div
+            v-if="!rightObj.data.children?.length"
+            style="width: 100%; text-align: center; color: gray; margin-top: 100px;"
+          >暂无数据</div>
+          <div 
+            v-else 
+            class="jobItem"
+            v-for="val in rightObj.data.children" 
+            :key="val.id" 
+            @click="handleJobClick(val)"
+          >
+          {{ val.nameCn }}</div>
         </div>
       </div>
     </v-card>
@@ -155,7 +151,7 @@ const carouselList = ref([
   justify-content: center; // 后面的flex会继承
   .leftCard {
     height: 384px;
-    width: 380px;
+    width: 300px;
     margin: 4px 0;
     overflow-x: hidden;
     overflow-y: auto;

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

@@ -7,7 +7,8 @@
           :idName="item.key"
           :title="item.title"
           :isSingle="item.isSingle"
-          :dictName="item.dictShow"
+          :isSlot="item.isSlot"
+          :displayDictName="item.displayDictName"
           :provideData="item.provideData || []"
           :info="item"
           @inputChange="inputChange"

+ 10 - 6
src/views/recruit/personal/position/components/conditionFilter/commonPath.vue

@@ -33,6 +33,10 @@ const props = defineProps({
     type: Boolean,
     default: false
   },
+  isSlot: { // 使用插槽(不调用getDict)
+    type: Boolean,
+    default: false
+  },
   isSingle: { // 是否单选
     type: Boolean,
     default: false
@@ -41,9 +45,9 @@ const props = defineProps({
     type: String,
     default: ''
   },
-  dictName: {
+  displayDictName: {
     type: [String, Number],
-    default: ''
+    default: '' // 1: 插槽使用会返回数组
   },
   provideData: {
     type: Array,
@@ -64,7 +68,7 @@ let items = ref()
 const selectedItems = ref([])
 
 const handle = (value) => {
-  if (props.dictName === 1) { // 插槽使用会返回数组
+  if (props.isSlot) {
     selectedItems.value = value
   } else {
     if (selectedItems.value.includes(value)) {
@@ -84,13 +88,13 @@ const handle = (value) => {
 }
 
 // 字典
-if (props.dictName === 1) show.value = true // 插槽使用
+if (props.isSlot) show.value = true // 插槽使用
 else if (props.provideData?.length) { // 自定义下拉数据
   items.value = props.provideData
   show.value = true
 }
-else if (props.dictName) {
-  getDict(props.dictName).then(({ data }) => {
+else if (props.displayDictName) {
+  getDict(props.displayDictName).then(({ data }) => {
     data = data?.length && data || []
     items.value = data
     show.value = true

+ 33 - 23
src/views/recruit/personal/position/components/dict.js

@@ -2,11 +2,11 @@ import { getDict } from '@/hooks/web/useDictionaries'
 import commonPath from './conditionFilter/commonPath.vue'
 // import areaType from './conditionFilter/areaType.vue'
 
-// dictUse: 查数据回显(一维数组字典),dictShow: 用户操作的字典(用户看到的数据)
+// toFilterDictName: 查数据回显(一维数组字典),dictShow: 用户操作的字典(用户看到的数据)
 // 当type是tree类型的数据的时候需要提供dictType
 const dictList = [
-  { 
-    dictShow: 'menduner_area_type',
+  {
+    displayDictName: 'menduner_area_type',
     apiType: 'areaList',
     key: 'areaIds',
     itemKey: 'id',
@@ -15,22 +15,32 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictUse: 'menduner_industry_type',
+  {
+    displayDictName: 'menduner_area_type',
+    apiType: 'areaList',
+    key: 'areaIds',
+    itemKey: 'id',
+    itemText: 'name',
+    title: '工作地点',
+    path: commonPath,
+    data: []
+  },
+  {
+    toFilterDictName: 'menduner_industry_type',
     apiType: 'industryList',
-    dictShow: 1,
     key: 'industryIds',
+    isSlot: true,
     itemKey: 'id',
     itemText: 'nameCn',
     title: '行业类型',
     path: commonPath,
     data: []
   },
-  { 
-    dictUse: 'positionData',
+  {
+    toFilterDictName: 'positionData',
     apiType: 'positionData',
-    dictShow: 1,
     key: 'positionId',
+    isSlot: true,
     itemKey: 'id',
     itemText: 'nameCn',
     title: '职位类型',
@@ -38,8 +48,8 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictShow: 'menduner_job_type',
+  {
+    displayDictName: 'menduner_job_type',
     key: 'jobType',
     itemKey: 'value',
     itemText: 'label',
@@ -47,8 +57,8 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictShow: 'menduner_exp_type',
+  {
+    displayDictName: 'menduner_exp_type',
     key: 'expType',
     itemKey: 'value',
     itemText: 'label',
@@ -56,8 +66,8 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictShow: 'menduner_pay_scope',
+  {
+    displayDictName: 'menduner_pay_scope',
     key: 'payScope',
     itemKey: 'value',
     itemText: 'label',
@@ -67,8 +77,8 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictShow: 'menduner_education_type',
+  {
+    displayDictName: 'menduner_education_type',
     key: 'eduType',
     itemKey: 'value',
     itemText: 'label',
@@ -76,8 +86,8 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictShow: 'menduner_scale',
+  {
+    displayDictName: 'menduner_scale',
     key: 'scale',
     itemKey: 'value',
     itemText: 'label',
@@ -85,8 +95,8 @@ const dictList = [
     path: commonPath,
     data: []
   },
-  { 
-    dictShow: 'menduner_financing_status',
+  {
+    displayDictName: 'menduner_financing_status',
     key: 'financingStatus',
     itemKey: 'value',
     itemText: 'label',
@@ -100,8 +110,8 @@ export const filterList = dictList
 // 字典
 const getDictList = async () => {
   dictList.forEach(async (dictListItem) => {
-    const dictUse = dictListItem.dictUse || dictListItem.dictShow
-    const { data } = await getDict(dictUse, dictListItem.params, dictListItem.apiType)
+    const toFilterDictName = dictListItem.toFilterDictName || dictListItem.displayDictName
+    const { data } = await getDict(toFilterDictName, dictListItem.params, dictListItem.apiType)
     dictListItem.data = data
   })
 }

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

@@ -49,6 +49,7 @@ const route = useRoute(); const router = useRouter()
 const cityFilterRef = ref()
 const conditionFilterRef = ref()
 const showFilterList = [
+  // { key: 'cityId' },
   { key: 'industryIds' },
   { key: 'positionId', isSingle: true },
   { key: 'jobType' },

+ 13 - 13
src/views/recruit/personal/recommend/components/item.vue

@@ -11,36 +11,36 @@
         <div class="job-info">
           <div class="sub-li-top">
             <div class="sub-li-info">
-              <p :class="['name', {'default-active': item.active }]">{{ item.job.name }}</p>
-              <svg-icon v-if="item.job.hire" name="pin" size="30"></svg-icon>
+              <p :class="['name', {'default-active': item.active }]">{{ item.name }}</p>
+              <svg-icon v-if="item.hire" name="pin" size="30"></svg-icon>
             </div>
-            <p v-if="!item.job.payFrom && !item.job.payTo" class="salary">面议</p>
-            <p v-else class="salary">{{ item.job.payFrom ? item.job.payFrom + '-' : '' }}{{ item.job.payTo }}{{ item.job.payName ? '/' + item.job.payName : '' }}</p>
+            <p v-if="!item.payFrom && !item.payTo" class="salary">面议</p>
+            <p v-else class="salary">{{ item.payFrom ? item.payFrom + '-' : '' }}{{ item.payTo }}{{ item.payName ? '/' + item.payName : '' }}</p>
           </div>
           <div class="d-flex justify-space-between align-center">
             <div>
               <span v-for="(j, i) in desc" :key="i" class="font-size-13" style="color: #808080;">
-                <span v-if="item.job[j.value]" class="mr-1 d-inline-block">{{ item.job[j.value] }}</span>
-                <span v-if="i !== desc.length - 1 && item.job[j.value] && item.job[desc[i + 1].value]" class="septal-line ml-1"></span>
+                <span v-if="item[j.value]" class="mr-1 d-inline-block">{{ item[j.value] }}</span>
+                <span v-if="i !== desc.length - 1 && item[j.value] && item[desc[i + 1].value]" class="septal-line ml-1"></span>
               </span>
             </div>
           </div>
           <div class="ellipsis" style="height: 24px;overflow: hidden;">
-            <span v-for="(j, i) in item.job.tagList" :key="i" class="mr-3 tags" style="color: #345768;">{{ j }}</span>
+            <span v-for="(j, i) in item.tagList" :key="i" class="mr-3 tags" style="color: #345768;">{{ j }}</span>
           </div>
         </div>
         <div class="sub-li-bottom">
           <div class="user-info">
             <div class="d-flex align-center">
               <v-avatar size="35">
-                <v-img :src="item.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" />
+                <v-img :src="item.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" />
               </v-avatar>
               <span class="names ml-2 font-size-14 ellipsis" style="max-width: 88%;">
-                {{ item.enterprise.anotherName }}
+                {{ item.anotherName }}
                 <span class="color-999 font-size-13 ml-3">
-                  <span>{{ item.enterprise.industryName }}</span>
-                  <span class="septal-line" v-if="item.enterprise.industryName && item.enterprise.scaleName"></span>
-                  <span>{{ item.enterprise.scaleName }}</span>
+                  <span>{{ item.industryName }}</span>
+                  <span class="septal-line" v-if="item.industryName && item.scaleName"></span>
+                  <span>{{ item.scaleName }}</span>
                 </span>
               </span>
             </div>
@@ -84,7 +84,7 @@ const handleClick = (item, index) => {
   emit('selectChange', item)
 }
 // const handleEnterprise = (item) => {
-//   window.open(`/recruit/personal/company/details/${item.enterprise.id}?key=briefIntroduction`)
+//   window.open(`/recruit/personal/company/details/${item.id}?key=briefIntroduction`)
 // }
 </script>
 

+ 36 - 15
src/views/recruit/personal/recommend/index.vue

@@ -28,8 +28,9 @@
 defineOptions({ name: 'personalPositionRecommend'})
 import buttons from '@/views/recruit/personal/components/buttons.vue'
 import { ref, reactive, nextTick } from 'vue'
-import { getJobAdvertisedSearch } from '@/api/position'
-import { dealDictObjData } from '@/utils/position'
+// import { getJobAdvertisedSearch } from '@/api/position'
+import { getPromotedPosition } from '@/api/position'
+import { dealDictArrayData } from '@/utils/position'
 import PositionList from './components/item'
 import recommendDetails from '@/views/recruit/personal/position/components/details.vue'
 
@@ -46,22 +47,42 @@ const query = reactive({
   pageSize: 10
 })
 const items = ref([])
-const getData = async () => {
-  const { list } = await getJobAdvertisedSearch(query)
-  if (!list.length) return
-  items.value = list.map((e, index) => {
-    const id = e?.job?.id || ''
+
+const getList = async () => {
+  const { list } = await getPromotedPosition(query)
+  if (!list.length) return items.value = []
+  items.value = list.map(e=> {
+    const id = e?.id || ''
     if (!id) return ''
     jobId.value = id
-    showRecommendDetails.value = true
-    e.job = { ...e.job, ...dealDictObjData({}, e.job) }
-    e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise) }
-    e.active = index ? false : true
-    return e
-  }).filter(Boolean)
-  console.log('personalPositionRecommend-data', items.value)
+  })
+  // 处理数据
+  items.value = dealDictArrayData([], list)
+  if (items.value?.length) showRecommendDetails.value = true
+  else {
+    // if (query.pageNum> 3) return
+    // query.pageNum++
+    // getList()
+  }
 }
-getData()
+getList()
+
+// const getData = async () => {
+//   const { list } = await getJobAdvertisedSearch(query)
+//   if (!list.length) return
+//   items.value = list.map((e, index) => {
+//     const id = e?.job?.id || ''
+//     if (!id) return ''
+//     jobId.value = id
+//     showRecommendDetails.value = true
+//     e.job = { ...e.job, ...dealDictObjData({}, e.job) }
+//     e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise) }
+//     e.active = index ? false : true
+//     return e
+//   }).filter(Boolean)
+//   console.log('personalPositionRecommend-data', items.value)
+// }
+// getData()
 
 </script>