diff --git a/app/components/app/antibiotic-in-use/entry.vue b/app/components/app/antibiotic-in-use/entry.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/antibiotic-in-use/list.cfg.ts b/app/components/app/antibiotic-in-use/list.cfg.ts new file mode 100644 index 00000000..429e2dd8 --- /dev/null +++ b/app/components/app/antibiotic-in-use/list.cfg.ts @@ -0,0 +1,28 @@ +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' +import { defineAsyncComponent } from 'vue' + +type SmallDetailDto = any + +const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) + +export const config: Config = { + cols: [{}, {}], + + headers: [[{ label: 'Kode' }, { label: 'Nama' }]], + + keys: ['code', 'name'], + + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], + + parses: { + }, + + components: { + }, + + htmls: { + }, +} diff --git a/app/components/app/antibiotic-in-use/list.vue b/app/components/app/antibiotic-in-use/list.vue new file mode 100644 index 00000000..fac15e5c --- /dev/null +++ b/app/components/app/antibiotic-in-use/list.vue @@ -0,0 +1,17 @@ + + + diff --git a/app/components/app/encounter/dropdown-action.vue b/app/components/app/encounter/dropdown-action.vue index 0cd85204..0815e6a7 100644 --- a/app/components/app/encounter/dropdown-action.vue +++ b/app/components/app/encounter/dropdown-action.vue @@ -13,32 +13,39 @@ const activeServicePosition = inject>('activeServicePosition')! // p const activeKey = ref(null) const linkItemsFiltered = ref([]) + const baseLinkItems: LinkItem[] = [ { label: 'Detail', value: 'detail', + groups: ['medical', 'registration'], onClick: () => { proceedItem(ActionEvents.showDetail) }, icon: 'i-lucide-eye', }, -] - -const medicalLinkItems: LinkItem[] = [ + { + label: 'Edit', + value: 'edit', + groups: ['registration'], + onClick: () => { + proceedItem(ActionEvents.showEdit) + }, + icon: 'i-lucide-pencil', + }, { label: 'Process', value: 'process', + groups: ['medical'], onClick: () => { proceedItem(ActionEvents.showProcess) }, icon: 'i-lucide-shuffle', }, -] - -const regLinkItems: LinkItem[] = [ { label: 'Print', value: 'print', + groups: ['registration'], onClick: () => { proceedItem(ActionEvents.showPrint) }, @@ -47,6 +54,7 @@ const regLinkItems: LinkItem[] = [ { label: 'Batalkan', value: 'cancel', + groups: ['registration'], onClick: () => { proceedItem(ActionEvents.showCancel) }, @@ -55,6 +63,7 @@ const regLinkItems: LinkItem[] = [ { label: 'Hapus', value: 'remove', + groups: ['registration'], onClick: () => { proceedItem(ActionEvents.showConfirmDelete) }, @@ -62,7 +71,7 @@ const regLinkItems: LinkItem[] = [ }, ] -const voidLinkItems: LinkItem[] = [ +const noneLinkItems: LinkItem[] = [ { label: 'Nothing', value: 'nothing', @@ -72,12 +81,6 @@ const voidLinkItems: LinkItem[] = [ linkItemsFiltered.value = [...baseLinkItems] -getLinks() - -watch(activeServicePosition, () => { - getLinks() -}) - function proceedItem(action: string) { recId.value = props.rec.id || 0 recItem.value = props.rec @@ -87,18 +90,24 @@ function proceedItem(action: string) { function getLinks() { switch (activeServicePosition.value) { case 'medical': - linkItemsFiltered.value = [...baseLinkItems, ...medicalLinkItems] + linkItemsFiltered.value = baseLinkItems.filter((item) => item.groups?.includes('medical')) break case 'registration': - linkItemsFiltered.value = [...baseLinkItems, ...regLinkItems] - case 'unit|resp': - linkItemsFiltered.value = [...baseLinkItems] + linkItemsFiltered.value = baseLinkItems.filter((item) => item.groups?.includes('registration')) break default: - linkItemsFiltered.value = voidLinkItems + linkItemsFiltered.value = noneLinkItems break } } + +watch(activeServicePosition, () => { + getLinks() +}) + +onMounted(() => { + getLinks() +})