123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <template>
- <div class="navbar">
- <!-- <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> -->
- <!-- <breadcrumb class="breadcrumb-container" /> -->
- <div class="navbar_top">
- <div class="nav_left">
- <div class="log_icon">
- <img src="../../assets/logo/pic_logo_top.png" />
- </div>
- <div class="dividing"></div>
- <div class="log_name">国航行李数据整合及应用</div>
- </div>
- <div class="right-menu">
- <el-dropdown>
- <div class="user">
- <img
- class="head-icon-img"
- src="../../assets/status/ic_user.png"
- alt=""
- />
- <span class="name">{{ name }}</span>
- <i class="el-icon-arrow-down el-icon--right"></i>
- </div>
- <el-dropdown-menu
- class="handleMsgMneu"
- slot="dropdown"
- >
- <el-dropdown-item v-if="name != '匿名用户'">
- <span
- class="editPwd"
- @click="dialogPwd"
- >修改密码</span>
- </el-dropdown-item>
- <el-dropdown-item>
- <span
- @click="exitDialog"
- class="layoutSys"
- >退出登录</span>
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-button
- @click="downFile"
- class="btn-help"
- plain
- >帮助</el-button>
- <!-- <div class="seting">
- <span @click="toSystem" class="img-icon"></span>
- </div> -->
- <!-- <div class="lock">
- <span @click="dialogPwd" class="img-icon"></span>
- </div>
- <div class="exit">
- <span @click="exitDialog" class="img-icon"></span>
- </div> -->
- </div>
- </div>
- <div
- class="navbar_lower"
- id="navbar_lowers"
- >
- <el-breadcrumb separator-class="el-icon-arrow-right">
- <el-breadcrumb-item
- v-for="(item, index) in breadList"
- :key="index"
- :to="index < breadList.length -1 ? item.path : undefined"
- >
- <span
- v-if="withButtonBack(item, index)"
- is="router-link"
- class="btn-back"
- :to="goBackHandler(item)"
- ><i class="el-icon-arrow-left" />返回</span>
- <span>{{ item.meta.title }}</span>
- </el-breadcrumb-item>
- </el-breadcrumb>
- <!-- <tags-view /> -->
- <div class="newdata">{{ newData }}</div>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import Breadcrumb from '@/components/Breadcrumb'
- import Hamburger from '@/components/Hamburger'
- // import { Format } from "../../config/util";
- import { timeInZone } from '@/utils/table'
- // import TagsView from "./TagsView";
- export default {
- props: ['logstart'],
- data() {
- return {
- newData: '',
- breadList: this.getBreadcrumb(),
- getTimeInterval: null
- }
- },
- components: {
- Breadcrumb,
- Hamburger
- // TagsView,
- },
- watch: {
- $route(val) {
- this.breadList = this.getBreadcrumb()
- }
- },
- computed: {
- ...mapGetters(['sidebar', 'avatar', 'name', 'timeZone'])
- },
- mounted() {
- this.getTimeInterval = setInterval(() => {
- // this.newData = Format("yyyy/MM/dd hh:mm:ss", new Date());
- this.newData = timeInZone(new Date(), this.timeZone).replaceAll('-', '/')
- })
- },
- beforeDestroy() {
- this.getTimeInterval && clearInterval(this.getTimeInterval)
- this.getTimeInterval = null
- },
- methods: {
- toggleSideBar() {
- this.$store.dispatch('app/toggleSideBar')
- },
- async logout() {
- await this.$store.dispatch('user/logout')
- this.$router.push(`/login?redirect=${this.$route.fullPath}`)
- },
- getBreadcrumb() {
- return this.$route.matched.filter(item => item.name && item.meta.title)
- },
- //修改密码
- dialogPwd() {
- this.$store.dispatch('app/togglePwdflag', true)
- },
- //退出系统-弹框
- exitDialog() {
- this.$store.dispatch('app/toggleOutflag', true)
- },
- //下载
- downFile() {
- const a = document.createElement('a')
- // 给a标签的href属性值加上地址,注意:这里是绝对路径,不用加 点.
- a.href = './国航行李整合及应用项目-用户使用手册V2.1.pdf'
- // 设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
- a.download = '国航行李整合及应用项目-用户使用手册V2.1.pdf'
- // 障眼法藏起来a标签
- a.style.display = 'none'
- // 将a标签追加到文档对象中
- document.body.appendChild(a)
- // 模拟点击了<a>标签,会触发<a>标签的href的读取,浏览器就会自动下载了
- a.click()
- // 一次性的,用完就删除a标签
- a.remove()
- // window.location.href = './国航行李整合及应用项目-用户使用手册V2.1.pdf'
- },
- withButtonBack(item, index) {
- if (['/systemSettings', '/BasicsData'].includes(this.$route.matched[0].path)) {
- return false
- }
- return (
- item.parent.path !== item.path &&
- !item.parent.redirect &&
- index > 0 &&
- index === this.breadList.length - 1
- )
- },
- goBackHandler(item) {
- return item.parent?.path
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .navbar {
- width: 100%;
- height: 80px;
- overflow: hidden;
- position: relative;
- background: #fff;
- position: fixed;
- top: 0;
- box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
- z-index: 999;
- ::v-deep .el-breadcrumb__separator {
- display: none;
- }
- ::v-deep .el-breadcrumb__inner {
- padding: 8px 31px 9px 31px;
- color: #afb4bf;
- }
- ::v-deep .el-breadcrumb__item:last-child {
- .el-breadcrumb__inner {
- padding: 8px 31px 9px 31px;
- background: #dfe3ea;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #101116;
- }
- }
- > .navbar_top {
- width: 100%;
- height: 48px;
- background: #2d67e3;
- display: flex;
- align-items: center;
- justify-content: space-between;
- // border-bottom: 1px solid #f2f6fc;
- padding-left: 14px;
- > .nav_left {
- height: 100%;
- display: flex;
- align-items: center;
- > .log_icon {
- width: 24px;
- height: 32px;
- border-radius: 50%;
- display: flex;
- align-items: center;
- > img {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- }
- }
- > .dividing {
- width: 1px;
- height: 16px;
- margin-left: 8px;
- margin-right: 12px;
- background: #ffffff;
- }
- > .log_name {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #ffffff;
- }
- }
- .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);
- }
- }
- .breadcrumb-container {
- float: left;
- }
- .right-menu {
- float: right;
- height: 100%;
- line-height: 48px;
- margin-right: 44px;
- display: flex;
- &:focus {
- outline: none;
- }
- > div {
- margin-right: 20px;
- }
- .img-icon {
- display: inline-block;
- width: 24px;
- height: 24px;
- vertical-align: middle;
- background-repeat: no-repeat;
- background-size: cover;
- cursor: pointer;
- transition: all 0.3s;
- }
- .lock {
- .img-icon {
- background-image: url('../../assets/status/ic_password.png');
- &:hover {
- background-image: url('../../assets/status/ic_password_hovar.png');
- }
- }
- }
- .exit {
- .img-icon {
- background-image: url('../../assets/status/ic_exit.png');
- &:hover {
- background-image: url('../../assets/status/ic_exit_hovar.png');
- }
- }
- }
- .btn-help {
- height: 20px;
- line-height: 20px;
- padding: 0;
- width: 38px;
- margin-top: 14px;
- border: 1px solid #fff;
- background: none;
- color: #fff;
- transition: all 0.3s;
- &:hover {
- background: #fff;
- color: #2d67e3;
- }
- }
- .user {
- img {
- position: relative;
- top: 6px;
- margin-right: 10px;
- }
- color: #fff;
- font-weight: 600;
- font-size: 16px;
- cursor: pointer;
- }
- > .right {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- padding-right: 80px;
- > .log {
- width: 40px;
- height: 40px;
- background: #e1e5eb;
- border-radius: 50%;
- margin-right: 16px;
- }
- > p {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 300;
- color: #303133;
- }
- }
- .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;
- &:hover {
- background: rgba(0, 0, 0, 0.025);
- }
- }
- }
- .avatar-container {
- margin-right: 30px;
- height: 100%;
- .avatar-wrapper {
- height: 100%;
- // margin-top: 5px;
- display: flex;
- align-items: center;
- position: relative;
- .search {
- width: 21px;
- height: 21px;
- background: url('../../assets/header/ic_search_top.png') no-repeat;
- background-size: 100% 100%;
- margin-top: 10px;
- margin-right: 41px;
- }
- .fullscreen {
- width: 21px;
- height: 21px;
- background: url('../../assets/header/ic_fullscreen_top.png') no-repeat;
- background-size: 100% 100%;
- margin-top: 10px;
- margin-right: 20px;
- }
- .journaler {
- width: 21px;
- height: 21px;
- background: url('../../assets/header/ic_data_top.png') no-repeat;
- background-size: 100% 100%;
- margin-top: 10px;
- margin-right: 41px;
- }
- .information {
- width: 21px;
- height: 21px;
- background: url('../../assets/header/ic_message_top.png') no-repeat;
- background-size: 100% 100%;
- margin-top: 10px;
- margin-right: 41px;
- position: relative;
- > .information_number {
- position: absolute;
- width: 15px;
- height: 15px;
- background: #ed5050;
- color: #ffffff;
- border-radius: 50%;
- top: -35%;
- right: -30%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 12px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- }
- }
- .user-avatar {
- cursor: pointer;
- width: 24px;
- height: 24px;
- border-radius: 50%;
- margin-right: 16px;
- }
- .username {
- // width: 200px;
- height: 40px;
- // margin-left: 5%;
- color: #ffffff;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- line-height: 40px;
- display: inline;
- }
- .el-icon-caret-bottom {
- cursor: pointer;
- position: absolute;
- right: -20px;
- top: 20px;
- font-size: 12px;
- }
- }
- }
- }
- }
- > .navbar_lower {
- width: 100%;
- height: 32px;
- display: flex;
- background: #ffffff;
- justify-content: space-between;
- align-items: center;
- padding-left: 48px;
- padding-right: 54px;
- ::v-deep .el-breadcrumb {
- font-size: 18px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- // color: #ffffff;
- .is-link {
- font-size: 14px !important;
- // color: #ffffff !important;
- }
- // .el-breadcrumb__item {
- // .el-breadcrumb__inner {
- // font-size: 14px;
- // color: #ffffff !important;
- // }
- // }
- // .is-link {
- // font-size: 14px;
- // color: #ffffff !important;
- // }
- .btn-back {
- margin-left: -18px;
- margin-right: 10px;
- font-size: 14px;
- color: #2d67e3;
- cursor: pointer;
- }
- }
- > .newdata {
- font-size: 14px;
- font-family: DIN;
- font-weight: bold;
- min-width: 200px;
- text-align: right;
- // color: #ffffff;
- }
- }
- }
- </style>
|