Files
mes-ui-d2/src/layout/header-aside/components/header-error-log/index.vue
liyang cfaa0d4c1c no message
Former-commit-id: de8099d3b8072b8096eb348ada10899af93c2b06 [formerly 09a7b50c20d4e68f7469cc280c3d8d89dd7f9d73] [formerly de8099d3b8072b8096eb348ada10899af93c2b06 [formerly 09a7b50c20d4e68f7469cc280c3d8d89dd7f9d73] [formerly de8099d3b8072b8096eb348ada10899af93c2b06 [formerly 09a7b50c20d4e68f7469cc280c3d8d89dd7f9d73] [formerly 09a7b50c20d4e68f7469cc280c3d8d89dd7f9d73 [formerly aa0d6d0b40bfa65df263c3ec7530d4cec2b2cf2c [formerly 8a84b826e70662ac02bb52bd4362e69645aea6e5]]]]]
Former-commit-id: 0c5c8dc0832c97b222638f60fc801d02fe3516b5
Former-commit-id: 8bb05eb8f85c77676b191e33343c4e3e03a9a8fc
Former-commit-id: eb90b9bbc0ace8e3d9ee9a6285d3e277a53ffb32 [formerly 422eb8223a1c7a2ed7f5187ec3b186ad3be7de6b]
Former-commit-id: fe247278ab2b82ba8bd5b06f31ed28a0bd769d99
Former-commit-id: a23223faf464e7f7a819afbaa5d7113ef0945f09
Former-commit-id: 74a928afc84ce09d05b7905d8d84bbd16fa5e2c1
Former-commit-id: 9404a57faa6efb931a32ba885392d6b3a5225313
Former-commit-id: b79942a7339fed4efb419eb374cff7a979082806
2018-08-07 16:28:19 +08:00

80 lines
1.8 KiB
Vue

<template>
<div>
<el-tooltip
effect="dark"
:content="tooltipContent"
placement="bottom">
<el-button
class="d2-ml-0 d2-mr btn-text can-hover"
type="text"
@click="handleClick">
<el-badge
v-if="d2adminLogLength > 0"
:max="99"
:value="d2adminLogErrorLength"
:is-dot="d2adminLogErrorLength === 0">
<d2-icon
:name="d2adminLogErrorLength === 0 ? 'dot-circle-o' : 'bug'"
style="font-size: 20px"/>
</el-badge>
<d2-icon
v-else
name="dot-circle-o"
style="font-size: 20px"/>
</el-button>
</el-tooltip>
<el-dialog
:title="tooltipContent"
:fullscreen="true"
:visible.sync="dialogVisible"
:append-to-body="true">
<div class="d2-mb-10">
<el-button type="danger" size="mini" @click="handleLogClean">
<d2-icon name="trash-o"/>
清空
</el-button>
</div>
<d2-error-log-list/>
</el-dialog>
</div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
export default {
data () {
return {
dialogVisible: false
}
},
computed: {
...mapGetters([
'd2adminLogLength',
'd2adminLogErrorLength'
]),
tooltipContent () {
return this.d2adminLogLength === 0
? '没有日志或异常'
: `${this.d2adminLogLength} 条日志${this.d2adminLogErrorLength > 0
? ` | 包含 ${this.d2adminLogErrorLength} 个异常`
: ''}`
}
},
methods: {
...mapMutations([
'd2adminLogClean'
]),
handleClick () {
if (this.d2adminLogLength > 0) {
this.dialogVisible = true
}
},
handleLogClean () {
this.dialogVisible = false
this.d2adminLogClean()
}
}
}
</script>