feat(chemo): add page process and modify components

This commit is contained in:
riefive
2025-11-03 15:03:56 +07:00
parent d1369d513b
commit 89b2fb9cd9
26 changed files with 296 additions and 24 deletions
@@ -0,0 +1,42 @@
<script setup lang="ts">
import type { PagePermission } from '~/models/role'
import Error from '~/components/pub/my-ui/error/error.vue'
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
definePageMeta({
middleware: ['rbac'],
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
title: 'Kemoterapi - Proses',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => `${route.meta.title}`,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/rehab/encounter']
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">
<ContentChemotherapyProcess />
</div>
<Error v-else :status-code="403" />
</template>
@@ -0,0 +1,9 @@
<script setup lang="ts">
// Redirect to list page - the process page is now at [id]/index.vue
const route = useRoute()
navigateTo('/outpatient-action/chemotherapy/list')
</script>
<template>
<div />
</template>
@@ -33,7 +33,7 @@ const canRead = true // hasReadAccess(roleAccess)
<template>
<div>
<div v-if="canRead">
<ContentCemotherapyList />
<ContentChemotherapyList />
</div>
<Error v-else :status-code="403" />
</div>
@@ -1,7 +0,0 @@
<script setup lang="ts">
const route = useRoute()
</script>
<template>
<ContentCemotherapyProtocol />
</template>