浏览代码

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

Xiao_123 1 年之前
父节点
当前提交
ee4fcf6ae5

+ 3 - 3
src/views/Home/personal/components/search.vue → src/components/headSearch/index.vue

@@ -5,7 +5,7 @@
         <span>职位类型</span>
         <span class="mdi mdi-chevron-down px-2" style="font-size: 18px;"></span>
       </div>
-      <jobTypeCard class="jobTypeCardBox" v-if="drawer" float @click.stop=""></jobTypeCard>
+      <jobTypeCard class="jobTypeCardBox" v-if="drawer" @click.stop=""></jobTypeCard>
     </div>
     <v-text-field
       v-model="value"
@@ -23,11 +23,11 @@
 
 <script setup>
 import { useSharedState } from '@/store/sharedState'
-import jobTypeCard from './jobTypeCard.vue'
+import jobTypeCard from '@/components/jobTypeCard'
 
 import { ref, watch } from 'vue';
 
-defineOptions({ name:'personal-search'})
+defineOptions({ name:'common-components-headSearch'})
 
 const value = ref('')
 let drawer = ref(false)

+ 27 - 20
src/views/Home/personal/components/jobTypeCard.vue → src/components/jobTypeCard/index.vue

@@ -1,16 +1,16 @@
 <template>
-  <div class="d-flex" :style="{ 'z-index': isFloat ? 9999: '' }" :class="isFloat ? 'floatCard' : 'labelCard'" @mouseleave="handleMouseLeave">
+  <div class="d-flex" :style="{ 'z-index': isPage ? '' : 999 }" :class="isPage ? 'hasPageCard' : 'floatCard'" @mouseleave="handleMouseLeave">
     <v-card class="card">
       <div class="leftCard">
         <div
-          class="leftCardItem" :class="{'leftIndexAct': index === leftIndex, 'elevation-5': (index === leftIndex && !isFloat)}"
+          class="leftCardItem" :class="{'leftIndexAct': index === leftIndex, 'elevation-5': (index === leftIndex && isPage)}"
           v-for="(item, index) in items" :key="item.id"
           @mouseover="handleMouseOver(item, index)"
         >
           <div class="rowItem d-flex">
             <span class="categoryName">{{ item.nameCn }}</span>
             <div class="jobItemsBox">
-              <div class="outerCovering" v-if="!isFloat && item.children?.length && item.children[0].children.length">
+              <div class="outerCovering" v-if="isPage && 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>
@@ -19,7 +19,7 @@
         </div>
         <!-- <v-divider vertical></v-divider> -->
         <!-- 分页 -->
-        <div v-if="!float" class="mt-2" @mouseover.stop="handleMouseLeave" style="border-top: 1px dashed #e6e6e6; position: absolute; bottom: 4px; width: 100%;">
+        <div v-if="isPage" class="mt-2" @mouseover.stop="handleMouseLeave" style="border-top: 1px dashed #e6e6e6; position: absolute; bottom: 4px; width: 100%;">
           <div class="d-flex justify-space-between align-center mx-4" style="height: 40px">
             <div style="color: var(--v-primary-base); font-size: 14px;">
               {{ pageInfo.current }} / {{ pageCount }}
@@ -47,7 +47,7 @@
         </div>
       </div>
     </v-card>
-    <v-card height="392px" v-if="!isFloat && !rightObj.show" class="card rightCardBox ml-1">
+    <v-card height="392px" v-if="isPage && !rightObj.show" class="card rightCardBox ml-1">
       <v-carousel show-arrows="hover" cycle>
         <v-carousel-item v-for="(item, i) in carouselList" :key="i">
           <div style="height: 392px; overflow: hidden;">
@@ -61,17 +61,19 @@
 
 <script setup>
 import { getPositionTreeClick } from '@/api/common/index'
-import { reactive, ref, inject } from 'vue';
+import { getDict } from '@/hooks/web/useDictionaries'
 
