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.
 
 
 
 

245 lines
5.5 KiB

<template>
<div class="navbar">
<div class="navbar-brand">
<img :src="headerLogo" class="header-logo" alt="" />
<span class="platform-title">智能巡视管控平台</span>
</div>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div v-else class="navbar-spacer" />
<div class="right-menu">
<template v-if="device !== 'mobile'">
<!-- <search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
</el-tooltip> -->
<!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
</el-tooltip> -->
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> -->
</template>
<el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="click"
>
<div class="avatar-wrapper">
<img :src="loginAvatar" class="user-avatar" />
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<!-- <router-link to="/user/profile">
<el-dropdown-item>{{ $t('navBar.IndividualCenter') }}</el-dropdown-item>
</router-link> -->
<el-dropdown-item @click.native="logout">
<span>{{ $t('navBar.LogOut') }}</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import TopNav from "@/components/TopNav";
import Screenfull from "@/components/Screenfull";
import headerLogo from "@/assets/images/header/logo.png";
import loginAvatar from "@/assets/images/aa-logo.png";
export default {
components: {
TopNav,
Screenfull,
},
data() {
return {
headerLogo,
loginAvatar
};
},
computed: {
...mapGetters(["avatar", "device"]),
topNav: {
get() {
return this.$store.state.settings.topNav;
},
}
},
methods: {
async logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
});
})
.catch(() => {});
}
},
};
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/variables.scss";
.navbar {
height: 68px;
overflow: hidden;
position: relative;
display: flex;
align-items: center;
padding: 0 18px 0 14px;
background: $base-navbar-background url("~@/assets/images/header/dingbu2.png") center / 100% 100% no-repeat;
box-shadow: none;
box-sizing: border-box;
.hamburger-container {
line-height: 46px;
height: 100%;
float: left;
cursor: pointer;
transition: background 0.3s;
-webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, 0.025);
}
}
.navbar-brand {
width: 430px;
height: 100%;
display: flex;
align-items: center;
flex: 0 0 430px;
min-width: 0;
}
.header-logo {
width: 147px;
height: 37px;
display: block;
object-fit: contain;
}
.platform-title {
margin-left: 10px;
color: #fff;
font-size: 34px;
font-weight: 700;
line-height: 1;
white-space: nowrap;
letter-spacing: 0;
text-shadow: 0 0 6px rgba(84, 255, 255, 0.55), 0 2px 2px rgba(0, 17, 74, 0.65);
}
.navbar-spacer {
flex: 1 1 auto;
min-width: 0;
}
.topmenu-container {
flex: 1 1 auto;
min-width: 0;
height: 100%;
align-self: stretch;
}
.errLog-container {
display: inline-block;
vertical-align: top;
}
.right-menu {
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
flex: 0 0 auto;
line-height: 1;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 10px;
height: 40px;
font-size: 18px;
color: #54FFFF;
vertical-align: middle;
&.hover-effect {
cursor: pointer;
transition: background 0.3s;
border-radius: 2px;
&:hover {
background: rgba(84, 255, 255, 0.1);
}
}
}
.avatar-container {
margin-right: 18px;
.avatar-wrapper {
margin-top: 0;
position: relative;
display: flex;
align-items: center;
padding-right: 16px;
.user-avatar {
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 10px;
}
.el-icon-caret-bottom {
color: #54FFFF;
cursor: pointer;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
font-size: 12px;
}
}
}
}
@media (max-width: 768px) {
padding: 0 10px;
.navbar-brand {
width: 300px;
flex-basis: 300px;
}
.platform-title {
font-size: 18px;
}
.right-menu {
.avatar-container {
margin-right: 0;
}
}
}
}
</style>