|
|
@@ -10,7 +10,7 @@
|
|
|
</div>
|
|
|
<div class="comment-content">{{comment.content}}</div>
|
|
|
<div class="comment-author">{{ createTime }} | 作者:{{comment.userName}} <span
|
|
|
- class="role">{{role}}</span></div>
|
|
|
+ class="role">{{userTypeNaming[comment.userType]}}</span></div>
|
|
|
<comment-tool-bar
|
|
|
:top-number="comment.topNumber || ''"
|
|
|
:user-id="comment.userId" :has-reply="comment.reply || ''"
|
|
|
@@ -36,13 +36,16 @@ import { removeComment, topComment, unTopComment } from '@/server/comment'
|
|
|
import CommentToolBar from '@/components/Discussion/CommentToolBar'
|
|
|
import CIcon from '@/components/Basic/CIcon'
|
|
|
import momentFromNow from '@/utils/moment-from-now'
|
|
|
+import { userTypeNaming } from '@/server/enums/user-type'
|
|
|
|
|
|
export default {
|
|
|
components: { CIcon, CommentToolBar },
|
|
|
props: ['comment', 'isNew'],
|
|
|
data () {
|
|
|
return {
|
|
|
- replyContent: ''
|
|
|
+ replyContent: '',
|
|
|
+
|
|
|
+ userTypeNaming
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -54,14 +57,6 @@ export default {
|
|
|
},
|
|
|
replyTime () {
|
|
|
return momentFromNow(this.comment.reply.createAt)
|
|
|
- },
|
|
|
- role () {
|
|
|
- if (this.comment.userType === 'TEACHER') {
|
|
|
- return '教师'
|
|
|
- } else if (this.comment.userType === 'STUDENT') {
|
|
|
- return '学生'
|
|
|
- }
|
|
|
- return '身份未知'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|