TopBar.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="top-bar-box">
  3. <div class="top-bar">
  4. <div class="top-box">
  5. <!-- <span>安全保卫管理平台</span>-->
  6. <van-icon name="setting-o" size="26" @click="clickOutLogin" />
  7. </div>
  8. <div class="bottom-box">
  9. <!-- <div>
  10. <p class="user-name">{{ userName }}</p>
  11. <p class="org-info">
  12. <span>{{ orgName }}</span>
  13. <van-icon name="arrow" size="20" />
  14. </p>
  15. <p class="van-multi-ellipsis&#45;&#45;l2 introduce-info ">
  16. <span v-for="item in roleList" :key="item.roleId">{{ item.roleName }}</span>
  17. </p>
  18. </div>-->
  19. </div>
  20. </div>
  21. <div class="top-card">
  22. <div class="top-card-line">
  23. <van-image
  24. round
  25. width="1.3rem"
  26. height="1.3rem"
  27. style="float: left"
  28. :src="require('@/assets/img/my/header.png')"
  29. />
  30. <p class="user-name">{{ userName }}</p>
  31. </div>
  32. <div class="top-card-line">
  33. <van-image
  34. width="0.7rem"
  35. height="0.6rem"
  36. style="float: left"
  37. :src="require('@/assets/img/my/org.png')"
  38. />
  39. <p style="line-height: 28px;">
  40. <span class="top_text_content">{{ orgName }}</span>
  41. </p>
  42. </div>
  43. <div class="top-card-line">
  44. <van-image
  45. width="0.7rem"
  46. height="0.7rem"
  47. style="float: left"
  48. :src="require('@/assets/img/my/role.png')"
  49. />
  50. <p class="van-multi-ellipsis&#45;&#45;l2 introduce-info " style="line-height: 28px;">
  51. <span class="top_text_content" v-for="item in roleList" :key="item.roleId">{{ item.roleName }}</span>
  52. </p>
  53. </div>
  54. <div style="height: 2vw;"></div>
  55. </div>
  56. <div class="card-footer"></div>
  57. </div>
  58. </template>
  59. <script>
  60. import { mapGetters } from 'vuex'
  61. import { logout } from '@/api/public'
  62. export default {
  63. data() {
  64. return {}
  65. },
  66. computed: {
  67. ...mapGetters(['userName', 'orgName','roleList', 'orgId']),
  68. },
  69. methods: {
  70. clickOutLogin() {
  71. logout().then(res => {
  72. sessionStorage.clear();
  73. this.$router.replace('/login');
  74. this.$toast('退出登录');
  75. })
  76. },
  77. }
  78. }
  79. </script>
  80. <style scoped lang="scss">
  81. .card-footer{
  82. height: 3vw;
  83. }
  84. .top-bar-box{
  85. position: relative;
  86. min-height: 90vw;
  87. height: auto;
  88. }
  89. .top-card{
  90. height: auto;
  91. min-height: 37vw;
  92. background-color: #FFFFFF;
  93. margin-top: -23vw;
  94. margin-left: 6%;
  95. margin-right: 6%;
  96. border-radius: 10px;
  97. .top-card-line{
  98. padding: 20px 40px 0 40px;
  99. }
  100. }
  101. .user-name{
  102. padding-left: 15vw;
  103. font-size: 6.333333vw;
  104. line-height: 14vw;
  105. }
  106. .top_text_content{
  107. margin-left: 2vw;
  108. font-size: 3.8vw;
  109. color: #797979;
  110. }
  111. .top-bar {
  112. height: 550px;
  113. width: 100%;
  114. background: url('../assets/img/my/my_header.png') no-repeat center rgba(255,255,255,.1);
  115. background-size: 100% 100%;
  116. padding: 40px 40px 20px 40px;
  117. text-shadow: 0 1px 3px #666;
  118. box-shadow: 0 1px 10px #ffffff;
  119. color: #fff;
  120. > div {
  121. width: 100%;
  122. }
  123. }
  124. .top-box {
  125. display: flex;
  126. justify-content: space-between;
  127. align-items: center;
  128. > span {
  129. font-size: 40px;
  130. }
  131. }
  132. .bottom-box {
  133. padding-top: 30px;
  134. > div {
  135. .user-name {
  136. font-size: 30px;
  137. margin-bottom: 10px;
  138. }
  139. .org-info{
  140. font-size: 28px;
  141. display: flex;
  142. justify-content: space-between;
  143. }
  144. .introduce-info {
  145. font-size: 24px;
  146. line-height: 34px;
  147. >span{
  148. display: inline-block;
  149. margin-right: 20px;
  150. }
  151. }
  152. }
  153. }
  154. </style>