From 59b030392cab8d6a0f97238dda0c98dae94507c9 Mon Sep 17 00:00:00 2001
From: liyang <1711467488@qq.com>
Date: Mon, 23 Jul 2018 20:16:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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
---
.vscode/settings.json | 3 +-
src/assets/style/fixed/tree-view.scss | 5 +++
src/assets/style/public-class.scss | 2 +
src/libs/db.js | 10 ++++-
src/main.js | 3 +-
src/menu/modules/demo-playground.js | 8 ++--
src/mock/login/index.js | 2 +-
.../playground/{ => store}/gray/index.vue | 0
src/pages/demo/playground/store/sys/index.vue | 40 +++++++++++++------
.../demo/playground/{ => store}/ua/index.vue | 0
src/router/routes.js.REMOVED.git-id | 2 +-
src/store/modules/d2admin.js.REMOVED.git-id | 2 +-
12 files changed, 52 insertions(+), 25 deletions(-)
create mode 100644 src/assets/style/fixed/tree-view.scss
rename src/pages/demo/playground/{ => store}/gray/index.vue (100%)
rename src/pages/demo/playground/{ => store}/ua/index.vue (100%)
diff --git a/.vscode/settings.json b/.vscode/settings.json
index fd86b7f7..e1a21666 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,7 +1,6 @@
{
"files.exclude": {
- "dist": true,
- "node_modules": true
+ "dist": true
},
"todo-tree.expanded": false
}
\ No newline at end of file
diff --git a/src/assets/style/fixed/tree-view.scss b/src/assets/style/fixed/tree-view.scss
new file mode 100644
index 00000000..4057c3e5
--- /dev/null
+++ b/src/assets/style/fixed/tree-view.scss
@@ -0,0 +1,5 @@
+.tree-view-wrapper.tree-view-small {
+ .tree-view-item {
+ font-size: 10px;
+ }
+}
\ No newline at end of file
diff --git a/src/assets/style/public-class.scss b/src/assets/style/public-class.scss
index 08cbc340..69e93d71 100644
--- a/src/assets/style/public-class.scss
+++ b/src/assets/style/public-class.scss
@@ -10,6 +10,8 @@
@import '~@/assets/style/fixed/vue-splitpane.scss';
// 补丁 vue-grid-layout
@import '~@/assets/style/fixed/vue-grid-layout.scss';
+// 补丁 tree-view
+@import '~@/assets/style/fixed/tree-view.scss';
// 动画
@import '~@/assets/style/animate/vue-transition.scss';
diff --git a/src/libs/db.js b/src/libs/db.js
index 914d9498..79c896b4 100644
--- a/src/libs/db.js
+++ b/src/libs/db.js
@@ -5,11 +5,17 @@ import { version } from '../../package'
const adapter = new LocalStorage(`d2admin-${version}`)
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({
themeActiveName: [],
pageOpenedList: [],
userInfo: []
-})
- .write()
+}).write()
export default db
diff --git a/src/main.js b/src/main.js
index 0d3b5f81..210aed45 100644
--- a/src/main.js
+++ b/src/main.js
@@ -86,7 +86,6 @@ new Vue({
* 处理路由 得到每一级的路由设置
*/
getAllTagFromRoutes () {
- // 所有加载在主框架内的页面
const pool = []
const push = function (routes) {
routes.forEach(route => {
@@ -99,7 +98,7 @@ new Vue({
})
}
push(frameInRoutes)
- this.$store.commit('d2adminTagPoolSet', pool)
+ this.$store.commit('d2adminpagePoolSet', pool)
}
}
}).$mount('#app')
diff --git a/src/menu/modules/demo-playground.js b/src/menu/modules/demo-playground.js
index bcc5130e..b5478361 100644
--- a/src/menu/modules/demo-playground.js
+++ b/src/menu/modules/demo-playground.js
@@ -27,14 +27,14 @@ export default {
title: '全局状态管理',
icon: 'bolt',
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}fullscreen`, title: '全屏', icon: 'arrows-alt' },
- { path: `${pre}gray`, title: '灰度模式', icon: 'eye' },
{ path: `${pre}db`, title: '数据持久化', icon: 'database' },
- { path: `${pre}env`, title: '环境信息', icon: 'microchip' },
- { path: `${pre}ua`, title: '浏览器信息', icon: 'info-circle' }
+ { path: `${pre}env`, title: '环境信息', icon: 'exclamation-circle' }
])('/demo/playground/')
}
diff --git a/src/mock/login/index.js b/src/mock/login/index.js
index dfbf1f9b..99222985 100644
--- a/src/mock/login/index.js
+++ b/src/mock/login/index.js
@@ -4,7 +4,7 @@ const userDB = [
{
username: 'admin',
password: 'admin',
- uuid: 'test-user-uuid',
+ uuid: 'admin-uuid',
name: '管理员'
},
{
diff --git a/src/pages/demo/playground/gray/index.vue b/src/pages/demo/playground/store/gray/index.vue
similarity index 100%
rename from src/pages/demo/playground/gray/index.vue
rename to src/pages/demo/playground/store/gray/index.vue
diff --git a/src/pages/demo/playground/store/sys/index.vue b/src/pages/demo/playground/store/sys/index.vue
index ff58daf9..fd6ab188 100644
--- a/src/pages/demo/playground/store/sys/index.vue
+++ b/src/pages/demo/playground/store/sys/index.vue
@@ -7,7 +7,7 @@
顶栏菜单数据
-
+
@@ -15,7 +15,7 @@
侧边栏菜单数据
-
+
@@ -44,26 +44,38 @@
当前主题
-
+
{{themeActiveName}}
-
+
+
+ 已经注册的主题
+
+
+
+
+
+
当前主题信息
-
-
+
+
+
+ 当前页面
+ {{pageCurrent}}
+
- 当前页面
+ 支持多页显示的页面列表
- {{pageCurrent}}
+
@@ -71,7 +83,7 @@
打开的标签页
-
+
@@ -79,14 +91,14 @@
缓存页面
-
+
最新版本数据 [ {{releasesUpdate ? '有新版本' : '已经是最新版本'}} ]
-
+
@@ -97,6 +109,7 @@ import { mapState, mapGetters } from 'vuex'
export default {
computed: {
...mapState({
+ userInfo: state => state.d2admin.userInfo,
version: state => state.d2admin.version,
releasesLatest: state => state.d2admin.releasesLatest,
releasesUpdate: state => state.d2admin.releasesUpdate,
@@ -105,9 +118,12 @@ export default {
isFullScreen: state => state.d2admin.isFullScreen,
isGrayMode: state => state.d2admin.isGrayMode,
isMenuAsideCollapse: state => state.d2admin.isMenuAsideCollapse,
+ themeList: state => state.d2admin.themeList,
themeActiveName: state => state.d2admin.themeActiveName,
+ pagePool: state => state.d2admin.pagePool,
pageOpenedList: state => state.d2admin.pageOpenedList,
- pageCurrent: state => state.d2admin.pageCurrent
+ pageCurrent: state => state.d2admin.pageCurrent,
+ ua: state => state.d2admin.ua
}),
...mapGetters([
'themeActiveSetting',
diff --git a/src/pages/demo/playground/ua/index.vue b/src/pages/demo/playground/store/ua/index.vue
similarity index 100%
rename from src/pages/demo/playground/ua/index.vue
rename to src/pages/demo/playground/store/ua/index.vue
diff --git a/src/router/routes.js.REMOVED.git-id b/src/router/routes.js.REMOVED.git-id
index 9440f484..8679bde8 100644
--- a/src/router/routes.js.REMOVED.git-id
+++ b/src/router/routes.js.REMOVED.git-id
@@ -1 +1 @@
-6cc11bb2f370fd4b3c2020cfe54720d7d8c43d3f
\ No newline at end of file
+c4d49155f38baacfd5717ec2b3eb78e27bfde9c5
\ No newline at end of file
diff --git a/src/store/modules/d2admin.js.REMOVED.git-id b/src/store/modules/d2admin.js.REMOVED.git-id
index 5de8720c..28995a67 100644
--- a/src/store/modules/d2admin.js.REMOVED.git-id
+++ b/src/store/modules/d2admin.js.REMOVED.git-id
@@ -1 +1 @@
-173a9f3d33cddfa88c52a85e30ddbdaa8d3ebd49
\ No newline at end of file
+a90ea1c26136a74ab078f2212cd396b2dfe12c13
\ No newline at end of file