2018-08-01 22:55:40 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
2018-08-02 20:16:41 +08:00
|
|
|
<el-tooltip effect="dark" :content="tooltipContent" placement="bottom">
|
2018-08-01 22:55:40 +08:00
|
|
|
<el-button class="d2-ml-0 d2-mr btn-text can-hover" type="text" @click="dialogVisible = true">
|
2018-08-02 20:16:41 +08:00
|
|
|
<el-badge
|
|
|
|
|
v-if="d2adminLogLength > 0"
|
|
|
|
|
:value="d2adminLogErrorLength"
|
|
|
|
|
:is-dot="d2adminLogErrorLength === 0">
|
|
|
|
|
<d2-icon name="bug" style="font-size: 20px"/>
|
|
|
|
|
</el-badge>
|
|
|
|
|
<d2-icon v-else name="bug" style="font-size: 20px"/>
|
2018-08-01 22:55:40 +08:00
|
|
|
</el-button>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="异常日志"
|
|
|
|
|
:fullscreen="true"
|
|
|
|
|
:visible.sync="dialogVisible"
|
|
|
|
|
:append-to-body="true">
|
|
|
|
|
<d2-error-log-list/>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2018-08-02 20:16:41 +08:00
|
|
|
import { mapGetters } from 'vuex'
|
2018-08-01 22:55:40 +08:00
|
|
|
export default {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
dialogVisible: false
|
|
|
|
|
}
|
2018-08-02 20:16:41 +08:00
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapGetters([
|
|
|
|
|
'd2adminLogLength',
|
|
|
|
|
'd2adminLogErrorLength'
|
|
|
|
|
]),
|
|
|
|
|
tooltipContent () {
|
|
|
|
|
return this.d2adminLogLength === 0 ?
|
|
|
|
|
'没有日志或异常' :
|
|
|
|
|
`${this.d2adminLogLength} 条日志${this.d2adminLogErrorLength > 0 ?
|
|
|
|
|
` | 包含 ${this.d2adminLogErrorLength} 个异常` :
|
|
|
|
|
''}`
|
|
|
|
|
}
|
2018-08-01 22:55:40 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|