Xiao_123 1 år sedan
förälder
incheckning
91a2e34515

+ 11 - 17
src/hooks/web/useDictionaries.js

@@ -1,27 +1,17 @@
-
 import { getDictData, getIndustryTreeData } from '@/api/common/index'
 // 定义对应的api
-const DICT_CITY_API = {
-  menduner_exp_type: getDictData, // 工作经验
-  menduner_pay_unit: getDictData, // 薪酬单位
-  menduner_enterprise_type: getDictData, // 企业类型
-  menduner_business_status: getDictData, // 经营状态
-  menduner_scale: getDictData, // 人员规模
-  menduner_financing_status: getDictData, // 融资状态
-  menduner_education_system_type: getDictData, // 学制类型
-  menduner_education_type: getDictData, // 学历
-  menduner_job_type: getDictData, // 求职类型
-  menduner_industry_type: getIndustryTreeData // 行业类型
-}
+// const DICT_CITY_API = {
+//   menduner_exp_type: getDictData
+// }
 
-const setDict = (type, val, cacheTime) => {
+const setDict = (type, val, cacheTime = 7200) => {
   localStorage.setItem(type, JSON.stringify({
     data: val,
-    expire: Date.now() + cacheTime
+    expire: Date.now() + cacheTime * 1000
   }))
 }
 
-export const getDict = (type, params) => {
+export const getDict = (type, params, apiType = 'dict') => {
     return new Promise((resolve) => {
       const item = localStorage.getItem(type)
       const catchData = item ? JSON.parse(item) : null
@@ -30,7 +20,11 @@ export const getDict = (type, params) => {
       }
       // 传参按照规范参数传
       const query = params ? params : { type }
-      DICT_CITY_API[type](query).then(data => {
+      const apiFn = {
+        dict: getDictData,
+        industryDict: getIndustryTreeData
+      }
+      apiFn[apiType](query).then(data => {
         setDict(type, data, Date.now())
         resolve({ data })
       })

+ 2 - 4
src/hooks/web/useTitle.js

@@ -1,14 +1,12 @@
 import { watch, ref } from 'vue'
 import { isString } from '@/utils/is'
-import { useAppStore } from '@/store/app'
 import { useI18n } from './useI18n'
-
+const mTitle = import.meta.env.VITE_APP_TITLE
 
 export const useTitle = (newTitle) => {
-  const appStore = useAppStore()
   const { t } = useI18n()
   const title = ref(
-    newTitle ? `${appStore.title} - ${t(newTitle)}` : appStore.title
+    newTitle ? `${mTitle} - ${t(newTitle)}` : mTitle
   )
 
   watch(

+ 1 - 1
src/layout/personal/navBar.vue

@@ -106,7 +106,7 @@ const localeStore = useLocaleStore()
 
 const list = ref([
   { text: '首页', path: '/home' },
-  { text: '职位', path: '' },
+  { text: '职位', path: '/recruit/position' },
   { text: '公司', path: '' }
 ])
 

+ 6 - 8
src/layout/personal/slider.vue

@@ -3,15 +3,13 @@
     <div v-for="item in list" :key="item.mdi" class="slider-box-item">
       <v-tooltip :text="item.tips" location="start">
         <template v-slot:activator="{ props }">
-          <v-icon size="30" class="icons" v-bind="props">{{ item.mdi }}</v-icon>
-        </template>
-        <template v-slot:default>
-          <div v-if="item.showImg" class="ma-3" style="text-align: center">
-            <v-img cover aspect-ratio="1/1" src="https://minio.citupro.com/dev/static/mendunerCode.jpg" :width="170" style="height: 170px;"></v-img>
-            <span class="tips-text">关注门墩儿直聘微信公众号</span>
-          </div>
-          <span v-else>{{ item.tips }}</span>
+          <v-btn size="30" class="icons" variant="text" v-bind="props" :icon="item.mdi"></v-btn>
         </template>
+        <div v-if="item.showImg" class="ma-3" style="text-align: center">
+          <v-img cover aspect-ratio="1/1" src="https://minio.citupro.com/dev/static/mendunerCode.jpg" :width="170" style="height: 170px;"></v-img>
+          <span class="tips-text">关注门墩儿直聘微信公众号</span>
+        </div>
+        <span v-else>{{ item.tips }}</span>
       </v-tooltip>
     </div>
   </div>

+ 1 - 1
src/plugins/snackbar/message.vue

@@ -3,7 +3,7 @@
     <v-snackbar
       timeout="-1"
       location="top"
-      :variant="variant || elevated"
+      :variant="variant || 'flat'"
       :color="color"
       v-model="snackbar"
     >{{message}}

+ 21 - 0
src/router/modules/recruit.js

@@ -0,0 +1,21 @@
+
+// 门墩儿招聘
+import Layout from '@/layout'
+const recruit = [
+  {
+    path: '/recruit',
+    component: Layout,
+    name: 'recruit',
+    children: [
+      {
+        path: '/recruit/position',
+        component: () => import('@/views/recruit/position'),
+        name: 'recruitPosition',
+        meta: {
+          title: '职位'
+        }
+      }
+    ]
+  }
+]
+export default recruit

+ 12 - 3
src/router/modules/remaining.js

@@ -1,13 +1,15 @@
 import personal from './personal'
 import enterprise from './enterprise'
+import recruit from './recruit'
 import Layout from '@/layout'
 
-const type  = 0
+// const type  = 0
 const routeArray = [
+  recruit,
   personal,
   enterprise
 ]
-const items = routeArray[type]
+// const items = routeArray[type]
 const remainingRouter = [
   {
     path: '/login',
@@ -40,6 +42,13 @@ const remainingRouter = [
     path: '',
     component: Layout,
     children: [
+      {
+        path: '',
+        component: () => import('@/views/Home/index'),
+        meta: {
+          title: '首页'
+        }
+      },
       {
         path: '/home',
         component: () => import('@/views/Home/index'),
@@ -58,7 +67,7 @@ const remainingRouter = [
       title: '注册企业'
     }
   },
-  ...items
+  ...routeArray
 ]
 
 export default remainingRouter

+ 0 - 20
src/store/app.js

@@ -1,20 +0,0 @@
-import { defineStore } from 'pinia'
-import { ref } from 'vue' 
-
-
-export const useAppStore = defineStore('app', 
-  () => {
-    const title = ref(import.meta.env.VITE_APP_TITLE) // 标题
-
-    const setTitle = (txt) => {
-      title.value = txt
-    }
-    return {
-      title,
-      setTitle
-    }
-  },
-  {
-    persist: true, // ref() 持久化响应
-  }
-)

+ 19 - 0
src/views/Home/personal/components/hotJobs.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="box text-center">
+    <span class="mr-2">热门职位:</span>
+    <v-btn v-for="(item, index) in jobs" :key="index" size="small" class="ml-2" color="primary" variant="tonal">{{ item }}</v-btn>
+  </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+defineOptions({ name:'personal-hotJobs-list'})
+
+const jobs = ref(['Java','PHP','Python','C#','.NET','GIS工程师','区块链工程师','测试', 'Python','C#','.NET'])
+</script>
+
+<style lang="scss" scoped>
+.box {
+  margin-bottom: 24px;
+}
+</style>

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

@@ -47,7 +47,7 @@ watch(() => sharedState.layoutClickCount, () => {
 .search {
   height: 50px;
   width: 800px;
-  margin: 16px auto 8px auto;
+  margin: 20px auto;
   border: 2px solid var(--v-primary-base);
   border-radius: 5px;
   .jobBox {

+ 2 - 0
src/views/Home/personal/index.vue

@@ -2,6 +2,7 @@
   <div>
     <headCarousel></headCarousel>
     <headSearch></headSearch>
+    <hotJobs></hotJobs>
     <div class="default-width mt-3">
       <hotPromotedPositions></hotPromotedPositions>
       <PopularEnterprises class="mt-10"></PopularEnterprises>
@@ -12,6 +13,7 @@
 <script setup>
 import headCarousel from './components/headCarousel.vue'
 import headSearch from './components/search.vue'
+import hotJobs from './components/hotJobs.vue'
 import hotPromotedPositions from './components/hotPromotedPositions.vue'
 import PopularEnterprises from './components/popularEnterprises.vue'
 defineOptions({ name:'personal-index'})

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

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    检索
+  </div>
+  <div>筛选条件</div>
+  <div>
+    <div>
+      左侧列表
+    </div>
+    <div>右侧列表</div>
+  </div>
+</template>
+<script setup>
+defineOptions({name: 'position-page'})
+</script>