Browse Source

整理菜单

lrf402788946 5 years ago
parent
commit
76510c1638
2 changed files with 10 additions and 23 deletions
  1. 7 21
      config/menu-config.js
  2. 3 2
      layout/admin/admin-menu.vue

+ 7 - 21
config/menu-config.js

@@ -1,19 +1,4 @@
-export const devMenu = [
-  {
-    path: '',
-    name: '测试',
-    module: 'center',
-    children: [
-      {
-        path: '/list',
-        name: '测试列表',
-      },
-      {
-        path: '/detail',
-        name: '测试详情',
-      },
-    ],
-  },
+export const center = [
   {
     path: '',
     name: '系统管理',
@@ -92,8 +77,8 @@ export const devMenu = [
       { path: '/questionstate/index', name: '问卷进度' },
     ],
   },
-
-  //学校
+];
+export const school = [
   {
     path: '',
     name: '测试',
@@ -124,7 +109,8 @@ export const devMenu = [
     name: '请假管理',
     module: 'school',
   },
-  //班主任
+];
+export const director = [
   {
     path: '',
     name: '测试',
@@ -150,8 +136,8 @@ export const devMenu = [
     name: '班级管理',
     module: 'director',
   },
-
-  //学校
+];
+export const teacher = [
   {
     path: '/plan/index',
     name: '查看计划', //上报名单

+ 3 - 2
layout/admin/admin-menu.vue

@@ -36,8 +36,9 @@
 </template>
 
 <script>
-import { devMenu } from '@frame/config/menu-config';
+import * as menus from '@frame/config/menu-config';
 import scrollBar from './scrollBar.vue';
+import _ from 'lodash';
 export default {
   name: 'admin-menu',
   props: {},
@@ -54,7 +55,7 @@ export default {
     },
   },
   mounted() {
-    let arr = devMenu.filter(fil => fil.module === this.project_modules);
+    let arr = _.get(menus, this.project_modules, []);
     this.$set(this, `menu`, arr);
   },
   methods: {