Former-commit-id: 91b17091a32da83c7b6f4a841254c43ab99cf3b6 [formerly 91b17091a32da83c7b6f4a841254c43ab99cf3b6 [formerly 91b17091a32da83c7b6f4a841254c43ab99cf3b6 [formerly 91b17091a32da83c7b6f4a841254c43ab99cf3b6 [formerly 135e93e3549d69630666df33d428be7bfad7d842 [formerly 5e67f104fc85975e3798b29cc3f5d63b89fb5b66]]]]] Former-commit-id: 372fd07cec15587021d0c5b92d356ec0e9b77202 Former-commit-id: 2dc09ebb6093d39f9cb920dfcf5c3a1b2876ef8c Former-commit-id: 7226698acf4f091f5d90fea8f0fc8c2a0620c0c1 [formerly 54bd739eaa4ab7a0c6bc730c7400a1a810d38282] Former-commit-id: 8675cb5f5dc9172606fbda4c02fa4f1f0eb9d285 Former-commit-id: 9a18568786d319d82b25e5be8080890a1b56156e Former-commit-id: 967c189a8b16d92ed1348a56e60405b2231fae58 Former-commit-id: 24b7c93933ffafe6b44573dd12bf921a97bc33ef Former-commit-id: 273fc2943892dfa469131919d123869e6e3a2e68
118 lines
3.7 KiB
Vue
118 lines
3.7 KiB
Vue
<template>
|
|
<div
|
|
class="d2-layout-header-aside-group"
|
|
:style="styleLayoutMainGroup"
|
|
:class="{grayMode: grayActive}">
|
|
<!-- 半透明遮罩 -->
|
|
<div class="d2-layout-header-aside-mask"></div>
|
|
<!-- 主体内容 -->
|
|
<div class="d2-layout-header-aside-content" flex="dir:top">
|
|
<!-- 顶栏 -->
|
|
<div class="d2-theme-header" flex-box="0">
|
|
<div class="logo-group" :style="{width: asideCollapse ? asideWidthCollapse : asideWidth}">
|
|
<img v-if="asideCollapse" :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/icon-only.png`">
|
|
<img v-else :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/all.png`">
|
|
</div>
|
|
<div class="toggle-aside-btn" @click="handleToggleAside">
|
|
<d2-icon name="bars"/>
|
|
</div>
|
|
<d2-menu-header/>
|
|
<!-- 顶栏右侧 -->
|
|
<div class="d2-header-right">
|
|
<!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" -->
|
|
<d2-header-error-log/>
|
|
<d2-header-help/>
|
|
<d2-header-fullscreen/>
|
|
<d2-header-theme/>
|
|
<d2-header-user/>
|
|
</div>
|
|
</div>
|
|
<!-- 下面 主体 -->
|
|
<div class="d2-theme-container" flex-box="1" flex>
|
|
<!-- 主体 侧边栏 -->
|
|
<div
|
|
flex-box="0"
|
|
ref="aside"
|
|
class="d2-theme-container-aside"
|
|
:style="{width: asideCollapse ? asideWidthCollapse : asideWidth}">
|
|
<d2-menu-side/>
|
|
</div>
|
|
<!-- 主体 -->
|
|
<div class="d2-theme-container-main" flex-box="1" flex="dir:top">
|
|
<div class="d2-theme-container-main-header" flex-box="0">
|
|
<d2-tabs/>
|
|
</div>
|
|
<div class="d2-theme-container-main-body" flex-box="1">
|
|
<transition name="fade-transverse">
|
|
<keep-alive :include="keepAliveInclude">
|
|
<router-view/>
|
|
</keep-alive>
|
|
</transition>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapState, mapGetters, mapMutations } from 'vuex'
|
|
export default {
|
|
name: 'd2-layout-header-aside',
|
|
components: {
|
|
'd2-menu-side': () => import('./components/menu-side'),
|
|
'd2-menu-header': () => import('./components/menu-header'),
|
|
'd2-tabs': () => import('./components/tabs'),
|
|
'd2-header-fullscreen': () => import('./components/header-fullscreen'),
|
|
'd2-header-theme': () => import('./components/header-theme'),
|
|
'd2-header-user': () => import('./components/header-user'),
|
|
'd2-header-help': () => import('./components/header-help'),
|
|
'd2-header-error-log': () => import('./components/header-error-log')
|
|
},
|
|
data () {
|
|
return {
|
|
// [侧边栏宽度] 正常状态
|
|
asideWidth: '200px',
|
|
// [侧边栏宽度] 折叠状态
|
|
asideWidthCollapse: '65px'
|
|
}
|
|
},
|
|
computed: {
|
|
...mapState('d2admin', {
|
|
grayActive: state => state.gray.active,
|
|
asideCollapse: state => state.menu.asideCollapse
|
|
}),
|
|
...mapGetters('d2admin', {
|
|
keepAliveInclude: 'keepAliveInclude',
|
|
themeActiveSetting: 'theme/activeSetting'
|
|
}),
|
|
/**
|
|
* @description 最外层容器的背景图片样式
|
|
*/
|
|
styleLayoutMainGroup () {
|
|
return {
|
|
...this.themeActiveSetting.backgroundImage ? {
|
|
backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`
|
|
} : {}
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
...mapMutations('d2admin/menu', [
|
|
'asideCollapseToggle'
|
|
]),
|
|
/**
|
|
* 接收点击切换侧边栏的按钮
|
|
*/
|
|
handleToggleAside () {
|
|
this.asideCollapseToggle()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
// 注册主题
|
|
@import '~@/assets/style/theme/register.scss';
|
|
</style>
|