feat (patient): implement patient list and entry form

This commit is contained in:
Abizrh
2025-08-12 17:01:50 +07:00
parent 500cdb6a21
commit 7ae9a9adfe
9 changed files with 342 additions and 13 deletions
+18 -2
View File
@@ -1,4 +1,6 @@
<script setup lang="ts">
const data = ref([])
const refSearchNav = {
onClick: () => {
// open filter modal
@@ -11,6 +13,10 @@ const refSearchNav = {
},
}
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
const hreaderPrep: HeaderPrep = {
title: 'Pasien',
icon: 'bi bi-journal-check',
@@ -22,15 +28,25 @@ const hreaderPrep: HeaderPrep = {
// NOTE: example api
async function getPatientList() {
const { data } = await xfetch('/api/v1/patient')
console.log('data patient', data)
const resp = await xfetch('/api/v1/patient')
console.log('data patient', resp)
if (resp.success) {
data.value = (resp.body as Record<string, any>)['data']
}
}
onMounted(() => {
getPatientList()
})
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
</script>
<template>
<PubNavHeaderPrep :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" icon="i-lucide-add" />
<div>
<AppPatientList :data="data" />
</div>
</template>