rating
This commit is contained in:
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 评分
|
||||
/**
|
||||
* 评分
|
||||
* @param {*} { topicId, itemId, scoreType }
|
||||
* @param {*} { topicId, itemId, scoreType, userId }
|
||||
* @returns
|
||||
*/
|
||||
export function score(data) {
|
||||
@@ -13,3 +13,16 @@ export function score(data) {
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论
|
||||
* @param {*} { topicId, itemId, comment, userId }
|
||||
* @returns
|
||||
*/
|
||||
export function comment(data) {
|
||||
return request({
|
||||
url: 'management/api/rating/topicItemOperate/comment',
|
||||
method: 'get',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -44,7 +44,33 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="queryForm.appId === '6a0d7dbe4c5de50f2ba66475'" label="操作" width="100">
|
||||
<el-table-column v-if="queryForm.appId === '6a0d7dbe4c5de50f2ba66475'" label="评价信息" min-width="300">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.ratingInfo && row.ratingInfo.length > 0" class="rating-info-list">
|
||||
<div v-for="item in row.ratingInfo" :key="item.id" class="rating-info-item">
|
||||
<el-image
|
||||
v-if="item.itemAvatarUrl"
|
||||
:preview-src-list="[item.itemAvatarUrl]"
|
||||
:src="getThumbUrl(item.itemAvatarUrl)"
|
||||
style="width: 30px; height: 30px; border-radius: 4px; margin-right: 8px; flex-shrink: 0"
|
||||
/>
|
||||
<div class="rating-info-content">
|
||||
<div class="rating-info-title">
|
||||
<span class="topic-name">[{{ item.topicName }}]</span>
|
||||
<span class="item-name">{{ item.itemName }}</span>
|
||||
</div>
|
||||
<div class="rating-info-meta">
|
||||
<el-tag size="mini" :type="getScoreTypeTag(item.scoreType)">{{ getScoreTypeText(item.scoreType) }}</el-tag>
|
||||
<span class="score-count">评价人数: {{ item.itemScoreCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>-</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="queryForm.appId === '6a0d7dbe4c5de50f2ba66475'" align="center" fixed="right" label="操作" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button type="text" @click="handleRating(row)">评分</el-button>
|
||||
</template>
|
||||
@@ -154,6 +180,26 @@
|
||||
handleRating(row) {
|
||||
this.$refs['ratingEdit'].showEdit(row)
|
||||
},
|
||||
getScoreTypeText(type) {
|
||||
const map = {
|
||||
1: '夯',
|
||||
2: '顶级',
|
||||
3: '人上人',
|
||||
4: 'NPC',
|
||||
5: '拉',
|
||||
}
|
||||
return map[type] || '未知'
|
||||
},
|
||||
getScoreTypeTag(type) {
|
||||
const map = {
|
||||
1: 'success', // 夯
|
||||
2: 'primary', // 顶级
|
||||
3: 'warning', // 人上人
|
||||
4: 'info', // NPC
|
||||
5: 'danger', // 拉
|
||||
}
|
||||
return map[type] || 'info'
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -162,4 +208,62 @@
|
||||
.robot-management-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.rating-info-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.rating-info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f7fa;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.rating-info-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.rating-info-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 4px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.topic-name {
|
||||
color: #409eff;
|
||||
margin-right: 5px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.rating-info-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.score-count {
|
||||
color: #909399;
|
||||
margin-left: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user