From 289996aa95b20601cf07ea4ca2302aa06ac0be7b Mon Sep 17 00:00:00 2001 From: ruibaby Date: Wed, 15 May 2019 10:53:20 +0800 Subject: [PATCH] Sheet comment management. --- src/api/comment.js | 30 ++ src/components/global.less | 8 +- src/views/comment/CommentList.vue | 449 ++--------------------------- src/views/comment/CommentTab.vue | 450 ++++++++++++++++++++++++++++++ 4 files changed, 506 insertions(+), 431 deletions(-) create mode 100644 src/views/comment/CommentTab.vue diff --git a/src/api/comment.js b/src/api/comment.js index cd583d62..64b1f9c9 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -20,6 +20,36 @@ function latestComment(target, top, status) { }) } +commentApi.queryComment = (target, params) => { + return service({ + url: `${baseUrl}/${target}/comments`, + params: params, + method: 'get' + }) +} + +commentApi.updateStatus = (target, commentId, status) => { + return service({ + url: `${baseUrl}/${target}/comments/${commentId}/status/${status}`, + method: 'put' + }) +} + +commentApi.delete = (target, commentId) => { + return service({ + url: `${baseUrl}/${target}/comments/${commentId}`, + method: 'delete' + }) +} + +commentApi.create = (target, comment) => { + return service({ + url: `${baseUrl}/${target}/comments`, + data: comment, + method: 'post' + }) +} + /** * Creates a comment. * @param {String} target diff --git a/src/components/global.less b/src/components/global.less index ddf64b07..b0418a8e 100644 --- a/src/components/global.less +++ b/src/components/global.less @@ -527,7 +527,13 @@ body { .ant-card-wider-padding { .ant-card-body { - padding: 24px !important; + padding: 16px !important; + } +} + +.comment-tab-wrapper{ + .ant-card-body { + padding: 0 !important; } } diff --git a/src/views/comment/CommentList.vue b/src/views/comment/CommentList.vue index d0ece8ed..83e670ec 100644 --- a/src/views/comment/CommentList.vue +++ b/src/views/comment/CommentList.vue @@ -1,446 +1,35 @@ diff --git a/src/views/comment/CommentTab.vue b/src/views/comment/CommentTab.vue new file mode 100644 index 00000000..585e0c63 --- /dev/null +++ b/src/views/comment/CommentTab.vue @@ -0,0 +1,450 @@ + +