From 32b5355ab38214a7573a88667f60ede52dbe65c1 Mon Sep 17 00:00:00 2001 From: liyy <18435186204@163.com> Date: Tue, 1 Sep 2026 16:57:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E6=A8=A1=E8=80=83?= =?UTF-8?q?=E5=88=86=E6=9E=90=E9=97=AD=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/api/index.ts | 9 +- client/src/components/base/icons.ts | 5 + client/src/router/index.ts | 3 + client/src/views/mock/MockFormView.vue | 315 +++++++++++++++++++++ client/src/views/mock/MockView.vue | 366 ++++++++++++++++++++++++- docs/checks/task-10.md | 80 ++++++ server/src/handlers/mock.ts | 109 ++++++-- server/src/routes.ts | 17 +- server/src/schemas/api.ts | 33 +++ server/src/server.ts | 6 +- 10 files changed, 921 insertions(+), 22 deletions(-) create mode 100644 client/src/views/mock/MockFormView.vue create mode 100644 docs/checks/task-10.md diff --git a/client/src/api/index.ts b/client/src/api/index.ts index 3849832..aad6b3f 100644 --- a/client/src/api/index.ts +++ b/client/src/api/index.ts @@ -117,9 +117,16 @@ export const plansApi = { export const mockApi = { analysis: () => unwrap(apiClient.GET('/api/mock-exams/analysis')), record: (body: BodyOf<'/api/mock-exams/record', 'post'>) => - unwrap(apiClient.POST('/api/mock-exams/record', { body })) + unwrap(apiClient.POST('/api/mock-exams/record', { body })), + update: (id: string, body: BodyOf<'/api/mock-exams/{id}/update', 'post'>) => + unwrap(apiClient.POST('/api/mock-exams/{id}/update', { params: { path: { id } }, body })), + remove: (id: string) => unwrap(apiClient.DELETE('/api/mock-exams/{id}', { params: { path: { id } } })) } +export type MockExamRecord = SuccessBody +export type MockExamAnalysis = SuccessBody +export type MockExamListItem = MockExamAnalysis['records'][number] + // ---- 要闻 ---- export const newsApi = { list: (query?: QueryOf<'/api/news/list', 'get'>) => diff --git a/client/src/components/base/icons.ts b/client/src/components/base/icons.ts index 2279255..f710632 100644 --- a/client/src/components/base/icons.ts +++ b/client/src/components/base/icons.ts @@ -24,6 +24,7 @@ export type IconName = | 'refresh' | 'book-open' | 'filter' + | 'line' interface IconNode { tag: 'path' | 'circle' | 'rect' | 'line' | 'polyline' @@ -52,6 +53,10 @@ export const icons: Record = { { tag: 'path', attrs: { d: 'M13 17V5' } }, { tag: 'path', attrs: { d: 'M8 17v-3' } } ], + line: [ + { tag: 'polyline', attrs: { points: '3 17 8 12 12 15 21 6' } }, + { tag: 'path', attrs: { d: 'M16 6h5v5' } } + ], calendar: [ { tag: 'rect', attrs: { x: 3, y: 4, width: 18, height: 18, rx: 2 } }, { tag: 'line', attrs: { x1: 16, y1: 2, x2: 16, y2: 6 } }, diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 18f1ba8..e7b2486 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -6,6 +6,7 @@ import AnswerView from '../views/practice/AnswerView.vue' import CustomView from '../views/practice/CustomView.vue' import WrongDetailView from '../views/practice/WrongDetailView.vue' import MockView from '../views/mock/MockView.vue' +import MockFormView from '../views/mock/MockFormView.vue' import PlanView from '../views/plan/PlanView.vue' import PlanReviewView from '../views/plan/PlanReviewView.vue' import NewsView from '../views/news/NewsView.vue' @@ -23,6 +24,8 @@ export const routes: RouteRecordRaw[] = [ { path: '/practice/wrong/:id', name: 'practice-wrong-detail', component: WrongDetailView, meta: { title: '错题详情' } }, { path: '/practice/essay', name: 'practice-essay', component: PracticeView, meta: { title: '申论' } }, { path: '/mock', name: 'mock', component: MockView, meta: { title: '模考分析' } }, + { path: '/mock/new', name: 'mock-new', component: MockFormView, meta: { title: '录入模考成绩' } }, + { path: '/mock/:id/edit', name: 'mock-edit', component: MockFormView, meta: { title: '修改模考成绩' } }, { path: '/plan', name: 'plan', component: PlanView, meta: { title: '备考计划' } }, { path: '/plan/review', name: 'plan-review', component: PlanReviewView, meta: { title: '周报复盘' } }, { path: '/news', name: 'news', component: NewsView, meta: { title: '要闻' } }, diff --git a/client/src/views/mock/MockFormView.vue b/client/src/views/mock/MockFormView.vue new file mode 100644 index 0000000..834fafa --- /dev/null +++ b/client/src/views/mock/MockFormView.vue @@ -0,0 +1,315 @@ + + +