Compare commits
3 Commits
c60ea798fd
...
5.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
254d2601bf | ||
|
|
28fff91b57 | ||
|
|
8da9a7e8cc |
@@ -57,39 +57,53 @@ export const asyncRoutes = [
|
||||
children: [
|
||||
{
|
||||
path: 'topic',
|
||||
name: 'RatingTopicIndex',
|
||||
component: () => import('@/views/rating/topic/index'),
|
||||
meta: { title: '评分话题' },
|
||||
},
|
||||
{
|
||||
path: 'topic-recommend',
|
||||
name: 'RatingTopicRecommendIndex',
|
||||
component: () => import('@/views/rating/topicRecommend/index'),
|
||||
meta: { title: '话题推荐' },
|
||||
},
|
||||
{
|
||||
path: 'topic-item',
|
||||
name: 'RatingTopicItemIndex',
|
||||
component: () => import('@/views/rating/topicItem/index'),
|
||||
meta: { title: '评分项' },
|
||||
},
|
||||
{
|
||||
path: 'topic-record',
|
||||
name: 'RatingTopicRecordIndex',
|
||||
component: () => import('@/views/rating/topicScoreRecord/index'),
|
||||
meta: { title: '用户评分记录' },
|
||||
},
|
||||
{
|
||||
path: 'topic-comment',
|
||||
name: 'RatingTopicCommentIndex',
|
||||
component: () => import('@/views/rating/topicCommentRecord/index'),
|
||||
meta: { title: '用户评论记录' },
|
||||
},
|
||||
{
|
||||
path: 'topic-category',
|
||||
name: 'RatingTopicCategoryIndex',
|
||||
component: () => import('@/views/rating/topicCategory/index'),
|
||||
meta: { title: '评分话题分类' },
|
||||
component: EmptyLayout,
|
||||
alwaysShow: true,
|
||||
redirect: 'noRedirect',
|
||||
name: 'TopicIndex',
|
||||
meta: {
|
||||
title: '评分话题',
|
||||
icon: 'clover',
|
||||
permissions: ['admin'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'recommend',
|
||||
name: 'RatingTopicRecommendIndex',
|
||||
component: () => import('@/views/rating/topicRecommend/index'),
|
||||
meta: { title: '话题推荐' },
|
||||
},
|
||||
{
|
||||
path: 'category',
|
||||
name: 'RatingTopicCategoryIndex',
|
||||
component: () => import('@/views/rating/topicCategory/index'),
|
||||
meta: { title: '评分话题分类' },
|
||||
},
|
||||
{
|
||||
path: 'list',
|
||||
name: 'RatingTopicIndex',
|
||||
component: () => import('@/views/rating/topic/index'),
|
||||
meta: { title: '评分话题' },
|
||||
},
|
||||
{
|
||||
path: 'item',
|
||||
name: 'RatingTopicItemIndex',
|
||||
component: () => import('@/views/rating/topicItem/index'),
|
||||
meta: { title: '评分项' },
|
||||
},
|
||||
{
|
||||
path: 'record',
|
||||
name: 'RatingTopicRecordIndex',
|
||||
component: () => import('@/views/rating/topicScoreRecord/index'),
|
||||
meta: { title: '用户评分记录' },
|
||||
},
|
||||
{
|
||||
path: 'comment',
|
||||
name: 'RatingTopicCommentIndex',
|
||||
component: () => import('@/views/rating/topicCommentRecord/index'),
|
||||
meta: { title: '用户评论记录' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'pk',
|
||||
|
||||
@@ -127,13 +127,18 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="item in commentUserList" :key="item.id" :label="item.nickname || item.id" :value="item.id">
|
||||
<div style="display: flex; align-items: center">
|
||||
<el-image
|
||||
v-if="item.avatar"
|
||||
:src="getThumbUrl(item.avatar)"
|
||||
style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px"
|
||||
/>
|
||||
<span>{{ item.nickname || '未知用户' }}</span>
|
||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||
<div style="display: flex; align-items: center; min-width: 0">
|
||||
<el-image
|
||||
v-if="item.avatar"
|
||||
:src="getThumbUrl(item.avatar)"
|
||||
style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px"
|
||||
/>
|
||||
<span>{{ item.nickname || '未知用户' }}</span>
|
||||
</div>
|
||||
<el-tag v-if="item.choose" size="mini" style="margin-left: 12px; flex-shrink: 0" type="info">
|
||||
{{ getCommentUserChooseName(item.choose) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -233,6 +238,7 @@
|
||||
},
|
||||
commentUserTotal: 0,
|
||||
fetchingCommentUsers: false,
|
||||
currentCommentPk: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -342,8 +348,19 @@
|
||||
handleVote(pkId, itemId, itemName) {
|
||||
this.$refs['voteEdit'].showEdit(pkId, itemId, itemName)
|
||||
},
|
||||
getCommentUserChooseName(choose) {
|
||||
if (!choose || !this.currentCommentPk) return '-'
|
||||
if (choose === this.currentCommentPk.leftItemId) {
|
||||
return this.currentCommentPk.leftItemName || '-'
|
||||
}
|
||||
if (choose === this.currentCommentPk.rightItemId) {
|
||||
return this.currentCommentPk.rightItemName || '-'
|
||||
}
|
||||
return '-'
|
||||
},
|
||||
handleComment(row) {
|
||||
this.commentDialogVisible = true
|
||||
this.currentCommentPk = row
|
||||
this.commentForm = {
|
||||
pkId: row.id,
|
||||
userId: '',
|
||||
@@ -360,6 +377,7 @@
|
||||
this.$refs['commentForm'].resetFields()
|
||||
}
|
||||
this.commentDialogVisible = false
|
||||
this.currentCommentPk = null
|
||||
},
|
||||
async fetchCommentUsers() {
|
||||
if (this.fetchingCommentUsers || !this.commentUserQuery.pkId) return
|
||||
|
||||
@@ -11,13 +11,18 @@
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="item in robotList" :key="item.id" :label="item.nickname" :value="item.id">
|
||||
<div style="display: flex; align-items: center">
|
||||
<el-image
|
||||
v-if="item.avatar"
|
||||
:src="getThumbUrl(item.avatar)"
|
||||
style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px"
|
||||
/>
|
||||
<span>{{ item.nickname }}</span>
|
||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||
<div style="display: flex; align-items: center; min-width: 0">
|
||||
<el-image
|
||||
v-if="item.avatar"
|
||||
:src="getThumbUrl(item.avatar)"
|
||||
style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px"
|
||||
/>
|
||||
<span>{{ item.nickname }}</span>
|
||||
</div>
|
||||
<el-tag v-if="item.score" size="mini" style="margin-left: 12px; flex-shrink: 0" :type="getScoreTagType(item.score)">
|
||||
{{ getScoreText(item.score) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -84,6 +89,26 @@
|
||||
},
|
||||
methods: {
|
||||
getThumbUrl,
|
||||
getScoreText(score) {
|
||||
const map = {
|
||||
2: '拉',
|
||||
4: 'npc',
|
||||
6: '人上人',
|
||||
8: '顶级',
|
||||
10: '夯',
|
||||
}
|
||||
return map[score] || score
|
||||
},
|
||||
getScoreTagType(score) {
|
||||
const map = {
|
||||
2: 'info',
|
||||
4: 'warning',
|
||||
6: '',
|
||||
8: 'success',
|
||||
10: 'danger',
|
||||
}
|
||||
return map[score] || 'info'
|
||||
},
|
||||
async showEdit(row, topicId) {
|
||||
this.title = `给 ${row.name} 写评论`
|
||||
this.form = this.$options.data().form
|
||||
@@ -92,6 +117,8 @@
|
||||
this.dialogFormVisible = true
|
||||
|
||||
this.robotQuery.pageNo = 1
|
||||
this.robotQuery.onlyTopicId = topicId
|
||||
this.robotQuery.onlyItemId = row.id
|
||||
this.robotList = []
|
||||
this.robotTotal = 0
|
||||
await this.fetchRobotList()
|
||||
|
||||
Reference in New Issue
Block a user