index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <script setup>
  2. import { Setting} from "@element-plus/icons-vue"; // 新增 Menu 图标
  3. const handleOpen = (key, keyPath) => {
  4. console.log(key, keyPath);
  5. };
  6. const handleClose = (key, keyPath) => {
  7. console.log(key, keyPath);
  8. };
  9. </script>
  10. <template>
  11. <el-container class="app-layout">
  12. <el-aside width="200px" class="app-side">
  13. <div class="logo">
  14. <span>ADMIN UI</span>
  15. </div>
  16. <el-menu default-active="/home" class="side-menu" @open="handleOpen" @close="handleClose" router>
  17. <el-menu-item index="/home">
  18. <el-icon>
  19. <HomeFilled />
  20. </el-icon>
  21. <span>⾸⻚</span>
  22. </el-menu-item>
  23. <el-sub-menu index="/system">
  24. <template #title>
  25. <el-icon>
  26. <setting />
  27. </el-icon>
  28. <span>系统管理</span>
  29. </template>
  30. <el-menu-item index="/system/user">
  31. <el-icon>
  32. <Menu />
  33. </el-icon>
  34. <span>⽤户管理</span>
  35. </el-menu-item>
  36. <el-menu-item index="/system/role">
  37. <el-icon>
  38. <Menu />
  39. </el-icon>
  40. <span>⻆⾊管理</span>
  41. </el-menu-item>
  42. <el-menu-item index="/system/permission">
  43. <el-icon>
  44. <Menu />
  45. </el-icon>
  46. <span>权限管理</span>
  47. </el-menu-item>
  48. </el-sub-menu>
  49. <el-sub-menu index="/edu">
  50. <template #title>
  51. <el-icon>
  52. <Setting />
  53. </el-icon>
  54. <span>教务管理</span>
  55. </template>
  56. <el-menu-item index="/educational/student">
  57. <el-icon>
  58. <Menu />
  59. </el-icon>
  60. <span>学生管理</span>
  61. </el-menu-item>
  62. <el-menu-item index="/educational/class">
  63. <el-icon>
  64. <Menu />
  65. </el-icon>
  66. <span>班级管理</span>
  67. </el-menu-item>
  68. </el-sub-menu>
  69. </el-menu>
  70. </el-aside>
  71. <el-container class="app-cent-container">
  72. <el-header class="app-header">Header</el-header>
  73. <el-main class="app-content">
  74. <div class="content-wrapper">
  75. <router-view></router-view>
  76. </div>
  77. </el-main>
  78. </el-container>
  79. </el-container>
  80. </template>
  81. <style lang="less" scoped>
  82. .app-layout {
  83. height: 100vh;
  84. background-color: #f0f2f5;
  85. .app-side {
  86. background-color: #fff;
  87. box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
  88. position: relative;
  89. z-index: 10;
  90. .logo {
  91. height: 64px;
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. padding: 0 24px;
  96. overflow: hidden;
  97. span {
  98. color: #0c0c0c;
  99. font-size: 18px;
  100. font-weight: 600;
  101. white-space: nowrap;
  102. }
  103. }
  104. .side-menu {
  105. border-right: none;
  106. }
  107. }
  108. .app-cent-container {
  109. position: fixed;
  110. top: 0;
  111. left: 200px;
  112. right: 0;
  113. bottom: 0;
  114. background-color: #f9f9f9;
  115. .app-header {
  116. display: flex;
  117. flex-direction: row;
  118. justify-content: space-between;
  119. height: 64px;
  120. background: #fff;
  121. padding-left: 16px;
  122. padding-right: 16px;
  123. line-height: 64px;
  124. align-items: center;
  125. border-bottom: 1px solid #d8dce5;
  126. }
  127. .app-content {
  128. display: flex;
  129. flex-direction: column;
  130. position: absolute;
  131. top: 104px;
  132. right: 20px;
  133. bottom: 20px;
  134. left: 20px;
  135. background-color: #fff;
  136. }
  137. }
  138. .app-footer {
  139. text-align: center;
  140. padding: 16px 24px;
  141. color: rgba(0, 0, 0, 0.45);
  142. font-size: 14px;
  143. background: #fff;
  144. .footer-links {
  145. margin-bottom: 8px;
  146. a {
  147. color: rgba(0, 0, 0, 0.45);
  148. margin: 0 8px;
  149. &:hover {
  150. color: rgba(0, 0, 0, 0.65);
  151. }
  152. }
  153. }
  154. }
  155. }
  156. </style>