Former-commit-id: e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly 5793d72d458b7eeaf28a097d026168cebc9fc256 [formerly 9c8de3644bd40a55711e618742e29cce390e4c5f]]]]]
Former-commit-id: 05ca3c8da65f8583c142720628aa6ea71d2dbf45
Former-commit-id: 7a4d2fba696e901db86071ea2810e9c932c976ad
Former-commit-id: c18d3689200ca0e528fbf9bf171f6e1b50131bc3 [formerly 455e9952ca890cd8ad882250cfb9eabd944d44ee]
Former-commit-id: 021fa8191681fe4f22e9a9f40389831a847e9066
Former-commit-id: 1022b7792417ce366901b9d5284762a015dd6d26
Former-commit-id: bed799410be508713cac76b7c8cf02d4457fe996
Former-commit-id: f6787cfaac3404132ad1011e2707e08484708ca9
Former-commit-id: 7a8a3baca9ef30393744fd56def6d608b51dcddd
This commit is contained in:
liyang
2018-07-16 10:43:14 +08:00
parent c53973a35f
commit 1d310c9c7d
496 changed files with 3 additions and 23673 deletions

View File

@@ -1,106 +0,0 @@
<template>
<div
class="d2-layout-main-group"
:style="styleLayoutMainGroup"
:class="{grayMode: isGrayMode}">
<!-- 半透明遮罩 -->
<div class="d2-layout-main-mask"></div>
<!-- 主体内容 -->
<div class="d2-layout-main-content">
<!-- 顶栏 -->
<div class="d2-theme-header">
<div class="logo-group" :style="{width: collapse ? asideWidthCollapse : asideWidth}">
<img v-if="collapse" :src="`${$assetsPublicPath}static/image/theme/${themeActiveSetting.name}/logo/icon-only.png`">
<img v-else :src="`${$assetsPublicPath}static/image/theme/${themeActiveSetting.name}/logo/all.png`">
</div>
<div class="toggle-aside-btn" @click="collapse = !collapse">
<d2-icon name="bars"/>
</div>
<d2-layout-main-menu-header/>
<!-- 顶栏右侧 -->
<div class="d2-header-right">
<d2-layout-main-header-github/>
<d2-layout-main-header-help/>
<d2-layout-main-header-full-screen/>
<d2-layout-main-header-theme/>
<d2-layout-main-header-user/>
</div>
</div>
<!-- 下面 主体 -->
<div class="d2-theme-container">
<!-- 主体 侧边栏 -->
<div ref="aside" class="d2-theme-container-aside" :style="{width: collapse ? asideWidthCollapse : asideWidth}">
<d2-layout-main-menu-side :collapse="collapse"/>
</div>
<!-- 主体 -->
<div class="d2-theme-container-main">
<div class="d2-theme-container-main-header">
<d2-multiple-page-control/>
</div>
<div class="d2-theme-container-main-body">
<transition name="fade-transverse">
<keep-alive :include="keepAliveList">
<router-view/>
</keep-alive>
</transition>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState, mapGetters } from 'vuex'
export default {
name: 'd2-layout-main',
components: {
'd2-layout-main-menu-side': () => import('./components/-menu-side'),
'd2-layout-main-menu-header': () => import('./components/-menu-header'),
'd2-layout-main-header-full-screen': () => import('./components/-full-screen'),
'd2-layout-main-header-theme': () => import('./components/-theme'),
'd2-layout-main-header-user': () => import('./components/-user'),
'd2-layout-main-header-help': () => import('./components/-help'),
'd2-layout-main-header-github': () => import('./components/-github')
},
data () {
return {
collapse: false,
// [侧边栏宽度] 正常状态
asideWidth: '200px',
// [侧边栏宽度] 折叠状态
asideWidthCollapse: '65px'
}
},
computed: {
...mapState({
isGrayMode: state => state.d2admin.isGrayMode,
pageOpenedList: state => state.d2admin.pageOpenedList
}),
...mapGetters([
'themeActiveSetting'
]),
/**
* @description 返回现在需要缓存的页面 name
*/
keepAliveList () {
return this.pageOpenedList.filter(item => !(item.meta && item.meta.notCache)).map(e => e.name)
},
/**
* @description 最外层容器的背景图片样式
*/
styleLayoutMainGroup () {
return {
...this.themeActiveSetting.backgroundImage ? {
backgroundImage: `url('${this.$assetsPublicPath}${this.themeActiveSetting.backgroundImage}')`
} : {}
}
}
}
}
</script>
<style lang="scss">
// 注册主题
@import '~@/assets/style/theme/register.scss';
</style>