1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
<div class="OperationLog">
<a-table :columns="columns" :dataSource="logData" size="default" rowKey="id" :pagination="pagination" @change="handleTableChange">
<span slot="title"></span>
<span slot="createBy" slot-scope="createBy">
{{ createBy ? createBy : '系统操作' }}
</span>
<span slot="remoteAddr"></span>
<span slot="createTime"></span>
</a-table>
</div>
</template>
<script>
import { config } from './../../../api/config.js'
import { $http } from './../../../api/axios.js'
export default {
name: 'operationLog',
data () {
return {
pagination: {
current: 1,
defaultCurrent: 1,
defaultPageSize: 10,
hideOnSinglePage: true,
total: 0
},
columns: [{
title: '日志类型',
dataIndex: 'title'
}, {
title: '操作人',
dataIndex: 'createBy',
scopedSlots: { customRender: 'createBy' }
}, {
title: 'IP地址',
dataIndex: 'remoteAddr'
}, {
title: '操作时间',
dataIndex: 'createTime'
}],
logData: []
}
},
created: function () {
this.queryLog()
},
methods: {
queryLog () {
let queryLogData = {
desc: 'create_time',
serviceId: 'mingpay-web',
current: this.pagination.current,
size: this.pagination.defaultPageSize
}
$http.get(`/mingpay/v1/log/query`, queryLogData).then((res) => {
if (res.data.resultCode === 0) {
this.pagination.total = res.data.data.total
this.logData = res.data.data.records
} else {
this.$message.error('获取日志信息失败')
}
}).catch(() => {
this.$message.error('获取日志信息失败')
})
},
handleTableChange (pagination, filters, sorter) {
this.pagination.current = pagination.current
this.queryLog()
}
}
}
</script>
<style lang="less" scoped>
</style>