Browse Source

青涩知夏-》评论管理优化

huanghuijie 4 years ago
parent
commit
a22efd3a11
3 changed files with 10 additions and 2 deletions
  1. 1 1
      src/api/comment.js
  2. 7 0
      src/views/comment/CommentList.vue
  3. 2 1
      src/views/comment/comment-constants.js

+ 1 - 1
src/api/comment.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 export function fetchCommentLists (query) {
   return axios({
-    url: '/comments/comments/v1/get',
+    url: '/comments/comments/v1/list',
     method: 'get',
     params: query
   })

+ 7 - 0
src/views/comment/CommentList.vue

@@ -13,6 +13,13 @@
         showPagination="true"
       >
 
+        <span slot="parentUserName" slot-scope="text">
+           <template>
+            <a v-if="text==null">自主留言</a>
+            <a v-else>{{text}}</a>
+          </template>
+        </span>
+
         <span slot="content" slot-scope="text">
           <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
         </span>

+ 2 - 1
src/views/comment/comment-constants.js

@@ -14,7 +14,8 @@ const table = {
     {
       title: '回复对象',
       align: 'center',
-      dataIndex: 'parentUserName'
+      dataIndex: 'parentUserName',
+      scopedSlots: { customRender: 'parentUserName' }
     },
     {
       title: '文章标题',