Files
mes-ui-d2/src/components/d2-error-log-list/index.vue
liyang 6d95aa83c9 暂存
Former-commit-id: 4a7cf25c3ba996a45eb5cd78b4bdecca3f5e1ac6 [formerly 4a7cf25c3ba996a45eb5cd78b4bdecca3f5e1ac6 [formerly 4a7cf25c3ba996a45eb5cd78b4bdecca3f5e1ac6 [formerly 4a7cf25c3ba996a45eb5cd78b4bdecca3f5e1ac6 [formerly 00a1f89bbf28dde544c78a5cd6ca85d6cb0af8e2 [formerly bc8e53d9b756c71a48b5297743317938be6e623b]]]]]
Former-commit-id: 0553d2a78845193b193ec40142dec84fabb37548
Former-commit-id: 3e85f148d5e5a744ee7dcc7509d41fa900b79b59
Former-commit-id: 912bc68def6df219bfe0d60cefe9dcb9e2a7f8ba [formerly 19bb68c42653c71e4178b6f064b55a0da36b03bf]
Former-commit-id: 6a39e7859d60f6186f174c1840d356a16f695b78
Former-commit-id: f5ae3e4bd9af5d4fd69c11d63dc52538a7488528
Former-commit-id: 08bb86e655a23772f82a7fad8b522f012762ec34
Former-commit-id: 9bd95b7b604280efd01da8f1182f0b4d8b084b62
Former-commit-id: a21ec55bfd4451d88553f61ddd1f5be7b2debc9d
2018-08-05 11:10:42 +08:00

120 lines
2.5 KiB
Vue

<template>
<el-table
:data="log"
border
stripe
style="width: 100%"
size="mini">
<el-table-column type="expand">
<template slot-scope="props">
<div style="overflow: auto;">
<pre>{{stackBeautify(props.row.err)}}</pre>
</div>
</template>
</el-table-column>
<el-table-column
prop="type"
label="类型"
width="80px"
align="center"
:filters="[
{ text: '日志', value: 'log' },
{ text: '异常', value: 'error' }
]"
:filter-multiple="false"
:filter-method="filterType"
filter-placement="bottom">
<template slot-scope="scope">
<el-tag
v-if="scope.row.type === 'error'"
size="mini"
type="danger">
<d2-icon name="bug"/> Bug
</el-tag>
<el-tag
v-else
size="mini"
type="info">
<d2-icon name="dot-circle-o"/> Log
</el-tag>
</template>
</el-table-column>
<el-table-column
label="地址"
prop="url"
width="140px"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
label="组件"
width="140px"
:show-overflow-tooltip="true">
<template
slot-scope="scope">
{{scope.row.vm ? scope.row.vm.$vnode.tag : ''}}
</template>
</el-table-column>
<el-table-column
label="信息"
prop="info"
width="200px"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
label="错误类型"
width="140px"
:show-overflow-tooltip="true">
<template
slot-scope="scope">
{{scope.row.err ? scope.row.err.name : ''}}
</template>
</el-table-column>
<el-table-column
label="错误信息">
<template
slot-scope="scope">
{{scope.row.err ? scope.row.err.message : ''}}
</template>
</el-table-column>
<el-table-column
label="time"
prop="time"
width="150px"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'd2-error-log-list',
computed: {
...mapState({
log: state => state.d2admin.log
})
},
methods: {
filterType (value, row) {
console.log('value', value)
return row.type === value
},
stackBeautify (err) {
if (!err) {
return ''
}
return err.stack
}
}
}
</script>