From 908f3ad1b144cea8c9a5c4aec74b8c0237fb1567 Mon Sep 17 00:00:00 2001 From: zzc <1761997216@qq.com> Date: Mon, 1 Jun 2026 18:50:47 +0800 Subject: [PATCH] rating --- src/api/rating/topicOperate.js | 2 +- src/views/rating/topicScoreRecord/index.vue | 38 +++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/api/rating/topicOperate.js b/src/api/rating/topicOperate.js index 45ad05c..39faef5 100644 --- a/src/api/rating/topicOperate.js +++ b/src/api/rating/topicOperate.js @@ -16,7 +16,7 @@ export function score(data) { /** * 评分记录 - * @param {*} { pageNo, pageSize, userId?, topicId?, itemId? } + * @param {*} { pageNo, pageSize, userId?, topicId?, itemId?, trueUser? } * @returns */ export function scoreRecordList(data) { diff --git a/src/views/rating/topicScoreRecord/index.vue b/src/views/rating/topicScoreRecord/index.vue index 1bc9a56..1cf1ce3 100644 --- a/src/views/rating/topicScoreRecord/index.vue +++ b/src/views/rating/topicScoreRecord/index.vue @@ -21,6 +21,8 @@ style="width: 24px; height: 24px; border-radius: 50%; margin-right: 10px" /> {{ item.nickname || '未知用户' }} + 机器人 + 真人 @@ -64,6 +66,12 @@ + + + {{ queryForm.trueUser ? '已去掉机器人' : '去掉机器人' }} + + + 查询 @@ -106,7 +114,11 @@ />
-
{{ row.user.nickname || '未知用户' }}
+
+ {{ row.user.nickname || '未知用户' }} + 机器人 + 真人 +
{{ row.user.id }}
@@ -177,11 +189,12 @@ userId: '', topicId: '', itemId: '', + trueUser: false, }, // 用户下拉列表状态 userList: [], - userQuery: { pageNo: 1, pageSize: 20 }, + userQuery: { pageNo: 1, pageSize: 20, trueUser: false }, userTotal: 0, fetchingUsers: false, @@ -212,7 +225,11 @@ if (this.fetchingUsers) return this.fetchingUsers = true 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.userTotal = data.totalCount || 0 } 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) { // 重置 item 选择 this.queryForm.itemId = '' @@ -309,6 +340,7 @@ if (this.queryForm.userId) params.userId = this.queryForm.userId if (this.queryForm.topicId) params.topicId = this.queryForm.topicId if (this.queryForm.itemId) params.itemId = this.queryForm.itemId + if (this.queryForm.trueUser) params.trueUser = true const { data } = await scoreRecordList(params) this.list = data.list || []