-defineOptions({ name:'personal-jobTypeCard'})
+import { reactive, ref } from 'vue';
+
+defineOptions({ name:'common-components-jobTypeCard'})
 
 const props = defineProps({
-  float: { // 搜索浮动
+  page: { // 是否分页
     type: Boolean,
     default: false
   },
 })
-const isFloat = props.float
+const isPage = props.page
 
 // 翻页数据
 const pageInfo = reactive({ current: 1, size: 8 })
@@ -85,16 +87,21 @@ const getPageItems = () => {
   const endIndex = Math.min(startIndex + pageInfo.size, defaultItems.value.length)
   items.value = defaultItems.value.slice(startIndex, endIndex)
 }
+getDict('positionTreeData', null, 'positionTreeData').then(({ data }) => {
+  data = data?.length && data || []
+  if (isPage) {
+    // 翻页数据
+    defaultItems.value = data
+    if (defaultItems.value?.length) {
+      pageCount.value = Math.ceil(defaultItems.value.length / pageInfo.size)
+      getPageItems()
+    } else pageInfo.current = 0
+  } else {
+    items.value = data
+  }
+})
+
 
-if (isFloat) items.value = JSON.parse(inject('industryTreeData').value)
-else {
-  // 翻页数据
-  defaultItems.value = JSON.parse(inject('industryTreeData').value)
-  if (defaultItems.value?.length) {
-    pageCount.value = Math.ceil(defaultItems.value.length / pageInfo.size)
-    getPageItems()
-  } else pageInfo.current = 0
-}
 // 翻页数据
 const previous = () => { if (pageInfo.current > 1) pageInfo.current--; getPageItems() }
 const nextPage = () => { if (pageInfo.current < pageCount.value) pageInfo.current++; getPageItems() }
@@ -114,8 +121,8 @@ const handleMouseLeave = () => { // 鼠标移出
 }
 // 轮播图片
 const carouselList = ref([
-  { src: 'https://img0.baidu.com/it/u=3769341087,3426515789&fm=253&fmt=auto&app=138&f=JPEG?w=1180&h=472', },
   { src: 'https://img.kinpan.com/Files/design/detailimages/20161228/6361853956839262507798973.jpg', },
+  { src: 'https://img0.baidu.com/it/u=3769341087,3426515789&fm=253&fmt=auto&app=138&f=JPEG?w=1180&h=472', },
 ])
 
 // 职位点击事件
@@ -177,7 +184,7 @@ const handleJobClick = async (val) => {
     }
   }
 }
-.labelCard {
+.hasPageCard {
   width: 100%;
   .card { border-radius: 12px; }
   .leftIndexAct {

+ 2 - 1
src/hooks/web/useDictionaries.js

@@ -1,4 +1,4 @@
-import { getDictData, getIndustryListData, getAreaListData } from '@/api/common/index'
+import { getDictData, getIndustryListData, getAreaListData, getPositionTreeData } from '@/api/common/index'
 // 定义对应的api
 // const DICT_CITY_API = {
 //   menduner_exp_type: getDictData
@@ -22,6 +22,7 @@ export const getDict = (type, params, apiType = 'dict') => {
       const query = params ? params : { type }
       const apiFn = {
         dict: getDictData,
+        positionTreeData: getPositionTreeData, // 职位tree
         industryList: getIndustryListData,
         areaList: getAreaListData
       }

+ 4 - 17
src/views/Home/personal/index.vue

@@ -2,11 +2,11 @@
   <div>
     <headCarousel></headCarousel>
     <div class="stickyBox py-5">
-      <headSearch v-if="industryTreeData"></headSearch>
+      <headSearch></headSearch>
     </div>
     <hotJobs></hotJobs>
     <div class="default-width">
-      <jobTypeCard class="mb-5" v-if="industryTreeData"></jobTypeCard>
+      <jobTypeCard  class="mb-5" page ></jobTypeCard>
       <hotPromotedPositions></hotPromotedPositions>
       <PopularEnterprises class="mt-10"></PopularEnterprises>
     </div>
@@ -15,25 +15,12 @@
 
 <script setup>
 import headCarousel from './components/headCarousel.vue'
-import headSearch from './components/search.vue'
+import headSearch from '@/components/headSearch'
 import hotJobs from './components/hotJobs.vue'
-import jobTypeCard from './components/jobTypeCard.vue'
+import jobTypeCard from '@/components/jobTypeCard'
 import hotPromotedPositions from './components/hotPromotedPositions.vue'
 import PopularEnterprises from './components/popularEnterprises.vue'
-import { getPositionTreeData } from '@/api/common/index'
-import { provide, ref } from 'vue';
-
 defineOptions({ name:'personal-index'})
-
-// 获取行业树形
-let industryTreeData = ref(null)
-const getTreeData = async () => {
-  const res = await getPositionTreeData()
-  if (res?.length) industryTreeData.value = JSON.stringify(res)
-  else industryTreeData.value = "[]"
-}
-provide('industryTreeData', industryTreeData)
-getTreeData()
 </script>
 
 <style lang="scss" scoped>

+ 16 - 0
src/views/recruit/company/index.vue

@@ -0,0 +1,16 @@
+<!-- 检索列表页 - 公司检索 -->
+<template>
+  <div>
+    检索
+  </div>
+  <div>筛选条件</div>
+  <div>
+    <div>
+      左侧列表
+    </div>
+    <div>右侧列表</div>
+  </div>
+</template>
+<script setup>
+defineOptions({name: 'retrieval-company-page'})
+</script>

+ 11 - 8
src/views/recruit/position/index.vue

@@ -1,15 +1,18 @@
+<!-- 检索列表页 - 职位检索 -->
 <template>
-  <div>
-    检索
-  </div>
-  <div>筛选条件</div>
-  <div>
+  <div class="default-width">
+    <div>
+      检索
+    </div>
+    <div>筛选条件</div>
     <div>
-      左侧列表
+      <div>
+        左侧列表
+      </div>
+      <div>右侧列表</div>
     </div>
-    <div>右侧列表</div>
   </div>
 </template>
 <script setup>
-defineOptions({name: 'position-page'})
+defineOptions({name: 'retrieval-position-page'})
 </script>