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 @@