diff --git a/frontend/src/api/sites.ts b/frontend/src/api/sites.ts new file mode 100644 index 00000000..5682b81f --- /dev/null +++ b/frontend/src/api/sites.ts @@ -0,0 +1,5 @@ +import { apiGet } from "./axios"; +import type { ApiListResponse } from "../types/api"; + +export const fetchSites = (studyId: string) => + apiGet>(`/api/v1/studies/${studyId}/sites/`); diff --git a/frontend/src/api/subjects.ts b/frontend/src/api/subjects.ts new file mode 100644 index 00000000..1b38570f --- /dev/null +++ b/frontend/src/api/subjects.ts @@ -0,0 +1,11 @@ +import { apiGet, apiPost, apiPatch } from "./axios"; +import type { ApiListResponse } from "../types/api"; + +export const fetchSubjects = (studyId: string, params?: Record) => + apiGet>(`/api/v1/studies/${studyId}/subjects/`, { params }); + +export const createSubject = (studyId: string, payload: Record) => + apiPost(`/api/v1/studies/${studyId}/subjects/`, payload); + +export const updateSubject = (studyId: string, subjectId: string, payload: Record) => + apiPatch(`/api/v1/studies/${studyId}/subjects/${subjectId}`, payload); diff --git a/frontend/src/api/visits.ts b/frontend/src/api/visits.ts new file mode 100644 index 00000000..1b36b92f --- /dev/null +++ b/frontend/src/api/visits.ts @@ -0,0 +1,7 @@ +import { apiGet, apiPatch } from "./axios"; + +export const fetchVisits = (studyId: string, subjectId: string) => + apiGet(`/api/v1/studies/${studyId}/subjects/${subjectId}/visits/`); + +export const updateVisit = (studyId: string, subjectId: string, visitId: string, payload: Record) => + apiPatch(`/api/v1/studies/${studyId}/subjects/${subjectId}/visits/${visitId}`, payload); diff --git a/frontend/src/components/Layout.vue b/frontend/src/components/Layout.vue index bb9a73de..47c934c9 100644 --- a/frontend/src/components/Layout.vue +++ b/frontend/src/components/Layout.vue @@ -19,6 +19,7 @@ 项目首页 里程碑 任务 + 受试者 diff --git a/frontend/src/components/SubjectForm.vue b/frontend/src/components/SubjectForm.vue new file mode 100644 index 00000000..b7a9b72b --- /dev/null +++ b/frontend/src/components/SubjectForm.vue @@ -0,0 +1,83 @@ + + + diff --git a/frontend/src/components/VisitTable.vue b/frontend/src/components/VisitTable.vue new file mode 100644 index 00000000..5734aa56 --- /dev/null +++ b/frontend/src/components/VisitTable.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 96e4f5f8..282c31ea 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -9,6 +9,7 @@ import StudyHome from "../views/StudyHome.vue"; import Tasks from "../views/Tasks.vue"; import Milestones from "../views/Milestones.vue"; import Subjects from "../views/Subjects.vue"; +import SubjectDetail from "../views/SubjectDetail.vue"; import Aes from "../views/Aes.vue"; import DataQueries from "../views/DataQueries.vue"; import Imp from "../views/Imp.vue"; @@ -57,6 +58,12 @@ const routes: RouteRecordRaw[] = [ component: Subjects, meta: { title: "受试者", requiresStudy: true }, }, + { + path: "study/subjects/:subjectId", + name: "StudySubjectDetail", + component: SubjectDetail, + meta: { title: "受试者详情", requiresStudy: true }, + }, { path: "study/aes", name: "StudyAes", diff --git a/frontend/src/views/SubjectDetail.vue b/frontend/src/views/SubjectDetail.vue new file mode 100644 index 00000000..225db51b --- /dev/null +++ b/frontend/src/views/SubjectDetail.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/frontend/src/views/Subjects.vue b/frontend/src/views/Subjects.vue index eff5b545..fd14622f 100644 --- a/frontend/src/views/Subjects.vue +++ b/frontend/src/views/Subjects.vue @@ -1,13 +1,152 @@ - + diff --git a/pg_data/base/16384/24576 b/pg_data/base/16384/24576 index 6064f0d5..8cbdcf86 100644 Binary files a/pg_data/base/16384/24576 and b/pg_data/base/16384/24576 differ diff --git a/pg_data/base/16384/24584 b/pg_data/base/16384/24584 index 0ea56314..caa95a55 100644 Binary files a/pg_data/base/16384/24584 and b/pg_data/base/16384/24584 differ diff --git a/pg_data/base/16384/24598 b/pg_data/base/16384/24598 index 91934de1..61c800e1 100644 Binary files a/pg_data/base/16384/24598 and b/pg_data/base/16384/24598 differ diff --git a/pg_data/base/16384/24605 b/pg_data/base/16384/24605 index 541c24c7..98af709c 100644 Binary files a/pg_data/base/16384/24605 and b/pg_data/base/16384/24605 differ diff --git a/pg_data/base/16384/24612 b/pg_data/base/16384/24612 index 36334ead..4f3e69c4 100644 Binary files a/pg_data/base/16384/24612 and b/pg_data/base/16384/24612 differ diff --git a/pg_data/base/16384/24672 b/pg_data/base/16384/24672 index 05769ac2..d1e43ed7 100644 Binary files a/pg_data/base/16384/24672 and b/pg_data/base/16384/24672 differ diff --git a/pg_data/base/16384/24678 b/pg_data/base/16384/24678 index 15c9ba8c..531f00d8 100644 Binary files a/pg_data/base/16384/24678 and b/pg_data/base/16384/24678 differ diff --git a/pg_data/base/16384/24690 b/pg_data/base/16384/24690 index 7a8458c6..920f5196 100644 Binary files a/pg_data/base/16384/24690 and b/pg_data/base/16384/24690 differ diff --git a/pg_data/base/16384/24697 b/pg_data/base/16384/24697 index d725cb2c..11aeab1d 100644 Binary files a/pg_data/base/16384/24697 and b/pg_data/base/16384/24697 differ diff --git a/pg_data/base/16384/24709 b/pg_data/base/16384/24709 index 2b18c250..46652bf7 100644 Binary files a/pg_data/base/16384/24709 and b/pg_data/base/16384/24709 differ diff --git a/pg_data/base/16384/24710 b/pg_data/base/16384/24710 index b92e8e78..b33b1a7a 100644 Binary files a/pg_data/base/16384/24710 and b/pg_data/base/16384/24710 differ diff --git a/pg_data/base/16384/24717 b/pg_data/base/16384/24717 index ee1faede..30f68547 100644 Binary files a/pg_data/base/16384/24717 and b/pg_data/base/16384/24717 differ diff --git a/pg_data/base/16384/24739 b/pg_data/base/16384/24739 index 3e6268de..50bde2fb 100644 Binary files a/pg_data/base/16384/24739 and b/pg_data/base/16384/24739 differ diff --git a/pg_data/base/16384/24740 b/pg_data/base/16384/24740 index a264ab19..b374bb71 100644 Binary files a/pg_data/base/16384/24740 and b/pg_data/base/16384/24740 differ diff --git a/pg_data/base/16384/24747 b/pg_data/base/16384/24747 index 0b277f7d..fef49cf5 100644 Binary files a/pg_data/base/16384/24747 and b/pg_data/base/16384/24747 differ diff --git a/pg_data/base/16384/24749 b/pg_data/base/16384/24749 index 891b20c1..28259868 100644 Binary files a/pg_data/base/16384/24749 and b/pg_data/base/16384/24749 differ diff --git a/pg_data/base/16384/24761 b/pg_data/base/16384/24761 index 7420b78e..4ae3413b 100644 Binary files a/pg_data/base/16384/24761 and b/pg_data/base/16384/24761 differ diff --git a/pg_data/base/16384/24762 b/pg_data/base/16384/24762 index 2bbf5fee..e6e6fe89 100644 Binary files a/pg_data/base/16384/24762 and b/pg_data/base/16384/24762 differ diff --git a/pg_data/base/16384/24763 b/pg_data/base/16384/24763 index 834fba40..308c7851 100644 Binary files a/pg_data/base/16384/24763 and b/pg_data/base/16384/24763 differ diff --git a/pg_data/base/16384/24770 b/pg_data/base/16384/24770 index 221b491d..4673ca14 100644 Binary files a/pg_data/base/16384/24770 and b/pg_data/base/16384/24770 differ diff --git a/pg_data/base/16384/24782 b/pg_data/base/16384/24782 index e3bf6c78..cea27979 100644 Binary files a/pg_data/base/16384/24782 and b/pg_data/base/16384/24782 differ diff --git a/pg_data/global/pg_control b/pg_data/global/pg_control index cefd5fee..23cf0730 100644 Binary files a/pg_data/global/pg_control and b/pg_data/global/pg_control differ diff --git a/pg_data/pg_wal/000000010000000000000001 b/pg_data/pg_wal/000000010000000000000001 index 39c4b244..17970046 100644 Binary files a/pg_data/pg_wal/000000010000000000000001 and b/pg_data/pg_wal/000000010000000000000001 differ diff --git a/pg_data/pg_xact/0000 b/pg_data/pg_xact/0000 index 0dc4a535..1bc456bd 100644 Binary files a/pg_data/pg_xact/0000 and b/pg_data/pg_xact/0000 differ