heads.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div id="heads">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-col :span="18" class="title">
  6. 吉林省小微企业金融管理后台
  7. </el-col>
  8. <el-col :span="6" class="admin">
  9. <i class="el-icon-user icon"></i>
  10. <span class="name">管理员:{{ user.name }}</span>
  11. <span class="shu">|</span>
  12. <el-link :underline="false" class="out" @click="toLogout()">退出</el-link>
  13. </el-col>
  14. </el-col>
  15. </el-row>
  16. </div>
  17. </template>
  18. <script>
  19. import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
  20. export default {
  21. name: 'heads',
  22. props: {},
  23. components: {},
  24. data: () => ({}),
  25. created() {},
  26. watch: {},
  27. computed: {
  28. ...mapState(['user']),
  29. },
  30. methods: {
  31. ...mapMutations(['deleteUser']),
  32. async toLogout() {
  33. this.deleteUser();
  34. this.$message({
  35. message: '注销成功',
  36. type: 'success',
  37. });
  38. this.toLogin();
  39. },
  40. async toLogin() {
  41. this.$router.push({ name: 'login' });
  42. },
  43. },
  44. };
  45. </script>
  46. <style lang="less" scoped>
  47. .title {
  48. font-size: 18px;
  49. font-family: Source Han Sans SC;
  50. font-weight: bold;
  51. color: #ffffff;
  52. padding: 23px 29px;
  53. }
  54. .admin {
  55. text-align: right;
  56. padding: 24px 30px;
  57. }
  58. .admin .icon {
  59. color: #fff;
  60. padding: 0 5px;
  61. }
  62. .admin .name {
  63. font-size: 14px;
  64. font-family: Source Han Sans SC;
  65. font-weight: 400;
  66. color: rgba(255, 255, 255, 1);
  67. }
  68. .admin .shu {
  69. padding: 0 10px;
  70. color: rgba(255, 255, 255, 1);
  71. }
  72. .admin .out {
  73. font-size: 14px;
  74. font-family: Source Han Sans SC;
  75. font-weight: 400;
  76. color: rgba(233, 2, 29, 1);
  77. }
  78. </style>