From 88ed92d78c7641ffe8cadee96cf5cb3b7880a842 Mon Sep 17 00:00:00 2001 From: Nelson <1475262689@qq.com> Date: Fri, 31 Jul 2026 16:30:39 +0800 Subject: [PATCH] feat: add admin user detail insights --- .../apps/admin-web/src/App.vue | 150 +++++++++++++++++- .../apps/admin-web/src/services/api.ts | 2 + .../apps/admin-web/src/styles.css | 41 +++++ .../apps/admin-web/src/types/api.ts | 47 ++++++ .../apps/backend/app/api/admin_users.py | 122 +++++++++++++- .../docs/qianwen_product_todo.md | 4 + 6 files changed, 361 insertions(+), 5 deletions(-) diff --git a/ai_knowledge_base_v2/apps/admin-web/src/App.vue b/ai_knowledge_base_v2/apps/admin-web/src/App.vue index dd1ad70..c582d7c 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/App.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/App.vue @@ -12,6 +12,7 @@ import { api, clearToken, getToken, saveToken } from "./services/api"; import type { AdminProfile, AdminUser, + AdminUserDetail, AiLogRecord, ChatDetail, ChatRecord, @@ -41,6 +42,9 @@ const dashboardFilters = reactive({ end: "", }); const users = ref([]); +const selectedUserDetail = ref(null); +const userDetailOpen = ref(false); +const userDetailLoading = ref(false); const userKeyword = ref(""); const entitlementPlans = ref([]); const editingEntitlementPlanId = ref(null); @@ -401,6 +405,17 @@ async function assignUserEntitlement(row: AdminUser, planId: number) { ElMessage.success("用户权益已更新"); } +async function openUserDetail(row: AdminUser) { + userDetailOpen.value = true; + selectedUserDetail.value = null; + userDetailLoading.value = true; + try { + selectedUserDetail.value = await api.userDetail(row.id); + } finally { + userDetailLoading.value = false; + } +} + async function loadRecordTab(tab = recordTab.value) { loading.value = true; try { @@ -1138,10 +1153,20 @@ function formatRecordDateTime(value: string, boundary: "start" | "end") { - + @@ -1610,6 +1635,125 @@ function formatRecordDateTime(value: string, boundary: "start" | "end") { + +
+ +
+
+