浏览代码

提交头部导航样式

TheLittlePrince 6 年之前
父节点
当前提交
8623be8e85
共有 2 个文件被更改,包括 9 次插入6 次删除
  1. 8 5
      src/components/MenuComponent.vue
  2. 1 1
      src/router/index.js

+ 8 - 5
src/components/MenuComponent.vue

@@ -3,13 +3,13 @@
       <el-col :span="2" class="sishuLogo">
        <img class="logoImg" src="../assets/img/log.png"/>
       </el-col>
-      <el-col :span="2" v-for="(item, index) of menuData" :key="item.id"
+      <el-col :span="3" v-show="roles.indexOf(item.id) >= 0" v-for="(item, index) of menuData" :key="item.id"
       :class="{active:index == checkindex,menu_item:true}"
       @click.native="secondNavClick(item,index)">
         <div class="lineStyle"></div>
         {{item.name}}
       </el-col>
-       <el-col :span="4" class="userLogo">
+       <el-col :span="2" class="userLogo">
          <div class="">
             <!-- <div v-html= "'Imgurl' +avatar"></div> -->
           <img class="userstyle" src="../assets/img/user.jpg"/>
@@ -31,7 +31,7 @@ export default {
     return {
       Imgurl:"https://xt.sharingschool.com/sz",
       menuData: [ {
-    id: "1",
+    id: "2",
     name: "校区管理员",
     href: "SchoolManager",
   },
@@ -41,7 +41,7 @@ export default {
     href: "TeacherApporval",
   },
   {
-    id: "3",
+    id: "2",
     name: "批改老师薪酬表",
     href: "TeacherPay",
   },
@@ -66,7 +66,7 @@ export default {
     }
   },
    computed: {
-      ...mapGetters(['name', 'avatar'])
+      ...mapGetters(['name', 'avatar','roles'])
     },
   mounted() {
     // this.initNav();
@@ -86,6 +86,9 @@ export default {
   height: 90%;
   text-align:center;
 }
+.userLogo{
+  margin-left:100px;
+}
 .menu_item:hover {
   color:#52CC60 ;
   border-bottom:2px solid #52cc60;

+ 1 - 1
src/router/index.js

@@ -61,7 +61,7 @@ export const asyncRouterMap = [
         path: "TeacherPay",
         name: "TeacherPay",
         component: TeacherPay,
-        meta: { title: '教师薪酬管理', roles: ['1'] }
+        meta: { title: '教师薪酬管理', roles: ['2'] }
       },
       {
         path: "*",