Browse Source

build: 菜单样式

chaooo 2 years ago
parent
commit
0f09eb4435

+ 1 - 3
src/components/Breadcrumb/index.vue

@@ -38,9 +38,7 @@ function getBreadcrumb() {
   );
   const first = matched[0];
   if (!isDashboard(first)) {
-    matched = [
-      { path: "/dashboard", meta: { title: "dashboard" } } as any,
-    ].concat(matched);
+    matched = [{ path: "/dashboard" } as any].concat(matched);
   }
   breadcrumbs.value = matched.filter((item) => {
     return item.meta && item.meta.title && item.meta.breadcrumb !== false;

+ 10 - 8
src/layout/components/Sidebar/Logo.vue

@@ -1,17 +1,19 @@
 <script lang="ts" setup>
-import { useSettingsStore } from '@/store/modules/settings';
+import { useSettingsStore } from "@/store/modules/settings";
 
 const settingsStore = useSettingsStore();
 
 defineProps({
   collapse: {
     type: Boolean,
-    required: true
-  }
+    required: true,
+  },
 });
 
 const logo = ref(new URL(`../../../assets/logo.png`, import.meta.url).href);
-const logoIco = ref(new URL(`../../../assets/logo-icon.png`, import.meta.url).href);
+const logoIco = ref(
+  new URL(`../../../assets/logo-icon.png`, import.meta.url).href
+);
 </script>
 
 <template>
@@ -23,7 +25,7 @@ const logoIco = ref(new URL(`../../../assets/logo-icon.png`, import.meta.url).hr
         class="logo w-full flex items-center justify-center"
         to="/"
       >
-        <img v-if="settingsStore.sidebarLogo" :src="logoIco" class="w-5 h-5" />
+        <img v-if="settingsStore.sidebarLogo" :src="logoIco" class="h-11" />
       </router-link>
 
       <router-link
@@ -47,8 +49,8 @@ const logoIco = ref(new URL(`../../../assets/logo-icon.png`, import.meta.url).hr
 .sidebarLogoFade-leave-to {
   opacity: 0;
 }
-.logo{
-	height:70px;
-	line-height:70px;
+.logo {
+  height: 70px;
+  line-height: 70px;
 }
 </style>

+ 1 - 0
src/layout/components/Sidebar/SidebarItem.vue

@@ -105,6 +105,7 @@ function resolvePath(routePath: string) {
           :icon-class="item.meta.icon"
         />
         <span v-if="item.meta && item.meta.title">{{ item.meta.title }}</span>
+        <el-icon><ArrowRightBold color="#ffffff" /></el-icon>
       </template>
 
       <sidebar-item

+ 44 - 2
src/store/modules/permission.ts

@@ -37,33 +37,75 @@ const adminRoutes: RouteRecordRaw[] = JSON.parse(
           component: "dashboard",
           meta: { title: "数据看板", icon: "board", keepAlive: true },
         },
+      ],
+    },
+    {
+      path: "/class",
+      component: "SchoolIndex",
+      redirect: "/class/index",
+      children: [
         {
           path: "class",
           component: "class",
           meta: { title: "班级管理", icon: "class", keepAlive: true },
         },
+      ],
+    },
+    {
+      path: "/teacher",
+      component: "SchoolIndex",
+      redirect: "/teacher/index",
+      children: [
         {
           path: "teacher",
           component: "teacher",
           meta: { title: "教师管理", icon: "teacher", keepAlive: true },
         },
+      ],
+    },
+    {
+      path: "/student",
+      component: "SchoolIndex",
+      redirect: "/student/index",
+      children: [
         {
           path: "student",
           component: "student",
           meta: { title: "学生管理", icon: "student", keepAlive: true },
         },
+      ],
+    },
+    {
+      path: "/equipment",
+      component: "SchoolIndex",
+      redirect: "/equipment/index",
+      children: [
         {
           path: "equipment",
           component: "equipment",
           meta: { title: "设备管理", icon: "equipment", keepAlive: true },
         },
+      ],
+    },
+    {
+      path: "/training",
+      component: "SchoolIndex",
+      redirect: "/training/index",
+      children: [
         {
-          path: "training",
+          path: "inxdex",
           component: "training",
           meta: { title: "训练管理", icon: "training", keepAlive: true },
         },
+      ],
+    },
+    {
+      path: "/evaluation",
+      component: "SchoolIndex",
+      redirect: "/evaluation/index",
+      children: [
         {
-          path: "evaluation",
+          path: "index",
           component: "evaluation",
           meta: { title: "测评数据看板", icon: "evaluation", keepAlive: true },
         },

+ 10 - 1
src/styles/sidebar.scss

@@ -73,6 +73,7 @@
       border-radius: 5px;
       color: #657dbc;
       font-size: 16px;
+      padding-left: 30px;
       span {
         color: $menuText;
       }
@@ -89,8 +90,16 @@
   .hideSidebar {
     .sidebar-container {
       width: 54px !important;
+      .el-menu-item {
+        width: 44px !important;
+        padding: 0;
+        margin: 0 auto;
+        .el-menu-tooltip__trigger {
+          padding: 0;
+        }
+      }
       .svg-icon {
-        margin-right: 0;
+        margin: 0 auto;
       }
     }
     .main-container {