From dd6bcfd94b0c8eff8b2a1c59df1c591f1a0021af Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Thu, 9 Aug 2018 01:03:20 +0800 Subject: [PATCH] log Former-commit-id: 067af1ad15588da779f6fdb52d8dd5e4d5337a83 [formerly 067af1ad15588da779f6fdb52d8dd5e4d5337a83 [formerly 067af1ad15588da779f6fdb52d8dd5e4d5337a83 [formerly 067af1ad15588da779f6fdb52d8dd5e4d5337a83 [formerly 26bff908e7e98cdecb3942975cb8dac912d22760 [formerly 5394d813fcdce16e699ff3d54fca956c87f1b56b]]]]] Former-commit-id: 4d70ea535fa6b135fd63ef83fc090e9a9d851e39 Former-commit-id: faec9e738fabb0225ec9ed61b86c30f269c02486 Former-commit-id: 9b54c495f13d810d67fa85e2129c05eec4a99324 [formerly 46471134b136a5df475c7787b5694052aca6b8ae] Former-commit-id: 0eb56ebbfa256ce1c2d3c1d99994ec7236c7ad5f Former-commit-id: 68c0847f64453808a6afc906ffc110654ccf84a4 Former-commit-id: 93c3b439339c575b5d7a085262817b295a852058 Former-commit-id: 32ccde3e80c1ec1a1dc8bc335082eb6ac80ea3e1 Former-commit-id: b8e2a549af61ff83b566fd961085ad7414d21b2d --- src/components/d2-error-log-list/index.vue | 12 +-- .../components/header-error-log/index.vue | 24 +++--- .../components/header-user/index.vue | 8 +- src/layout/header-aside/layout.vue | 8 +- src/pages/demo/playground/store/sys/index.vue | 8 +- src/plugin/error/index.js | 2 +- src/plugin/log/index.js | 2 +- .../modules/d2admin/index.js.REMOVED.git-id | 2 +- src/store/modules/d2admin/modules/log.js | 75 +++++++++++++++++++ 9 files changed, 106 insertions(+), 35 deletions(-) create mode 100644 src/store/modules/d2admin/modules/log.js diff --git a/src/components/d2-error-log-list/index.vue b/src/components/d2-error-log-list/index.vue index 666fac97..737153f4 100644 --- a/src/components/d2-error-log-list/index.vue +++ b/src/components/d2-error-log-list/index.vue @@ -136,15 +136,15 @@ export default { ExpandItem }, computed: { - ...mapState('d2admin', [ - 'log' - ]), + ...mapState('d2admin', { + logList: state => state.log.list + }), logReverse () { // 直接 reverse 的话有点问题 const res = [] - const loglength = this.log.length - this.log.forEach((log, index) => { - res.push(this.log[loglength - 1 - index]) + const loglength = this.logList.length + this.logList.forEach((log, index) => { + res.push(this.logList[loglength - 1 - index]) }) return 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 b031d8c5..c326860a 100644 --- a/src/layout/header-aside/components/header-error-log/index.vue +++ b/src/layout/header-aside/components/header-error-log/index.vue @@ -11,10 +11,10 @@ + :value="logLengthError" + :is-dot="logLengthError === 0"> 0 - ? ` | 包含 ${this.logErrorLength} 个异常` + : `${this.logLength} 条日志${this.logLengthError > 0 + ? ` | 包含 ${this.logLengthError} 个异常` : ''}` } }, methods: { - ...mapMutations('d2admin', [ - 'logClean' + ...mapMutations('d2admin/log', [ + 'clean' ]), handleClick () { if (this.logLength > 0) { @@ -72,7 +72,7 @@ export default { }, handleLogClean () { this.dialogVisible = false - this.logClean() + this.clean() } } } diff --git a/src/layout/header-aside/components/header-user/index.vue b/src/layout/header-aside/components/header-user/index.vue index 44f81b14..e5d25609 100644 --- a/src/layout/header-aside/components/header-user/index.vue +++ b/src/layout/header-aside/components/header-user/index.vue @@ -1,6 +1,6 @@