fix: robot

This commit is contained in:
zzc
2026-07-05 18:34:48 +08:00
parent c60ea798fd
commit 8da9a7e8cc

View File

@@ -11,13 +11,18 @@
style="width: 100%" style="width: 100%"
> >
<el-option v-for="item in robotList" :key="item.id" :label="item.nickname" :value="item.id"> <el-option v-for="item in robotList" :key="item.id" :label="item.nickname" :value="item.id">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center; justify-content: space-between">
<el-image <div style="display: flex; align-items: center; min-width: 0">
v-if="item.avatar" <el-image
:src="getThumbUrl(item.avatar)" v-if="item.avatar"
style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px" :src="getThumbUrl(item.avatar)"
/> style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px"
<span>{{ item.nickname }}</span> />
<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> </div>
</el-option> </el-option>
</el-select> </el-select>
@@ -84,6 +89,26 @@
}, },
methods: { methods: {
getThumbUrl, 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) { async showEdit(row, topicId) {
this.title = `${row.name} 写评论` this.title = `${row.name} 写评论`
this.form = this.$options.data().form this.form = this.$options.data().form
@@ -92,6 +117,8 @@
this.dialogFormVisible = true this.dialogFormVisible = true
this.robotQuery.pageNo = 1 this.robotQuery.pageNo = 1
this.robotQuery.onlyTopicId = topicId
this.robotQuery.onlyItemId = row.id
this.robotList = [] this.robotList = []
this.robotTotal = 0 this.robotTotal = 0
await this.fetchRobotList() await this.fetchRobotList()