From 6e8495374082ecb87a4e4071553f2af97a4dd0d6 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Mon, 11 Aug 2025 17:01:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=96=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4exam=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 2 +- src/utils/Common.ts | 11 + src/views/Exam/ExamEditModal.vue | 833 +++++++++++++++++++++++ src/views/Exam/ExamInfoModal.vue | 330 +++++++++ src/views/Exam/Index.vue | 294 ++++++++ src/views/ExamView.vue | 1069 ------------------------------ 6 files changed, 1469 insertions(+), 1070 deletions(-) create mode 100644 src/views/Exam/ExamEditModal.vue create mode 100644 src/views/Exam/ExamInfoModal.vue create mode 100644 src/views/Exam/Index.vue delete mode 100644 src/views/ExamView.vue diff --git a/src/router/index.ts b/src/router/index.ts index 56158e0..93e7ed9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -4,7 +4,7 @@ import AuthView from "../views/AuthView.vue"; import ProjectView from "../views/Project/Index.vue"; import TestView from "../views/TestView.vue"; import UserView from "@/views/User/Index.vue"; -import ExamView from "@/views/ExamView.vue"; +import ExamView from "@/views/Exam/Index.vue"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), diff --git a/src/utils/Common.ts b/src/utils/Common.ts index 922e843..a8ff5cd 100644 --- a/src/utils/Common.ts +++ b/src/utils/Common.ts @@ -48,3 +48,14 @@ export function useOptionalInjection( const value = useFn(); return value ?? defaultValue; } + +export function formatDate(date: Date | string) { + const dateObj = typeof date === "string" ? new Date(date) : date; + return dateObj.toLocaleString("zh-CN", { + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + }); +} diff --git a/src/views/Exam/ExamEditModal.vue b/src/views/Exam/ExamEditModal.vue new file mode 100644 index 0000000..cdb470c --- /dev/null +++ b/src/views/Exam/ExamEditModal.vue @@ -0,0 +1,833 @@ + + + + + diff --git a/src/views/Exam/ExamInfoModal.vue b/src/views/Exam/ExamInfoModal.vue new file mode 100644 index 0000000..cd8f8db --- /dev/null +++ b/src/views/Exam/ExamInfoModal.vue @@ -0,0 +1,330 @@ + + + + diff --git a/src/views/Exam/Index.vue b/src/views/Exam/Index.vue new file mode 100644 index 0000000..20a598d --- /dev/null +++ b/src/views/Exam/Index.vue @@ -0,0 +1,294 @@ + + + + + diff --git a/src/views/ExamView.vue b/src/views/ExamView.vue deleted file mode 100644 index 9e56614..0000000 --- a/src/views/ExamView.vue +++ /dev/null @@ -1,1069 +0,0 @@ - - - - -