From dd249c8753d0529d2ecf39db35a76cc4768a347d Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 30 Apr 2026 09:05:06 -0600 Subject: [PATCH] feat: add showcase frontend --- src/api.ts | 22 ++ src/components/task/TaskPanel.vue | 8 + src/pages/Showcase.vue | 235 +++++++++++++++++ src/pages/ShowcaseDetail.vue | 415 ++++++++++++++++++++++++++++++ src/router.ts | 13 + src/utils/type.ts | 44 ++++ 6 files changed, 737 insertions(+) create mode 100644 src/pages/Showcase.vue create mode 100644 src/pages/ShowcaseDetail.vue diff --git a/src/api.ts b/src/api.ts index 23dfb34..662fbdb 100644 --- a/src/api.ts +++ b/src/api.ts @@ -8,6 +8,9 @@ import type { PromptMessage, TaskStatsOut, TaskAsset, + AwardSection, + ShowcaseDetail, + PromptRound, } from "./utils/type" import { BASE_URL, STORAGE_KEY } from "./utils/const" @@ -282,6 +285,25 @@ export const Helper = { }, } +export const Showcase = { + async list(): Promise { + const res = await http.get("/submission/showcase/") + return res.data + }, + + async getDetail(submissionId: string): Promise { + const res = await http.get(`/submission/showcase/${submissionId}/`) + return res.data + }, + + async getPromptChain(submissionId: string): Promise { + const res = await http.get( + `/submission/showcase/${submissionId}/prompt-chain/`, + ) + return res.data + }, +} + export const TaskAssets = { async listChallenge(display: number): Promise { return (await http.get(`/assets/challenge/${display}`)).data diff --git a/src/components/task/TaskPanel.vue b/src/components/task/TaskPanel.vue index 5c71bf3..1c45907 100644 --- a/src/components/task/TaskPanel.vue +++ b/src/components/task/TaskPanel.vue @@ -57,6 +57,14 @@ 提交记录 + + + 作品广场 +