diff --git a/ai_knowledge_base_v2/apps/admin-web/src/components/RecordAuditView.vue b/ai_knowledge_base_v2/apps/admin-web/src/components/RecordAuditView.vue index 693ad63..97fb0c5 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/components/RecordAuditView.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/components/RecordAuditView.vue @@ -6,6 +6,7 @@ import type { AiLogRecord, ChatRecord, QuestionInsightSummary, + SsoClientItem, } from "../types/api"; import AdminPagination from "./AdminPagination.vue"; import AiLogDetailDrawer from "./AiLogDetailDrawer.vue"; @@ -15,6 +16,7 @@ type RecordTab = "chats" | "questionInsights" | "aiLogs" | "operationLogs"; const loading = ref(false); const activeTab = ref("chats"); const chats = ref([]); +const ssoClients = ref([]); const aiLogs = ref([]); const operationLogs = ref[]>([]); const insights = ref(null); @@ -32,6 +34,8 @@ const chatFilters = reactive({ keyword: "", userId: undefined as number | undefined, status: "", + sourceType: "", + sourceClientId: undefined as number | undefined, dateFrom: "", dateTo: "", }); @@ -42,7 +46,9 @@ const insightFilters = reactive({ maxMessages: 5000, }); -onMounted(() => loadTab("chats")); +onMounted(async () => { + await Promise.all([loadTab("chats"), loadSsoClients()]); +}); watch(activeTab, (tab) => loadTab(tab)); async function loadTab(tab: RecordTab = activeTab.value) { @@ -91,6 +97,13 @@ async function loadTab(tab: RecordTab = activeTab.value) { loading.value = false; } } +async function loadSsoClients() { + try { + ssoClients.value = await api.ssoClients(); + } catch { + ssoClients.value = []; + } +} async function changePage(tab: RecordTab, page: number, pageSize: number) { Object.assign(pagers[tab], { page, pageSize }); @@ -123,6 +136,8 @@ async function resetChatFilters() { keyword: "", userId: undefined, status: "", + sourceType: "", + sourceClientId: undefined, dateFrom: "", dateTo: "", }); @@ -173,6 +188,8 @@ function buildChatQuery() { keyword: chatFilters.keyword, userId: chatFilters.userId, status: chatFilters.status, + sourceType: chatFilters.sourceType, + sourceClientId: chatFilters.sourceClientId, dateFrom: formatDateTime(chatFilters.dateFrom, "start"), dateTo: formatDateTime(chatFilters.dateTo, "end"), }; @@ -220,6 +237,13 @@ function formatMoney(value?: number | null, currency = "CNY") { label="已停止" value="STOPPED" /> + + + + + + +