Blame view

src/views/homePage/components/Header.vue 2.42 KB
9b7e125f   monkeyhouyi   属地页面
1
2
3
4
5
6
7
8
  <template>
    <header>
      <div class="slogin">
        举旗帜聚民心、防风险保安全、强治理惠民生、 增动能促发展、谋合作图共赢
      </div>
      <div class="title">内部系统</div>
      <div class="user">
        <div class="head">
477ec56f   monkeyhouyi   权限
9
          <el-image :src="avatar" fit="cover"></el-image>
9b7e125f   monkeyhouyi   属地页面
10
11
        </div>
        <el-dropdown @command="handleCommand">
477ec56f   monkeyhouyi   权限
12
13
14
          <div class="info">
            {{ userInfo.userName }}({{ userInfo.organizeName }})
          </div>
9b7e125f   monkeyhouyi   属地页面
15
16
17
18
19
20
21
22
23
24
25
26
27
          <el-dropdown-menu slot="dropdown" router>
            <el-dropdown-item>修改信息</el-dropdown-item>
            <passwordForm>
              <el-dropdown-item>修改密码</el-dropdown-item>
            </passwordForm>
            <el-dropdown-item command="logout">退出系统</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </header>
  </template>
  
  <script>
9b7e125f   monkeyhouyi   属地页面
28
29
30
31
  export default {
    name: "Header",
    data() {
      return {
477ec56f   monkeyhouyi   权限
32
33
        userInfo: this.$store.state.user.userInfo,
        avatar: this.$store.state.user.avatar,
9b7e125f   monkeyhouyi   属地页面
34
35
36
37
      };
    },
    mounted() {},
    methods: {
0af91599   monkeyhouyi   弹框请求优化
38
39
      async logout() {
        await this.$store.dispatch("LogOut");
9b7e125f   monkeyhouyi   属地页面
40
41
42
43
44
45
46
47
48
49
50
        this.$router.push({ path: "/login" });
      },
      handleCommand(command) {
        switch (command) {
          case "logout":
            this.$confirm("确定退出登录?", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            })
              .then(() => {
0af91599   monkeyhouyi   弹框请求优化
51
                this.logout();
9b7e125f   monkeyhouyi   属地页面
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
              })
              .catch(() => {});
  
            break;
  
          default:
            break;
        }
      },
    },
  };
  </script>
  <style scoped lang="scss">
  header {
    width: 100%;
    color: rgba(255, 255, 255, 1);
    position: relative;
    .slogin {
      position: absolute;
      left: 28px;
      top: 21px;
      width: 600px;
      text-align: right;
      font-size: 28px;
      font-family: Roboto;
      font-weight: 400;
      line-height: 39px;
    }
    .title {
      text-align: center;
      width: 100%;
      padding-top: 5px;
      font-size: 40px;
      font-weight: 700;
      line-height: 56px;
    }
    .user {
      position: absolute;
      right: 33px;
      top: 25px;
      display: flex;
      align-items: center;
      flex-direction: row;
      .head {
        width: 50px;
        height: 50px;
        margin-right: 13px;
        .el-image {
          width: 100%;
          height: 100%;
          border-radius: 50%;
        }
      }
      .info {
        color: #fff;
        cursor: pointer;
      }
    }
  }
  </style>