You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

660 lines
13 KiB

  1. /* $sideBarWidth: vertical 模式下主体内容距离网页文档左侧的距离 */
  2. @mixin merge-style($sideBarWidth) {
  3. $menuActiveText: #7a80b4;
  4. @media screen and (min-width: 150px) and (max-width: 420px) {
  5. .app-main-nofixed-header {
  6. overflow-y: hidden;
  7. }
  8. }
  9. @media screen and (min-width: 420px) {
  10. .app-main-nofixed-header {
  11. overflow: hidden;
  12. }
  13. }
  14. .sub-menu-icon {
  15. vertical-align: middle;
  16. font-size: 18px;
  17. display: inline-flex;
  18. justify-content: center;
  19. align-items: center;
  20. margin-right: 5px;
  21. }
  22. .set-icon {
  23. height: 48px;
  24. width: 40px;
  25. display: flex;
  26. cursor: pointer;
  27. align-items: center;
  28. justify-content: center;
  29. }
  30. .main-container {
  31. height: 100vh;
  32. min-height: 100%;
  33. /* main-content 属性动画 */
  34. transition: margin-left var(--pure-transition-duration);
  35. margin-left: $sideBarWidth;
  36. position: relative;
  37. background: #f0f2f5;
  38. .el-scrollbar__wrap {
  39. overflow: auto;
  40. height: 100%;
  41. }
  42. }
  43. .fixed-header {
  44. position: fixed;
  45. top: 0;
  46. right: 0;
  47. z-index: 998;
  48. width: calc(100% - 210px);
  49. /* fixed-header 属性左上角动画 */
  50. transition: width var(--pure-transition-duration);
  51. }
  52. .main-hidden {
  53. margin-left: 0 !important;
  54. .fixed-header {
  55. width: 100% !important;
  56. + .app-main {
  57. padding-top: 37px !important;
  58. }
  59. }
  60. }
  61. .el-popper.is-light {
  62. border: none !important;
  63. }
  64. .sidebar-container {
  65. /* 展开动画 */
  66. transition: width var(--pure-transition-duration);
  67. width: $sideBarWidth !important;
  68. background: $menuBg;
  69. height: 100%;
  70. position: fixed;
  71. font-size: 0;
  72. top: 0;
  73. bottom: 0;
  74. left: 0;
  75. z-index: 1001;
  76. overflow: hidden;
  77. box-shadow: 0 0 1px #888;
  78. .scrollbar-wrapper {
  79. overflow-x: hidden !important;
  80. }
  81. .el-scrollbar__bar.is-vertical {
  82. right: 0;
  83. }
  84. .el-scrollbar {
  85. height: calc(100% - 44px);
  86. }
  87. &.has-logo {
  88. .el-scrollbar.pc {
  89. /* logo: 48px、leftCollapse: 40px、leftCollapse-shadow: 4px */
  90. height: calc(100% - 92px);
  91. }
  92. .el-scrollbar.mobile {
  93. height: 100%;
  94. }
  95. }
  96. .is-horizontal {
  97. display: none;
  98. }
  99. a {
  100. display: inline-block;
  101. display: flex;
  102. padding-left: 10px;
  103. flex-wrap: wrap;
  104. width: 100%;
  105. }
  106. .el-menu {
  107. border: none;
  108. height: 100%;
  109. background-color: transparent !important;
  110. }
  111. .el-menu-item,
  112. .el-sub-menu__title {
  113. height: 50px;
  114. color: $menuText;
  115. background-color: transparent !important;
  116. &:hover {
  117. color: $menuTitleHover !important;
  118. }
  119. div,
  120. span {
  121. height: 50px;
  122. line-height: 50px;
  123. }
  124. }
  125. .submenu-title-noDropdown,
  126. .el-sub-menu__title {
  127. &:hover {
  128. background-color: transparent;
  129. }
  130. }
  131. .is-active > .el-sub-menu__title,
  132. .is-active.submenu-title-noDropdown {
  133. color: $subMenuActiveText !important;
  134. i {
  135. color: $subMenuActiveText !important;
  136. }
  137. }
  138. .is-active {
  139. transition: color 0.3s;
  140. color: $subMenuActiveText !important;
  141. }
  142. .el-menu .el-menu--inline .el-sub-menu__title,
  143. & .el-sub-menu .el-menu-item {
  144. font-size: 12px;
  145. min-width: $sideBarWidth !important;
  146. background-color: $subMenuBg !important;
  147. }
  148. /* 无子集的激活菜单背景 */
  149. .is-active.submenu-title-noDropdown.outer-most {
  150. background: $subMenuActiveBg !important;
  151. }
  152. /* 有子集的激活菜单背景 */
  153. .is-active.nest-menu {
  154. background: $subMenuActiveBg !important;
  155. }
  156. }
  157. .horizontal-header {
  158. display: flex;
  159. justify-content: space-around;
  160. background: $menuBg;
  161. width: 100%;
  162. height: 48px;
  163. align-items: center;
  164. .horizontal-header-left {
  165. display: flex;
  166. height: 100%;
  167. width: auto;
  168. min-width: 200px;
  169. align-items: center;
  170. padding-left: 10px;
  171. cursor: pointer;
  172. transition: all 0.125s ease;
  173. i {
  174. font-size: 30px;
  175. color: #1890ff;
  176. margin-right: 4px;
  177. }
  178. h4 {
  179. font-size: 16px;
  180. font-weight: 700;
  181. color: $subMenuActiveText;
  182. transition: all 0.5s;
  183. }
  184. }
  185. .horizontal-header-menu {
  186. height: 100%;
  187. min-width: 0;
  188. flex: 1;
  189. align-items: center;
  190. }
  191. .horizontal-header-right {
  192. display: flex;
  193. min-width: 340px;
  194. align-items: center;
  195. color: $subMenuActiveText;
  196. justify-content: flex-end;
  197. /* 搜索 */
  198. .search-container,
  199. /* 告警 */
  200. .dropdown-badge,
  201. /* 全屏 */
  202. .screen-full,
  203. /* 国际化 */
  204. .globalization,
  205. /* 登录名 */
  206. .el-dropdown-link,
  207. /* 设置 */
  208. .set-icon {
  209. &:hover {
  210. background: $menuHover;
  211. }
  212. }
  213. .dropdown-badge {
  214. height: 48px;
  215. color: $subMenuActiveText;
  216. }
  217. .globalization {
  218. width: 40px;
  219. height: 48px;
  220. padding: 11px;
  221. outline: none;
  222. cursor: pointer;
  223. color: $subMenuActiveText;
  224. }
  225. .el-dropdown-link {
  226. height: 48px;
  227. padding: 10px;
  228. display: flex;
  229. cursor: pointer;
  230. align-items: center;
  231. justify-content: space-around;
  232. color: $subMenuActiveText;
  233. p {
  234. font-size: 14px;
  235. }
  236. img {
  237. width: 22px;
  238. height: 22px;
  239. border-radius: 50%;
  240. }
  241. }
  242. }
  243. .el-menu {
  244. border: none;
  245. height: 100%;
  246. width: 100% !important;
  247. background-color: transparent;
  248. }
  249. .el-menu-item,
  250. .el-sub-menu__title {
  251. color: $menuText;
  252. &:hover {
  253. color: $menuTitleHover !important;
  254. }
  255. }
  256. .submenu-title-noDropdown,
  257. .el-sub-menu__title {
  258. height: 48px;
  259. line-height: 48px;
  260. background: $menuBg;
  261. svg {
  262. position: static !important;
  263. }
  264. }
  265. .is-active > .el-sub-menu__title,
  266. .is-active.submenu-title-noDropdown {
  267. color: $subMenuActiveText !important;
  268. i {
  269. color: $subMenuActiveText !important;
  270. }
  271. }
  272. .is-active {
  273. transition: color 0.3s;
  274. color: $subMenuActiveText !important;
  275. }
  276. }
  277. /* vertical 菜单折叠 */
  278. .el-menu--vertical {
  279. .el-menu--popup {
  280. background-color: $subMenuBg !important;
  281. .el-menu-item {
  282. span {
  283. font-size: 12px;
  284. }
  285. }
  286. }
  287. & > .el-menu {
  288. i {
  289. margin-right: 20px;
  290. }
  291. }
  292. .is-active > .el-sub-menu__title,
  293. .is-active.submenu-title-noDropdown {
  294. color: $subMenuActiveText !important;
  295. i {
  296. color: $subMenuActiveText !important;
  297. }
  298. }
  299. /* 子菜单中还有子菜单 */
  300. .el-menu .el-sub-menu__title {
  301. font-size: 12px;
  302. min-width: $sideBarWidth !important;
  303. background-color: $subMenuBg !important;
  304. }
  305. .el-menu-item,
  306. .el-sub-menu__title {
  307. height: 50px;
  308. line-height: 50px;
  309. color: $menuText;
  310. background-color: $subMenuBg;
  311. &:hover {
  312. color: $menuTitleHover !important;
  313. }
  314. }
  315. .is-active {
  316. transition: color 0.3s;
  317. color: $subMenuActiveText !important;
  318. }
  319. .el-menu-item.is-active.nest-menu {
  320. background: $subMenuActiveBg !important;
  321. }
  322. .el-menu-item,
  323. .el-sub-menu {
  324. // i {
  325. // width: 20px;
  326. // text-align: center;
  327. // font-size: 16px;
  328. // }
  329. // i.fa {
  330. // margin-right: 5px;
  331. // font-size: 16px;
  332. // }
  333. .el-menu-tooltip__trigger {
  334. width: 54px;
  335. padding: 18px !important;
  336. }
  337. }
  338. }
  339. /* horizontal 菜单 */
  340. .el-menu--horizontal {
  341. & > .el-sub-menu .el-sub-menu__icon-arrow {
  342. position: static !important;
  343. margin-top: 0;
  344. }
  345. .el-menu--popup {
  346. background-color: $subMenuBg !important;
  347. .el-menu-item {
  348. color: $menuText;
  349. background-color: $subMenuBg;
  350. span {
  351. font-size: 12px;
  352. }
  353. }
  354. .el-sub-menu__title {
  355. color: $menuText;
  356. }
  357. }
  358. /* 无子菜单时激活 border-bottom */
  359. .router-link-exact-active > .submenu-title-noDropdown {
  360. height: 60px;
  361. border-bottom: 2px solid var(--el-menu-active-color);
  362. }
  363. /* 子菜单中还有子菜单 */
  364. .el-menu .el-sub-menu__title {
  365. font-size: 12px;
  366. min-width: $sideBarWidth !important;
  367. background-color: $subMenuBg !important;
  368. &:hover {
  369. color: $menuTitleHover !important;
  370. }
  371. }
  372. .is-active > .el-sub-menu__title,
  373. .is-active.submenu-title-noDropdown {
  374. color: $subMenuActiveText !important;
  375. i {
  376. color: $subMenuActiveText !important;
  377. }
  378. }
  379. .nest-menu .el-sub-menu > .el-sub-menu__title,
  380. .el-menu-item {
  381. &:hover {
  382. color: $menuTitleHover !important;
  383. }
  384. }
  385. /* 有子集的激活菜单背景 */
  386. .is-active.nest-menu {
  387. background: $subMenuActiveBg !important;
  388. }
  389. .el-menu-item.is-active {
  390. transition: color 0.3s;
  391. color: $subMenuActiveText !important;
  392. }
  393. }
  394. .el-menu--collapse .el-menu .el-sub-menu {
  395. min-width: $sideBarWidth !important;
  396. }
  397. /* 有子菜单 */
  398. .el-menu--collapse
  399. .is-active.outer-most.el-sub-menu
  400. > .el-sub-menu__title::before,
  401. /* 无子菜单 */
  402. .el-menu--collapse .is-active.submenu-title-noDropdown.outer-most::before {
  403. position: absolute;
  404. top: 0;
  405. left: 2px;
  406. width: 2px;
  407. height: 100%;
  408. background-color: $menuActiveBefore;
  409. content: "";
  410. clear: both;
  411. transition: all 0.125s ease-in-out;
  412. transform: translateY(0);
  413. }
  414. .el-menu--collapse .outer-most.el-sub-menu > .el-sub-menu__title::before,
  415. .el-menu--collapse .submenu-title-noDropdown.outer-most::before {
  416. content: "";
  417. display: block;
  418. position: absolute;
  419. height: 0;
  420. width: 3px;
  421. transform: translateY(-50%);
  422. top: 50%;
  423. }
  424. /* 手机端 */
  425. .mobile {
  426. .fixed-header {
  427. width: 100% !important;
  428. transition: width var(--pure-transition-duration);
  429. }
  430. .main-container {
  431. margin-left: 0 !important;
  432. }
  433. .sidebar-container {
  434. transition: transform var(--pure-transition-duration);
  435. width: $sideBarWidth;
  436. }
  437. &.hideSidebar {
  438. .sidebar-container {
  439. pointer-events: none;
  440. transition-duration: 0.3s;
  441. transform: translate3d(-$sideBarWidth, 0, 0);
  442. }
  443. }
  444. }
  445. }
  446. body[layout="vertical"] {
  447. $sideBarWidth: 210px;
  448. @include merge-style($sideBarWidth);
  449. .el-menu--collapse {
  450. width: 54px;
  451. }
  452. .sidebar-logo-container {
  453. background: $sidebarLogo;
  454. }
  455. .hideSidebar {
  456. .fixed-header {
  457. width: calc(100% - 54px);
  458. transition: width var(--pure-transition-duration);
  459. }
  460. .sidebar-container {
  461. transition: width 0.125s;
  462. width: 54px !important;
  463. .is-active.submenu-title-noDropdown.outer-most {
  464. background: transparent !important;
  465. }
  466. }
  467. .main-container {
  468. margin-left: 54px;
  469. }
  470. /* 菜单折叠 */
  471. .el-menu--collapse {
  472. .el-sub-menu {
  473. & > .el-sub-menu__title {
  474. & > span {
  475. height: 0;
  476. width: 0;
  477. overflow: hidden;
  478. visibility: hidden;
  479. display: inline-block;
  480. }
  481. }
  482. }
  483. .submenu-title-noDropdown {
  484. background: transparent !important;
  485. }
  486. .el-sub-menu__title {
  487. padding: 0 18px !important;
  488. }
  489. }
  490. .sub-menu-icon {
  491. margin-right: 0;
  492. }
  493. }
  494. /* 搜索 */
  495. .search-container,
  496. /* 告警 */
  497. .dropdown-badge,
  498. /* 全屏 */
  499. .screen-full,
  500. /* 国际化 */
  501. .globalization,
  502. /* 登录名 */
  503. .el-dropdown-link,
  504. /* 设置 */
  505. .set-icon {
  506. &:hover {
  507. background: #f6f6f6;
  508. }
  509. }
  510. }
  511. body[layout="horizontal"] {
  512. $sideBarWidth: 0;
  513. @include merge-style($sideBarWidth);
  514. .fixed-header {
  515. width: 100%;
  516. transition: none !important;
  517. }
  518. }
  519. body[layout="mix"] {
  520. $sideBarWidth: 210px;
  521. @include merge-style($sideBarWidth);
  522. .el-menu--collapse {
  523. width: 54px;
  524. }
  525. .el-menu {
  526. --el-menu-hover-bg-color: transparent !important;
  527. }
  528. .hideSidebar {
  529. .fixed-header {
  530. width: calc(100% - 54px);
  531. transition: width var(--pure-transition-duration);
  532. }
  533. .sidebar-container {
  534. transition: width 0.125s;
  535. width: 54px !important;
  536. .is-active.submenu-title-noDropdown.outer-most {
  537. background: transparent !important;
  538. }
  539. }
  540. .main-container {
  541. margin-left: 54px;
  542. }
  543. /* 菜单折叠 */
  544. .el-menu--collapse {
  545. .el-sub-menu {
  546. & > .el-sub-menu__title {
  547. & > span {
  548. height: 0;
  549. width: 0;
  550. overflow: hidden;
  551. visibility: hidden;
  552. display: inline-block;
  553. }
  554. }
  555. }
  556. }
  557. }
  558. }