Merge branch 'dev' of github.com:dikstub-rssa/simrs-fe into feat/satusehat

This commit is contained in:
Khafid Prayoga
2025-08-19 11:05:03 +07:00
23 changed files with 1125 additions and 742 deletions

No files matched your search

@@ -0,0 +1,9 @@
<script setup lang="ts">
definePageMeta({
roles: ['sys', 'doc'],
})
</script>
<template>
<div>detail pasien</div>
</template>
@@ -0,0 +1,9 @@
<script setup lang="ts">
definePageMeta({
roles: ['sys', 'doc'],
})
</script>
<template>
<div>edit detail pasien</div>
</template>
+40
View File
@@ -0,0 +1,40 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Tambah Dokter',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
throw createError({
statusCode: 403,
statusMessage: 'Access denied',
})
}
// Define permission-based computed properties
const canCreate = hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<FlowDoctorAdd />
</div>
<PubBaseError v-else :status-code="403" />
</template>
+39
View File
@@ -0,0 +1,39 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Daftar Dokter',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
navigateTo('/403')
}
// Define permission-based computed properties
const canRead = hasReadAccess(roleAccess)
</script>
<template>
<div>
<div v-if="canRead">
<FlowDoctorList />
</div>
<PubBaseError v-else :status-code="403" />
</div>
</template>
+1 -1
View File
@@ -12,7 +12,7 @@ definePageMeta({
const route = useRoute()
useHead({
title: () => route.meta.title,
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/patient']
+8 -181
View File
@@ -1,190 +1,17 @@
<script setup lang="ts">
import { Activity, CreditCard, DollarSign, Users } from 'lucide-vue-next'
definePageMeta({
roles: ['sys', 'doc'],
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Dashboard',
contentFrame: 'cf-full-width',
})
const { userRole } = useUserStore()
const dataCard = ref({
totalRevenue: 0,
totalRevenueDesc: 0,
subscriptions: 0,
subscriptionsDesc: 0,
sales: 0,
salesDesc: 0,
activeNow: 0,
activeNowDesc: 0,
})
const dataRecentSales = [
{
name: 'Olivia Martin',
email: '[email protected]',
amount: 1999,
},
{
name: 'Jackson Lee',
email: '[email protected]',
amount: 39,
},
{
name: 'Isabella Nguyen',
email: '[email protected]',
amount: 299,
},
{
name: 'William Kim',
email: '[email protected]',
amount: 99,
},
{
name: 'Sofia Davis',
email: '[email protected]',
amount: 39,
},
]
onMounted(() => {
dataCard.value = {
totalRevenue: 45231.89,
totalRevenueDesc: 20.1 / 100,
subscriptions: 2350,
subscriptionsDesc: 180.5 / 100,
sales: 12234,
salesDesc: 45 / 100,
activeNow: 573,
activeNowDesc: 201,
}
const route = useRoute()
useHead({
title: () => route.meta.title,
})
</script>
<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 {{ userRole }}</h2>
<div class="flex items-center space-x-2"></div>
</div>
<main class="flex flex-1 flex-col gap-4 md:gap-8">
<div class="grid gap-4 md:grid-cols-2 md:gap-8 lg:grid-cols-4">
<Card>
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle class="text-sm font-medium"> Total Pasien Hari Ini </CardTitle>
<DollarSign class="text-muted-foreground h-4 w-4" />
</CardHeader>
<CardContent>
<div class="text-2xl font-bold">
<!-- <NumberFlow -->
<!-- :value="dataCard.totalRevenue" -->
<!-- :format="{ style: 'currency', currency: 'USD', trailingZeroDisplay: 'stripIfInteger' }" -->
<!-- /> -->
</div>
<p class="text-muted-foreground text-xs">
<!-- <NumberFlow -->
<!-- :value="dataCard.totalRevenueDesc" -->
<!-- prefix="+" -->
<!-- :format="{ style: 'percent', minimumFractionDigits: 1 }" -->
<!-- /> -->
from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle class="text-sm font-medium"> Subscriptions </CardTitle>
<Users class="text-muted-foreground h-4 w-4" />
</CardHeader>
<CardContent>
<div class="text-2xl font-bold">
<!-- <NumberFlow :value="dataCard.subscriptions" prefix="+" /> -->
</div>
<p class="text-muted-foreground text-xs">
<!-- <NumberFlow -->
<!-- :value="dataCard.subscriptionsDesc" -->
<!-- prefix="+" -->
<!-- :format="{ style: 'percent', minimumFractionDigits: 1 }" -->
<!-- /> -->
from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle class="text-sm font-medium"> Sales </CardTitle>
<CreditCard class="text-muted-foreground h-4 w-4" />
</CardHeader>
<CardContent>
<div class="text-2xl font-bold">
<!-- <NumberFlow :value="dataCard.sales" prefix="+" /> -->
</div>
<p class="text-muted-foreground text-xs">
<!-- <NumberFlow -->
<!-- :value="dataCard.salesDesc" -->
<!-- prefix="+" -->
<!-- :format="{ style: 'percent', minimumFractionDigits: 1 }" -->
<!-- /> -->
from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle class="text-sm font-medium"> Active Now </CardTitle>
<Activity class="text-muted-foreground h-4 w-4" />
</CardHeader>
<CardContent>
<div class="text-2xl font-bold">
<!-- <NumberFlow :value="dataCard.activeNow" prefix="+" /> -->
</div>
<p class="text-muted-foreground text-xs">
<!-- <NumberFlow :value="dataCard.activeNowDesc" prefix="+" /> since last hour -->
</p>
</CardContent>
</Card>
</div>
<div class="grid gap-4 md:gap-8 lg:grid-cols-2 xl:grid-cols-3">
<Card class="xl:col-span-2">
<CardHeader>
<CardTitle>Overview</CardTitle>
</CardHeader>
<CardContent class="pl-2">
<!-- <DashboardOverview /> -->
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle>Recent Sales</CardTitle>
</CardHeader>
<CardContent class="grid gap-8">
<div v-for="recentSales in dataRecentSales" :key="recentSales.name" class="flex items-center gap-4">
<Avatar class="hidden h-9 w-9 sm:flex">
<AvatarFallback>{{
recentSales.name
.split(' ')
.map((n) => n[0])
.join('')
}}</AvatarFallback>
</Avatar>
<div class="grid gap-1">
<p class="text-sm font-medium leading-none">
{{ recentSales.name }}
</p>
<p class="text-muted-foreground text-sm">
{{ recentSales.email }}
</p>
</div>
<div class="ml-auto font-medium">
<!-- <NumberFlow -->
<!-- :value="recentSales.amount" -->
<!-- :format="{ style: 'currency', currency: 'USD', trailingZeroDisplay: 'stripIfInteger' }" -->
<!-- prefix="+" -->
<!-- /> -->
</div>
</div>
</CardContent>
</Card>
</div>
</main>
</div>
<FlowDashboard />
</template>