Browse Source

企业-集团账户:只有企业管理员可看

Xiao_123 1 tháng trước cách đây
mục cha
commit
d084dca99c
1 tập tin đã thay đổi với 5 bổ sung17 xóa
  1. 5 17
      src/layout/company/side.vue

+ 5 - 17
src/layout/company/side.vue

@@ -52,16 +52,14 @@ const enterpriseStore = useEnterpriseStore()
 const list = computed(() => {
   return getList(enterpriseStore.enterpriseMenu)
 })
-// console.log(import.meta.env.VITE_NODE_ENV, '当前环境变量============')
 
-// const isAdmin = localStorage.getItem('isAdmin') === '1'
+const isAdmin = localStorage.getItem('isAdmin') === '1'
 // const info = localStorage.getItem('entBaseInfo') ? JSON.parse(localStorage.getItem('entBaseInfo')) : {}
 const getList = (arr, obj = [], root = '') => {
   // 是否为企业管理员
   arr.forEach(element => {
     if (!element.alwaysShow) return
     let data = {}
-    // const path = element.path[0] === '/' ? element.path : '/' + element.path
     const path = root + element.path
     data = {
       title: element.name,
@@ -71,9 +69,6 @@ const getList = (arr, obj = [], root = '') => {
       path: enterpriseStore.menuType.CATALOGUE === element.type ? path + '/index' : path,
       children: []
     }
-    // if (element?.meta?.isAdmin) {
-    //   data.isAdmin = true
-    // }
     // 人才地图
     // if (element?.meta?.isPersonMap) data.isPersonMap = true
     // 全员猎寻
@@ -81,18 +76,11 @@ const getList = (arr, obj = [], root = '') => {
     if (element?.children) {
       getList(element.children, data.children, path + '/')
     }
-    obj.push(data)
+
+    // 企业管理员才有集团账户的权限
+    if (data.path === '/recruit/enterprise/systemManagement/groupAccount' && !isAdmin) {}
+    else obj.push(data)
   })
-  // if (!isAdmin) {
-  //   obj = obj.filter(e => !e.isAdmin)
-  //   obj.map(e => {
-  //     e.children = e.children.filter(val => !val.isAdmin)
-  //   })
-  // }
-  // 人才地图是否可看
-  // if (info && Object.keys(info).length && !info?.entitlement?.personMap) obj = obj.filter(e => !e.isPersonMap)
-  // 全员猎寻是否可看
-  // if (info && Object.keys(info).length && !info?.entitlement?.hireJob) obj = obj.filter(e => !e.hireJob)
 
   // 生产环境隐藏门墩儿新任命
   if (import.meta.env.VITE_NODE_ENV === 'production') obj = obj.filter(e => !e.path.includes('/recruit/enterprise/newlyAppointed'))