diff --git a/src/admin/transforms.ts b/src/admin/transforms.ts index 643ee3e..63e99b6 100644 --- a/src/admin/transforms.ts +++ b/src/admin/transforms.ts @@ -14,5 +14,7 @@ export function toProblemListItem(result: AdminProblem) { has_ast_rules: result.has_ast_rules, allow_flowchart: result.allow_flowchart, show_flowchart: result.show_flowchart, + // 比赛题目列表接口不返回这个字段 + top_reaction: result.top_reaction ?? null, } } diff --git a/src/oj/problem/components/ProblemReaction.vue b/src/oj/problem/components/ProblemReaction.vue index efeeb8d..531083d 100644 --- a/src/oj/problem/components/ProblemReaction.vue +++ b/src/oj/problem/components/ProblemReaction.vue @@ -1,7 +1,7 @@ {{ item.label }} - {{ counts[item.key] }} + {{ counts[item.key] }} 完成本题后可以评价 -
+ {{ locked ? "已评价,不能修改" : "选一个,点了直接提交,不能修改" }} -
+ @@ -83,27 +83,3 @@ onMounted(() => { if (userStore.isAuthed) load() }) - - diff --git a/src/utils/types.ts b/src/utils/types.ts index c94014c..4ab9426 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -177,7 +177,11 @@ export interface Problem { sql_display?: SQLDisplay | null } -export type AdminProblem = Problem & AlterProblem +export type AdminProblem = Problem & + AlterProblem & { + // 后台题目列表接口附带的最高票评价,比赛题目列表不返回 + top_reaction?: { type: ReactionKey; count: number } | null + } interface AlterProblem { test_case_id: string