From afb3738e5b600c991719fd80d272ec50fbeae750 Mon Sep 17 00:00:00 2001 From: Andrian Roshandy Date: Fri, 28 Nov 2025 18:36:24 +0700 Subject: [PATCH] feat/page-cleaning: finished --- .../app/encounter/dropdown-action.vue | 100 ++++----- app/components/app/encounter/filter-form.vue | 114 ++++++++++ app/components/app/encounter/filter-nav.vue | 123 +++++++++++ app/components/app/encounter/list.vue | 3 +- app/components/app/encounter/quick-info.vue | 55 ++--- app/components/content/encounter/list.vue | 127 ++++------- .../content/encounter/process-bu.vue | 114 ++++++++++ .../content/encounter/process-next.vue | 132 ------------ app/components/content/encounter/process.vue | 198 ++++++++++-------- .../content-switcher/content-switcher.vue | 6 +- app/components/pub/my-ui/doc-entry/colon.vue | 6 +- app/components/pub/my-ui/menus/submenu.vue | 26 ++- app/components/pub/my-ui/nav-content/ba.vue | 2 +- app/composables/useRBAC.ts | 2 +- app/const/page-permission/ambulatory.ts | 57 +++++ app/const/page-permission/chemoteraphy.ts | 16 ++ app/handlers/encounter-init.handler.ts | 6 +- app/layouts/default.vue | 10 +- .../ambulatory/consultation/index.vue | 10 + .../ambulatory/encounter-queue/index.vue | 10 + .../ambulatory/encounter/[id]/edit.vue | 63 ++++++ .../ambulatory/encounter/[id]/index.vue | 47 +++++ .../ambulatory/encounter/[id]/process.vue | 45 ++++ .../(features)/ambulatory/encounter/add.vue | 51 +++++ .../(features)/ambulatory/encounter/index.vue | 59 ++++++ .../ambulatory/registration-queue/index.vue | 10 + .../chemotherapy/[mode]/[id]/verification.vue | 47 +++++ .../(features)/chemotherapy/[mode]/index.vue | 55 +++++ app/pages/(features)/chemotherapy/index.vue | 9 + app/pages/(features)/chemotherapy/list.vue | 40 ++++ .../(features)/echocardiography/index.vue | 10 + app/pages/(features)/hemophilia/index.vue | 10 + app/pages/(features)/spirometry/index.vue | 10 + app/pages/(features)/thalasemia/index.vue | 10 + 34 files changed, 1169 insertions(+), 414 deletions(-) create mode 100644 app/components/app/encounter/filter-form.vue create mode 100644 app/components/app/encounter/filter-nav.vue create mode 100644 app/components/content/encounter/process-bu.vue delete mode 100644 app/components/content/encounter/process-next.vue create mode 100644 app/const/page-permission/ambulatory.ts create mode 100644 app/const/page-permission/chemoteraphy.ts create mode 100644 app/pages/(features)/ambulatory/consultation/index.vue create mode 100644 app/pages/(features)/ambulatory/encounter-queue/index.vue create mode 100644 app/pages/(features)/ambulatory/encounter/[id]/edit.vue create mode 100644 app/pages/(features)/ambulatory/encounter/[id]/index.vue create mode 100644 app/pages/(features)/ambulatory/encounter/[id]/process.vue create mode 100644 app/pages/(features)/ambulatory/encounter/add.vue create mode 100644 app/pages/(features)/ambulatory/encounter/index.vue create mode 100644 app/pages/(features)/ambulatory/registration-queue/index.vue create mode 100644 app/pages/(features)/chemotherapy/[mode]/[id]/verification.vue create mode 100644 app/pages/(features)/chemotherapy/[mode]/index.vue create mode 100644 app/pages/(features)/chemotherapy/index.vue create mode 100644 app/pages/(features)/chemotherapy/list.vue create mode 100644 app/pages/(features)/echocardiography/index.vue create mode 100644 app/pages/(features)/hemophilia/index.vue create mode 100644 app/pages/(features)/spirometry/index.vue create mode 100644 app/pages/(features)/thalasemia/index.vue diff --git a/app/components/app/encounter/dropdown-action.vue b/app/components/app/encounter/dropdown-action.vue index bd7a4974..0cd85204 100644 --- a/app/components/app/encounter/dropdown-action.vue +++ b/app/components/app/encounter/dropdown-action.vue @@ -9,38 +9,38 @@ const props = defineProps<{ const recId = inject>('rec_id')! const recAction = inject>('rec_action')! const recItem = inject>('rec_item')! +const activeServicePosition = inject>('activeServicePosition')! // previously: activePosition + const activeKey = ref(null) -const activePosition = inject>('position')! const linkItemsFiltered = ref([]) -const linkItemsBase: LinkItem[] = [ - { - label: 'Nothing', - value: 'nothing', - icon: 'i-lucide-file', - }, -] -const linkItems: LinkItem[] = [ +const baseLinkItems: LinkItem[] = [ { label: 'Detail', value: 'detail', onClick: () => { - detail() + proceedItem(ActionEvents.showDetail) }, icon: 'i-lucide-eye', }, +] + +const medicalLinkItems: LinkItem[] = [ { label: 'Process', - value: 'edit', + value: 'process', onClick: () => { - edit() + proceedItem(ActionEvents.showProcess) }, - icon: 'i-lucide-pencil', + icon: 'i-lucide-shuffle', }, +] + +const regLinkItems: LinkItem[] = [ { label: 'Print', value: 'print', onClick: () => { - print() + proceedItem(ActionEvents.showPrint) }, icon: 'i-lucide-printer', }, @@ -48,7 +48,7 @@ const linkItems: LinkItem[] = [ label: 'Batalkan', value: 'cancel', onClick: () => { - cancel() + proceedItem(ActionEvents.showCancel) }, icon: 'i-lucide-circle-x', }, @@ -56,65 +56,49 @@ const linkItems: LinkItem[] = [ label: 'Hapus', value: 'remove', onClick: () => { - remove() + proceedItem(ActionEvents.showConfirmDelete) }, icon: 'i-lucide-trash', }, ] -function detail() { +const voidLinkItems: LinkItem[] = [ + { + label: 'Nothing', + value: 'nothing', + icon: 'i-lucide-file', + }, +] + +linkItemsFiltered.value = [...baseLinkItems] + +getLinks() + +watch(activeServicePosition, () => { + getLinks() +}) + +function proceedItem(action: string) { recId.value = props.rec.id || 0 - recAction.value = ActionEvents.showDetail recItem.value = props.rec + recAction.value = action } -function edit() { - recId.value = props.rec.id || 0 - recAction.value = ActionEvents.showEdit - recItem.value = props.rec -} - -function print() { - recId.value = props.rec.id || 0 - recAction.value = ActionEvents.showPrint - recItem.value = props.rec -} - -function cancel() { - recId.value = props.rec.id || 0 - recAction.value = ActionEvents.showCancel - recItem.value = props.rec -} - -function remove() { - recId.value = props.rec.id || 0 - recAction.value = ActionEvents.showConfirmDelete - recItem.value = props.rec -} - -linkItemsFiltered.value = [...linkItemsBase] - -function getLinks(position: string) { - switch (position) { +function getLinks() { + switch (activeServicePosition.value) { case 'medical': - linkItemsFiltered.value = [...linkItems] + linkItemsFiltered.value = [...baseLinkItems, ...medicalLinkItems] break - case 'verificator': - linkItemsFiltered.value = [ - ...linkItems.filter((item) => ['detail', 'print'].includes(item.value || '')), - ] + case 'registration': + linkItemsFiltered.value = [...baseLinkItems, ...regLinkItems] + case 'unit|resp': + linkItemsFiltered.value = [...baseLinkItems] break default: - linkItemsFiltered.value = [...linkItemsBase] + linkItemsFiltered.value = voidLinkItems break } } - -getLinks(activePosition.value) - -watch(activePosition, () => { - getLinks(activePosition.value) -})