云联一号 2 hafta önce
ebeveyn
işleme
dc2d6d1e21
1 değiştirilmiş dosya ile 64 ekleme ve 38 silme
  1. 64 38
      src/layout/components/Sidebar/index.vue

+ 64 - 38
src/layout/components/Sidebar/index.vue

@@ -1,17 +1,16 @@
 <template>
-  <div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
-    <logo v-if="showLogo" :collapse="isCollapse" />
-    <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
+  <div class="sidebar-wrapper" :style="{ backgroundColor: '#fff' }">
+    <el-scrollbar wrap-class="scrollbar-wrapper">
       <el-menu
         :default-active="activeMenu"
         :collapse="isCollapse"
-        :background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
-        :text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
+        :background-color="'#fff'"
+        :text-color="'#555'"
         :unique-opened="true"
-        :active-text-color="settings.theme"
+        :active-text-color="'#4F46E5'"
         :collapse-transition="false"
         mode="vertical"
-        class="custom-menu"
+        class="sidebar-menu"
       >
         <sidebar-item
           v-for="(route, index) in sidebarRouters"
@@ -26,30 +25,21 @@
 
 <script>
 import { mapGetters, mapState } from "vuex";
-import Logo from "./Logo";
 import SidebarItem from "./SidebarItem";
-import variables from "@/assets/styles/variables.scss";
 
 export default {
-  components: { SidebarItem, Logo },
+  components: { SidebarItem },
   computed: {
     ...mapState(["settings"]),
     ...mapGetters(["sidebarRouters", "sidebar"]),
     activeMenu() {
       const route = this.$route;
       const { meta, path } = route;
-      // if set path, the sidebar will highlight the path you set
       if (meta.activeMenu) {
         return meta.activeMenu;
       }
       return path;
     },
-    showLogo() {
-      return this.$store.state.settings.sidebarLogo;
-    },
-    variables() {
-      return variables;
-    },
     isCollapse() {
       return !this.sidebar.opened;
     }
@@ -57,28 +47,64 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.sidebar-wrapper {
+  width: 200px;
+  height: 100%;
+  background: #fff;
+  border-right: 1px solid #f0f0f0;
 
+  .sidebar-menu {
+    border: none;
+    height: 100%;
+    width: 100% !important;
 
-.custom-menu ::v-deep .el-menu-item{
-  width: 90%;
-  margin: auto;
-}
-//.custom-menu ::v-deep .el-menu-item:hover{
-//  background: linear-gradient(270deg, rgba(29, 141, 245, 0.2) 0%, rgba(29, 141, 245, 0.2) 100%)!important;
-//  width: 90%;
-//  margin: auto;
-//  border-radius: 6px;
-//}
-.custom-menu ::v-deep .el-menu-item.is-active {
-  //background-color: #006CFF!important;
-  color: #F2B680 !important;
-  width: 90%;
-  margin: auto;
-  border-radius: 6px;
-}
-//.custom-menu ::v-deep .el-menu-item.is-active{
-//  background: linear-gradient(270deg, #006CFF 0%, #006CFF 100%)!important;
-//
-//}
+    ::v-deep .el-menu-item {
+      height: 44px;
+      line-height: 44px;
+      font-size: 14px;
+      color: #555;
+      padding-left: 20px !important;
+
+      &:hover {
+        background-color: rgba(79, 70, 229, 0.04) !important;
+      }
+
+      &.is-active {
+        color: #4F46E5 !important;
+        background-color: #EDE9FE !important;
+        border-radius: 0;
+        font-weight: 500;
+      }
+    }
+
+    ::v-deep .el-submenu__title {
+      height: 44px;
+      line-height: 44px;
+      font-size: 14px;
+      color: #555;
+      padding-left: 20px !important;
+      font-weight: 500;
 
+      &:hover {
+        background-color: rgba(79, 70, 229, 0.04) !important;
+      }
+
+      .svg-icon {
+        margin-right: 10px;
+        font-size: 16px;
+      }
+    }
+
+    ::v-deep .el-submenu .el-menu-item {
+      padding-left: 44px !important;
+      font-size: 14px;
+      font-weight: 400;
+      min-width: auto !important;
+    }
+
+    ::v-deep .el-submenu .el-submenu .el-menu-item {
+      padding-left: 60px !important;
+    }
+  }
+}
 </style>