From 11e63dde3ef2826e45cf60af5606b497717c7cb1 Mon Sep 17 00:00:00 2001 From: riefive Date: Mon, 29 Sep 2025 09:57:57 +0700 Subject: [PATCH 01/15] feat(medicine): modify entry-form, create handler and service --- .../app/medicine-method/entry-form.vue | 4 +- app/components/app/medicine/entry-form.vue | 218 ++++++++++++------ .../content/medicine-group/list.vue | 6 +- .../content/medicine-method/list.vue | 6 +- app/components/content/medicine/list.vue | 214 +++++++++++++++++ app/handlers/medicine.handler.ts | 94 ++++++++ app/models/medicine.ts | 38 ++- app/schemas/medicine.schema.ts | 17 +- app/services/medicine.service.ts | 79 +++++++ 9 files changed, 566 insertions(+), 110 deletions(-) create mode 100644 app/handlers/medicine.handler.ts create mode 100644 app/services/medicine.service.ts diff --git a/app/components/app/medicine-method/entry-form.vue b/app/components/app/medicine-method/entry-form.vue index b2fbdc94..49264cfe 100644 --- a/app/components/app/medicine-method/entry-form.vue +++ b/app/components/app/medicine-method/entry-form.vue @@ -8,7 +8,7 @@ import Label from '~/components/pub/custom-ui/doc-entry/label.vue' import Button from '~/components/pub/ui/button/Button.vue' // Types -import type { MedicineBaseFormData } from '~/schemas/medicine.schema' +import { type BaseFormData } from '~/schemas/base.schema' // Helpers import type z from 'zod' @@ -26,7 +26,7 @@ const props = defineProps() const isLoading = props.isLoading !== undefined ? props.isLoading : false const isReadonly = props.isReadonly !== undefined ? props.isReadonly : false const emit = defineEmits<{ - submit: [values: MedicineBaseFormData, resetForm: () => void] + submit: [values: BaseFormData, resetForm: () => void] cancel: [resetForm: () => void] }>() diff --git a/app/components/app/medicine/entry-form.vue b/app/components/app/medicine/entry-form.vue index 719eea5d..3e068538 100644 --- a/app/components/app/medicine/entry-form.vue +++ b/app/components/app/medicine/entry-form.vue @@ -1,80 +1,160 @@ diff --git a/app/components/content/medicine-group/list.vue b/app/components/content/medicine-group/list.vue index 5d3240bc..5608f372 100644 --- a/app/components/content/medicine-group/list.vue +++ b/app/components/content/medicine-group/list.vue @@ -11,7 +11,7 @@ import { toast } from '~/components/pub/ui/toast' // Types import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types' -import { MedicineBaseSchema, type MedicineBaseFormData } from '~/schemas/medicine.schema' +import { BaseSchema, type BaseFormData } from '~/schemas/base.schema' // Handlers import { @@ -122,12 +122,12 @@ onMounted(async () => { prevent-outside > +
+ +
+ + + + +