大数据局-工单系统-前端
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.

103 lines
2.6 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">
<!-- <el-tooltip
effect="dark"
:content="$t('navbar.notice')"
placement="bottom"
>
<div class="top-bar__item top-bar__item--show">
<top-notice></top-notice>
</div>
</el-tooltip> -->
3 years ago
<div class="avatar">
<img :src="userInfo.avatar" alt="" width="56px" height="56px" style="border-radius:50%;"/>
</div>
3 years ago
<!-- <div style="margin-right:10px;">
{{userInfo.real_name}}
3 years ago
</div> -->
<el-dropdown>
3 years ago
<span class="el-dropdown-link">
<span style="cursor:pointer;color:#000;">{{userInfo.real_name}}</span>
3 years ago
<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>
3 years ago
</el-dropdown-item>
<el-dropdown-item
v-if="this.website.switchMode"
@click.native="switchDept"
>{{ $t("navbar.switchDept") }}
3 years ago
</el-dropdown-item>
<el-dropdown-item @click.native="logout" divided
>{{ $t("navbar.logOut") }}
3 years ago
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
3 years ago
</div>
</div>
</template>
<script>
3 years ago
import { mapGetters } from "vuex";
import { resetRouter } from "@/router/router";
import topNotice from "./top-notice";
3 years ago
export default {
3 years ago
name: "top",
data() {
return {};
3 years ago
},
components: {
topNotice,
3 years ago
},
created() {},
3 years ago
computed: {
...mapGetters(["userInfo", "tag"]),
3 years ago
},
3 years ago
methods: {
logout() {
3 years ago
this.$confirm(this.$t("logoutTip"), this.$t("tip"), {
confirmButtonText: this.$t("submitText"),
cancelButtonText: this.$t("cancelText"),
type: "warning",
3 years ago
}).then(() => {
this.$store.dispatch("LogOut").then(() => {
resetRouter();
process.env.NODE_ENV != "production" ? this.$router.push({path: '/newlogin'}) : window.location.href="http://jhoa.qd.gov.cn/Default.aspx";
});
});
},
},
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>