|
|
@ -1,28 +1,34 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="navbar">
|
|
|
|
<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"/>
|
|
|
|
|
|
|
|
|
|
|
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
|
|
|
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
|
|
|
|
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
|
|
|
|
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right-menu">
|
|
|
|
<div class="right-menu">
|
|
|
|
<template v-if="device!=='mobile'">
|
|
|
|
<el-badge :value="warnData.count" class=" hover-effect share-button">
|
|
|
|
<search id="header-search" class="right-menu-item" />
|
|
|
|
<el-button type="warning" icon="el-icon-check" circle style="max-width: 22px;max-height: 22px;"></el-button>
|
|
|
|
|
|
|
|
</el-badge>
|
|
|
|
|
|
|
|
|
|
|
|
<!--todo 右上角添加信息提示等功能-->
|
|
|
|
<template v-if="device!=='mobile'">
|
|
|
|
|
|
|
|
<search id="header-search" class="right-menu-item"/>
|
|
|
|
|
|
|
|
|
|
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
|
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
|
|
|
|
|
|
|
|
|
|
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
|
|
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
|
|
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
|
|
|
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
|
|
|
</el-tooltip>
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
|
|
|
<div class="avatar-wrapper">
|
|
|
|
<div class="avatar-wrapper">
|
|
|
|
<img :src="avatar" class="user-avatar">
|
|
|
|
<img :src="avatar" class="user-avatar">
|
|
|
|
<i class="el-icon-caret-bottom" />
|
|
|
|
<i class="el-icon-caret-bottom"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
<router-link to="/user/profile">
|
|
|
|
<router-link to="/user/profile">
|
|
|
@ -41,7 +47,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
import {mapGetters} from 'vuex'
|
|
|
|
import Breadcrumb from '@/components/Breadcrumb'
|
|
|
|
import Breadcrumb from '@/components/Breadcrumb'
|
|
|
|
import TopNav from '@/components/TopNav'
|
|
|
|
import TopNav from '@/components/TopNav'
|
|
|
|
import Hamburger from '@/components/Hamburger'
|
|
|
|
import Hamburger from '@/components/Hamburger'
|
|
|
@ -62,11 +68,19 @@ export default {
|
|
|
|
RuoYiGit,
|
|
|
|
RuoYiGit,
|
|
|
|
RuoYiDoc
|
|
|
|
RuoYiDoc
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
warnData: {},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
...mapGetters([
|
|
|
|
...mapGetters([
|
|
|
|
'sidebar',
|
|
|
|
'sidebar',
|
|
|
|
'avatar',
|
|
|
|
'avatar',
|
|
|
|
'device'
|
|
|
|
'device',
|
|
|
|
|
|
|
|
"$socket",
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
setting: {
|
|
|
|
setting: {
|
|
|
|
get() {
|
|
|
|
get() {
|
|
|
@ -85,7 +99,21 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
this.$socket.registerCallBack(
|
|
|
|
|
|
|
|
"apiWarning",
|
|
|
|
|
|
|
|
this.getData
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
getData(data) {
|
|
|
|
|
|
|
|
if (data) {
|
|
|
|
|
|
|
|
this.warnData = data
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
toggleSideBar() {
|
|
|
|
toggleSideBar() {
|
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -98,19 +126,41 @@ export default {
|
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
|
location.href = '/index';
|
|
|
|
location.href = '/index';
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
|
|
|
// 在组件销毁的时候, 进行回调函数的取消
|
|
|
|
|
|
|
|
this.$socket.unRegisterCallBack();
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
.share-button {
|
|
|
|
|
|
|
|
margin-right: 23px;
|
|
|
|
|
|
|
|
color: #5a5e66;
|
|
|
|
|
|
|
|
padding-bottom: 22px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&.hover-effect {
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
transition: background .3s;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
|
|
background: rgba(0, 0, 0, .025)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.navbar {
|
|
|
|
.navbar {
|
|
|
|
height: 50px;
|
|
|
|
height: 50px;
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
background: #fff;
|
|
|
|
background: #fff;
|
|
|
|
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
|
|
|
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
|
|
|
|
|
|
|
|
|
|
|
.hamburger-container {
|
|
|
|
.hamburger-container {
|
|
|
|
line-height: 46px;
|
|
|
|
line-height: 46px;
|
|
|
@ -118,7 +168,7 @@ export default {
|
|
|
|
float: left;
|
|
|
|
float: left;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: background .3s;
|
|
|
|
transition: background .3s;
|
|
|
|
-webkit-tap-highlight-color:transparent;
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
&:hover {
|
|
|
|
background: rgba(0, 0, 0, .025)
|
|
|
|
background: rgba(0, 0, 0, .025)
|
|
|
|