| | |
| | | <template> |
| | | <div class="navbar"> |
| | | <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> |
| | | <!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> --> |
| | | <div class="title">通信电源监控主站测控系统</div> |
| | | <div class="info"> |
| | | <!-- 左边 --> |
| | | <div class="left"> |
| | | <div class="box"> |
| | | 分闸开关 |
| | | <div class="num">12</div> |
| | | </div> |
| | | <div class="box">合闸开关<div class="num">22</div></div> |
| | | </div> |
| | | <!-- 右边 --> |
| | | <div class="right"> |
| | | <div class="box"> |
| | | 开关告警数 |
| | | <div class="num">4</div> |
| | | </div> |
| | | <div class="box"> |
| | | 跳闸开关 |
| | | <div class="num">12</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="right-menu"> |
| | | <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover"> |
| | | <el-dropdown |
| | | class="avatar-container right-menu-item hover-effect" |
| | | trigger="hover" |
| | | > |
| | | <div class="avatar-wrapper"> |
| | | <span class="user-name">{{ name }}</span> |
| | | <i class="el-icon-caret-bottom" /> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item @click.native="changePwd"> |
| | | <span style="display:block;">修改密码</span> |
| | | <span style="display: block">修改密码</span> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item @click.native="logout"> |
| | | <span style="display:block;">退出登录</span> |
| | | <span style="display: block">退出登录</span> |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </div> |
| | | <!-- 密码修改 --> |
| | | <el-dialog |
| | | <!-- 密码修改 --> |
| | | <el-dialog |
| | | title="密码修改" |
| | | width="400px" |
| | | :visible.sync="changePwdVisible" |
| | |
| | | class="dialog-center" |
| | | :modal-append-to-body="false" |
| | | > |
| | | <pwd-change v-if="changePwdVisible" :visible.sync="changePwdVisible"></pwd-change> |
| | | </el-dialog> |
| | | <pwd-change |
| | | v-if="changePwdVisible" |
| | | :visible.sync="changePwdVisible" |
| | | ></pwd-change> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import Hamburger from '@/components/Hamburger' |
| | | import { mapGetters } from "vuex"; |
| | | // import Hamburger from '@/components/Hamburger' |
| | | import PwdChange from "./PwdChange"; |
| | | export default { |
| | | components: { |
| | | Hamburger, |
| | | // Hamburger, |
| | | PwdChange, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'sidebar', |
| | | 'avatar', |
| | | 'device', |
| | | 'name', |
| | | ]) |
| | | ...mapGetters(["sidebar", "avatar", "device", "name"]), |
| | | }, |
| | | data() { |
| | | return { |
| | | changePwdVisible: false, |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | changePwd() { |
| | | this.changePwdVisible = true; |
| | | }, |
| | | toggleSideBar() { |
| | | this.$store.dispatch('app/toggleSideBar') |
| | | this.$store.dispatch("app/toggleSideBar"); |
| | | }, |
| | | async logout() { |
| | | await this.$store.dispatch('user/logout') |
| | | this.$router.push(`/login?redirect=${this.$route.fullPath}`) |
| | | } |
| | | } |
| | | } |
| | | await this.$store.dispatch("user/logout"); |
| | | this.$router.push(`/login?redirect=${this.$route.fullPath}`); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .navbar { |
| | | height: 50px; |
| | | height: 104px; |
| | | overflow: hidden; |
| | | position: relative; |
| | | background: #fff; |
| | | box-shadow: 0 1px 4px rgba(0,21,41,.08); |
| | | |
| | | color: #fff; |
| | | background: #011f39 url("images/header-bg.png") 50% 50% / auto 100% no-repeat; |
| | | box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); |
| | | .title { |
| | | font-size: 34px; |
| | | font-weight: bold; |
| | | text-align: center; |
| | | line-height: 76px; |
| | | letter-spacing: 6px; |
| | | } |
| | | .info { |
| | | position: absolute; |
| | | left: 0; |
| | | right: 0; |
| | | top: 30px; |
| | | bottom: 0; |
| | | display: flex; |
| | | .left, |
| | | .right { |
| | | width: 50%; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | .left { |
| | | // padding-right: 380px; |
| | | padding-right: 264px; |
| | | } |
| | | .right { |
| | | padding-left: 264px; |
| | | } |
| | | .box { |
| | | display: inline-block; |
| | | width: 160px; |
| | | height: 40px; |
| | | line-height: 38px; |
| | | font-size: 16px; |
| | | border: 1px #5ec7d4 solid; |
| | | border-radius: 10px; |
| | | text-align: center; |
| | | .num { |
| | | display: inline-block; |
| | | height: 36px; |
| | | min-width: 36px; |
| | | padding: 6px; |
| | | background: #78eef8; |
| | | margin-top: 1px; |
| | | line-height: 24px; |
| | | border-radius: 18px; |
| | | color: #011f39; |
| | | margin-left: 1.2em; |
| | | } |
| | | & + .box { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | .hamburger-container { |
| | | line-height: 46px; |
| | | height: 100%; |
| | | float: left; |
| | | cursor: pointer; |
| | | transition: background .3s; |
| | | -webkit-tap-highlight-color:transparent; |
| | | transition: background 0.3s; |
| | | -webkit-tap-highlight-color: transparent; |
| | | |
| | | &:hover { |
| | | background: rgba(0, 0, 0, .025) |
| | | background: rgba(0, 0, 0, 0.025); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .right-menu { |
| | | float: right; |
| | | position: absolute; |
| | | right: 0; |
| | | top: 0; |
| | | height: 100%; |
| | | line-height: 50px; |
| | | |
| | | padding-top: 40px; |
| | | &:focus { |
| | | outline: none; |
| | | } |
| | |
| | | padding: 0 8px; |
| | | height: 100%; |
| | | font-size: 18px; |
| | | color: #5a5e66; |
| | | color: #fff; |
| | | vertical-align: text-bottom; |
| | | |
| | | &.hover-effect { |
| | | cursor: pointer; |
| | | transition: background .3s; |
| | | transition: background 0.3s; |
| | | |
| | | &:hover { |
| | | background: rgba(0, 0, 0, .025) |
| | | background: rgba(0, 0, 0, 0.025); |
| | | } |
| | | } |
| | | } |