海信医疗-远程超声管理平台-信创国产化
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.

304 lines
7.4 KiB

1 month ago
<template>
<div class="navbar" :class="'nav' + navType">
<hamburger
id="hamburger-container"
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/>
1 month ago
<breadcrumb
v-if="navType == 1"
id="breadcrumb-container"
class="breadcrumb-container"
/>
<top-nav
v-if="navType == 2"
id="topmenu-container"
class="topmenu-container"
/>
1 month ago
<template v-if="navType == 3">
<logo v-show="showLogo" :collapse="false"></logo>
<top-bar id="topbar-container" class="topbar-container" />
</template>
<div class="right-menu">
1 month ago
<!-- <template v-if="device!=='mobile'">
1 month ago
<search id="header-search" class="right-menu-item" />
1 month ago
<el-tooltip content="源码地址" effect="dark" placement="bottom">
1 month ago
<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" />
1 month ago
</el-tooltip>
1 month ago
<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>
<el-tooltip content="消息通知" effect="dark" placement="bottom">
<header-notice id="header-notice" class="right-menu-item hover-effect" />
</el-tooltip>
1 month ago
</template> -->
1 month ago
<el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="hover"
>
1 month ago
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar" />
1 month ago
<span class="user-nickname"> {{ nickName }} </span>
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<!-- <el-dropdown-item @click.native="setLayout" v-if="setting">
1 month ago
<span>布局设置</span>
</el-dropdown-item> -->
1 month ago
<el-dropdown-item @click.native="lockScreen">
<span>锁定屏幕</span>
</el-dropdown-item>
<el-dropdown-item @click.native="showSystemSetting = true">
系统设置
</el-dropdown-item>
<el-dropdown-item @click.native="showAbout = true">
关于
</el-dropdown-item>
<el-dropdown-item @click.native="switchAccount">
切换账号
</el-dropdown-item>
1 month ago
<el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<!-- 系统设置弹窗 -->
<SystemSettingDialog :visible.sync="showSystemSetting" />
<!-- 关于弹窗 -->
<AboutDialog :visible.sync="showAbout" />
1 month ago
</div>
</template>
<script>
import { mapGetters } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import TopNav from "./TopNav";
import TopBar from "./TopBar";
import Logo from "./Sidebar/Logo";
import Hamburger from "@/components/Hamburger";
import Screenfull from "@/components/Screenfull";
import SizeSelect from "@/components/SizeSelect";
import Search from "@/components/HeaderSearch";
import RuoYiGit from "@/components/RuoYi/Git";
import RuoYiDoc from "@/components/RuoYi/Doc";
import HeaderNotice from "./HeaderNotice";
import SystemSettingDialog from "./SystemSettingDialog";
import AboutDialog from "./AboutDialog";
1 month ago
export default {
components: {
Breadcrumb,
Logo,
TopNav,
TopBar,
Hamburger,
Screenfull,
SizeSelect,
Search,
RuoYiGit,
RuoYiDoc,
HeaderNotice,
SystemSettingDialog,
AboutDialog,
},
data() {
return {
showSystemSetting: false,
showAbout: false,
};
1 month ago
},
computed: {
...mapGetters(["sidebar", "avatar", "device", "nickName"]),
1 month ago
setting: {
get() {
return this.$store.state.settings.showSettings;
},
1 month ago
},
navType: {
get() {
return this.$store.state.settings.navType;
},
1 month ago
},
showLogo: {
get() {
return this.$store.state.settings.sidebarLogo;
},
},
1 month ago
},
methods: {
toggleSideBar() {
this.$store.dispatch("app/toggleSideBar");
1 month ago
},
setLayout(event) {
this.$emit("setLayout");
1 month ago
},
lockScreen() {
const currentPath = this.$route.fullPath;
this.$store.dispatch("lock/lockScreen", currentPath).then(() => {
this.$router.push("/lock");
});
1 month ago
},
switchAccount() {
this.$confirm("确定要切换账号吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
});
})
.catch(() => {});
},
1 month ago
logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
});
1 month ago
})
.catch(() => {});
},
},
};
1 month ago
</script>
<style lang="scss" scoped>
.navbar.nav3 {
.hamburger-container {
display: none !important;
}
}
.navbar {
height: 50px;
overflow: hidden;
position: relative;
background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
1 month ago
display: flex;
align-items: center;
// padding: 0 8px;
box-sizing: border-box;
.hamburger-container {
line-height: 46px;
height: 100%;
cursor: pointer;
transition: background 0.3s;
-webkit-tap-highlight-color: transparent;
1 month ago
display: flex;
align-items: center;
flex-shrink: 0;
margin-right: 8px;
&:hover {
background: rgba(0, 0, 0, 0.025);
1 month ago
}
}
.breadcrumb-container {
flex-shrink: 0;
}
.topmenu-container {
position: absolute;
left: 50px;
}
.topbar-container {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
overflow: hidden;
margin-left: 8px;
}
.right-menu {
height: 100%;
line-height: 50px;
display: flex;
align-items: center;
margin-left: auto;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
padding: 0 8px;
height: 100%;
font-size: 18px;
color: #5a5e66;
vertical-align: text-bottom;
&.hover-effect {
cursor: pointer;
transition: background 0.3s;
1 month ago
&:hover {
background: rgba(0, 0, 0, 0.025);
1 month ago
}
}
}
.avatar-container {
margin-right: 0px;
padding-right: 0px;
.avatar-wrapper {
margin-top: 10px;
right: 8px;
position: relative;
.user-avatar {
cursor: pointer;
width: 30px;
height: 30px;
border-radius: 50%;
}
.user-nickname {
1 month ago
position: relative;
bottom: 10px;
left: 2px;
font-size: 14px;
font-weight: bold;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 25px;
font-size: 12px;
}
}
}
}
}
</style>