|
|
|
@ -1,87 +1,89 @@
|
|
|
|
|
<template> |
|
|
|
|
<a-comment> |
|
|
|
|
<template #author> |
|
|
|
|
<a :href="comment.authorUrl" target="_blank"> |
|
|
|
|
<a-icon v-if="comment.isAdmin" style="margin-right: 3px" type="user" /> |
|
|
|
|
{{ comment.author }} |
|
|
|
|
</a> |
|
|
|
|
</template> |
|
|
|
|
<a-list-item class="!p-0"> |
|
|
|
|
<a-comment> |
|
|
|
|
<template #author> |
|
|
|
|
<a :href="comment.authorUrl" target="_blank"> |
|
|
|
|
<a-icon v-if="comment.isAdmin" style="margin-right: 3px" type="user" /> |
|
|
|
|
{{ comment.author }} |
|
|
|
|
</a> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template #avatar> |
|
|
|
|
<a-avatar :alt="comment.author" :src="comment.avatar" size="large" /> |
|
|
|
|
</template> |
|
|
|
|
<template #avatar> |
|
|
|
|
<a-avatar :alt="comment.author" :src="comment.avatar" size="large" /> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template #content> |
|
|
|
|
<div class="comment-modal-content" v-html="$options.filters.markdownRender(comment.content)"></div> |
|
|
|
|
</template> |
|
|
|
|
<template #content> |
|
|
|
|
<div class="comment-modal-content" v-html="$options.filters.markdownRender(comment.content)"></div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template #datetime> |
|
|
|
|
<a-tooltip> |
|
|
|
|
<template #title> |
|
|
|
|
<span>{{ comment.createTime | moment }}</span> |
|
|
|
|
</template> |
|
|
|
|
<span>{{ comment.createTime | timeAgo }}</span> |
|
|
|
|
</a-tooltip> |
|
|
|
|
</template> |
|
|
|
|
<template #datetime> |
|
|
|
|
<a-tooltip> |
|
|
|
|
<template #title> |
|
|
|
|
<span>{{ comment.createTime | moment }}</span> |
|
|
|
|
</template> |
|
|
|
|
<span>{{ comment.createTime | timeAgo }}</span> |
|
|
|
|
</a-tooltip> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template #actions> |
|
|
|
|
<a-dropdown v-if="comment.status === 'AUDITING'" :trigger="['click']"> |
|
|
|
|
<span>通过</span> |
|
|
|
|
<template #actions> |
|
|
|
|
<a-dropdown v-if="comment.status === 'AUDITING'" :trigger="['click']"> |
|
|
|
|
<span>通过</span> |
|
|
|
|
|
|
|
|
|
<template #overlay> |
|
|
|
|
<a-menu> |
|
|
|
|
<a-menu-item key="1" @click="handleChangeStatus('PUBLISHED')"> 通过</a-menu-item> |
|
|
|
|
<a-menu-item key="2" @click="handlePublishAndReply"> 通过并回复</a-menu-item> |
|
|
|
|
</a-menu> |
|
|
|
|
</template> |
|
|
|
|
</a-dropdown> |
|
|
|
|
<template #overlay> |
|
|
|
|
<a-menu> |
|
|
|
|
<a-menu-item key="1" @click="handleChangeStatus('PUBLISHED')"> 通过</a-menu-item> |
|
|
|
|
<a-menu-item key="2" @click="handlePublishAndReply"> 通过并回复</a-menu-item> |
|
|
|
|
</a-menu> |
|
|
|
|
</template> |
|
|
|
|
</a-dropdown> |
|
|
|
|
|
|
|
|
|
<span v-else-if="comment.status === 'PUBLISHED'" @click="replyModalVisible = true">回复</span> |
|
|
|
|
<span v-else-if="comment.status === 'PUBLISHED'" @click="replyModalVisible = true">回复</span> |
|
|
|
|
|
|
|
|
|
<a-popconfirm |
|
|
|
|
v-else-if="comment.status === 'RECYCLE'" |
|
|
|
|
:title="'你确定要还原该评论?'" |
|
|
|
|
cancelText="取消" |
|
|
|
|
okText="确定" |
|
|
|
|
@confirm="handleChangeStatus('PUBLISHED')" |
|
|
|
|
> |
|
|
|
|
还原 |
|
|
|
|
</a-popconfirm> |
|
|
|
|
<a-popconfirm |
|
|
|
|
v-else-if="comment.status === 'RECYCLE'" |
|
|
|
|
:title="'你确定要还原该评论?'" |
|
|
|
|
cancelText="取消" |
|
|
|
|
okText="确定" |
|
|
|
|
@confirm="handleChangeStatus('PUBLISHED')" |
|
|
|
|
> |
|
|
|
|
还原 |
|
|
|
|
</a-popconfirm> |
|
|
|
|
|
|
|
|
|
<a-popconfirm |
|
|
|
|
v-if="comment.status === 'PUBLISHED' || comment.status === 'AUDITING'" |
|
|
|
|
:title="'你确定要将该评论移到回收站?'" |
|
|
|
|
cancelText="取消" |
|
|
|
|
okText="确定" |
|
|
|
|
@confirm="handleChangeStatus('RECYCLE')" |
|
|
|
|
> |
|
|
|
|
回收站 |
|
|
|
|
</a-popconfirm> |
|
|
|
|
<a-popconfirm |
|
|
|
|
v-if="comment.status === 'PUBLISHED' || comment.status === 'AUDITING'" |
|
|
|
|
:title="'你确定要将该评论移到回收站?'" |
|
|
|
|
cancelText="取消" |
|
|
|
|
okText="确定" |
|
|
|
|
@confirm="handleChangeStatus('RECYCLE')" |
|
|
|
|
> |
|
|
|
|
回收站 |
|
|
|
|
</a-popconfirm> |
|
|
|
|
|
|
|
|
|
<a-popconfirm :title="'你确定要永久删除该评论?'" cancelText="取消" okText="确定" @confirm="handleDelete"> |
|
|
|
|
删除 |
|
|
|
|
</a-popconfirm> |
|
|
|
|
</template> |
|
|
|
|
<a-popconfirm :title="'你确定要永久删除该评论?'" cancelText="取消" okText="确定" @confirm="handleDelete"> |
|
|
|
|
删除 |
|
|
|
|
</a-popconfirm> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template v-if="comment.children"> |
|
|
|
|
<TargetCommentTreeNode |
|
|
|
|
v-for="(child, index) in comment.children" |
|
|
|
|
:key="index" |
|
|
|
|
:comment="child" |
|
|
|
|
<template v-if="comment.children"> |
|
|
|
|
<TargetCommentTreeNode |
|
|
|
|
v-for="(child, index) in comment.children" |
|
|
|
|
:key="index" |
|
|
|
|
:comment="child" |
|
|
|
|
:target="target" |
|
|
|
|
:target-id="targetId" |
|
|
|
|
@reload="$emit('reload')" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<CommentReplyModal |
|
|
|
|
:comment="comment" |
|
|
|
|
:target="target" |
|
|
|
|
:target-id="targetId" |
|
|
|
|
@reload="$emit('reload')" |
|
|
|
|
:visible.sync="replyModalVisible" |
|
|
|
|
@succeed="$emit('reload')" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<CommentReplyModal |
|
|
|
|
:comment="comment" |
|
|
|
|
:target="target" |
|
|
|
|
:target-id="targetId" |
|
|
|
|
:visible.sync="replyModalVisible" |
|
|
|
|
@succeed="$emit('reload')" |
|
|
|
|
/> |
|
|
|
|
</a-comment> |
|
|
|
|
</a-comment> |
|
|
|
|
</a-list-item> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import apiClient from '@/utils/api-client' |
|
|
|
|