440 lines
9.5 KiB
SCSS
440 lines
9.5 KiB
SCSS
#app {
|
|
|
|
.main-container {
|
|
height: 100%;
|
|
transition: margin-left .28s;
|
|
margin-left: $base-sidebar-width;
|
|
position: relative;
|
|
}
|
|
|
|
.sidebarHide {
|
|
margin-left: 0!important;
|
|
}
|
|
|
|
.sidebar-container {
|
|
-webkit-transition: width .28s ease-in-out;
|
|
transition: width 0.28s ease-in-out, box-shadow 0.3s ease;
|
|
width: $base-sidebar-width !important;
|
|
background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
|
|
height: 100vh;
|
|
position: fixed;
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
z-index: 1001;
|
|
overflow: hidden;
|
|
border-radius: 0 20px 20px 0;
|
|
-webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
|
// 添加悬停效果
|
|
&:hover {
|
|
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
// 添加进入动画
|
|
animation: slideInLeft 0.5s ease-out;
|
|
}
|
|
|
|
@keyframes slideInLeft {
|
|
from {
|
|
transform: translateX(-100%);
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
transform: translateX(0);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
// 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;
|
|
}
|
|
|
|
.scrollbar-wrapper {
|
|
overflow-x: hidden !important;
|
|
}
|
|
|
|
.el-scrollbar__bar.is-vertical {
|
|
right: 0px;
|
|
}
|
|
|
|
.el-scrollbar {
|
|
height: 100%;
|
|
}
|
|
|
|
&.has-logo {
|
|
.el-scrollbar {
|
|
height: calc(100% - 60px);
|
|
}
|
|
}
|
|
|
|
.is-horizontal {
|
|
display: none;
|
|
}
|
|
|
|
a {
|
|
display: inline-block;
|
|
width: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.svg-icon {
|
|
margin-right: 16px;
|
|
}
|
|
|
|
.el-menu {
|
|
border: none;
|
|
height: 100%;
|
|
width: 100% !important;
|
|
font-size: 14px;
|
|
background: transparent !important;
|
|
padding: 10px 0;
|
|
}
|
|
|
|
.el-menu-item, .el-submenu__title {
|
|
overflow: hidden !important;
|
|
text-overflow: ellipsis !important;
|
|
white-space: nowrap !important;
|
|
font-size: 14px !important;
|
|
font-weight: 500;
|
|
color: rgba(33, 33, 33, 0.85) !important;
|
|
background: transparent !important;
|
|
border-radius: 12px;
|
|
margin: 4px 12px;
|
|
padding: 0 16px !important;
|
|
height: 48px;
|
|
line-height: 48px;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
position: relative;
|
|
|
|
span {
|
|
font-size: 14px !important;
|
|
display: inline-block !important;
|
|
visibility: visible !important;
|
|
opacity: 1 !important;
|
|
width: auto !important;
|
|
height: auto !important;
|
|
overflow: visible !important;
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(25, 118, 210, 0.1) !important;
|
|
color: #1976d2 !important;
|
|
transform: translateX(4px);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
&.is-active {
|
|
background: rgba(25, 118, 210, 0.15) !important;
|
|
color: #1976d2 !important;
|
|
font-weight: 600;
|
|
box-shadow: 0 4px 16px rgba(25, 118, 210, 0.2);
|
|
|
|
&::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: 0;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
width: 4px;
|
|
height: 20px;
|
|
background: #1976d2;
|
|
border-radius: 0 2px 2px 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 子菜单样式优化
|
|
.el-submenu {
|
|
.el-submenu__title {
|
|
border-radius: 12px;
|
|
margin: 4px 12px;
|
|
padding: 0 16px !important;
|
|
height: 48px;
|
|
line-height: 48px;
|
|
|
|
&:hover {
|
|
background: rgba(25, 118, 210, 0.1) !important;
|
|
color: #1976d2 !important;
|
|
transform: translateX(4px);
|
|
}
|
|
}
|
|
|
|
.el-menu {
|
|
background: rgba(255, 255, 255, 0.3) !important;
|
|
border-radius: 12px;
|
|
margin: 8px 12px;
|
|
padding: 8px 0;
|
|
box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
|
|
.el-menu-item {
|
|
margin: 2px 8px;
|
|
padding: 0 24px !important;
|
|
height: 40px;
|
|
line-height: 40px;
|
|
font-size: 13px !important;
|
|
|
|
span {
|
|
font-size: 13px !important;
|
|
display: inline-block !important;
|
|
visibility: visible !important;
|
|
opacity: 1 !important;
|
|
width: auto !important;
|
|
height: auto !important;
|
|
overflow: visible !important;
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(25, 118, 210, 0.08) !important;
|
|
color: #1976d2 !important;
|
|
transform: translateX(2px);
|
|
}
|
|
|
|
&.is-active {
|
|
background: rgba(25, 118, 210, 0.12) !important;
|
|
color: #1976d2 !important;
|
|
|
|
&::before {
|
|
width: 3px;
|
|
height: 16px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// 图标样式优化
|
|
.svg-icon {
|
|
color: rgba(33, 33, 33, 0.7) !important;
|
|
transition: all 0.3s ease;
|
|
margin-right: 12px;
|
|
|
|
&:hover {
|
|
color: #1976d2 !important;
|
|
transform: scale(1.1);
|
|
}
|
|
}
|
|
}
|
|
|
|
.hideSidebar {
|
|
.sidebar-container {
|
|
width: 54px !important;
|
|
}
|
|
|
|
.main-container {
|
|
margin-left: 54px;
|
|
}
|
|
|
|
.submenu-title-noDropdown {
|
|
padding: 0 !important;
|
|
position: relative;
|
|
|
|
.el-tooltip {
|
|
padding: 0 !important;
|
|
|
|
.svg-icon {
|
|
margin-left: 20px;
|
|
}
|
|
}
|
|
|
|
span {
|
|
height: 0 !important;
|
|
width: 0 !important;
|
|
overflow: hidden !important;
|
|
visibility: hidden !important;
|
|
display: inline-block !important;
|
|
}
|
|
}
|
|
|
|
.el-submenu {
|
|
overflow: hidden;
|
|
|
|
&>.el-submenu__title {
|
|
padding: 0 !important;
|
|
|
|
.svg-icon {
|
|
margin-left: 20px;
|
|
}
|
|
|
|
span {
|
|
height: 0 !important;
|
|
width: 0 !important;
|
|
overflow: hidden !important;
|
|
visibility: hidden !important;
|
|
display: inline-block !important;
|
|
}
|
|
}
|
|
}
|
|
|
|
.el-menu--collapse {
|
|
.el-submenu {
|
|
&>.el-submenu__title {
|
|
&>span {
|
|
height: 0 !important;
|
|
width: 0 !important;
|
|
overflow: hidden !important;
|
|
visibility: hidden !important;
|
|
display: inline-block !important;
|
|
}
|
|
}
|
|
}
|
|
|
|
.el-menu-item {
|
|
span {
|
|
height: 0 !important;
|
|
width: 0 !important;
|
|
overflow: hidden !important;
|
|
visibility: hidden !important;
|
|
display: inline-block !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.el-menu--collapse .el-menu .el-submenu {
|
|
min-width: $base-sidebar-width !important;
|
|
}
|
|
|
|
// mobile responsive
|
|
.mobile {
|
|
.main-container {
|
|
margin-left: 0px;
|
|
}
|
|
|
|
.sidebar-container {
|
|
transition: transform .28s ease-in-out;
|
|
width: $base-sidebar-width !important;
|
|
border-radius: 0;
|
|
|
|
// 移动端优化
|
|
.el-menu-item, .el-submenu__title {
|
|
margin: 2px 8px;
|
|
padding: 0 12px !important;
|
|
height: 44px;
|
|
line-height: 44px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.el-submenu .el-menu-item {
|
|
height: 36px;
|
|
line-height: 36px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
|
|
&.hideSidebar {
|
|
.sidebar-container {
|
|
pointer-events: none;
|
|
transition-duration: 0.3s;
|
|
transform: translate3d(-$base-sidebar-width, 0, 0);
|
|
box-shadow: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 平板设备优化
|
|
@media (max-width: 1024px) {
|
|
.sidebar-container {
|
|
.el-menu-item, .el-submenu__title {
|
|
font-size: 13px;
|
|
height: 44px;
|
|
line-height: 44px;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 小屏幕优化
|
|
@media (max-width: 768px) {
|
|
.sidebar-container {
|
|
border-radius: 0;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
|
|
|
.el-menu {
|
|
padding: 8px 0;
|
|
}
|
|
|
|
.el-menu-item, .el-submenu__title {
|
|
margin: 2px 6px;
|
|
padding: 0 10px !important;
|
|
height: 40px;
|
|
line-height: 40px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.withoutAnimation {
|
|
|
|
.main-container,
|
|
.sidebar-container {
|
|
transition: none;
|
|
}
|
|
}
|
|
|
|
// 弹出菜单样式优化
|
|
.el-menu--popup {
|
|
background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
|
|
border-radius: 12px !important;
|
|
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2) !important;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
padding: 8px 0;
|
|
|
|
.el-menu-item {
|
|
color: rgba(33, 33, 33, 0.85) !important;
|
|
margin: 2px 8px;
|
|
border-radius: 8px;
|
|
transition: all 0.3s ease;
|
|
|
|
&:hover {
|
|
background: rgba(25, 118, 210, 0.1) !important;
|
|
color: #1976d2 !important;
|
|
transform: translateX(4px);
|
|
}
|
|
|
|
&.is-active {
|
|
background: rgba(25, 118, 210, 0.15) !important;
|
|
color: #1976d2 !important;
|
|
}
|
|
}
|
|
|
|
// 自定义滚动条
|
|
&::-webkit-scrollbar-track-piece {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
&::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
border-radius: 4px;
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.5);
|
|
}
|
|
}
|
|
}
|
|
|
|
// 收起状态下的样式
|
|
.el-menu--vertical {
|
|
&>.el-menu {
|
|
.svg-icon {
|
|
margin-right: 16px;
|
|
}
|
|
}
|
|
|
|
.nest-menu .el-submenu>.el-submenu__title,
|
|
.el-menu-item {
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.15) !important;
|
|
}
|
|
}
|
|
}
|