diff --git a/server/src/Database/Type.cs b/server/src/Database/Type.cs index 8989bf7..a075d6c 100644 --- a/server/src/Database/Type.cs +++ b/server/src/Database/Type.cs @@ -1,6 +1,7 @@ using DotNext; using LinqToDB; using LinqToDB.Mapping; +using Tapper; namespace Database; @@ -231,6 +232,7 @@ public class Exam /// /// 资源类型枚举 /// +[TranspilationSource] public static class ResourceTypes { /// diff --git a/src/components/UploadModal.vue b/src/components/UploadModal.vue new file mode 100644 index 0000000..32601f7 --- /dev/null +++ b/src/components/UploadModal.vue @@ -0,0 +1,117 @@ + + + + + + + 文件上传 + + + + + + + + + + + + 点击或拖拽上传 + + + + + + {{ inputFiles?.[0]?.name }} + + 点击重新选择 + + + + + + 上传 + + + + + + + diff --git a/src/router/index.ts b/src/router/index.ts index d294964..e8aa7ee 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -14,9 +14,8 @@ const router = createRouter({ { path: "/login", name: "login", component: AuthView }, { path: "/project", name: "project", component: ProjectView }, { path: "/test", name: "test", component: TestView }, - { path: "/user/:page?", name: "user", component: UserView }, - { path: "/exam/:examId?", name: "exam", component: ExamView }, - { path: "/exam", redirect: "/exam/" }, + { path: "/user/:page*", name: "user", component: UserView }, + { path: "/exam/:page*", name: "exam", component: ExamView }, { path: "/markdown", name: "markdown", component: MarkdownEditor }, ], }); diff --git a/src/views/Exam/ExamEditModal.vue b/src/views/Exam/ExamEditModal.vue index f15a95d..db0a4da 100644 --- a/src/views/Exam/ExamEditModal.vue +++ b/src/views/Exam/ExamEditModal.vue @@ -8,19 +8,7 @@ {{ mode === "create" ? "新建实验" : "编辑实验" }} - - - + @@ -417,11 +405,13 @@ import { BinaryIcon, FileArchiveIcon, FileJsonIcon, + XIcon, } from "lucide-vue-next"; import { ExamClient, ExamDto, ResourceClient, + ResourcePurpose, type FileParameter, } from "@/APIClient"; import { useAlertStore } from "@/components/Alert"; @@ -685,7 +675,12 @@ async function uploadExamResources(examId: string) { data: uploadFiles.value.mdFile, fileName: uploadFiles.value.mdFile.name, }; - await client.addResource("doc", "template", examId, mdFileParam); + await client.addResource( + "doc", + ResourcePurpose.Template, + examId, + mdFileParam, + ); console.log("MD文档上传成功"); } @@ -695,7 +690,12 @@ async function uploadExamResources(examId: string) { data: imageFile, fileName: imageFile.name, }; - await client.addResource("image", "template", examId, imageFileParam); + await client.addResource( + "image", + ResourcePurpose.Template, + examId, + imageFileParam, + ); console.log("图片上传成功:", imageFile.name); } @@ -707,7 +707,7 @@ async function uploadExamResources(examId: string) { }; await client.addResource( "bitstream", - "template", + ResourcePurpose.Template, examId, bitstreamFileParam, ); @@ -720,7 +720,12 @@ async function uploadExamResources(examId: string) { data: canvasFile, fileName: canvasFile.name, }; - await client.addResource("canvas", "template", examId, canvasFileParam); + await client.addResource( + "canvas", + ResourcePurpose.Template, + examId, + canvasFileParam, + ); console.log("画布模板上传成功:", canvasFile.name); } @@ -732,7 +737,7 @@ async function uploadExamResources(examId: string) { }; await client.addResource( "resource", - "template", + ResourcePurpose.Template, examId, resourceFileParam, ); @@ -775,6 +780,7 @@ defineExpose({ show, close, editExam, + editExamInfo, }); diff --git a/src/views/Exam/ExamInfoModal.vue b/src/views/Exam/ExamInfoModal.vue index 2fd417a..56e207d 100644 --- a/src/views/Exam/ExamInfoModal.vue +++ b/src/views/Exam/ExamInfoModal.vue @@ -13,19 +13,7 @@ @click="closeExamDetail" class="btn btn-sm btn-circle btn-ghost" > - - - + @@ -147,17 +135,18 @@ 当前状态 - 未完成 - - - - 批阅状态 - 待提交 + + {{ + isUndefined(commitsList) || commitsList.length === 0 + ? "未提交" + : "已提交" + }} + 成绩 - 未评分 + 未评分 @@ -167,17 +156,22 @@ 提交历史 暂无提交记录 - Register - Choose plan - Purchase - Receive Product + + {{ commit.id }} --- + {{ commit.uploadTime.toDateString() }} + + ...... @@ -187,58 +181,27 @@ - - - + 开始实验 + + + 提交实验 + + - - - + 下载中... 下载资源包 - - - + 查看记录 @@ -247,6 +210,12 @@ +