From 41c4fdbc5c1d03eb98c1ead607875cfa30715cff Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 4 Jun 2026 08:44:54 -0600 Subject: [PATCH] update --- src/admin/ai/list.vue | 82 ++++++++++++++++++++++++++++--------- src/admin/api.ts | 8 ++++ src/oj/ai/components/AI.vue | 37 +++++++++++------ src/oj/api.ts | 4 ++ src/oj/store/ai.ts | 10 ++++- 5 files changed, 107 insertions(+), 34 deletions(-) diff --git a/src/admin/ai/list.vue b/src/admin/ai/list.vue index c39059c..d7d0aec 100644 --- a/src/admin/ai/list.vue +++ b/src/admin/ai/list.vue @@ -8,6 +8,21 @@ style="width: 200px" /> + + 以下 {{ pinnedReports.length }} 位用户的 AI 分析报告已被锁定,前台将固定显示该报告: + + + {{ r.username }}{{ r.class_name ? `(${r.class_name})` : "" }} + + + {{ parseTime(detail.create_time, "YYYY-MM-DD HH:mm:ss") }} -
{{ detail.analysis }}
+
@@ -32,16 +47,19 @@ @@ -114,13 +165,4 @@ watchDebounced(() => query.username, listReports, { debounce: 500, maxWait: 1000 .detail .meta { margin-bottom: 0; } -.analysis { - white-space: pre-wrap; - word-break: break-word; - font-family: inherit; - font-size: 14px; - line-height: 1.6; - margin: 0; - padding: 8px; -} diff --git a/src/admin/api.ts b/src/admin/api.ts index aa17eff..fc6bfc7 100644 --- a/src/admin/api.ts +++ b/src/admin/api.ts @@ -501,3 +501,11 @@ export function getAIReportList(offset = 0, limit = 10, username = "") { export function getAIReportDetail(id: number) { return http.get("admin/ai/reports", { params: { id } }) } + +export function pinAIReport(id: number) { + return http.post("admin/ai/reports", { id }) +} + +export function getPinnedAIReports() { + return http.get("admin/ai/reports", { params: { pinned_only: "true" } }) +} diff --git a/src/oj/ai/components/AI.vue b/src/oj/ai/components/AI.vue index 0d3d2ca..46c5686 100644 --- a/src/oj/ai/components/AI.vue +++ b/src/oj/ai/components/AI.vue @@ -7,19 +7,24 @@ - - - 开始分析 - - + + @@ -38,6 +43,12 @@ async function handleAnalyze() { } await aiStore.fetchAIAnalysis() } + +onMounted(async () => { + if (!aiStore.targetUsername) { + await aiStore.fetchPinnedReport() + } +})