From 97049d562b159182a9a258c41072ec4614d8b231 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 13 Oct 2026 13:27:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=90=8E=E5=8F=B0=E9=A2=98=E7=9B=AE):=20?= =?UTF-8?q?=E9=A2=98=E7=9B=AE=E5=88=97=E8=A1=A8=E9=87=8D=E6=8E=92=E2=80=94?= =?UTF-8?q?=E2=80=941366=20=E5=B1=8F=E4=B8=8A=E4=B8=8D=E7=94=A8=E6=A8=AA?= =?UTF-8?q?=E6=BB=9A=E5=B0=B1=E7=9C=8B=E5=BE=97=E5=88=B0=E3=80=8C=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E7=9C=8B=E5=BE=97=E5=88=B0=E3=80=8D=E5=BC=80=E5=85=B3?= =?UTF-8?q?=EF=BC=9B=E4=B8=80=E8=A1=8C=E5=8F=AA=E5=89=A9=E3=80=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E3=80=8D=E5=92=8C=20=E2=8B=AF=EF=BC=8C=E6=9C=89?= =?UTF-8?q?=E4=BA=BA=E4=BA=A4=E8=BF=87=E7=9A=84=E9=A2=98=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E7=81=B0=E6=8E=89=EF=BC=9B=E5=8B=BE=E5=87=A0?= =?UTF-8?q?=E9=81=93=E4=B8=80=E6=AC=A1=E6=94=BE=E5=87=BA=E3=80=81=E8=97=8F?= =?UTF-8?q?=E8=B5=B7=E3=80=81=E5=8A=A0=E5=87=8F=E7=9F=A5=E8=AF=86=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去掉内部 ID、难度、看不懂的「功能」图标和反馈表情几列;题目名点了就是编辑。 Co-Authored-By: Claude Opus 5.5 --- apps/web/src/admin/api.ts | 21 +- .../src/admin/problem/components/Actions.vue | 64 ++-- apps/web/src/admin/problem/list.vue | 310 ++++++++++++------ apps/web/src/admin/transforms.ts | 2 + apps/web/src/utils/types.ts | 3 + 5 files changed, 280 insertions(+), 120 deletions(-) diff --git a/apps/web/src/admin/api.ts b/apps/web/src/admin/api.ts index 714a841..1c7b8b8 100644 --- a/apps/web/src/admin/api.ts +++ b/apps/web/src/admin/api.ts @@ -72,17 +72,36 @@ export async function getProblemList( tagId?: number, /** 题型:sql = SQL 题,code = 编程题;不传是全部(比赛题列表不认) */ kind?: "sql" | "code" | "", + /** 1 = 学生看得到的,0 = 藏着的;不传是全部(比赛题列表不认) */ + visible?: "1" | "0" | "", ) { const endpoint = contestID ? `admin/contests/${contestID}/problems` : "admin/problems" const res = await api.get(endpoint, { - params: { offset, limit, keyword, author, tagId, kind: kind || undefined }, + params: { + offset, + limit, + keyword, + author, + tagId, + kind: kind || undefined, + visible: visible || undefined, + }, }) return { results: res.results.map(toAdminProblemRow), total: res.total, + counts: res.counts ?? null, } } +/** 勾了几道,一次让学生看得到 / 藏起来 */ +export function batchSetProblemVisible(problemIds: number[], visible: boolean) { + return api.post<{ problemCount: number }>("admin/problems/batch-visible", { + problemIds, + visible, + }) +} + // 比赛「从题库中选择」用:列所有可见的公开题,不只是自己创建的 export async function getLibraryProblemList(offset = 0, limit = 10, keyword: string) { const res = await api.get("admin/problems", { diff --git a/apps/web/src/admin/problem/components/Actions.vue b/apps/web/src/admin/problem/components/Actions.vue index 21a5a4c..3ca505a 100644 --- a/apps/web/src/admin/problem/components/Actions.vue +++ b/apps/web/src/admin/problem/components/Actions.vue @@ -1,13 +1,22 @@