Former-commit-id: 46dd58602044e544021e6dac3750f8063dd8f630 [formerly 46dd58602044e544021e6dac3750f8063dd8f630 [formerly 46dd58602044e544021e6dac3750f8063dd8f630 [formerly 46dd58602044e544021e6dac3750f8063dd8f630 [formerly 02da1cf89a30a31b7ada6753276bf8d7db49c7c2 [formerly 8732cbe9dc0937266a143b0cb94061cc6458c22f]]]]] Former-commit-id: 9bb0587d2bf29ae030c34e973b2968898c409efa Former-commit-id: 4573b85856d998f1e0e1fc745aa84c116374b757 Former-commit-id: 499c55cf76d4187c091b3780fc492b863b20160a [formerly 522496547f9dcaeb7cceff1c71ca90d19fa853ce] Former-commit-id: 76cf33d5c5abb90f90715e0678987996286b8e7a Former-commit-id: c5601273186197e17715589beec00fa4b0d93c8f Former-commit-id: 2057049057822377d125e273d901e9e0b01d3d99 Former-commit-id: 4a45cde995408c9e2de7028e9335c72a57f93530 Former-commit-id: b8a74a0c8dca434b6dd43606d97cebb396bc36c0
86 lines
1.6 KiB
Vue
86 lines
1.6 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">{{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;
|
|
}
|
|
}
|
|
}
|
|
</style>
|