Przeglądaj źródła

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

lifanagju_citu 3 miesięcy temu
rodzic
commit
c88947caa7

+ 0 - 1
src/permission.js

@@ -22,7 +22,6 @@ const ENTERPRISE_PATH = '/recruit/enterprise'
 router.beforeEach(async (to, from, next) => {
   start()
   // 个人端 404 处理
-  // debugger
   if (to.path === '/404') {
     next()
     return

+ 4 - 0
src/store/user.js

@@ -160,6 +160,10 @@ export const useUserStore = defineStore('user',
       },
       // 切换为招聘者
       async changeRole (res) {
+        // 切换企业时需将个人的账户信息另外储存起来,以防企业账户有角色无菜单权限返回首页清除企业信息时个人账户信息丢失
+        const perAccountData = JSON.parse(localStorage.getItem('accountInfo'))
+        localStorage.setItem('perAccountInfo', JSON.stringify(perAccountData))
+
         let data
         if (res?.type === 'emailLogin') {
           data = res

+ 27 - 1
src/views/recruit/enterprise/hirePosition/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div :class="{'disable': info && info?.entitlement && !info?.entitlement?.hireJob}">
     <v-card class="card-box pa-5">
       <div class="d-flex justify-center mt-3">
         <TextUI :item="textItem" @enter="handleEnter" @appendInnerClick="handleEnter"></TextUI>
@@ -78,6 +78,12 @@ const textItem = ref({
   appendInnerIcon: 'mdi-magnify'
 })
 
+// 获取企业权益信息
+const info = ref(localStorage.getItem('entBaseInfo') ? JSON.parse(localStorage.getItem('entBaseInfo')) : {})
+store.$subscribe((mutation, state) => {
+  if (Object.keys(state.entBaseInfo).length) info.value = state.entBaseInfo
+})
+
 const handleAdd = async () => {
   const data = await getEnterprisePubJobTypePermission()
   if (!data || !data.length) return Snackbar.warning('没有该操作权限,请联系平台管理员升级后再试')
@@ -143,4 +149,24 @@ const handleEnter = (e) => {
 </script>
 
 <style scoped lang="scss">
+.disable {
+  position: relative;
+  overflow: hidden;
+  &::after {
+    content: '很抱歉,您当前没有权限使用全员猎寻模块';
+    position: absolute;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 1.5em;
+    font-weight: bold;
+    color: #fff;
+    top: 0;
+    border-radius: 12px;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, 0.35);
+  }
+}
 </style>

+ 10 - 1
src/views/recruit/enterprise/permissionPrompt/index.vue

@@ -17,8 +17,17 @@ const router = useRouter()
 const handleToHome = async () => {
 	// 退出企业登录
 	await logoutToken(getToken(1))
+	
+	// 有企业id则为求职者切换招聘者
+	// 切换招聘者时已将企业账户信息赋值给accountInfo,现退出企业登录后需将个人账户信息赋值给accountInfo
+	const isChangeRole = localStorage.getItem('enterpriseId')
+	if (isChangeRole) {
+		const perAccountData = JSON.parse(localStorage.getItem('perAccountInfo'))
+		localStorage.setItem('accountInfo', JSON.stringify(perAccountData))
+	} else localStorage.removeItem('accountInfo')
+	
 	// 清除企业相关缓存信息
-	const enterpriseLocalStorage = ['ENT_REFRESH_TOKEN', 'ENT_ACCESS_TOKEN', 'entBaseInfo', 'accountInfo', 'isAdmin', 'enterpriseUserAccount', 'entUpdatePassword', 'emailLoginInfo', 'enterpriseStore', 'enterpriseId']
+	const enterpriseLocalStorage = ['ENT_REFRESH_TOKEN', 'ENT_ACCESS_TOKEN', 'entBaseInfo', 'isAdmin', 'enterpriseUserAccount', 'entUpdatePassword', 'emailLoginInfo', 'enterpriseStore', 'enterpriseId']
 	enterpriseLocalStorage.forEach(e => localStorage.removeItem(e))
 
 	router.push('/')

+ 115 - 94
src/views/recruit/enterprise/talentMap/index.vue

@@ -1,94 +1,94 @@
 <template>
-<div>
-  <v-card class="card-box pa-5" style="height: 100%;">
-    <div class="d-flex flex-column align-center" :class="{'v-center': init}">
-      <TextUI
-        v-model="content"
-        :item="textItem"
-        @keyup.enter="handleConfirm"
-        @appendInnerClick="handleConfirm"
-      ></TextUI>
-      <div class="align-center">
-        <template v-if="init && defaultLabelsShow?.length">
-          <v-btn
-            v-for="(val, index) in defaultLabelsShow" :key="val + index"
-            class="mr-3 my-2 py-0 px-2"
-            density="comfortable"
-            color="primary" variant="tonal"
-            @click="clickChip(index)"
-          >
-            {{ val }}
-          </v-btn>
-          <!-- <v-btn class="ml-0 my-1 py-0 px-2" density="comfortable" variant="tonal" color="error" @click="moreLabels">
-            更多人才标签...
-          </v-btn> -->
-        </template>
-      </div>
-    </div>
-    <template v-if="!init">
-      <span class="mr-2 color-666" style="width: 68px; min-width: 68px;">人才标签:</span>
-      <v-btn
-        v-for="(val, index) in chosenLabels" :key="val + index"
-        class="mr-3 my-2 py-0 px-2"
-        density="comfortable"
-        color="primary" variant="tonal"
-      >
-        {{ val }}
-        <v-icon class="ml-1" style="margin-top: 1px;" @click="deleteChip(index)">mdi-close</v-icon>
-      </v-btn>
-      <!-- <v-btn
-        class="mr-3 my-2 py-0 px-0"
-        density="comfortable"
-        color="primary" variant="tonal"
-        @click="moreLabels"
-      >
-        <v-icon>mdi-plus-box</v-icon>
-      </v-btn> -->
-      <v-btn icon="mdi-plus" class="mr-8" variant="outlined" size="x-small" @click="moreLabels"></v-btn>
-      <span v-if="chosenLabels?.length" class="my-2" style="font-size: 14px;cursor: pointer;color: var(--color-999);" @click="resetLabel">清空标签</span>
-    </template>
-    <!-- 人员信息表单 -->
-    <CtTable
-      v-if="dataList?.length && (chosenLabels?.length || content)"
-      class="mt-3"
-      :items="dataList"
-      :headers="headers"
-      :loading="loading"
-      :elevation="0"
-      height="calc(100vh - 380px)"
-      :isTools="false"
-      :showPage="true"
-      :total="total"
-      :page-info="pageInfo"
-      itemKey="id"
-      @pageHandleChange="handleChangePage"
-    >
-      <template #name="{ item }">
-        <div class="d-flex align-center cursor-pointer" @click="talentPoolDetails(item)">
-          <v-badge
-            v-if="item?.sex === '1' || item?.sex === '2'"
-            bordered
-            offset-y="6"
-            :color="badgeColor(item)"
-            :icon="badgeIcon(item)">
-            <v-avatar size="40" :image="getUserAvatar(item.avatar, item.sex)"></v-avatar>
-          </v-badge>
-          <v-avatar v-else size="40" :image="getUserAvatar(item.avatar, item.sex)"></v-avatar>
-          <span class="defaultLink ml-3">{{ item?.name }}</span>
+  <div :class="{'disable': info && info?.entitlement && !info?.entitlement?.personMap}">
+    <v-card class="card-box pa-5" style="height: 100%;">
+      <div class="d-flex flex-column align-center" :class="{'v-center': init}">
+        <TextUI
+          v-model="content"
+          :item="textItem"
+          @keyup.enter="handleConfirm"
+          @appendInnerClick="handleConfirm"
+        ></TextUI>
+        <div class="align-center">
+          <template v-if="init && defaultLabelsShow?.length">
+            <v-btn
+              v-for="(val, index) in defaultLabelsShow" :key="val + index"
+              class="mr-3 my-2 py-0 px-2"
+              density="comfortable"
+              color="primary" variant="tonal"
+              @click="clickChip(index)"
+            >
+              {{ val }}
+            </v-btn>
+            <!-- <v-btn class="ml-0 my-1 py-0 px-2" density="comfortable" variant="tonal" color="error" @click="moreLabels">
+              更多人才标签...
+            </v-btn> -->
+          </template>
         </div>
+      </div>
+      <template v-if="!init">
+        <span class="mr-2 color-666" style="width: 68px; min-width: 68px;">人才标签:</span>
+        <v-btn
+          v-for="(val, index) in chosenLabels" :key="val + index"
+          class="mr-3 my-2 py-0 px-2"
+          density="comfortable"
+          color="primary" variant="tonal"
+        >
+          {{ val }}
+          <v-icon class="ml-1" style="margin-top: 1px;" @click="deleteChip(index)">mdi-close</v-icon>
+        </v-btn>
+        <!-- <v-btn
+          class="mr-3 my-2 py-0 px-0"
+          density="comfortable"
+          color="primary" variant="tonal"
+          @click="moreLabels"
+        >
+          <v-icon>mdi-plus-box</v-icon>
+        </v-btn> -->
+        <v-btn icon="mdi-plus" class="mr-8" variant="outlined" size="x-small" @click="moreLabels"></v-btn>
+        <span v-if="chosenLabels?.length" class="my-2" style="font-size: 14px;cursor: pointer;color: var(--color-999);" @click="resetLabel">清空标签</span>
       </template>
-      <template #actions="{ item }">
-        <v-btn color="primary" variant="text" @click="talentPoolDetails(item)">查看</v-btn>
-      </template>
-    </CtTable>
-    <Empty v-if="!init && !total" :message="loading ? '加载中...' : '没有找到对应人才信息,请换个条件搜索'" :elevation="false" class="mt-15"></Empty>
-  </v-card>
-  <CtDialog :visible="showMore" titleClass="text-h6" title="选择人才标签" @close="showMore = false" @submit="handleSubmit">
-    <div style="width: 80%; margin: 0 auto; min-height: 400px;">
-      <CtForm :items="formItems" style="width: 100%;"></CtForm>
-    </div>
-  </CtDialog>
-</div>
+      <!-- 人员信息表单 -->
+      <CtTable
+        v-if="dataList?.length && (chosenLabels?.length || content)"
+        class="mt-3"
+        :items="dataList"
+        :headers="headers"
+        :loading="loading"
+        :elevation="0"
+        height="calc(100vh - 380px)"
+        :isTools="false"
+        :showPage="true"
+        :total="total"
+        :page-info="pageInfo"
+        itemKey="id"
+        @pageHandleChange="handleChangePage"
+      >
+        <template #name="{ item }">
+          <div class="d-flex align-center cursor-pointer" @click="talentPoolDetails(item)">
+            <v-badge
+              v-if="item?.sex === '1' || item?.sex === '2'"
+              bordered
+              offset-y="6"
+              :color="badgeColor(item)"
+              :icon="badgeIcon(item)">
+              <v-avatar size="40" :image="getUserAvatar(item.avatar, item.sex)"></v-avatar>
+            </v-badge>
+            <v-avatar v-else size="40" :image="getUserAvatar(item.avatar, item.sex)"></v-avatar>
+            <span class="defaultLink ml-3">{{ item?.name }}</span>
+          </div>
+        </template>
+        <template #actions="{ item }">
+          <v-btn color="primary" variant="text" @click="talentPoolDetails(item)">查看</v-btn>
+        </template>
+      </CtTable>
+      <Empty v-if="!init && !total" :message="loading ? '加载中...' : '没有找到对应人才信息,请换个条件搜索'" :elevation="false" class="mt-15"></Empty>
+    </v-card>
+    <CtDialog :visible="showMore" titleClass="text-h6" title="选择人才标签" @close="showMore = false" @submit="handleSubmit">
+      <div style="width: 80%; margin: 0 auto; min-height: 400px;">
+        <CtForm :items="formItems" style="width: 100%;"></CtForm>
+      </div>
+    </CtDialog>
+  </div>
 </template>
 
 <script setup>
@@ -98,6 +98,7 @@ import { getRocketLabelList } from '@/api/recruit/enterprise/resumeManagement/ta
 import { dealDictArrayData } from '@/utils/position'
 import { getUserAvatar } from '@/utils/avatar'
 import { timesTampChange } from '@/utils/date'
+import { useUserStore } from '@/store/user'
 import TextUI from '@/components/FormUI/TextInput'
 import Snackbar from '@/plugins/snackbar'
 
@@ -112,20 +113,21 @@ const total = ref(0)
 const headers = [
   { title: '姓名', key: 'name', sortable: false },
   { title: '求职状态', key: 'jobStatusName', sortable: false },
-  // { title: '求职类型', key: 'jobName', sortable: false },
   { title: '电话号码', key: 'phone', sortable: false },
-  // { title: '常用邮箱', key: 'email', sortable: false },
-  // { title: '微信二维码', key: 'wxCode', sortable: false },
   { title: '出生日期', key: 'birthday', sortable: false, value: item =>  timesTampChange(item.birthday, 'Y-M-D') },
   { title: '婚姻状况', key: 'maritalStatusName', sortable: false },
   { title: '所在城市', key: 'areaName', sortable: false },
-  // { title: '户籍地', key: 'regName', sortable: false },
   { title: '首次工作时间', key: 'firstWorkTime', sortable: false, value: item =>  timesTampChange(item.firstWorkTime, 'Y-M-D') },
-  // { title: '个人优势', key: 'advantage', sortable: false },
   { title: '工作年限', key: 'expName', sortable: false },
   { title: '最高学历', key: 'eduName', sortable: false },
   { title: '操作', value: 'actions', sortable: false }
 ]
+// 获取企业权益信息
+const store = useUserStore()
+const info = ref(localStorage.getItem('entBaseInfo') ? JSON.parse(localStorage.getItem('entBaseInfo')) : {})
+store.$subscribe((mutation, state) => {
+  if (Object.keys(state.entBaseInfo).length) info.value = state.entBaseInfo
+})
 
 const init = ref(true)
 const labelList = ref([])
@@ -208,7 +210,6 @@ const getData = async () => {
   }) : []
   loading.value = false
 }
-// getData()
 
 const handleChangePage = (e) => {
   pageInfo.pageNo = e
@@ -256,6 +257,26 @@ const talentPoolDetails = ({ userId }) => {
 </script>
 
 <style scoped lang="scss">
+.disable {
+  position: relative;
+  overflow: hidden;
+  &::after {
+    content: '很抱歉,您当前没有权限使用人才地图模块';
+    position: absolute;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 1.5em;
+    font-weight: bold;
+    color: #fff;
+    top: 0;
+    border-radius: 12px;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, 0.35);
+  }
+}
 :deep(.v-table > .v-table__wrapper > table > thead) {
   background-color: #f7f8fa !important;
 }