From 33f9d4fa4cef685ad21d4fe67ee40907ec76d7a3 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 08 四月 2026 13:04:28 +0800
Subject: [PATCH] 1.样式修改

---
 src/assets/styles/sidebar.scss |  218 +++++++++++++++++++++++++++++++++--------------------
 1 files changed, 135 insertions(+), 83 deletions(-)

diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss
index 88be1a9..5dd7d5e 100644
--- a/src/assets/styles/sidebar.scss
+++ b/src/assets/styles/sidebar.scss
@@ -1,21 +1,19 @@
 #app {
-
   .main-container {
     min-height: 100%;
-    transition: margin-left .28s;
+    transition: margin-left 0.28s;
     margin-left: $base-sidebar-width;
     position: relative;
+    background: transparent;
   }
 
   .sidebarHide {
-    margin-left: 0!important;
+    margin-left: 0 !important;
   }
 
   .sidebar-container {
-    -webkit-transition: width .28s;
     transition: width 0.28s;
     width: $base-sidebar-width !important;
-    background-color: $base-menu-background;
     height: 100%;
     position: fixed;
     font-size: 0px;
@@ -24,12 +22,14 @@
     left: 0;
     z-index: 1001;
     overflow: hidden;
-    -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
-    box-shadow: 2px 0 6px rgba(0,21,41,.35);
+    padding: 12px 0 16px 16px;
+    background: transparent;
+    box-shadow: none;
 
     // reset element-ui css
     .horizontal-collapse-transition {
-      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
+      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
+        0s padding-right ease-in-out;
     }
 
     .scrollbar-wrapper {
@@ -46,7 +46,8 @@
 
     &.has-logo {
       .el-scrollbar {
-        height: calc(100% - 50px);
+        height: calc(100% - 72px);
+        margin-top: 10px;
       }
     }
 
@@ -68,9 +69,15 @@
       border: none;
       height: 100%;
       width: 100% !important;
+      padding: 10px 8px 18px;
+      border-radius: 0 28px 28px 0;
+      background: var(--menu-surface);
+      backdrop-filter: blur(18px);
+      box-shadow: var(--shadow-sm);
     }
 
-    .el-menu-item, .menu-title {
+    .el-menu-item,
+    .menu-title {
       overflow: hidden !important;
       text-overflow: ellipsis !important;
       white-space: nowrap !important;
@@ -81,92 +88,131 @@
     }
 
     // menu hover
-    .sub-menu-title-noDropdown,
-    .el-sub-menu__title {
-      &:hover {
-        background-color: rgba(0, 0, 0, 0.06) !important;
-      }
+    .submenu-title-noDropdown,
+    .el-sub-menu__title {
+      &:hover {
+        background-color: var(--menu-hover) !important;
+      }
+    }
+    & .theme-light .is-active > .el-sub-menu__title {
+      color: var(--current-color) !important;
     }
 
-    & .theme-dark .is-active > .el-sub-menu__title {
-      color: $base-menu-color-active !important;
-    }
-
-    & .nest-menu .el-sub-menu>.el-sub-menu__title,
+    & .nest-menu .el-sub-menu > .el-sub-menu__title,
     & .el-sub-menu .el-menu-item {
       min-width: $base-sidebar-width !important;
 
       &:hover {
-        background-color: rgba(0, 0, 0, 0.06) !important;
+        background-color: var(--menu-hover) !important;
+      }
+      &.is-active {
+        background-color: var(--menu-active-bg) !important;
       }
     }
 
-    & .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
-    & .theme-dark .el-sub-menu .el-menu-item {
-      background-color: $base-sub-menu-background !important;
+    & .theme-light .nest-menu .el-sub-menu > .el-sub-menu__title,
+    & .theme-light .el-sub-menu .el-menu-item {
+      //background-color: transparent;
 
       &:hover {
-        background-color: $base-sub-menu-hover !important;
+        background-color: var(--menu-hover) !important;
       }
     }
   }
 
-  .hideSidebar {
-    .sidebar-container {
-      width: 54px !important;
-    }
+  .hideSidebar {
+    .sidebar-container {
+      width: 68px !important;
+      padding-left: 12px;
+      padding-right: 0;
+    }
+
+    .main-container {
+      margin-left: 84px;
+    }
 
-    .main-container {
-      margin-left: 54px;
-    }
-
-    .sub-menu-title-noDropdown {
-      padding: 0 !important;
-      position: relative;
-
-      .el-tooltip {
-        padding: 0 !important;
-
-        .svg-icon {
-          margin-left: 20px;
-        }
-      }
-    }
-
-    .el-sub-menu {
-      overflow: hidden;
-
-      &>.el-sub-menu__title {
-        padding: 0 !important;
-
-        .svg-icon {
-          margin-left: 20px;
-        }
-
-      }
-    }
-
-    .el-menu--collapse {
-      .el-sub-menu {
-        &>.el-sub-menu__title {
-          &>span {
+    .submenu-title-noDropdown {
+      padding: 0 !important;
+      position: relative;
+      display: flex !important;
+      align-items: center;
+      justify-content: center;
+
+      .el-tooltip {
+        padding: 0 !important;
+        display: inline-flex !important;
+        align-items: center;
+        justify-content: center;
+        width: 100%;
+
+        .svg-icon {
+          margin-left: 0;
+        }
+      }
+
+      .el-menu-tooltip__trigger {
+        width: 100%;
+        display: inline-flex !important;
+        align-items: center;
+        justify-content: center;
+
+        .svg-icon {
+          width: 18px;
+          height: 18px;
+          margin-right: 0;
+          flex-shrink: 0;
+        }
+      }
+    }
+    .el-sub-menu {
+      overflow: hidden;
+
+      & > .el-sub-menu__title {
+        padding: 0 !important;
+        display: flex !important;
+        align-items: center;
+        justify-content: center;
+
+        .svg-icon {
+          margin-left: 0;
+        }
+      }
+    }
+
+    .el-menu--collapse {
+      > .el-menu-item,
+      .el-sub-menu {
+        & > .el-sub-menu__title,
+        &.el-menu-item {
+          display: flex !important;
+          align-items: center;
+          justify-content: center;
+
+          .svg-icon {
+            width: 18px;
+            height: 18px;
+            margin-right: 0;
+            flex-shrink: 0;
+          }
+
+          & > span {
+            height: 0;
+            width: 0;
+            overflow: hidden;
+            visibility: hidden;
+            display: inline-block;
+          }
+          & > i {
             height: 0;
             width: 0;
             overflow: hidden;
             visibility: hidden;
             display: inline-block;
-          }
-          &>i {
-            height: 0;
-            width: 0;
-            overflow: hidden;
-            visibility: hidden;
-            display: inline-block;
-          }
-        }
-      }
-    }
-  }
+          }
+        }
+      }
+    }
+  }
 
   .el-menu--collapse .el-menu .el-sub-menu {
     min-width: $base-sidebar-width !important;
@@ -179,7 +225,7 @@
     }
 
     .sidebar-container {
-      transition: transform .28s;
+      transition: transform 0.28s;
       width: $base-sidebar-width !important;
     }
 
@@ -193,7 +239,6 @@
   }
 
   .withoutAnimation {
-
     .main-container,
     .sidebar-container {
       transition: none;
@@ -203,27 +248,34 @@
 
 // when menu collapsed
 .el-menu--vertical {
-  &>.el-menu {
+  & > .el-menu {
     .svg-icon {
       margin-right: 16px;
     }
   }
 
-  .nest-menu .el-sub-menu>.el-sub-menu__title,
+  .nest-menu .el-sub-menu > .el-sub-menu__title,
   .el-menu-item {
     &:hover {
       // you can use $sub-menuHover
-      background-color: rgba(0, 0, 0, 0.06) !important;
+      background-color: var(--menu-hover) !important;
+    }
+    &.is-active {
+      background-color: var(--menu-active-bg) !important;
     }
   }
 
   // the scroll bar appears when the sub-menu is too long
-  >.el-menu--popup {
+  > .el-menu--popup {
     max-height: 100vh;
     overflow-y: auto;
+    padding: 8px;
+    border-radius: 18px;
+    border: 1px solid var(--surface-border);
+    box-shadow: var(--shadow-md);
 
     &::-webkit-scrollbar-track-piece {
-      background: #d3dce6;
+      background: #dfe7e1;
     }
 
     &::-webkit-scrollbar {
@@ -231,7 +283,7 @@
     }
 
     &::-webkit-scrollbar-thumb {
-      background: #99a9bf;
+      background: #9aa79e;
       border-radius: 20px;
     }
   }

--
Gitblit v1.9.3