From 039b274bc1488e86e74e0153606284f9f720427b Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 18 Apr 2019 22:20:13 +0800 Subject: [PATCH] Complate comment list. --- src/api/comment.js | 26 ++++++ src/views/comment/CommentList.vue | 134 ++++++++++++++++++++++++------ src/views/post/PostList.vue | 3 - src/views/user/Profile.vue | 2 +- 4 files changed, 134 insertions(+), 31 deletions(-) diff --git a/src/api/comment.js b/src/api/comment.js index 0afa43c8..4b90249d 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -11,4 +11,30 @@ commentApi.listLatest = () => { }) } +commentApi.query = params => { + return service({ + url: baseUrl, + params: params, + method: 'get' + }) +} + +commentApi.commentStatus = { + PUBLISHED: { + color: 'green', + status: 'success', + text: '已发布' + }, + AUDITING: { + color: 'yellow', + status: 'warning', + text: '待审核' + }, + RECYCLE: { + color: 'red', + status: 'error', + text: '回收站' + } +} + export default commentApi diff --git a/src/views/comment/CommentList.vue b/src/views/comment/CommentList.vue index 86b83ac9..3cd3919c 100644 --- a/src/views/comment/CommentList.vue +++ b/src/views/comment/CommentList.vue @@ -6,23 +6,25 @@ - + - - 已发布 - 待审核 - 回收站 + + {{ commentStatus[status].text }} - 查询 - 重置 + 查询 + 重置 @@ -32,22 +34,46 @@
- 回收站 + + 回收站 + - 批量操作 - + + 批量操作 +
- + + + + {{ statusProperty.text }} + + {{ post.title }} + {{ createTime | timeAgo }} - 编辑 - + 通过 + 删除 + + +
@@ -55,13 +81,10 @@ + diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue index 7c624027..e97d69b2 100644 --- a/src/views/post/PostList.vue +++ b/src/views/post/PostList.vue @@ -191,7 +191,6 @@ export default { data() { return { postStatus: postApi.postStatus, - // 查询参数 pagination: { current: 1, pageSize: 10, @@ -253,8 +252,6 @@ export default { ], selectedRowKeys: [], selectedRows: [], - options: {}, - optionAlertShow: false, categories: [], posts: [], postsLoading: false diff --git a/src/views/user/Profile.vue b/src/views/user/Profile.vue index 7a95d039..b1cd36fb 100644 --- a/src/views/user/Profile.vue +++ b/src/views/user/Profile.vue @@ -1,6 +1,6 @@