merge dev

This commit is contained in:
2025-11-27 04:50:07 +07:00
parent 4d16ce0f25
commit 3bb10bc556
31 changed files with 161 additions and 617 deletions

No files matched your search

@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Permission } from '~/models/role'
import { permissions } from '~/const/page-permission/outpatient'
import { permissions } from '~/const/page-permission/ambulatory'
import Error from '~/components/pub/my-ui/error/error.vue'
import Content from '~/components/content/encounter/entry.vue'
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Permission } from '~/models/role'
import { permissions } from '~/const/page-permission/outpatient'
import { permissions } from '~/const/page-permission/emergency'
import Error from '~/components/pub/my-ui/error/error.vue'
import Content from '~/components/content/encounter/list.vue'
@@ -13,7 +13,8 @@ definePageMeta({
})
// Preps role checking
const roleAccess: Record<string, Permission[]> = permissions['/outpatient/encounter'] || {}
const route = useRoute()
const roleAccess: Record<string, Permission[]> = permissions[route.path] || {}
const { checkRole, hasReadAccess } = useRBAC()
// Check if user has access to this page
@@ -26,18 +27,12 @@ if (!hasAccess) {
const canRead = hasReadAccess(roleAccess)
// Page needs
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const { user, getActiveRole } = useUserStore()
// const activeRole = getActiveRole()
// const activeRoleParts = activeRole ? activeRole.split('|') : ['', '']
// const activeRolePos = activeRoleParts[0] // reaching this page means it is already set
// const activeRoleType = activeRoleParts[1] == 'rehab' ? activeRoleParts[1] : ''
const { user } = useUserStore()
const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
</script>
<template>
@@ -45,7 +40,7 @@ const subClassCode = user.unit_code == 'rehab' ? 'rehab' : 'reg'
<div v-if="canRead">
<Content
class-code="emergency"
sub-class-code="reg"
:sub-class-code="subClassCode"
type="encounter"
/>
</div>