123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661 |
- @mixin merge-style(
- /* vertical模式下主体内容距离网页文档左侧的距离 */ $sideBarWidth
- ) {
- $menuActiveText: #7a80b4;
- @media screen and (min-width: 150px) and (max-width: 420px) {
- .app-main-nofixed-header {
- overflow-y: hidden;
- }
- }
- @media screen and (min-width: 420px) {
- .app-main-nofixed-header {
- overflow: hidden;
- }
- }
- .sub-menu-icon {
- vertical-align: middle;
- font-size: 18px;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- margin-right: 5px;
- }
- .main-container {
- height: 100vh;
- min-height: 100%;
- /* main-content属性动画 */
- transition: margin-left var(--pure-transition-duration);
- margin-left: $sideBarWidth;
- position: relative;
- background: #f0f2f5;
- .el-scrollbar__wrap {
- overflow: auto;
- height: 100%;
- }
- }
- .fixed-header {
- position: fixed;
- top: 0;
- right: 0;
- z-index: 998;
- width: calc(100% - 210px);
- /* fixed-header属性左上角动画 */
- transition: width var(--pure-transition-duration);
- }
- .main-hidden {
- margin-left: 0 !important;
- .fixed-header {
- width: 100% !important;
- + .app-main {
- padding-top: 37px !important;
- }
- }
- }
- .el-popper.is-light {
- border: none !important;
- }
- .sidebar-container {
- /* 展开动画 */
- transition: width var(--pure-transition-duration);
- width: $sideBarWidth !important;
- background: $menuBg;
- height: 100%;
- position: fixed;
- font-size: 0;
- top: 0;
- bottom: 0;
- left: 0;
- z-index: 1001;
- overflow: hidden;
- box-shadow: 0 0 1px #888;
- .scrollbar-wrapper {
- overflow-x: hidden !important;
- }
- .el-scrollbar__bar.is-vertical {
- right: 0;
- }
- .el-scrollbar {
- height: calc(100% - 44px);
- }
- &.has-logo {
- .el-scrollbar.pc {
- /* logo: 48px、leftCollapse: 40px、leftCollapse-shadow: 4px */
- height: calc(100% - 92px);
- }
- .el-scrollbar.mobile {
- height: 100%;
- }
- }
- .is-horizontal {
- display: none;
- }
- a {
- display: inline-block;
- display: flex;
- padding-left: 10px;
- flex-wrap: wrap;
- width: 100%;
- }
- .el-menu {
- border: none;
- height: 100%;
- background-color: transparent !important;
- }
- .el-menu-item,
- .el-sub-menu__title {
- height: 50px;
- color: $menuText;
- background-color: transparent !important;
- &:hover {
- color: $menuTitleHover !important;
- }
- div,
- span {
- height: 50px;
- line-height: 50px;
- }
- }
- .submenu-title-noDropdown,
- .el-sub-menu__title {
- &:hover {
- background-color: transparent;
- }
- }
- .is-active > .el-sub-menu__title,
- .is-active.submenu-title-noDropdown {
- color: $subMenuActiveText !important;
- i {
- color: $subMenuActiveText !important;
- }
- }
- .is-active {
- transition: color 0.3s;
- color: $subMenuActiveText !important;
- }
- .el-menu .el-menu--inline .el-sub-menu__title,
- & .el-sub-menu .el-menu-item {
- font-size: 12px;
- min-width: $sideBarWidth !important;
- background-color: $subMenuBg !important;
- }
- /* 无子集的激活菜单背景 */
- .is-active.submenu-title-noDropdown.outer-most {
- background: $subMenuActiveBg !important;
- }
- /* 有子集的激活菜单背景 */
- .is-active.nest-menu {
- background: $subMenuActiveBg !important;
- }
- }
- .horizontal-header {
- display: flex;
- justify-content: space-around;
- background: $menuBg;
- width: 100%;
- height: 48px;
- align-items: center;
- .horizontal-header-left {
- display: flex;
- height: 100%;
- width: auto;
- min-width: 200px;
- align-items: center;
- padding-left: 10px;
- cursor: pointer;
- transition: all 0.125s ease;
- i {
- font-size: 30px;
- color: #1890ff;
- margin-right: 4px;
- }
- h4 {
- font-size: 16px;
- font-weight: 700;
- color: $subMenuActiveText;
- transition: all 0.5s;
- }
- }
- .horizontal-header-menu {
- height: 100%;
- min-width: 0;
- flex: 1;
- align-items: center;
- }
- .horizontal-header-right {
- display: flex;
- min-width: 340px;
- align-items: center;
- color: $subMenuActiveText;
- justify-content: flex-end;
- /* 搜索 */
- .search-container,
- /* 告警 */
- .dropdown-badge,
- /* 全屏 */
- .screen-full,
- /* 国际化 */
- .globalization,
- /* 登录名 */
- .el-dropdown-link,
- /* 设置 */
- .el-icon-setting {
- &:hover {
- background: $menuHover;
- }
- }
- .dropdown-badge {
- height: 48px;
- color: $subMenuActiveText;
- }
- .globalization {
- width: 40px;
- height: 48px;
- padding: 11px;
- outline: none;
- cursor: pointer;
- color: $subMenuActiveText;
- }
- .el-dropdown-link {
- height: 48px;
- padding: 10px;
- display: flex;
- cursor: pointer;
- align-items: center;
- justify-content: space-around;
- color: $subMenuActiveText;
- p {
- font-size: 14px;
- }
- img {
- width: 22px;
- height: 22px;
- border-radius: 50%;
- }
- }
- .el-icon-setting {
- height: 48px;
- width: 40px;
- padding: 12px;
- display: flex;
- cursor: pointer;
- align-items: center;
- }
- }
- .el-menu {
- border: none;
- height: 100%;
- width: 100% !important;
- background-color: transparent;
- }
- .el-menu-item,
- .el-sub-menu__title {
- color: $menuText;
- &:hover {
- color: $menuTitleHover !important;
- }
- }
- .submenu-title-noDropdown,
- .el-sub-menu__title {
- height: 48px;
- line-height: 48px;
- background: $menuBg;
- svg {
- position: static !important;
- }
- }
- .is-active > .el-sub-menu__title,
- .is-active.submenu-title-noDropdown {
- color: $subMenuActiveText !important;
- i {
- color: $subMenuActiveText !important;
- }
- }
- .is-active {
- transition: color 0.3s;
- color: $subMenuActiveText !important;
- }
- }
- /* vertical菜单折叠 */
- .el-menu--vertical {
- .el-menu--popup {
- background-color: $subMenuBg !important;
- .el-menu-item {
- span {
- font-size: 12px;
- }
- }
- }
- & > .el-menu {
- i {
- margin-right: 20px;
- }
- }
- .is-active > .el-sub-menu__title,
- .is-active.submenu-title-noDropdown {
- color: $subMenuActiveText !important;
- i {
- color: $subMenuActiveText !important;
- }
- }
- /* 子菜单中还有子菜单 */
- .el-menu .el-sub-menu__title {
- font-size: 12px;
- min-width: $sideBarWidth !important;
- background-color: $subMenuBg !important;
- }
- .el-menu-item,
- .el-sub-menu__title {
- height: 50px;
- line-height: 50px;
- color: $menuText;
- background-color: $subMenuBg;
- &:hover {
- color: $menuTitleHover !important;
- }
- }
- .is-active {
- transition: color 0.3s;
- color: $subMenuActiveText !important;
- }
- .el-menu-item.is-active.nest-menu {
- background: $subMenuActiveBg !important;
- }
- .el-menu-item,
- .el-sub-menu {
- // i {
- // width: 20px;
- // text-align: center;
- // font-size: 16px;
- // }
- // i.fa {
- // margin-right: 5px;
- // font-size: 16px;
- // }
- .el-menu-tooltip__trigger {
- width: 54px;
- padding: 18px !important;
- }
- }
- }
- /* horizontal菜单 */
- .el-menu--horizontal {
- & > .el-sub-menu .el-sub-menu__icon-arrow {
- position: static !important;
- margin-top: 0;
- }
- .el-menu--popup {
- background-color: $subMenuBg !important;
- .el-menu-item {
- color: $menuText;
- background-color: $subMenuBg;
- span {
- font-size: 12px;
- }
- }
- .el-sub-menu__title {
- color: $menuText;
- }
- }
- /* 无子菜单时激活border-bottom */
- .router-link-exact-active > .submenu-title-noDropdown {
- height: 60px;
- border-bottom: 2px solid var(--el-menu-active-color);
- }
- /* 子菜单中还有子菜单 */
- .el-menu .el-sub-menu__title {
- font-size: 12px;
- min-width: $sideBarWidth !important;
- background-color: $subMenuBg !important;
- &:hover {
- color: $menuTitleHover !important;
- }
- }
- .is-active > .el-sub-menu__title,
- .is-active.submenu-title-noDropdown {
- color: $subMenuActiveText !important;
- i {
- color: $subMenuActiveText !important;
- }
- }
- .nest-menu .el-sub-menu > .el-sub-menu__title,
- .el-menu-item {
- &:hover {
- color: $menuTitleHover !important;
- }
- }
- /* 有子集的激活菜单背景 */
- .is-active.nest-menu {
- background: $subMenuActiveBg !important;
- }
- .el-menu-item.is-active {
- transition: color 0.3s;
- color: $subMenuActiveText !important;
- }
- }
- .el-menu--collapse .el-menu .el-sub-menu {
- min-width: $sideBarWidth !important;
- }
- /* 有子菜单 */
- .el-menu--collapse
- .is-active.outer-most.el-sub-menu
- > .el-sub-menu__title::before,
- /* 无子菜单 */
- .el-menu--collapse .is-active.submenu-title-noDropdown.outer-most::before {
- position: absolute;
- top: 0;
- left: 2px;
- width: 2px;
- height: 100%;
- background-color: $menuActiveBefore;
- content: "";
- clear: both;
- transition: all 0.125s ease-in-out;
- transform: translateY(0);
- }
- .el-menu--collapse .outer-most.el-sub-menu > .el-sub-menu__title::before,
- .el-menu--collapse .submenu-title-noDropdown.outer-most::before {
- content: "";
- display: block;
- position: absolute;
- height: 0;
- width: 3px;
- transform: translateY(-50%);
- top: 50%;
- }
- /* 手机端 */
- .mobile {
- .fixed-header {
- width: 100% !important;
- transition: width var(--pure-transition-duration);
- }
- .main-container {
- margin-left: 0 !important;
- }
- .sidebar-container {
- transition: transform var(--pure-transition-duration);
- width: $sideBarWidth;
- }
- &.hideSidebar {
- .sidebar-container {
- pointer-events: none;
- transition-duration: 0.3s;
- transform: translate3d(-$sideBarWidth, 0, 0);
- }
- }
- }
- }
- body[layout="vertical"] {
- $sideBarWidth: 210px;
- @include merge-style($sideBarWidth);
- .el-menu--collapse {
- width: 54px;
- }
- .sidebar-logo-container {
- background: $sidebarLogo;
- }
- .hideSidebar {
- .fixed-header {
- width: calc(100% - 54px);
- transition: width var(--pure-transition-duration);
- }
- .sidebar-container {
- transition: width 0.125s;
- width: 54px !important;
- .is-active.submenu-title-noDropdown.outer-most {
- background: transparent !important;
- }
- }
- .main-container {
- margin-left: 54px;
- }
- /* 菜单折叠 */
- .el-menu--collapse {
- .el-sub-menu {
- & > .el-sub-menu__title {
- & > span {
- height: 0;
- width: 0;
- overflow: hidden;
- visibility: hidden;
- display: inline-block;
- }
- }
- }
- .submenu-title-noDropdown {
- background: transparent !important;
- }
- .el-sub-menu__title {
- padding: 0 18px !important;
- }
- }
- .sub-menu-icon {
- margin-right: 0;
- }
- }
- /* 搜索 */
- .search-container,
- /* 告警 */
- .dropdown-badge,
- /* 全屏 */
- .screen-full,
- /* 国际化 */
- .globalization,
- /* 登录名 */
- .el-dropdown-link,
- /* 设置 */
- .el-icon-setting {
- &:hover {
- background: #f6f6f6;
- }
- }
- }
- body[layout="horizontal"] {
- $sideBarWidth: 0;
- @include merge-style($sideBarWidth);
- .fixed-header {
- width: 100%;
- transition: none !important;
- }
- }
- body[layout="mix"] {
- $sideBarWidth: 210px;
- @include merge-style($sideBarWidth);
- .el-menu--collapse {
- width: 54px;
- }
- .el-menu {
- --el-menu-hover-bg-color: transparent !important;
- }
- .hideSidebar {
- .fixed-header {
- width: calc(100% - 54px);
- transition: width var(--pure-transition-duration);
- }
- .sidebar-container {
- transition: width 0.125s;
- width: 54px !important;
- .is-active.submenu-title-noDropdown.outer-most {
- background: transparent !important;
- }
- }
- .main-container {
- margin-left: 54px;
- }
- /* 菜单折叠 */
- .el-menu--collapse {
- .el-sub-menu {
- & > .el-sub-menu__title {
- & > span {
- height: 0;
- width: 0;
- overflow: hidden;
- visibility: hidden;
- display: inline-block;
- }
- }
- }
- }
- }
- }
|