From f94b6d273a627cd0affe234c0791d6fa9726bd37 Mon Sep 17 00:00:00 2001 From: Muhammad Rifai Date: Fri, 10 Oct 2025 20:36:07 +0700 Subject: [PATCH 01/10] Feat Infra (#108) * fix: adjustment some schemas * fix(room): fixing integrate unit of room * feat(warehouse): modify form and integration * feat(counter): modify form and integration * feat(screen): add list, form and integration * feat(screen): add page for public screen * fix: add on reset state at list * fix: solve list of relation * feat(chamber): integrate form to api chamber * feat(bed): integrate form to api bed * fix: add searching function on list service * fix: rewrite style for dropdown and tree select * fix: add sort params * fix: add sort params on division + medicine * feat(division-position): layouting form + list * fix: add sort params for getValueList * chore: modify side menu style * chore: fix ui dashboard * feat(division-position): add content list * feat(division-position): add temporary page * feat(division-position): modify content and entry form --- app/components/app/bed/entry-form.vue | 67 +++++- app/components/app/bed/list-cfg.ts | 7 +- app/components/app/bed/list.vue | 11 +- app/components/app/chamber/entry-form.vue | 67 +++++- app/components/app/chamber/list-cfg.ts | 7 +- app/components/app/chamber/list.vue | 9 +- app/components/app/counter/entry-form.vue | 6 +- .../app/division-position/entry-form.vue | 207 ++++++++++++++++++ .../app/division-position/list-cfg.ts | 64 ++++++ app/components/app/division-position/list.vue | 41 ++++ app/components/app/division/entry-form.vue | 9 +- app/components/app/floor/entry-form.vue | 41 +++- .../app/public-screen/entry-form.vue | 108 +++++++++ app/components/app/public-screen/list-cfg.ts | 37 ++++ app/components/app/public-screen/list.vue | 41 ++++ app/components/app/room/entry-form.vue | 78 ++++--- app/components/app/room/list-cfg.ts | 17 +- app/components/app/unit/entry-form.vue | 4 +- app/components/app/warehouse/entry-form.vue | 67 +++++- app/components/app/warehouse/list-cfg.ts | 7 +- app/components/app/warehouse/list.vue | 9 +- app/components/content/bed/list.vue | 202 ++++++++++++++++- app/components/content/building/list.vue | 48 +++- app/components/content/chamber/list.vue | 202 ++++++++++++++++- app/components/content/counter/list.vue | 41 +++- app/components/content/dashboard/index.vue | 6 +- .../content/division-position/list.vue | 201 +++++++++++++++++ app/components/content/division/list.vue | 12 +- app/components/content/equipment/list.vue | 31 ++- app/components/content/floor/list.vue | 50 ++++- app/components/content/installation/list.vue | 31 ++- .../content/medicine-group/list.vue | 8 + .../content/medicine-method/list.vue | 8 + app/components/content/medicine/list.vue | 42 +++- app/components/content/public-screen/list.vue | 194 ++++++++++++++++ app/components/content/room/list.vue | 117 +++++++--- app/components/content/specialist/list.vue | 29 ++- app/components/content/subspecialist/list.vue | 29 ++- app/components/content/tools/list.vue | 35 ++- app/components/content/unit/list.vue | 36 ++- app/components/content/uom/list.vue | 36 ++- app/components/content/warehouse/list.vue | 202 ++++++++++++++++- .../pub/my-ui/data/dropdown-action-du.vue | 47 ++-- .../pub/my-ui/data/dropdown-action-ducd.vue | 59 ++--- .../pub/my-ui/data/dropdown-action-dud.vue | 59 ++--- .../pub/my-ui/data/dropdown-action-pdud.vue | 71 +++--- .../pub/my-ui/data/dropdown-action-ud.vue | 47 ++-- app/components/pub/my-ui/doc-entry/label.vue | 2 +- app/components/pub/my-ui/form/combobox.vue | 6 +- .../pub/my-ui/select-tree/command-item.vue | 7 +- app/components/pub/my-ui/select-tree/leaf.vue | 4 +- .../pub/my-ui/select-tree/tree-node.vue | 29 ++- .../pub/my-ui/select-tree/tree-select.vue | 26 ++- .../pub/ui/sidebar/SidebarMenuSubButton.vue | 39 ++-- app/components/pub/ui/sidebar/index.ts | 8 +- app/lib/constants.ts | 15 +- app/models/division-position.ts | 4 +- .../service-src/public-screen/index.vue | 24 ++ app/pages/_dev/division-position/index.vue | 24 ++ app/schemas/device.schema.ts | 2 +- app/schemas/division-position.schema.ts | 21 ++ app/schemas/division.schema.ts | 4 +- app/schemas/infra.schema.ts | 2 +- app/schemas/installation.schema.ts | 3 +- app/schemas/material.schema.ts | 2 +- app/schemas/specialist.schema.ts | 2 +- app/schemas/subspecialist.schema.ts | 2 +- app/schemas/unit.schema.ts | 2 +- app/services/division.service.ts | 1 - app/services/employee.service.ts | 38 ++++ app/services/item.service.ts | 38 ++++ app/services/specialist.service.ts | 1 + app/services/subspecialist.service.ts | 1 + 73 files changed, 2638 insertions(+), 416 deletions(-) create mode 100644 app/components/app/division-position/entry-form.vue create mode 100644 app/components/app/division-position/list-cfg.ts create mode 100644 app/components/app/division-position/list.vue create mode 100644 app/components/app/public-screen/entry-form.vue create mode 100644 app/components/app/public-screen/list-cfg.ts create mode 100644 app/components/app/public-screen/list.vue create mode 100644 app/components/content/division-position/list.vue create mode 100644 app/components/content/public-screen/list.vue create mode 100644 app/pages/(features)/service-src/public-screen/index.vue create mode 100644 app/pages/_dev/division-position/index.vue create mode 100644 app/schemas/division-position.schema.ts create mode 100644 app/services/employee.service.ts create mode 100644 app/services/item.service.ts diff --git a/app/components/app/bed/entry-form.vue b/app/components/app/bed/entry-form.vue index fb851aa4..0b103cd0 100644 --- a/app/components/app/bed/entry-form.vue +++ b/app/components/app/bed/entry-form.vue @@ -5,6 +5,10 @@ import Cell from '~/components/pub/my-ui/doc-entry/cell.vue' import Field from '~/components/pub/my-ui/doc-entry/field.vue' import Label from '~/components/pub/my-ui/doc-entry/label.vue' import Button from '~/components/pub/ui/button/Button.vue' +import Combobox from '~/components/pub/my-ui/form/combobox.vue' + +// Constants +import { infraGroupCodesKeys } from '~/lib/constants' // Types import type { InfraFormData } from '~/schemas/infra.schema' @@ -16,6 +20,7 @@ import { toTypedSchema } from '@vee-validate/zod' interface Props { schema: z.ZodSchema + parents: any[] values: any isLoading?: boolean isReadonly?: boolean @@ -34,27 +39,28 @@ const { defineField, errors, meta } = useForm({ initialValues: { code: '', name: '', - infraGroup_code: 'counter', + infraGroup_code: infraGroupCodesKeys.bed, parent_id: null, } as Partial, }) const [code, codeAttrs] = defineField('code') const [name, nameAttrs] = defineField('name') -const [infraGroup_code, infraGroupAttrs] = defineField('infraGroup_code') +const [infraGroup_code] = defineField('infraGroup_code') const [parent_id, parentIdAttrs] = defineField('parent_id') if (props.values) { if (props.values.code !== undefined) code.value = props.values.code if (props.values.name !== undefined) name.value = props.values.name if (props.values.infraGroup_code !== undefined) infraGroup_code.value = props.values.infraGroup_code - if (props.values.parent_id !== undefined) parent_id.value = props.values.parent_id + if (props.values.parent_id !== undefined) + parent_id.value = props.values.parent_id ? Number(props.values.parent_id) : null } const resetForm = () => { code.value = '' name.value = '' - infraGroup_code.value = 'counter' + infraGroup_code.value = infraGroupCodesKeys.bed parent_id.value = null } @@ -62,8 +68,8 @@ function onSubmitForm() { const formData: InfraFormData = { code: code.value || '', name: name.value || '', - infraGroup_code: infraGroup_code.value || 'counter', - parent_id: parent_id.value || null, + infraGroup_code: infraGroup_code.value || infraGroupCodesKeys.bed, + parent_id: parent_id.value ? Number(parent_id.value) : null, } emit('submit', formData, resetForm) } @@ -74,23 +80,62 @@ function onCancelForm() {