大数据局-工单系统-前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.0 KiB

3 years ago
<template>
<div class="avue-top">
<div class="top-left">{{tag.label==="首页"?"数据看板":tag.label}}</div>
3 years ago
<div class="top-right">
3 years ago
<div class="avatar">
<img :src="userInfo.avatar" alt="" width="56px" height="56px">
</div>
<el-dropdown >
<span class="el-dropdown-link">
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<router-link to="/info/index">{{$t('navbar.userinfo')}}</router-link>
</el-dropdown-item>
<el-dropdown-item v-if="this.website.switchMode" @click.native="switchDept"
>{{$t('navbar.switchDept')}}
</el-dropdown-item>
<el-dropdown-item @click.native="logout"
divided>{{$t('navbar.logOut')}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
3 years ago
</div>
</div>
</template>
<script>
3 years ago
import { mapGetters } from "vuex";
3 years ago
import { resetRouter } from '@/router/router'
3 years ago
export default {
3 years ago
name: "top",
data () {
return {
}
},
filters: {},
created () {
},
mounted () {
console.log(this.userInfo)
},
3 years ago
computed: {
3 years ago
...mapGetters([
"userInfo",
"tag",
])
3 years ago
},
3 years ago
methods: {
logout () {
this.$confirm(this.$t("logoutTip"), this.$t("tip"), {
confirmButtonText: this.$t("submitText"),
cancelButtonText: this.$t("cancelText"),
type: "warning"
}).then(() => {
this.$store.dispatch("LogOut").then(() => {
resetRouter()
this.$router.push({ path: "/login" })
})
})
}
}
3 years ago
};
3 years ago
</script>
<style lang="scss" scoped>
3 years ago
.top-left {
color: #273240;
font-size: 30px;
font-weight: 500;
}
.top-right {
display: flex;
align-items: center;
.avatar {
width: 56px;
height: 56px;
border-radius: 50%;
margin-right: 18px;
3 years ago
border: 2px solid #fff;
3 years ago
}
i {
font-style: normal;
font-size: 20px;
color: #6e7e92;
font-weight: 800;
}
}
3 years ago
</style>