feat (patient): add example api request

This commit is contained in:
Abizrh
2025-08-10 15:54:41 +07:00
parent 8705ba8fe4
commit 0515f8628f
3 changed files with 21 additions and 5 deletions
+11 -1
View File
@@ -7,7 +7,7 @@ const refSearchNav = {
console.log('>>>', val)
},
onClear: () => {
// refresh page
// clear url param
},
}
@@ -19,6 +19,16 @@ const hreaderPrep: HeaderPrep = {
onClick: () => (window.location.pathname = '/emergency/patient/add'),
},
}
// NOTE: example api
async function getPatientList() {
const { data } = await xfetch('/api/v1/patient')
console.log('data patient', data)
}
onMounted(() => {
getPatientList()
})
</script>
<template>
+5 -1
View File
@@ -1,4 +1,8 @@
<script setup lang="ts"></script>
<script setup lang="ts">
definePageMeta({
roles: ['system', 'doctor'],
})
</script>
<template>
<div>
+5 -3
View File
@@ -2,9 +2,11 @@
import { Activity, CreditCard, DollarSign, Users } from 'lucide-vue-next'
definePageMeta({
middleware: 'auth',
roles: ['sys', 'doc'],
})
const { userRole } = useUserStore()
const dataCard = ref({
totalRevenue: 0,
totalRevenueDesc: 0,
@@ -61,7 +63,7 @@ onMounted(() => {
<template>
<div class="flex w-full flex-col gap-4">
<div class="flex flex-wrap items-center justify-between gap-2">
<h2 class="text-2xl font-bold tracking-tight">Dashboard</h2>
<h2 class="text-2xl font-bold tracking-tight">Dashboard {{ userRole }}</h2>
<div class="flex items-center space-x-2"></div>
</div>
<main class="flex flex-1 flex-col gap-4 md:gap-8">
@@ -147,7 +149,7 @@ onMounted(() => {
<CardTitle>Overview</CardTitle>
</CardHeader>
<CardContent class="pl-2">
<DashboardOverview />
<!-- <DashboardOverview /> -->
</CardContent>
</Card>
<Card>