fix: robot
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
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">
|
||||
<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)"
|
||||
@@ -19,6 +20,10 @@
|
||||
/>
|
||||
<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>
|
||||
</el-form-item>
|
||||
@@ -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