Browse Source

学生隐藏多余菜单

zhuf 1 year ago
parent
commit
24f8e8efb7
1 changed files with 87 additions and 83 deletions
  1. 87 83
      src/components/NavHeader/index.vue

+ 87 - 83
src/components/NavHeader/index.vue

@@ -1,6 +1,7 @@
 <script setup>
 import { js_code, user, webInfo } from '~/store/index'
 
+console.log('user : ', user)
 const router = useRouter()
 const link = window.GLOBAL_CONFIG
 
@@ -15,98 +16,99 @@ const { currentRoute } = useRouter()
 const route = currentRoute.value
 const notShowHeader = route.query.notShowHeader
 
-const navbarData = [
-
-  {
-    id: 'issue_combine',
-    label: '试题库',
-    arr: [{
-      id: 'issue_combine_chapter',
-      label: '章节试题',
-      href: `${link.yzy}/webapps/page/task.html?mold=issue&sort=chapter`,
-    },
-    {
-      id: 'issue_combine_knowledge',
-      label: '知识点试题',
-      href: `${link.yzy}/webapps/page/task.html?mold=issue&sort=knowledge`,
-    },
-    {
-      id: 'issue_combine_intellect',
-      label: '智能选题',
-      href: `${link.yzy}/webapps/page/zlzj.html`,
-    },
-    ],
-  },
-  {
-    id: 'exam_mark',
-    label: '考试阅卷',
-    arr: [
+const navbarData = (user.value.user_role_id === '76')
+  ? []
+  : [
       {
-        id: 'exam_mark_manage',
-        label: '组卷管理',
-        href: `${link.yzy}/webapps/page/exam.html?mold=manage`,
-      }, {
-        id: 'exam_mark_online',
-        label: '考试管理',
-        href: `${link.yzy}/webapps/page/exam.html?mold=online&sort=one&pid=total`,
+        id: 'issue_combine',
+        label: '试题库',
+        arr: [{
+          id: 'issue_combine_chapter',
+          label: '章节试题',
+          href: `${link.yzy}/webapps/page/task.html?mold=issue&sort=chapter`,
+        },
+        {
+          id: 'issue_combine_knowledge',
+          label: '知识点试题',
+          href: `${link.yzy}/webapps/page/task.html?mold=issue&sort=knowledge`,
+        },
+        {
+          id: 'issue_combine_intellect',
+          label: '智能选题',
+          href: `${link.yzy}/webapps/page/zlzj.html`,
+        },
+        ],
       },
       {
-        id: 'marking_process',
-        label: '阅卷流程',
-        href: `${link.yzy}/webapps/page/marking-process-list.html`,
+        id: 'exam_mark',
+        label: '考试阅卷',
+        arr: [
+          {
+            id: 'exam_mark_manage',
+            label: '组卷管理',
+            href: `${link.yzy}/webapps/page/exam.html?mold=manage`,
+          }, {
+            id: 'exam_mark_online',
+            label: '考试管理',
+            href: `${link.yzy}/webapps/page/exam.html?mold=online&sort=one&pid=total`,
+          },
+          {
+            id: 'marking_process',
+            label: '阅卷流程',
+            href: `${link.yzy}/webapps/page/marking-process-list.html`,
+          },
+          {
+            id: 'liankao',
+            label: '联考管理',
+            href: `${link.yzy}/webapps/page/liankao/#/process`,
+          },
+        ],
       },
       {
-        id: 'liankao',
-        label: '联考管理',
-        href: `${link.yzy}/webapps/page/liankao/#/process`,
+        id: 'paper_library',
+        label: '试卷库',
+        href: `${link.yzy}/webapps/page/paper_library.html`,
+        arr: [],
       },
-    ],
-  },
-  {
-    id: 'paper_library',
-    label: '试卷库',
-    href: `${link.yzy}/webapps/page/paper_library.html`,
-    arr: [],
-  },
-  // {
-  //   id: 'expert_task',
-  //   label: '专家题库',
-  //   arr: [{
-  //     id: 'expert_task_chapter',
-  //     label: '章节试题',
-  //   },
-  //   {
-  //     id: 'expert_task_knowledge',
-  //     label: '知识点试题',
-  //   },
-  //   {
-  //     id: 'expert_task_intellect',
-  //     label: '智能选题',
-  //   },
-  //   ],
-  // },
-  {
-    id: 'vip_task',
-    label: 'VIP题库',
-    arr: [
+      // {
+      //   id: 'expert_task',
+      //   label: '专家题库',
+      //   arr: [{
+      //     id: 'expert_task_chapter',
+      //     label: '章节试题',
+      //   },
+      //   {
+      //     id: 'expert_task_knowledge',
+      //     label: '知识点试题',
+      //   },
+      //   {
+      //     id: 'expert_task_intellect',
+      //     label: '智能选题',
+      //   },
+      //   ],
+      // },
       {
-        id: 'vip_task_chapter',
-        label: '章节试题',
-        href: `${link.yzy}/webapps/page/vip_task.html?mold=vip&sort=chapter`,
+        id: 'vip_task',
+        label: 'VIP题库',
+        arr: [
+          {
+            id: 'vip_task_chapter',
+            label: '章节试题',
+            href: `${link.yzy}/webapps/page/vip_task.html?mold=vip&sort=chapter`,
+          },
+          {
+            id: 'vip_task_knowledge',
+            label: '知识点试题',
+            href: `${link.yzy}/webapps/page/vip_task.html?mold=vip&sort=knowledge`,
+          },
+        ],
       },
       {
-        id: 'vip_task_knowledge',
-        label: '知识点试题',
-        href: `${link.yzy}/webapps/page/vip_task.html?mold=vip&sort=knowledge`,
+        id: 'prop_requirement',
+        label: '命题要求',
+        href: `${link.yzy}/webapps/page/propRequireList.html`,
       },
-    ],
-  },
-  {
-    id: 'prop_requirement',
-    label: '命题要求',
-    href: `${link.yzy}/webapps/page/propRequireList.html`,
-  },
-]
+    ]
 
 let currentNav = $ref(sessionStorage.getItem('currentNav'))
 
@@ -276,7 +278,9 @@ function backHome() {
 </template>
 
 <style>
-.el-tooltip__trigger { outline: none; }
+.el-tooltip__trigger {
+  outline: none;
+}
 </style>
 
 <!-- <style lang="scss">