v-fastmenu.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div class="fast-menu">
  3. <div class="menu-list">
  4. <!-- <a @click="backToMainPage" class="header-right">
  5. <span><i class="el-icon-s-home"></i>返回首页</span>
  6. </a>
  7. <a @click="backToMainPage" class="header-right">
  8. <span><i class="el-icon-monitor"></i>管理端</span>
  9. </a> -->
  10. <el-popover placement="top-start" trigger="hover" width="300px">
  11. <div class="user-tip">
  12. <div class="u-tip-1">
  13. <img src="@/assets/images/user-photo.png" />
  14. <div class="user-info">
  15. <div class="user-name">
  16. <h2>张三</h2><span>某某部门</span>
  17. </div>
  18. <div class="phone-number">18686688888</div>
  19. </div>
  20. </div>
  21. <div style="margin-bottom: 1rem;">
  22. <el-button type="primary" size="small">修改密码</el-button>
  23. <el-button type="warning" size="small">退出登录</el-button>
  24. </div>
  25. <a href="#" style="border-top: 1px solid #334780;"><i class="el-icon-s-home"></i>返回首页</a>
  26. <a href="#"><i class="el-icon-monitor"></i>管理系统</a>
  27. </div>
  28. <div slot="reference" style="text-align: center; width:4rem;height:3rem;">
  29. <img src="@/assets/images/mascot-small.png" />
  30. </div>
  31. </el-popover>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. visible: false
  40. // fastMenu: [{
  41. // name: '返回首页',
  42. // path: '/',
  43. // icon: 'el-icon-s-home',
  44. // // msValue: 1
  45. // },
  46. // {
  47. // name: '管理端',
  48. // path: '/',
  49. // icon: 'sj-icon-rwzx',
  50. // // msValue: 2
  51. // },
  52. // ],
  53. }
  54. },
  55. methods: {
  56. backToMainPage() {
  57. let href = window.location.href
  58. let protacal = href.substr(0, href.indexOf("://") + 3)
  59. let mo = href.lastIndexOf(":") > 6 ? href.lastIndexOf(":") : href.lastIndexOf("/")
  60. let ip = href.substr(href.indexOf("://") + 3, mo);
  61. let url = href.substr(0, mo)
  62. let toUrl = url + ":15001/index58"
  63. window.location.href = toUrl
  64. },
  65. },
  66. computed: {},
  67. }
  68. </script>
  69. <style rel="stylesheet/scss" lang="scss">
  70. @import '@/assets/styles/base.scss';
  71. .user-tip {
  72. width: 100%;
  73. display: flex;
  74. font-size: .8rem;
  75. flex-direction: column;
  76. .u-tip-1 {
  77. display: flex;
  78. margin-bottom: 1rem;
  79. img {
  80. margin-right: 1rem;
  81. border-radius: .3rem;
  82. }
  83. .user-info {
  84. display: flex;
  85. flex-direction: column;
  86. justify-content: space-between;
  87. .user-name {
  88. display: flex;
  89. align-items: flex-end;
  90. h2 {
  91. color: $inBlue;
  92. margin-right: .5rem;
  93. font-weight: bolder;
  94. }
  95. span {
  96. color: $grayBlue;
  97. }
  98. }
  99. .phone-number {
  100. color: $inBlue;
  101. }
  102. }
  103. }
  104. a {
  105. color: $inBlue;
  106. display: flex;
  107. border-bottom: 1px solid #334780;
  108. justify-content: center;
  109. align-items: center;
  110. height: 2rem;
  111. i{
  112. margin-right:.3rem ;
  113. }
  114. }
  115. a:hover{
  116. color: $inBlueHover;
  117. box-shadow:$shadowTip
  118. }
  119. }
  120. .fast-menu {
  121. right: 0.5rem;
  122. position: absolute;
  123. display: flex;
  124. .menu-list {
  125. margin-left: 20px;
  126. display: flex;
  127. align-items: center;
  128. }
  129. .el-badge__content.is-fixed {
  130. right: 3px;
  131. }
  132. .el-badge__content {
  133. border: 0;
  134. }
  135. }
  136. .el-popover{
  137. background:#0c1327;
  138. border:1px solid #334780;
  139. box-shadow:$shadowListHover;
  140. border-radius: 1rem;
  141. }
  142. </style>