✨ feat (patient): implement patient list and entry form
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user