This commit is contained in:
zzc
2026-06-01 18:50:47 +08:00
parent 4789ac6ca0
commit 908f3ad1b1
2 changed files with 36 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ export function score(data) {
/** /**
* 评分记录 * 评分记录
* @param {*} { pageNo, pageSize, userId?, topicId?, itemId? } * @param {*} { pageNo, pageSize, userId?, topicId?, itemId?, trueUser? }
* @returns * @returns
*/ */
export function scoreRecordList(data) { export function scoreRecordList(data) {

View File

@@ -21,6 +21,8 @@
style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px" style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px"
/> />
<span>{{ item.nickname || '未知用户' }}</span> <span>{{ item.nickname || '未知用户' }}</span>
<el-tag v-if="item.isRobot" size="mini" style="margin-left: 8px" type="info">机器人</el-tag>
<el-tag v-else size="mini" style="margin-left: 8px" type="success">真人</el-tag>
</div> </div>
</el-option> </el-option>
</el-select> </el-select>
@@ -64,6 +66,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item>
<el-button :type="queryForm.trueUser ? 'warning' : 'default'" @click="toggleTrueUser">
{{ queryForm.trueUser ? '已去掉机器人' : '去掉机器人' }}
</el-button>
</el-form-item>
<el-form-item> <el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button> <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item> </el-form-item>
@@ -106,7 +114,11 @@
/> />
<div v-else class="user-avatar-placeholder"><i class="el-icon-user" /></div> <div v-else class="user-avatar-placeholder"><i class="el-icon-user" /></div>
<div class="user-details"> <div class="user-details">
<div class="user-nickname">{{ row.user.nickname || '未知用户' }}</div> <div class="user-nickname">
{{ row.user.nickname || '未知用户' }}
<el-tag v-if="row.user.isRobot" size="mini" style="margin-left: 4px" type="info">机器人</el-tag>
<el-tag v-else size="mini" style="margin-left: 4px" type="success">真人</el-tag>
</div>
<div class="user-id">{{ row.user.id }}</div> <div class="user-id">{{ row.user.id }}</div>
</div> </div>
</div> </div>
@@ -177,11 +189,12 @@
userId: '', userId: '',
topicId: '', topicId: '',
itemId: '', itemId: '',
trueUser: false,
}, },
// 用户下拉列表状态 // 用户下拉列表状态
userList: [], userList: [],
userQuery: { pageNo: 1, pageSize: 20 }, userQuery: { pageNo: 1, pageSize: 20, trueUser: false },
userTotal: 0, userTotal: 0,
fetchingUsers: false, fetchingUsers: false,
@@ -212,7 +225,11 @@
if (this.fetchingUsers) return if (this.fetchingUsers) return
this.fetchingUsers = true this.fetchingUsers = true
try { try {
const { data } = await getUserList(this.userQuery) // 清理传参
const params = { pageNo: this.userQuery.pageNo, pageSize: this.userQuery.pageSize, appId: '6a0d7dbe4c5de50f2ba66475' }
if (this.userQuery.trueUser) params.trueUser = true
const { data } = await getUserList(params)
this.userList = this.userList.concat(data.list || []) this.userList = this.userList.concat(data.list || [])
this.userTotal = data.totalCount || 0 this.userTotal = data.totalCount || 0
} catch (error) { } catch (error) {
@@ -268,6 +285,20 @@
}, },
// -- 交互与筛选 -- // -- 交互与筛选 --
toggleTrueUser() {
this.queryForm.trueUser = !this.queryForm.trueUser
// 同步更新 userQuery
this.userQuery.trueUser = this.queryForm.trueUser
// 重新拉取用户下拉列表
this.userQuery.pageNo = 1
this.userList = []
this.userTotal = 0
this.fetchUserList()
// 重新拉取表格数据
this.queryData()
},
handleTopicChange(val) { handleTopicChange(val) {
// 重置 item 选择 // 重置 item 选择
this.queryForm.itemId = '' this.queryForm.itemId = ''
@@ -309,6 +340,7 @@
if (this.queryForm.userId) params.userId = this.queryForm.userId if (this.queryForm.userId) params.userId = this.queryForm.userId
if (this.queryForm.topicId) params.topicId = this.queryForm.topicId if (this.queryForm.topicId) params.topicId = this.queryForm.topicId
if (this.queryForm.itemId) params.itemId = this.queryForm.itemId if (this.queryForm.itemId) params.itemId = this.queryForm.itemId
if (this.queryForm.trueUser) params.trueUser = true
const { data } = await scoreRecordList(params) const { data } = await scoreRecordList(params)
this.list = data.list || [] this.list = data.list || []