feat(cemo): enhance admin mode functionality and update series handling
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<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'
|
||||
import ContentChemotherapyAdminList from '~/components/content/chemotherapy/admin-list.vue'
|
||||
import ContentChemotherapyVerification from '~/components/content/chemotherapy/verification.vue'
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['rbac'],
|
||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||
title: 'Kemoterapi Admin',
|
||||
contentFrame: 'cf-full-width',
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
useHead({
|
||||
title: () => {
|
||||
const mode = route.params.mode as string
|
||||
if (mode === 'admin') {
|
||||
return 'Administrasi Pasien Rawat Jalan Kemoterapi'
|
||||
} else if (mode === 'verification') {
|
||||
return 'Verifikasi Jadwal Pasien'
|
||||
}
|
||||
return 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 = true // hasReadAccess(roleAccess)
|
||||
|
||||
const mode = computed(() => route.params.mode as string)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="canRead">
|
||||
<ContentChemotherapyAdminList v-if="mode === 'admin'" />
|
||||
<ContentChemotherapyVerification v-else-if="mode === 'verification'" />
|
||||
<Error v-else :status-code="404" status-message="Mode tidak ditemukan" />
|
||||
</div>
|
||||
<Error v-else :status-code="403" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user