Index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <script setup lang="ts">
  2. import SubMenu from '@/layouts/Menu/SubMenu.vue'
  3. import Main from '@/layouts/Main/index.vue'
  4. import Header from '@/layouts/Header/index.vue'
  5. import { Menu_User_List } from '@/api/role/index'
  6. import { GlobalStore } from '@/stores/index'
  7. // import md5 from 'js-md5'
  8. // console.log(md5('123456'))
  9. const globalStore = GlobalStore()
  10. const getMenu = async () => {
  11. const res = await Menu_User_List({ User_tokey: globalStore.GET_User_tokey })
  12. }
  13. getMenu()
  14. const routerList = [
  15. {
  16. path: '/home',
  17. name: 'Home',
  18. meta: {
  19. icon: 'HomeFilled',
  20. title: '首页',
  21. isKeepAlive: true
  22. }
  23. },
  24. {
  25. path: '/account',
  26. name: 'Account',
  27. meta: {
  28. icon: 'HomeFilled',
  29. title: '账户管理',
  30. isKeepAlive: true
  31. },
  32. children: [
  33. {
  34. path: '/users',
  35. name: 'Users',
  36. meta: {
  37. icon: 'Memo',
  38. title: '账户管理',
  39. isKeepAlive: true
  40. }
  41. },
  42. {
  43. path: '/roles',
  44. name: 'Roles',
  45. meta: {
  46. icon: 'UserFilled',
  47. title: '角色管理',
  48. isKeepAlive: true
  49. }
  50. }
  51. ]
  52. },
  53. {
  54. path: '',
  55. name: '仓库管理',
  56. iocn: '',
  57. meta: {
  58. icon: 'HomeFilled',
  59. title: '首页',
  60. isKeepAlive: true
  61. }
  62. },
  63. {
  64. path: '/salary',
  65. name: '薪资管理',
  66. meta: {
  67. icon: 'HomeFilled',
  68. title: '薪资管理',
  69. isKeepAlive: true
  70. },
  71. children: [
  72. {
  73. path: '/salary',
  74. name: '薪资管理',
  75. meta: {
  76. icon: 'HomeFilled',
  77. title: '薪资管理',
  78. isKeepAlive: true
  79. }
  80. },
  81. {
  82. path: '/salaryCount',
  83. name: '薪资统计',
  84. meta: {
  85. icon: 'HomeFilled',
  86. title: '薪资统计',
  87. isKeepAlive: true
  88. }
  89. },
  90. {
  91. path: '/salaryMy',
  92. name: '我的薪资',
  93. meta: {
  94. icon: 'HomeFilled',
  95. title: '我的薪资',
  96. isKeepAlive: true
  97. }
  98. }
  99. ]
  100. },
  101. {
  102. path: '',
  103. name: '薪资管理',
  104. iocn: '',
  105. meta: {
  106. icon: 'HomeFilled',
  107. title: '首页',
  108. isKeepAlive: true
  109. },
  110. children: [
  111. {
  112. path: '',
  113. name: '统筹管理',
  114. meta: {
  115. icon: 'HomeFilled',
  116. title: '首页',
  117. isKeepAlive: true
  118. }
  119. },
  120. {
  121. path: '',
  122. name: '统筹管理(财务)',
  123. meta: {
  124. icon: 'HomeFilled',
  125. title: '首页',
  126. isKeepAlive: true
  127. }
  128. }
  129. // { index: '5-3', path: '', name: '加班审批', iocn: '' },
  130. // { index: '5-4', path: '', name: '请假审批', iocn: '' },
  131. // { index: '5-5', path: '', name: '我的加班', iocn: '' },
  132. // { index: '5-6', path: '', name: '我的请假', iocn: '' }
  133. ]
  134. }
  135. ]
  136. </script>
  137. <template>
  138. <el-container class="home-container">
  139. <el-aside width="210px">
  140. <!-- <h1 style="color: #fff; text-align: center; margin: 20px; font-size: 32px">ERP系统</h1> -->
  141. <el-scrollbar class="scrollbar">
  142. <!-- text-color="#303133" -->
  143. <el-menu
  144. :unique-opened="true"
  145. :collapse-transition="false"
  146. active-text-color="#ffd04b"
  147. text-color="#fff"
  148. background-color="#091215"
  149. >
  150. <SubMenu :menu-list="routerList"></SubMenu>
  151. </el-menu>
  152. </el-scrollbar>
  153. </el-aside>
  154. <el-container>
  155. <el-header>
  156. <Header />
  157. </el-header>
  158. <Main />
  159. </el-container>
  160. </el-container>
  161. </template>
  162. <style scoped lang="scss">
  163. .home-container {
  164. height: 100%;
  165. .scrollbar {
  166. border-right: solid 1px var(--el-menu-border-color);
  167. :deep(.el-menu) {
  168. border-right: none;
  169. }
  170. }
  171. .el-aside {
  172. background-color: #091215;
  173. }
  174. .el-header {
  175. display: flex;
  176. align-items: center;
  177. border-bottom: solid 1px var(--el-menu-border-color);
  178. }
  179. }
  180. /* fade-transform */
  181. .fade-transform-leave-active,
  182. .fade-transform-enter-active {
  183. transition: all 0.2s;
  184. }
  185. .fade-transform-enter-from {
  186. opacity: 0;
  187. transition: all 0.2s;
  188. transform: translateX(-30px);
  189. }
  190. .fade-transform-leave-to {
  191. opacity: 0;
  192. transition: all 0.2s;
  193. transform: translateX(30px);
  194. }
  195. </style>