sideMenu.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <script>
  2. import { onMounted, ref } from "vue"
  3. import { get } from '../../utils/request'
  4. import Dashboard from '@/components/icon/menu_dashboard.vue'
  5. import Product from '@/components/icon/menu_product.vue'
  6. import Team from '@/components/icon/menu_team.vue'
  7. import License from '@/components/icon/menu_license.vue'
  8. import Device from '@/components/icon/menu_device.vue'
  9. import Settings from '@/components/icon/menu_setting.vue'
  10. import Support from '@/components/icon/menu_support.vue'
  11. import Logout from '@/components/icon/logout.vue'
  12. import { Aside } from 'element-ui'
  13. export default {
  14. name:'sideMenu',
  15. components:{
  16. Dashboard,
  17. Product,
  18. Team,
  19. License,
  20. Device,
  21. Settings,
  22. Support,
  23. Logout
  24. },
  25. data() {
  26. return {
  27. userName:'',
  28. email:'',
  29. role:''
  30. }
  31. },
  32. mounted() {
  33. get('http://81.68.234.235:8032/pdf-tech/vppMember/getMemberInfo').then((res)=>{
  34. this.userName = res.data.result.fullName
  35. this.email = res.data.result.email
  36. this.role = res.data.result.role
  37. })
  38. },
  39. methods:{
  40. logout(){
  41. get('http://81.68.234.235:8032/pdf-tech/logout').then((res)=>{
  42. if (res.data.code === 200 && res.data.msg == 'success') {
  43. this.$router.push('login')
  44. }
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <template>
  51. <div class=" flex flex-col justify-between h-100vh">
  52. <div class="aside">
  53. <div class="user-info">
  54. <div class="head-photo"><p>{{ userName.substr(0, 1).toUpperCase() }}</p></div>
  55. <div class="info">
  56. <p>{{ userName }}</p>
  57. <p>{{ email }}</p>
  58. </div>
  59. <div class="type">{{ role === 1 ? 'Super admin' : 'Team admin' }}</div>
  60. </div>
  61. <el-menu :default-active="$route.fullPath" active-text-color="#1460F3" text-color="#232A40" router>
  62. <el-menu-item index="/dashboard">
  63. <Dashboard />
  64. <span>Dashboard</span>
  65. </el-menu-item>
  66. <el-menu-item index="/productManagement">
  67. <Product />
  68. <span>Product Management</span>
  69. </el-menu-item>
  70. <el-submenu index="3">
  71. <template slot="title">
  72. <Team />
  73. <span>Team Management</span>
  74. </template>
  75. <el-menu-item index="/manage-team">Manage Team</el-menu-item>
  76. <el-menu-item index="/manage-member">Manage Member</el-menu-item>
  77. <el-menu-item index="/manageAdmin">Manage Admin</el-menu-item>
  78. </el-submenu>
  79. <el-submenu index="4">
  80. <template slot="title">
  81. <License />
  82. <span>License Management</span>
  83. </template>
  84. <el-menu-item index="/licenseManage">Manage License</el-menu-item>
  85. <el-menu-item index="/assignlicense">Assign License</el-menu-item>
  86. <el-menu-item index="/volumecancel">Volume Cancel</el-menu-item>
  87. </el-submenu>
  88. <el-menu-item index="/device">
  89. <Device />
  90. <span>Device Management</span>
  91. </el-menu-item>
  92. <el-menu-item index="/settings">
  93. <Settings />
  94. <span>Settings</span>
  95. </el-menu-item>
  96. <el-menu-item index="/support">
  97. <Support />
  98. <span>Support</span>
  99. </el-menu-item>
  100. </el-menu>
  101. </div>
  102. <div @click="logout()" class="absolute left-0 bottom-0 w-full h-40px bg-[#F6F7F9] flex items-center cursor-pointer"><Logout class="ml-27px" /><span class="ml-11px text-14px text-[#232A40] font-bold">Log out</span></div>
  103. </div>
  104. </template>
  105. <style lang="scss" scoped>
  106. .aside {
  107. padding: 48px 20px 0;
  108. background-color: #fff;
  109. ::v-deep .el-submenu.is-active,
  110. ::v-deep .el-submenu.is-active .el-submenu__title {
  111. color: #1460F3 !important;
  112. }
  113. ::v-deep .el-submenu__title {
  114. color: #232A40 !important;
  115. }
  116. .user-info {
  117. display: flex;
  118. flex-direction: column;
  119. align-items: center;
  120. margin-bottom: 40px;
  121. .head-photo {
  122. display: flex;
  123. justify-content: center;
  124. align-items: center;
  125. width: 56px;
  126. height: 56px;
  127. border-radius: 50%;
  128. background-color: #8D9CB9;
  129. p {
  130. font-weight: 700;
  131. font-size: 30px;
  132. line-height: 39px;
  133. color: #FFF;
  134. }
  135. }
  136. .info {
  137. margin-top: 8px;
  138. text-align: center;
  139. word-wrap: break-word;
  140. word-break: break-all;
  141. & p:first-child {
  142. font-weight: 700;
  143. font-size: 18px;
  144. line-height: 24px;
  145. color: #232A40;
  146. }
  147. & p:last-child {
  148. font-size: 14px;
  149. line-height: 20px;
  150. color: #505258;
  151. }
  152. }
  153. .type {
  154. margin-top: 8px;
  155. padding: 4px 12px;
  156. height: 24px;
  157. background: #EEF4FF;
  158. border-radius: 31px;
  159. font-size: 12px;
  160. line-height: 16px;
  161. color: #2752A6;
  162. font-weight: 700;
  163. }
  164. }
  165. }
  166. </style>