Format log type.

pull/9/head
ruibaby 6 years ago
parent b1345b6850
commit 396f3c3443

@ -14,4 +14,43 @@ logApi.listLatest = (top) => {
}) })
} }
logApi.logType = {
BLOG_INITIALIZED: {
value: 0,
text: '博客初始化'
},
POST_PUBLISHED: {
value: 5,
text: '文章发布'
},
POST_EDITED: {
value: 15,
text: '文章修改'
},
POST_DELETED: {
value: 20,
text: '文章删除'
},
LOGGED_IN: {
value: 25,
text: '用户登陆'
},
LOGGED_OUT: {
value: 30,
text: '注销登陆'
},
LOGIN_FAILED: {
value: 35,
text: '登陆失败'
},
PASSWORD_UPDATED: {
value: 40,
text: '修改密码'
},
PROFILE_UPDATED: {
value: 45,
text: '资料修改'
}
}
export default logApi export default logApi

@ -221,7 +221,7 @@
title="日志记录" title="日志记录"
:bodyStyle="{ padding: '16px' }" :bodyStyle="{ padding: '16px' }"
> >
<a-list :dataSource="logData"> <a-list :dataSource="formattedLogDatas">
<a-list-item <a-list-item
slot="renderItem" slot="renderItem"
slot-scope="item, index" slot-scope="item, index"
@ -256,6 +256,7 @@ export default {
}, },
data() { data() {
return { return {
logType: logApi.logType,
activityLoading: true, activityLoading: true,
logLoading: true, logLoading: true,
countsLoading: true, countsLoading: true,
@ -279,6 +280,12 @@ export default {
post.status = postApi.postStatus[post.status] post.status = postApi.postStatus[post.status]
return post return post
}) })
},
formattedLogDatas() {
return this.logData.map(log => {
log.type = this.logType[log.type].text
return log
})
} }
}, },
methods: { methods: {

@ -3,9 +3,11 @@
<div class="card-content"> <div class="card-content">
<a-row :gutter="12"> <a-row :gutter="12">
<a-col <a-col
:sm="24" :xl="4"
:lg="4"
:md="12" :md="12"
:lg="8" :sm="24"
:xs="24"
> >
<a-card <a-card
title="Markdown 文章导入" title="Markdown 文章导入"

Loading…
Cancel
Save