index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <el-container style="height: 100vh">
  3. <div class="mask" v-show="!isCollapse" @click="hideMenu"></div>
  4. <el-aside :width="isCollapse ? '50px' : '260px'"
  5. class="layout_aside"
  6. :class="isCollapse ? 'hide-aside' : 'show-side'"
  7. >
  8. <FilletAside/>
  9. </el-aside>
  10. <el-container style="height: 100vh">
  11. <el-header style="height: 50px; display: block">
  12. <header-v2/>
  13. </el-header>
  14. <el-main class="scrollbar" ref="mainRef">
  15. <router-view v-slot="{ Component }">
  16. <transition name="fade-transform" mode="out-in">
  17. <keep-alive>
  18. <component :is="Component"/>
  19. </keep-alive>
  20. </transition>
  21. </router-view>
  22. </el-main>
  23. </el-container>
  24. </el-container>
  25. </template>
  26. <script setup lang="ts">
  27. import {computed} from 'vue'
  28. import HeaderV2 from "@/layout/fillet-layout/HeaderV2.vue";
  29. import {useSystemStore} from "@/pinia/system-store";
  30. import FilletAside from "@/layout/fillet-layout/FilletAside.vue";
  31. const systemStore = useSystemStore()
  32. const isCollapse = computed(() => systemStore.userConfig.isCollapse)
  33. const hideMenu = () => {
  34. systemStore.setCollapse(true)
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .layout_aside {
  39. margin: 7px 4px 6px 6px;
  40. box-shadow: 0 0 12px rgba(0, 0, 0, .12);;
  41. border-radius: 4px;
  42. overflow: hidden;
  43. transition: width .3s ease;
  44. background-color: white;
  45. }
  46. .el-header {
  47. padding-left: 0;
  48. padding-right: 0;
  49. background-color: transparent;
  50. }
  51. .el-aside {
  52. display: flex;
  53. flex-direction: column;
  54. overflow-x: hidden;
  55. transition: 0.3s;
  56. &::-webkit-scrollbar {
  57. width: 0 !important;
  58. }
  59. }
  60. .el-main {
  61. background-color: var(--system-container-background);
  62. height: 100%;
  63. padding: 0;
  64. }
  65. .scrollbar {
  66. margin: 5px 5px 6px 5px;
  67. //margin: 8px;
  68. //box-shadow: var(--el-box-shadow-light);
  69. //border-radius: 5px;
  70. &::-webkit-scrollbar {
  71. display: none;
  72. width: 6px;
  73. }
  74. &::-webkit-scrollbar-thumb {
  75. border-radius: 10px;
  76. background: rgba(144, 147, 153, 0.3);
  77. }
  78. &:hover {
  79. &::-webkit-scrollbar {
  80. display: block;
  81. }
  82. &::-webkit-scrollbar-thumb {
  83. border-radius: 10px;
  84. background: rgba(144, 147, 153, 0.3);
  85. &:hover {
  86. background: rgba(144, 147, 153, 0.5);
  87. }
  88. }
  89. }
  90. }
  91. .el-main-box {
  92. width: 100%;
  93. min-width: 1200px;
  94. height: 100%;
  95. box-sizing: border-box;
  96. }
  97. @media screen and (max-width: 1000px) {
  98. .el-aside {
  99. position: fixed;
  100. top: 0;
  101. left: 0;
  102. height: 100vh;
  103. z-index: 1000;
  104. &.hide-aside {
  105. left: -250px;
  106. }
  107. }
  108. .mask {
  109. position: fixed;
  110. top: 0;
  111. left: 0;
  112. width: 100vw;
  113. height: 100vh;
  114. z-index: 999;
  115. background: rgba(0, 0, 0, 0.5);
  116. }
  117. }
  118. </style>