From dd51f56707effeeea86e0800c7bd1ab1011698c1 Mon Sep 17 00:00:00 2001 From: Cheng Zhou Date: Wed, 17 Dec 2025 14:37:57 +0800 Subject: [PATCH] =?UTF-8?q?Step=20UX-1=EF=BC=9A=E9=80=9A=E7=94=A8=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/sites.ts | 4 +- frontend/src/api/users.ts | 5 + frontend/src/components/AeForm.vue | 21 +--- frontend/src/components/DataQueryForm.vue | 15 ++- frontend/src/components/FinanceForm.vue | 10 +- .../src/components/ImpTransactionForm.vue | 19 +++- frontend/src/components/IssueForm.vue | 7 ++ frontend/src/components/TaskForm.vue | 12 +-- .../src/components/selectors/SiteSelect.vue | 90 ++++++++++++++++ .../components/selectors/SubjectSelect.vue | 98 ++++++++++++++++++ .../src/components/selectors/UserSelect.vue | 81 +++++++++++++++ frontend/src/views/Verification.vue | 24 +++-- pg_data/pg_wal/000000010000000000000001 | Bin 16777216 -> 16777216 bytes 13 files changed, 334 insertions(+), 52 deletions(-) create mode 100644 frontend/src/api/users.ts create mode 100644 frontend/src/components/selectors/SiteSelect.vue create mode 100644 frontend/src/components/selectors/SubjectSelect.vue create mode 100644 frontend/src/components/selectors/UserSelect.vue diff --git a/frontend/src/api/sites.ts b/frontend/src/api/sites.ts index 5682b81f..cf99c9e6 100644 --- a/frontend/src/api/sites.ts +++ b/frontend/src/api/sites.ts @@ -1,5 +1,5 @@ import { apiGet } from "./axios"; import type { ApiListResponse } from "../types/api"; -export const fetchSites = (studyId: string) => - apiGet>(`/api/v1/studies/${studyId}/sites/`); +export const fetchSites = (studyId: string, params?: Record) => + apiGet>(`/api/v1/studies/${studyId}/sites/`, { params }); diff --git a/frontend/src/api/users.ts b/frontend/src/api/users.ts new file mode 100644 index 00000000..ffbd1aba --- /dev/null +++ b/frontend/src/api/users.ts @@ -0,0 +1,5 @@ +import { apiGet } from "./axios"; +import type { ApiListResponse } from "../types/api"; + +export const fetchUsers = (params?: Record) => + apiGet>("/api/v1/users", { params }); diff --git a/frontend/src/components/AeForm.vue b/frontend/src/components/AeForm.vue index 37106730..dbb71d1b 100644 --- a/frontend/src/components/AeForm.vue +++ b/frontend/src/components/AeForm.vue @@ -2,14 +2,7 @@ - - - + @@ -45,14 +38,13 @@ import type { FormInstance, FormRules } from "element-plus"; import { ElMessage } from "element-plus"; import { createAe, updateAe } from "../api/aes"; import { useStudyStore } from "../store/study"; +import SubjectSelect from "./selectors/SubjectSelect.vue"; -interface Props { +const props = defineProps<{ modelValue: boolean; ae?: Record; subjects?: any[]; -} - -const props = defineProps(); +}>(); const emit = defineEmits(["update:modelValue", "success"]); const visible = computed({ @@ -125,16 +117,11 @@ const onSubmit = async () => { submitting.value = true; try { const payload: Record = {}; - const uuidLike = /^[0-9a-fA-F-]{36}$/; Object.entries(form).forEach(([k, v]) => { if (v !== "" && v !== null && v !== undefined) { payload[k] = v; } }); - if (payload.subject_id && !uuidLike.test(String(payload.subject_id))) { - ElMessage.warning("受试者ID格式不正确,已忽略"); - delete payload.subject_id; - } if (isEdit.value && props.ae) { await updateAe(study.currentStudy.id, props.ae.id, payload); } else { diff --git a/frontend/src/components/DataQueryForm.vue b/frontend/src/components/DataQueryForm.vue index 9e011b5d..a4e31ea8 100644 --- a/frontend/src/components/DataQueryForm.vue +++ b/frontend/src/components/DataQueryForm.vue @@ -5,9 +5,7 @@ - - - + @@ -25,7 +23,7 @@ - + @@ -47,14 +45,13 @@ import type { FormInstance, FormRules } from "element-plus"; import { ElMessage } from "element-plus"; import { createDataQuery, updateDataQuery } from "../api/dataQueries"; import { useStudyStore } from "../store/study"; +import SubjectSelect from "./selectors/SubjectSelect.vue"; +import UserSelect from "./selectors/UserSelect.vue"; -interface Props { +const props = defineProps<{ modelValue: boolean; query?: Record; - subjects?: any[]; -} - -const props = defineProps(); +}>(); const emit = defineEmits(["update:modelValue", "success"]); const visible = computed({ diff --git a/frontend/src/components/FinanceForm.vue b/frontend/src/components/FinanceForm.vue index ff14a1e0..4c196353 100644 --- a/frontend/src/components/FinanceForm.vue +++ b/frontend/src/components/FinanceForm.vue @@ -21,11 +21,11 @@ - - + + - - + +