From ea1b114dd251ed1850059c7fb6c9710f005710bd Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Sat, 26 Apr 2025 19:59:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Preview.vue | 31 ++++++++++++++++++----- src/pages/Submission.vue | 51 ++++++++++++++++++++++++++++++++++++++ src/pages/Submissions.vue | 8 +++++- src/router.ts | 6 +++++ 4 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 src/pages/Submission.vue diff --git a/src/components/Preview.vue b/src/components/Preview.vue index 132a117..36e8090 100644 --- a/src/components/Preview.vue +++ b/src/components/Preview.vue @@ -4,6 +4,9 @@ 下载 全屏 + + 复制链接 + 查看代码 @@ -21,21 +24,24 @@ + + diff --git a/src/pages/Submissions.vue b/src/pages/Submissions.vue index ee38858..f8cd3a5 100644 --- a/src/pages/Submissions.vue +++ b/src/pages/Submissions.vue @@ -32,6 +32,7 @@ :html="html" :css="css" :js="js" + :submission-id="submission.id" @after-score="afterScore" @show-code="codeModal = true" /> @@ -128,7 +129,11 @@ const columns: DataTableColumn[] = [ render: (row) => h( NButton, - { quaternary: true, onClick: () => getSubmissionByID(row.id) }, + { + quaternary: submission.value.id !== row.id, + type: submission.value.id === row.id ? "primary" : "default", + onClick: () => getSubmissionByID(row.id), + }, () => "查看", ), }, @@ -190,5 +195,6 @@ onUnmounted(() => { .container { padding: 10px; box-sizing: border-box; + height: calc(100% - 43px); } diff --git a/src/router.ts b/src/router.ts index c178af8..fdee2d3 100644 --- a/src/router.ts +++ b/src/router.ts @@ -11,6 +11,12 @@ const routes = [ name: "submissions", component: () => import("./pages/Submissions.vue"), }, + { + path: "/submission/:id", + name: "submission", + component: () => import("./pages/Submission.vue"), + props: true + }, { path: "/dashboard", name: "dashboard",