From 2b8bf55e8acfa650dadb8fa7a3e3ba158d5de2da Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Fri, 17 Oct 2025 13:20:29 +0700 Subject: [PATCH] feat(medical-action): implement medical action source management - Add medical action source list component with pagination and search - Create CRUD operations for medical action source - Implement form entry and validation for medical action source - Add confirmation dialog for delete operations --- .../app/medical-action-src/entry-form.vue | 119 +++++++++++ .../app/medical-action-src/list-cfg.ts | 32 +++ .../app/medical-action-src/list.vue | 36 ++++ .../content/medical-action-src/list.vue | 184 ++++++++++++++++++ app/handlers/medical-action-src.handler.ts | 24 +++ .../mcu-src/medical-action/index.vue | 4 +- app/schemas/medical-action-src.schema.ts | 23 +++ app/services/medical-action-src.service.ts | 41 ++++ 8 files changed, 462 insertions(+), 1 deletion(-) create mode 100644 app/components/app/medical-action-src/entry-form.vue create mode 100644 app/components/app/medical-action-src/list-cfg.ts create mode 100644 app/components/app/medical-action-src/list.vue create mode 100644 app/components/content/medical-action-src/list.vue create mode 100644 app/handlers/medical-action-src.handler.ts create mode 100644 app/schemas/medical-action-src.schema.ts create mode 100644 app/services/medical-action-src.service.ts diff --git a/app/components/app/medical-action-src/entry-form.vue b/app/components/app/medical-action-src/entry-form.vue new file mode 100644 index 00000000..0a02ea85 --- /dev/null +++ b/app/components/app/medical-action-src/entry-form.vue @@ -0,0 +1,119 @@ + + + diff --git a/app/components/app/medical-action-src/list-cfg.ts b/app/components/app/medical-action-src/list-cfg.ts new file mode 100644 index 00000000..2fecde69 --- /dev/null +++ b/app/components/app/medical-action-src/list-cfg.ts @@ -0,0 +1,32 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) + +export const config: Config = { + cols: [{}, {}, {}, { width: 50 }], + + headers: [[{ label: 'Kode' }, { label: 'Nama' }, { label: '' }]], + + keys: ['code', 'name', 'action'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama ' }, + ], + + parses: {}, + + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, + }, + + htmls: {}, +} diff --git a/app/components/app/medical-action-src/list.vue b/app/components/app/medical-action-src/list.vue new file mode 100644 index 00000000..1be60a60 --- /dev/null +++ b/app/components/app/medical-action-src/list.vue @@ -0,0 +1,36 @@ + + + diff --git a/app/components/content/medical-action-src/list.vue b/app/components/content/medical-action-src/list.vue new file mode 100644 index 00000000..c39ff4b8 --- /dev/null +++ b/app/components/content/medical-action-src/list.vue @@ -0,0 +1,184 @@ + + + diff --git a/app/handlers/medical-action-src.handler.ts b/app/handlers/medical-action-src.handler.ts new file mode 100644 index 00000000..652d6d60 --- /dev/null +++ b/app/handlers/medical-action-src.handler.ts @@ -0,0 +1,24 @@ +// Handlers +import { genCrudHandler } from '~/handlers/_handler' + +// Services +import { create, update, remove } from '~/services/medical-action-src.service' + +export const { + recId, + recAction, + recItem, + isReadonly, + isProcessing, + isFormEntryDialogOpen, + isRecordConfirmationOpen, + onResetState, + handleActionSave, + handleActionEdit, + handleActionRemove, + handleCancelForm, +} = genCrudHandler({ + create, + update, + remove, +}) diff --git a/app/pages/(features)/mcu-src/medical-action/index.vue b/app/pages/(features)/mcu-src/medical-action/index.vue index 36fb8feb..7e471367 100644 --- a/app/pages/(features)/mcu-src/medical-action/index.vue +++ b/app/pages/(features)/mcu-src/medical-action/index.vue @@ -32,7 +32,9 @@ const canRead = true