heads.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div id="heads">
  3. <el-row>
  4. <div class="headTop">
  5. <a href="" class="headImg">
  6. <img src="../../assets/logo.png" width="50" height="50" />
  7. </a>
  8. <h3 class="headCompany">吉林省计算中心科技服务平台管理后台</h3>
  9. </div>
  10. <div class="headBtn">
  11. <span class="mr14">|</span>
  12. <span class="mr14">
  13. <span class="el-icon-s-custom info_icon"></span>
  14. &nbsp;{{ user.name || '请登录' }}
  15. </span>
  16. <span class="mr14">|</span>
  17. <span style="color: #333;" @click="toLogout"
  18. ><span class="el-icon-switch-button info_icon"></span>
  19. &nbsp;退出
  20. </span>
  21. </div>
  22. </el-row>
  23. </div>
  24. </template>
  25. <script>
  26. import { mapActions, mapState, mapMutations, createNamespacedHelpers } from 'vuex';
  27. const { mapActions: login } = createNamespacedHelpers('login');
  28. export default {
  29. name: 'heads',
  30. props: {},
  31. components: {},
  32. data: () => ({}),
  33. created() {},
  34. watch: {},
  35. computed: {
  36. ...mapState(['user']),
  37. },
  38. methods: {
  39. ...login(['logout']),
  40. toLogout() {
  41. localStorage.removeItem('token');
  42. //TODO 跳转到登陆
  43. window.location.href = 'http://free.liaoningdoupo.com/platlogin';
  44. },
  45. },
  46. };
  47. </script>
  48. <style lang="less" scoped>
  49. img {
  50. max-height: 100%;
  51. max-width: 100%;
  52. }
  53. a {
  54. text-decoration: none;
  55. }
  56. .headTop {
  57. float: left;
  58. width: 50%;
  59. padding: 0 0 0 50px;
  60. }
  61. .headImg {
  62. float: left;
  63. width: 60px;
  64. height: 60px;
  65. margin: 4px 0 0 0;
  66. text-align: center;
  67. }
  68. .headXinyong {
  69. float: left;
  70. width: 70px;
  71. height: 40px;
  72. margin: 13px 0 0 10px;
  73. }
  74. .headCompany {
  75. float: left;
  76. font-size: 21px;
  77. width: 500px;
  78. padding: 18px 10px;
  79. margin: 0;
  80. color: #333;
  81. font-family: 'inherit';
  82. font-weight: 500;
  83. }
  84. .headBtn {
  85. float: right;
  86. width: 40%;
  87. text-align: right;
  88. padding: 0 60px 0 0;
  89. margin-top: 20px;
  90. font-size: 14px;
  91. color: #333;
  92. }
  93. .headBtn .mr14 {
  94. margin-right: 14px;
  95. color: #333;
  96. }
  97. .headBtn .el-button {
  98. border-radius: 0px;
  99. border: none;
  100. width: 0;
  101. height: 0px;
  102. }
  103. .headBtn .el-button:hover {
  104. background: none;
  105. }
  106. .popover-content {
  107. margin: 0;
  108. padding: 0;
  109. .el-col {
  110. border-bottom: 1px dashed #cccccc;
  111. font-size: 0.8rem;
  112. height: 1.25rem;
  113. }
  114. }
  115. /deep/.el-popper {
  116. border: 1px solid #ccc;
  117. border-radius: 0px;
  118. height: 100px;
  119. padding: 0;
  120. }
  121. /deep/.popoverCon {
  122. width: 400px;
  123. height: 70px;
  124. text-align: center;
  125. padding: 0;
  126. margin: 0;
  127. }
  128. /deep/.popoverCon li {
  129. list-style: none;
  130. }
  131. /deep/.popoverBtn {
  132. position: absolute;
  133. bottom: 0;
  134. left: 0px;
  135. width: 424px;
  136. height: 30px;
  137. line-height: 30px;
  138. text-align: right;
  139. color: #333;
  140. border-radius: 0 0 4px 4px;
  141. background: #f6f6f6;
  142. margin: 0;
  143. padding: 0;
  144. }
  145. /deep/.popoverBtn:hover {
  146. text-decoration: underline;
  147. color: #409eff;
  148. }
  149. /deep/.el-form-item__label {
  150. padding: 0px 0px 0 0;
  151. }
  152. /deep/.el-dialog__header {
  153. background-color: #40a44c;
  154. }
  155. /deep/.el-icon-close:before {
  156. color: #000;
  157. }
  158. /deep/.el-dialog__footer {
  159. padding: 0px 20px 10px;
  160. }
  161. /deep/.el-dialog__body {
  162. padding: 15px 20px;
  163. }
  164. </style>