优化
Former-commit-id: 4d3b3dba4b787cc551e868f564481a9c9d1005cd [formerly 4d3b3dba4b787cc551e868f564481a9c9d1005cd [formerly 4d3b3dba4b787cc551e868f564481a9c9d1005cd [formerly 4d3b3dba4b787cc551e868f564481a9c9d1005cd [formerly a1bee0a09872436a8178d2f3ff28dfcfa1334527 [formerly 165ed9ed5023c54e8b77aaad78d2a08dab1850a7]]]]] Former-commit-id: 6b575639a46cc5b724f1a86715d5d94419dbb38b Former-commit-id: 6e277e97e0ccea94986808b8bcaa49c4e31735a9 Former-commit-id: 3df022a4669e4f8d8e92e548de06d5a5aa793b07 [formerly a28d57f91d62a7f34fdd1861ddaee196f9951596] Former-commit-id: b6878bde8a3b1b90f63ad788741593a70dfb2e13 Former-commit-id: 4ee5dbc6e4a8ed07b4f6bb0ec4a91b94242bcab1 Former-commit-id: 2c886cd2db7924007a8b70089da78bea41996ae7 Former-commit-id: 2fb2dee79878ab07bb821549dd78ce6a80a6d975 Former-commit-id: 6b5b3c21ff34740bc59f760ea6c7f181d1526501
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"dist": true,
|
"dist": true
|
||||||
"node_modules": true
|
|
||||||
},
|
},
|
||||||
"todo-tree.expanded": false
|
"todo-tree.expanded": false
|
||||||
}
|
}
|
||||||
5
src/assets/style/fixed/tree-view.scss
Normal file
5
src/assets/style/fixed/tree-view.scss
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.tree-view-wrapper.tree-view-small {
|
||||||
|
.tree-view-item {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
@import '~@/assets/style/fixed/vue-splitpane.scss';
|
@import '~@/assets/style/fixed/vue-splitpane.scss';
|
||||||
// 补丁 vue-grid-layout
|
// 补丁 vue-grid-layout
|
||||||
@import '~@/assets/style/fixed/vue-grid-layout.scss';
|
@import '~@/assets/style/fixed/vue-grid-layout.scss';
|
||||||
|
// 补丁 tree-view
|
||||||
|
@import '~@/assets/style/fixed/tree-view.scss';
|
||||||
|
|
||||||
// 动画
|
// 动画
|
||||||
@import '~@/assets/style/animate/vue-transition.scss';
|
@import '~@/assets/style/animate/vue-transition.scss';
|
||||||
|
|||||||
@@ -5,11 +5,17 @@ import { version } from '../../package'
|
|||||||
const adapter = new LocalStorage(`d2admin-${version}`)
|
const adapter = new LocalStorage(`d2admin-${version}`)
|
||||||
const db = low(adapter)
|
const db = low(adapter)
|
||||||
|
|
||||||
|
console.group('db')
|
||||||
|
console.log(`db.get('themeActiveName').value()`, db.get('themeActiveName').value())
|
||||||
|
console.log(`db.get('pageOpenedList').value()`, db.get('pageOpenedList').value())
|
||||||
|
console.log(`db.get('userInfo').value()`, db.get('userInfo').value())
|
||||||
|
console.groupEnd()
|
||||||
|
|
||||||
|
// 初始化数据库
|
||||||
db.defaults({
|
db.defaults({
|
||||||
themeActiveName: [],
|
themeActiveName: [],
|
||||||
pageOpenedList: [],
|
pageOpenedList: [],
|
||||||
userInfo: []
|
userInfo: []
|
||||||
})
|
}).write()
|
||||||
.write()
|
|
||||||
|
|
||||||
export default db
|
export default db
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ new Vue({
|
|||||||
* 处理路由 得到每一级的路由设置
|
* 处理路由 得到每一级的路由设置
|
||||||
*/
|
*/
|
||||||
getAllTagFromRoutes () {
|
getAllTagFromRoutes () {
|
||||||
// 所有加载在主框架内的页面
|
|
||||||
const pool = []
|
const pool = []
|
||||||
const push = function (routes) {
|
const push = function (routes) {
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
@@ -99,7 +98,7 @@ new Vue({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
push(frameInRoutes)
|
push(frameInRoutes)
|
||||||
this.$store.commit('d2adminTagPoolSet', pool)
|
this.$store.commit('d2adminpagePoolSet', pool)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ export default {
|
|||||||
title: '全局状态管理',
|
title: '全局状态管理',
|
||||||
icon: 'bolt',
|
icon: 'bolt',
|
||||||
children: [
|
children: [
|
||||||
{ path: `${pre}store/sys`, title: '系统状态' }
|
{ path: `${pre}store/sys`, title: '系统状态', icon: 'microchip' },
|
||||||
|
{ path: `${pre}store/ua`, title: '浏览器信息', icon: 'info-circle' },
|
||||||
|
{ path: `${pre}store/gray`, title: '灰度模式', icon: 'eye' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ path: `${pre}theme`, title: '主题', icon: 'flask' },
|
{ path: `${pre}theme`, title: '主题', icon: 'flask' },
|
||||||
{ path: `${pre}fullscreen`, title: '全屏', icon: 'arrows-alt' },
|
{ path: `${pre}fullscreen`, title: '全屏', icon: 'arrows-alt' },
|
||||||
{ path: `${pre}gray`, title: '灰度模式', icon: 'eye' },
|
|
||||||
{ path: `${pre}db`, title: '数据持久化', icon: 'database' },
|
{ path: `${pre}db`, title: '数据持久化', icon: 'database' },
|
||||||
{ path: `${pre}env`, title: '环境信息', icon: 'microchip' },
|
{ path: `${pre}env`, title: '环境信息', icon: 'exclamation-circle' }
|
||||||
{ path: `${pre}ua`, title: '浏览器信息', icon: 'info-circle' }
|
|
||||||
])('/demo/playground/')
|
])('/demo/playground/')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const userDB = [
|
|||||||
{
|
{
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'admin',
|
password: 'admin',
|
||||||
uuid: 'test-user-uuid',
|
uuid: 'admin-uuid',
|
||||||
name: '管理员'
|
name: '管理员'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">顶栏菜单数据</template>
|
<template slot="header">顶栏菜单数据</template>
|
||||||
<div style="height: 300px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
<tree-view :data="menusHeader" :options="{ rootObjectKey: 'menusHeader', maxDepth: 2 }"/>
|
<tree-view class="tree-view-small" :data="menusHeader" :options="{ rootObjectKey: 'menusHeader', maxDepth: 2 }"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">侧边栏菜单数据</template>
|
<template slot="header">侧边栏菜单数据</template>
|
||||||
<div style="height: 300px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
<tree-view :data="menusAside" :options="{ rootObjectKey: 'menusAside', maxDepth: 1 }"/>
|
<tree-view class="tree-view-small" :data="menusAside" :options="{ rootObjectKey: 'menusAside', maxDepth: 1 }"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -44,26 +44,38 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">当前主题</template>
|
<template slot="header">当前主题</template>
|
||||||
<div style="height: 150px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
{{themeActiveName}}
|
{{themeActiveName}}
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="16">
|
<el-col :span="8">
|
||||||
|
<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 }"/>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">当前主题信息</template>
|
<template slot="header">当前主题信息</template>
|
||||||
<div style="height: 150px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
<tree-view :data="themeActiveSetting" :options="{ rootObjectKey: 'themeActiveSetting', maxDepth: 1 }"/>
|
<tree-view class="tree-view-small" :data="themeActiveSetting" :options="{ rootObjectKey: 'themeActiveSetting', maxDepth: 1 }"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
|
<template slot="header">当前页面</template>
|
||||||
|
{{pageCurrent}}
|
||||||
|
</el-card>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">当前页面</template>
|
<template slot="header">支持多页显示的页面列表</template>
|
||||||
<div style="height: 300px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
{{pageCurrent}}
|
<tree-view class="tree-view-small" :data="pagePool" :options="{ rootObjectKey: 'pagePool', maxDepth: 1 }"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -71,7 +83,7 @@
|
|||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">打开的标签页</template>
|
<template slot="header">打开的标签页</template>
|
||||||
<div style="height: 300px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
<tree-view :data="pageOpenedList" :options="{ rootObjectKey: 'pageOpenedList', maxDepth: 1 }"/>
|
<tree-view class="tree-view-small" :data="pageOpenedList" :options="{ rootObjectKey: 'pageOpenedList', maxDepth: 1 }"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -79,14 +91,14 @@
|
|||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">缓存页面</template>
|
<template slot="header">缓存页面</template>
|
||||||
<div style="height: 300px; overflow: auto;">
|
<div style="height: 300px; overflow: auto;">
|
||||||
<tree-view :data="d2adminKeepAliveInclude" :options="{ rootObjectKey: 'd2adminKeepAliveInclude', maxDepth: 1 }"/>
|
<tree-view class="tree-view-small" :data="d2adminKeepAliveInclude" :options="{ rootObjectKey: 'd2adminKeepAliveInclude', maxDepth: 1 }"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-card shadow="never" class="d2-card d2-mb">
|
<el-card shadow="never" class="d2-card d2-mb">
|
||||||
<template slot="header">最新版本数据 [ {{releasesUpdate ? '有新版本' : '已经是最新版本'}} ]</template>
|
<template slot="header">最新版本数据 [ {{releasesUpdate ? '有新版本' : '已经是最新版本'}} ]</template>
|
||||||
<tree-view :data="releasesLatest" :options="{ rootObjectKey: 'releasesLatest', maxDepth: 1 }"/>
|
<tree-view class="tree-view-small" :data="releasesLatest" :options="{ rootObjectKey: 'releasesLatest', maxDepth: 1 }"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</d2-container>
|
</d2-container>
|
||||||
@@ -97,6 +109,7 @@ import { mapState, mapGetters } from 'vuex'
|
|||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
|
userInfo: state => state.d2admin.userInfo,
|
||||||
version: state => state.d2admin.version,
|
version: state => state.d2admin.version,
|
||||||
releasesLatest: state => state.d2admin.releasesLatest,
|
releasesLatest: state => state.d2admin.releasesLatest,
|
||||||
releasesUpdate: state => state.d2admin.releasesUpdate,
|
releasesUpdate: state => state.d2admin.releasesUpdate,
|
||||||
@@ -105,9 +118,12 @@ export default {
|
|||||||
isFullScreen: state => state.d2admin.isFullScreen,
|
isFullScreen: state => state.d2admin.isFullScreen,
|
||||||
isGrayMode: state => state.d2admin.isGrayMode,
|
isGrayMode: state => state.d2admin.isGrayMode,
|
||||||
isMenuAsideCollapse: state => state.d2admin.isMenuAsideCollapse,
|
isMenuAsideCollapse: state => state.d2admin.isMenuAsideCollapse,
|
||||||
|
themeList: state => state.d2admin.themeList,
|
||||||
themeActiveName: state => state.d2admin.themeActiveName,
|
themeActiveName: state => state.d2admin.themeActiveName,
|
||||||
|
pagePool: state => state.d2admin.pagePool,
|
||||||
pageOpenedList: state => state.d2admin.pageOpenedList,
|
pageOpenedList: state => state.d2admin.pageOpenedList,
|
||||||
pageCurrent: state => state.d2admin.pageCurrent
|
pageCurrent: state => state.d2admin.pageCurrent,
|
||||||
|
ua: state => state.d2admin.ua
|
||||||
}),
|
}),
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'themeActiveSetting',
|
'themeActiveSetting',
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
6cc11bb2f370fd4b3c2020cfe54720d7d8c43d3f
|
c4d49155f38baacfd5717ec2b3eb78e27bfde9c5
|
||||||
@@ -1 +1 @@
|
|||||||
173a9f3d33cddfa88c52a85e30ddbdaa8d3ebd49
|
a90ea1c26136a74ab078f2212cd396b2dfe12c13
|
||||||
Reference in New Issue
Block a user