whychw
2021-04-27 4160bb727b3520df4d08535b7b774067823b38e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
<template>
    <div class="pageHeader">
        <div class="headTitle">FMDS | 电机试验集中测控平台</div>
        <div class="headToolsCon">
            <div class="avatar">
                <span class="avatar-icon">
                    <i class="el-icon-s-home"></i>
                </span>
                <span class="avatar-text" @click="logout">退出登录</span>
            </div>
            <div class="avatar">
                <span class="avatar-icon">
                    <i class="el-icon-user-solid"></i>
                </span>
                <span class="avatar-text">
                    {{username}}<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
            </div>
 
        </div>
    </div>
</template>
 
<script>
    export default {
        data() {
            return {
                username: this.$store.state.user.username
            }
        },
        methods: {
            logout () {
                this.$store.dispatch('setLogin');
                this.$router.push({path: '/login'});
            }
        }
    }
</script>
 
<style scoped>
    .pageHeader {
        width: 100%;
        height: 100px;
        position: relative;
    }
 
    .headTitle {
        width: 100%;
        height: 86px;
        line-height: 86px;
        font-size: 36px;
        color: #ffffff;
        letter-spacing: 3px;
        text-align: center;
        text-indent: -40px;
    }
 
    .headToolsCon {
        width: 100%;
        height: 40px;
        position: absolute;
        left: 0;
        bottom: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        padding-right: 40px;
    }
 
    .avatar {
        display: inline-block;
        margin-right: 30px;
        cursor: pointer;
        color: #e4e3e3;
    }
 
    .avatar:hover {
        color: #FFFFFF;
    }
 
    .avatar .el-icon-arrow-down {
        transform: rotate(-90deg);
    }
 
    .avatar-icon {
        display: inline-flex;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        justify-content: center;
        background-color: #727ff3;
        align-items: center;
        color: #171350;
    }
 
    .avatar-icon .iconfont {
        font-size: 16px;
    }
 
    .avatar-text {
        color: #ffffff;
        margin-left: 8px;
        font-size: 16px;
    }
 
    .avatar-text .el-icon-arrow-down {
        margin-left: 4px;
    }
</style>