From b1459f100d6f670fce6d8f594b0ccc1c4c68d0fc Mon Sep 17 00:00:00 2001
From: liyang <1711467488@qq.com>
Date: Wed, 8 Aug 2018 09:19:11 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=91=BD=E5=90=8D=E7=A9=BA?=
=?UTF-8?q?=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Former-commit-id: 63fcb6e8af280eb6aa1847600c096fb48cf53ea1 [formerly 63fcb6e8af280eb6aa1847600c096fb48cf53ea1 [formerly 63fcb6e8af280eb6aa1847600c096fb48cf53ea1 [formerly 63fcb6e8af280eb6aa1847600c096fb48cf53ea1 [formerly 632d40c9d0643c6a24abfb7b58b999d829d4f4e5 [formerly 57132b61c7b2f326d08dbe138fda1fac4cb83c62]]]]]
Former-commit-id: c0cb71135408e03add94e219759ae37cfb75f31b
Former-commit-id: 7f8209eae78f59e644c204712c31dff787899384
Former-commit-id: b08fbd31671e552da8012eb3ee901edf4f89c0e9 [formerly bb7abe3cc56f2f376a59413c370032d896b50c38]
Former-commit-id: 0872ac8e17b45829eee426dc5f80f25e37c85ea3
Former-commit-id: 373b0874ce730b26f256600de55a39b2e40d5f9f
Former-commit-id: 472309b468a04d5e57a1a917a6472061668cc7f0
Former-commit-id: 88ad7d087a7382d66523f481b7e1476c21f2830d
Former-commit-id: 6557698b7db15cc1b62cf9c3976521de6cc194cd
---
src/components/d2-error-log-list/index.vue | 6 +--
.../components/header-error-log/index.vue | 28 ++++++------
.../components/header-fullscreen/index.vue | 12 ++---
.../components/d2-theme-list/index.vue | 14 +++---
.../components/header-user/index.vue | 12 ++---
.../components/menu-header/index.vue | 6 +--
.../components/menu-side/index.vue | 8 ++--
.../header-aside/components/tabs/index.vue | 30 ++++++-------
src/layout/header-aside/layout.vue | 32 +++++++-------
src/libs/util.js | 4 +-
src/main.js | 12 ++---
src/pages/demo/playground/db/public/index.vue | 16 +++----
src/pages/demo/playground/db/user/index.vue | 16 +++----
.../playground/store/fullscreen/index.vue | 14 +++---
.../demo/playground/store/gray/index.vue | 22 +++++-----
.../demo/playground/store/menu/index.vue | 30 ++++++-------
src/pages/demo/playground/store/sys/index.vue | 44 +++++++++----------
.../demo/playground/store/theme/index.vue | 14 +++---
src/pages/demo/playground/store/ua/index.vue | 6 +--
src/pages/login/page.vue | 6 +--
src/plugin/error/index.js | 2 +-
src/plugin/log/index.js | 2 +-
src/router/index.js | 2 +-
.../modules/d2admin/index.js.REMOVED.git-id | 2 +-
24 files changed, 170 insertions(+), 170 deletions(-)
diff --git a/src/components/d2-error-log-list/index.vue b/src/components/d2-error-log-list/index.vue
index 34a93065..666fac97 100644
--- a/src/components/d2-error-log-list/index.vue
+++ b/src/components/d2-error-log-list/index.vue
@@ -136,9 +136,9 @@ export default {
ExpandItem
},
computed: {
- ...mapState({
- log: state => state.d2admin.log
- }),
+ ...mapState('d2admin', [
+ 'log'
+ ]),
logReverse () {
// 直接 reverse 的话有点问题
const res = []
diff --git a/src/layout/header-aside/components/header-error-log/index.vue b/src/layout/header-aside/components/header-error-log/index.vue
index d95c6e1e..b031d8c5 100644
--- a/src/layout/header-aside/components/header-error-log/index.vue
+++ b/src/layout/header-aside/components/header-error-log/index.vue
@@ -9,12 +9,12 @@
type="text"
@click="handleClick">
+ :value="logErrorLength"
+ :is-dot="logErrorLength === 0">
0
- ? ` | 包含 ${this.d2adminLogErrorLength} 个异常`
+ : `${this.logLength} 条日志${this.logErrorLength > 0
+ ? ` | 包含 ${this.logErrorLength} 个异常`
: ''}`
}
},
methods: {
- ...mapMutations([
- 'd2adminLogClean'
+ ...mapMutations('d2admin', [
+ 'logClean'
]),
handleClick () {
- if (this.d2adminLogLength > 0) {
+ if (this.logLength > 0) {
this.dialogVisible = true
}
},
handleLogClean () {
this.dialogVisible = false
- this.d2adminLogClean()
+ this.logClean()
}
}
}
diff --git a/src/layout/header-aside/components/header-fullscreen/index.vue b/src/layout/header-aside/components/header-fullscreen/index.vue
index 68f801be..8e6ed7ea 100644
--- a/src/layout/header-aside/components/header-fullscreen/index.vue
+++ b/src/layout/header-aside/components/header-fullscreen/index.vue
@@ -3,7 +3,7 @@
effect="dark"
:content="isFullScreen ? '退出全屏' : '全屏'"
placement="bottom">
-
+
@@ -14,13 +14,13 @@
import { mapState, mapMutations } from 'vuex'
export default {
computed: {
- ...mapState({
- isFullScreen: state => state.d2admin.isFullScreen
- })
+ ...mapState('d2admin', [
+ 'isFullScreen'
+ ])
},
methods: {
- ...mapMutations([
- 'd2adminFullScreenToggle'
+ ...mapMutations('d2admin', [
+ 'fullScreenToggle'
])
}
}
diff --git a/src/layout/header-aside/components/header-theme/components/d2-theme-list/index.vue b/src/layout/header-aside/components/header-theme/components/d2-theme-list/index.vue
index 9038b29b..8b81cc76 100644
--- a/src/layout/header-aside/components/header-theme/components/d2-theme-list/index.vue
+++ b/src/layout/header-aside/components/header-theme/components/d2-theme-list/index.vue
@@ -30,17 +30,17 @@ export default {
}
},
computed: {
- ...mapState({
- themeList: state => state.d2admin.themeList,
- themeActiveName: state => state.d2admin.themeActiveName
- })
+ ...mapState('d2admin', [
+ 'themeList',
+ 'themeActiveName'
+ ])
},
methods: {
- ...mapMutations([
- 'd2adminThemeSet'
+ ...mapMutations('d2admin', [
+ 'themeSet'
]),
handleSelectTheme (name) {
- this.d2adminThemeSet(name)
+ this.themeSet(name)
}
}
}
diff --git a/src/layout/header-aside/components/header-user/index.vue b/src/layout/header-aside/components/header-user/index.vue
index 7ed24019..3cc270b0 100644
--- a/src/layout/header-aside/components/header-user/index.vue
+++ b/src/layout/header-aside/components/header-user/index.vue
@@ -14,19 +14,19 @@
import { mapState, mapActions } from 'vuex'
export default {
computed: {
- ...mapState({
- userInfo: state => state.d2admin.userInfo
- })
+ ...mapState('d2admin', [
+ 'userInfo'
+ ])
},
methods: {
- ...mapActions([
- 'd2adminLogout'
+ ...mapActions('d2admin', [
+ 'logout'
]),
/**
* @description 登出
*/
logOff () {
- this.d2adminLogout({
+ this.logout({
vm: this,
confirm: true
})
diff --git a/src/layout/header-aside/components/menu-header/index.vue b/src/layout/header-aside/components/menu-header/index.vue
index a52d4e5d..0d634f27 100644
--- a/src/layout/header-aside/components/menu-header/index.vue
+++ b/src/layout/header-aside/components/menu-header/index.vue
@@ -22,9 +22,9 @@ export default {
'd2-layout-header-aside-menu-sub': d2LayoutMainMenuSub
},
computed: {
- ...mapState({
- menuHeader: state => state.d2admin.menuHeader
- })
+ ...mapState('d2admin', [
+ 'menuHeader'
+ ])
}
}
diff --git a/src/layout/header-aside/components/menu-side/index.vue b/src/layout/header-aside/components/menu-side/index.vue
index e387b810..cae75156 100644
--- a/src/layout/header-aside/components/menu-side/index.vue
+++ b/src/layout/header-aside/components/menu-side/index.vue
@@ -41,10 +41,10 @@ export default {
}
},
computed: {
- ...mapState({
- menuAside: state => state.d2admin.menuAside,
- isMenuAsideCollapse: state => state.d2admin.isMenuAsideCollapse
- })
+ ...mapState('d2admin', [
+ 'menuAside',
+ 'isMenuAsideCollapse'
+ ])
},
watch: {
// 折叠和展开菜单的时候销毁 better scroll
diff --git a/src/layout/header-aside/components/tabs/index.vue b/src/layout/header-aside/components/tabs/index.vue
index 9111f38b..36b8753e 100644
--- a/src/layout/header-aside/components/tabs/index.vue
+++ b/src/layout/header-aside/components/tabs/index.vue
@@ -82,17 +82,17 @@ export default {
}
},
computed: {
- ...mapState({
- pageOpenedList: state => state.d2admin.pageOpenedList,
- pageCurrent: state => state.d2admin.pageCurrent
- })
+ ...mapState('d2admin', [
+ 'pageOpenedList',
+ 'pageCurrent'
+ ])
},
methods: {
- ...mapMutations([
- 'd2adminTagCloseLeft',
- 'd2adminTagCloseRight',
- 'd2adminTagCloseOther',
- 'd2adminTagCloseAll'
+ ...mapMutations('d2admin', [
+ 'tagCloseLeft',
+ 'tagCloseRight',
+ 'tagCloseOther',
+ 'tagCloseAll'
]),
/**
* @description 右键菜单功能点击
@@ -136,16 +136,16 @@ export default {
}
switch (command) {
case 'left':
- this.d2adminTagCloseLeft(params)
+ this.tagCloseLeft(params)
break
case 'right':
- this.d2adminTagCloseRight(params)
+ this.tagCloseRight(params)
break
case 'other':
- this.d2adminTagCloseOther(params)
+ this.tagCloseOther(params)
break
case 'all':
- this.d2adminTagCloseAll(this)
+ this.tagCloseAll(this)
break
default:
this.$message.error('无效的操作')
@@ -156,7 +156,7 @@ export default {
* @description 接收点击关闭控制上按钮的事件
*/
handleControlBtnClick () {
- this.d2adminTagCloseAll(this)
+ this.tagCloseAll(this)
},
/**
* @description 接收点击 tab 标签的事件
@@ -174,7 +174,7 @@ export default {
*/
handleTabsEdit (tagName, action) {
if (action === 'remove') {
- this.$store.commit('d2adminTagClose', {
+ this.$store.commit('d2admin/tagClose', {
tagName,
vm: this
})
diff --git a/src/layout/header-aside/layout.vue b/src/layout/header-aside/layout.vue
index 9f672db9..bf8f0985 100644
--- a/src/layout/header-aside/layout.vue
+++ b/src/layout/header-aside/layout.vue
@@ -10,8 +10,8 @@