From 34b7c7ab003467398e583417e8ab0a6691f00333 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 25 Feb 2022 10:24:43 +0800 Subject: [PATCH] refactor: comment list component code optimization (halo-dev/console#464) Signed-off-by: Ryan Wang --- src/core/constant.js | 21 + src/views/comment/CommentList.vue | 4 +- src/views/comment/components/CommentTab.vue | 583 ++++++++++---------- 3 files changed, 307 insertions(+), 301 deletions(-) diff --git a/src/core/constant.js b/src/core/constant.js index d91414463..f06dd0490 100644 --- a/src/core/constant.js +++ b/src/core/constant.js @@ -166,3 +166,24 @@ export const sheetStatuses = { text: '回收站' } } + +export const commentStatuses = { + PUBLISHED: { + value: 'PUBLISHED', + color: 'green', + status: 'success', + text: '已发布' + }, + AUDITING: { + value: 'AUDITING', + color: 'yellow', + status: 'warning', + text: '待审核' + }, + RECYCLE: { + value: 'RECYCLE', + color: 'red', + status: 'error', + text: '回收站' + } +} diff --git a/src/views/comment/CommentList.vue b/src/views/comment/CommentList.vue index f40efa2fd..bbbffe13e 100644 --- a/src/views/comment/CommentList.vue +++ b/src/views/comment/CommentList.vue @@ -3,10 +3,10 @@
- + - +
diff --git a/src/views/comment/components/CommentTab.vue b/src/views/comment/components/CommentTab.vue index 8d5096a21..0914e4866 100644 --- a/src/views/comment/components/CommentTab.vue +++ b/src/views/comment/components/CommentTab.vue @@ -12,8 +12,8 @@ - - {{ commentStatus[status].text }} + + {{ commentStatuses[status].text }} @@ -33,131 +33,151 @@
- - - 通过 - - - 移到回收站 - - - 永久删除 - - + 批量操作
+
- - - - -