theme 模块

Former-commit-id: 5a60f7a68cfa3c9effbf33aee1a0bf606cb7a045 [formerly 5a60f7a68cfa3c9effbf33aee1a0bf606cb7a045 [formerly 5a60f7a68cfa3c9effbf33aee1a0bf606cb7a045 [formerly 5a60f7a68cfa3c9effbf33aee1a0bf606cb7a045 [formerly afdd5cb7b4d018f68b61257181f089438a12fa44 [formerly 6fdb6e759e339cd17c8d76d09d50b902fce8b74d]]]]]
Former-commit-id: 6e388aa8ce29cec9d8901ed1b11d8fe11a0cf2d4
Former-commit-id: c6c36e452f960cb9b24d73d65b28907e40c621b4
Former-commit-id: 7685d8e053d9f26643092bf32e74844d6cf89446 [formerly 8cfb43881c4ed2ac4facf1bd95ff6ac901dc41ba]
Former-commit-id: 8493ae32e3635ee733b09d558eb9049154883ebf
Former-commit-id: 728960b5d4f3ebf00130d78edb964beb3321fe59
Former-commit-id: 978d3701efedbcce3d5c694eaed1d34537cdf561
Former-commit-id: 4fd5476f29dd398a103a12d0f820e4d70750c97d
Former-commit-id: 2580f2041c87b19410c4bff2a99ec6a94727e766
This commit is contained in:
liyang
2018-08-08 22:30:56 +08:00
parent 9f06cd2c6f
commit b793604445
8 changed files with 124 additions and 35 deletions

View File

@@ -7,7 +7,10 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">顶栏菜单数据</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="menuHeader" :options="{ rootObjectKey: 'menuHeader', maxDepth: 2 }"/>
<tree-view
class="tree-view-small"
:data="menuHeader"
:options="{ rootObjectKey: 'menuHeader', maxDepth: 2 }"/>
</div>
</el-card>
</el-col>
@@ -15,7 +18,10 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">侧边栏菜单数据</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="menuAside" :options="{ rootObjectKey: 'menuAside', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="menuAside"
:options="{ rootObjectKey: 'menuAside', maxDepth: 1 }"/>
</div>
</el-card>
</el-col>
@@ -53,7 +59,10 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">已经注册的主题</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="themeList" :options="{ rootObjectKey: 'themeList', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="themeList"
:options="{ rootObjectKey: 'themeList', maxDepth: 1 }"/>
</div>
</el-card>
</el-col>
@@ -61,7 +70,10 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">当前主题信息</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="themeActiveSetting" :options="{ rootObjectKey: 'themeActiveSetting', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="themeActiveSetting"
:options="{ rootObjectKey: 'themeActiveSetting', maxDepth: 1 }"/>
</div>
</el-card>
</el-col>
@@ -75,7 +87,10 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">支持多页显示的页面列表</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="pagePool" :options="{ rootObjectKey: 'pagePool', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="pagePool"
:options="{ rootObjectKey: 'pagePool', maxDepth: 1 }"/>
</div>
</el-card>
</el-col>
@@ -83,7 +98,10 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">打开的标签页</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="pageOpenedList" :options="{ rootObjectKey: 'pageOpenedList', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="pageOpenedList"
:options="{ rootObjectKey: 'pageOpenedList', maxDepth: 1 }"/>
</div>
</el-card>
</el-col>
@@ -91,14 +109,20 @@
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">缓存页面</template>
<div style="height: 300px; overflow: auto;">
<tree-view class="tree-view-small" :data="keepAliveInclude" :options="{ rootObjectKey: 'keepAliveInclude', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="keepAliveInclude"
:options="{ rootObjectKey: 'keepAliveInclude', maxDepth: 1 }"/>
</div>
</el-card>
</el-col>
</el-row>
<el-card shadow="never" class="d2-card d2-mb">
<template slot="header">最新版本数据 [ {{releasesUpdate ? '有新版本' : '已经是最新版本'}} ]</template>
<tree-view class="tree-view-small" :data="releasesLatest" :options="{ rootObjectKey: 'releasesLatest', maxDepth: 1 }"/>
<tree-view
class="tree-view-small"
:data="releasesLatest"
:options="{ rootObjectKey: 'releasesLatest', maxDepth: 1 }"/>
</el-card>
</div>
</d2-container>
@@ -118,22 +142,25 @@ export default {
// 菜单
menuHeader: state => state.menu.header,
menuAside: state => state.menu.aside,
menuAsideCollapse: state => state.menu.asideCollapse
menuAsideCollapse: state => state.menu.asideCollapse,
// 主题
themeList: state => state.theme.list,
themeActiveName: state => state.theme.activeName
}),
...mapState('d2admin', [
'isFullScreen',
'isGrayMode',
'themeList',
'themeActiveName',
'pagePool',
'pageOpenedList',
'pageCurrent',
'ua'
]),
...mapGetters('d2admin', [
'themeActiveSetting',
'keepAliveInclude'
])
]),
...mapGetters('d2admin/theme', {
themeActiveSetting: 'activeSetting'
})
}
}
</script>

View File

@@ -1,7 +1,7 @@
<template>
<d2-container type="card" class="page">
<template slot="header">主题</template>
<el-table :data="themeList" v-bind="table">
<el-table :data="list" v-bind="table">
<el-table-column prop="name" align="center" width="260"/>
<el-table-column label="预览" width="120">
<div
@@ -12,7 +12,7 @@
</el-table-column>
<el-table-column prop="address" align="center">
<template slot-scope="scope">
<el-button v-if="themeActiveName === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button>
<el-button v-if="activeName === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button>
<el-button v-else round @click="handleSelectTheme(scope.row.name)">使用</el-button>
</template>
</el-table-column>
@@ -25,7 +25,7 @@
</el-button>
</div>
<template slot="footer">
<el-button type="primary" size="small">当前激活主题 {{themeActiveName}}</el-button>
<el-button type="primary" size="small">当前激活主题 {{activeName}}</el-button>
</template>
</d2-container>
</template>
@@ -42,17 +42,17 @@ export default {
}
},
computed: {
...mapState('d2admin', [
'themeList',
'themeActiveName'
...mapState('d2admin/theme', [
'list',
'activeName'
])
},
methods: {
...mapMutations('d2admin', [
'themeSet'
...mapMutations('d2admin/theme', [
'set'
]),
handleSelectTheme (name) {
this.themeSet(name)
this.set(name)
}
}
}