|
|
|
@ -1,16 +1,16 @@ |
|
|
|
|
<template> |
|
|
|
|
<a-layout-header :class="[theme, 'global-header']"> |
|
|
|
|
<a-layout-header :class="[headerTheme, 'global-header']"> |
|
|
|
|
<div :class="['global-header-wide', layout]"> |
|
|
|
|
<router-link v-if="isMobile || layout === 'head'" to="/" :class="['logo', isMobile ? null : 'pc', theme]"> |
|
|
|
|
<router-link v-if="isMobile || layout === 'head'" to="/" :class="['logo', isMobile ? null : 'pc', headerTheme]"> |
|
|
|
|
<img width="32" src="@/assets/img/vue-antd-logo.png" /> |
|
|
|
|
<h1 v-if="!isMobile">{{systemName}}</h1> |
|
|
|
|
</router-link> |
|
|
|
|
<a-divider v-if="isMobile" type="vertical" /> |
|
|
|
|
<a-icon v-if="layout === 'side'" class="trigger" :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="toggleCollapse"/> |
|
|
|
|
<div v-if="layout === 'head'" class="global-header-menu"> |
|
|
|
|
<i-menu style="height: 64px; line-height: 64px;" :theme="theme" mode="horizontal" :menuData="menuData" @select="onSelect"/> |
|
|
|
|
<div v-if="layout == 'head' && !isMobile" class="global-header-menu"> |
|
|
|
|
<i-menu style="height: 64px; line-height: 64px;" :theme="headerTheme" mode="horizontal" :menuData="menuData" @select="onSelect"/> |
|
|
|
|
</div> |
|
|
|
|
<div :class="['global-header-right', theme]"> |
|
|
|
|
<div :class="['global-header-right', headerTheme]"> |
|
|
|
|
<header-search class="header-item" /> |
|
|
|
|
<a-tooltip class="header-item" title="帮助文档" placement="bottom" > |
|
|
|
|
<a> |
|
|
|
@ -29,23 +29,21 @@ import HeaderSearch from './HeaderSearch' |
|
|
|
|
import HeaderNotice from './HeaderNotice' |
|
|
|
|
import HeaderAvatar from './HeaderlAvatar' |
|
|
|
|
import IMenu from '../components/menu/menu' |
|
|
|
|
import {mapState} from 'vuex' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'GlobalHeader', |
|
|
|
|
components: {IMenu, HeaderAvatar, HeaderNotice, HeaderSearch}, |
|
|
|
|
props: ['collapsed', 'menuData'], |
|
|
|
|
computed: { |
|
|
|
|
isMobile () { |
|
|
|
|
return this.$store.state.setting.isMobile |
|
|
|
|
}, |
|
|
|
|
layout () { |
|
|
|
|
return this.$store.state.setting.layout |
|
|
|
|
}, |
|
|
|
|
theme () { |
|
|
|
|
return this.layout === 'side' ? 'light' : this.$store.state.setting.theme |
|
|
|
|
provide() { |
|
|
|
|
return { |
|
|
|
|
headerTheme: this.theme |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
systemName () { |
|
|
|
|
return this.$store.state.setting.systemName |
|
|
|
|
computed: { |
|
|
|
|
...mapState('setting', ['theme', 'isMobile', 'layout', 'systemName']), |
|
|
|
|
headerTheme () { |
|
|
|
|
return (this.layout == 'side' && !this.isMobile) ? 'light' : this.theme |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -85,13 +83,16 @@ export default { |
|
|
|
|
padding: 0 12px 0 0; |
|
|
|
|
-webkit-box-shadow: 0 1px 4px rgba(0,21,41,.08); |
|
|
|
|
box-shadow: 0 1px 4px rgba(0,21,41,.08); |
|
|
|
|
z-index: 99; |
|
|
|
|
z-index: 1; |
|
|
|
|
position: relative; |
|
|
|
|
&.light{ |
|
|
|
|
background: #fff; |
|
|
|
|
} |
|
|
|
|
&.dark{ |
|
|
|
|
background: #001529; |
|
|
|
|
.trigger{ |
|
|
|
|
color: white; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.global-header-wide{ |
|
|
|
|
&.head{ |
|
|
|
|