Files
mes-ui-d2/src/views/system/log/index.vue
liyang 780c5071ed 日志区分颜色
Former-commit-id: aeb2b84bf8da5275a1e8eafc9079954dd41bf80c [formerly aeb2b84bf8da5275a1e8eafc9079954dd41bf80c [formerly aeb2b84bf8da5275a1e8eafc9079954dd41bf80c [formerly aeb2b84bf8da5275a1e8eafc9079954dd41bf80c [formerly 350c8c6514e327fbab5060978b4b7523a098f6d0 [formerly 17c340c2f594b545b945d52cc1a8647348ae3389]]]]]
Former-commit-id: 52db1bdfa3c024dfe218c09e9cf75747b6abb038
Former-commit-id: b2f85a553a4e78de0daa8c18c3d332e5b92510b1
Former-commit-id: ecd4f39b10208f44d030bfaba635e21215053ebc [formerly e68563d7da177cf374736e7f0b8170f0e407a9f4]
Former-commit-id: 2f8af3f79a52372c93e4b27d1f034d214edcd64d
Former-commit-id: 960bd7e3d8cfb67e152c07312ff68652114d480b
Former-commit-id: 9a716fc01315ad5e1064d9c64b671cdc36301721
Former-commit-id: 02d7d4a0e3aab9bfc0318e5dfbe355f306d1f9c3
Former-commit-id: 0c0c46088a4e916e3cd9c1099594b3e1a15bce46
2019-03-21 22:51:22 +08:00

98 lines
1.9 KiB
Vue

<template>
<d2-container>
<template slot="header">
<el-button
type="primary"
size="mini"
:loading="uploading"
@click="handleUpload">
<d2-icon name="cloud-upload"/>
Upload {{log.length}} log data
</el-button>
</template>
<section class="page">
<p
class="log"
v-for="(logItem, logIndex) in log"
:key="logIndex">
<span class="log-time">{{logItem.time}}</span>
<span class="log-message" :class="`log-message--${logItem.type}`">{{logItem.message}}</span>
</p>
</section>
</d2-container>
</template>
<script>
import { mapState } from 'vuex'
export default {
data () {
return {
uploading: false
}
},
computed: {
...mapState('d2admin/log', [
'log'
])
},
methods: {
handleUpload () {
this.uploading = true
this.$notify({
type: 'info',
title: '日志上传',
message: `开始上传${this.log.length}条日志`
})
setTimeout(() => {
this.uploading = false
this.$notify({
type: 'success',
title: '日志上传',
message: '上传成功'
})
}, 3000)
}
}
}
</script>
<style lang="scss" scoped>
.page {
.log {
margin: 4px -4px;
padding: 4px;
border-radius: 2px;
font-size: 14px;
@extend %unable-select;
&:hover {
background-color: $color-bg;
}
&:first-child {
margin-top: 0px;
}
&:last-child {
margin-bottom: 0px;
}
.log-time {
color: $color-text-main;
margin-right: 10px;
}
.log-message {
color: $color-text-normal;
&.log-message--success {
color: $color-success;
}
&.log-message--warning {
color: $color-warning;
}
&.log-message--info {
color: $color-info;
}
&.log-message--danger {
color: $color-danger;
}
}
}
}
</style>