feat/things-munaja: content switcher
This commit is contained in:
No files matched your search
@@ -42,14 +42,14 @@ if (props.data.responsible_doctor) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="w-full">
|
<div class="w-full py-3 2xl:py-4 px-5">
|
||||||
<!-- Data Pasien -->
|
<!-- Data Pasien -->
|
||||||
<h2 class="mb-2 font-semibold md:text-base 2xl:text-lg">
|
<h2 class="mb-2 font-semibold md:text-base 2xl:text-lg">
|
||||||
{{ data.patient.person.name }} - {{ data.patient.number }}
|
{{ data.patient.person.name }} - {{ data.patient.number }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-3">
|
<div class="grid grid-cols-3">
|
||||||
<div>
|
<div>
|
||||||
<DE.Block mode="preview">
|
<DE.Block mode="preview" class="!mb-0">
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
<DE.Label class="font-semibold">Tgl. Lahir</DE.Label>
|
<DE.Label class="font-semibold">Tgl. Lahir</DE.Label>
|
||||||
<DE.Colon />
|
<DE.Colon />
|
||||||
@@ -58,7 +58,7 @@ if (props.data.responsible_doctor) {
|
|||||||
</DE.Field>
|
</DE.Field>
|
||||||
</DE.Cell>
|
</DE.Cell>
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
<DE.Label class="font-semibold">Jns. Kelamin</DE.Label>
|
<DE.Label class="font-semibold"><span class="hidden xl:inline">Jns.</span> Kelamin</DE.Label>
|
||||||
<DE.Colon />
|
<DE.Colon />
|
||||||
<DE.Field>
|
<DE.Field>
|
||||||
{{ genderCodes[data.patient.person.gender_code as keyof typeof genderCodes] }}
|
{{ genderCodes[data.patient.person.gender_code as keyof typeof genderCodes] }}
|
||||||
@@ -74,7 +74,7 @@ if (props.data.responsible_doctor) {
|
|||||||
</DE.Block>
|
</DE.Block>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<DE.Block mode="preview">
|
<DE.Block mode="preview" class="!mb-0">
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
<DE.Label position="dynamic" class="font-semibold">Tgl. Masuk</DE.Label>
|
<DE.Label position="dynamic" class="font-semibold">Tgl. Masuk</DE.Label>
|
||||||
<DE.Colon />
|
<DE.Colon />
|
||||||
@@ -99,7 +99,7 @@ if (props.data.responsible_doctor) {
|
|||||||
</DE.Block>
|
</DE.Block>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<DE.Block mode="preview">
|
<DE.Block mode="preview" class="!mb-0">
|
||||||
<DE.Cell>
|
<DE.Cell>
|
||||||
<DE.Label position="dynamic" class="font-semibold">DPJP</DE.Label>
|
<DE.Label position="dynamic" class="font-semibold">DPJP</DE.Label>
|
||||||
<DE.Colon />
|
<DE.Colon />
|
||||||
|
|||||||
@@ -87,44 +87,46 @@ function handleClick(value: string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<h2 class="mb-4 font-semibold md:text-base 2xl:text-lg">Menu Cepat:</h2>
|
<div class="w-full py-3 2xl:py-4 px-5">
|
||||||
<div class="flex flex-wrap gap-2 mb-2">
|
<h2 class="mb-2 font-semibold md:text-base 2xl:text-lg">Akses Cepat:</h2>
|
||||||
<Button
|
<div class="flex flex-wrap gap-2 mb-2">
|
||||||
v-for="item in itemsOne"
|
<Button
|
||||||
:key="item.value"
|
v-for="item in itemsOne"
|
||||||
:class="[
|
:key="item.value"
|
||||||
'flex items-center gap-2 rounded-lg border px-3 py-1 text-sm font-medium transition-colors',
|
:class="[
|
||||||
activeMenu === item.value
|
'flex items-center gap-2 rounded-lg border px-3 py-1 text-sm font-medium transition-colors',
|
||||||
? 'border-orange-300 bg-orange-400 text-white'
|
activeMenu === item.value
|
||||||
: 'border-orange-300 bg-white text-orange-500 hover:bg-orange-400 hover:text-white'
|
? 'border-orange-300 bg-orange-400 text-white'
|
||||||
]"
|
: 'border-orange-300 bg-white text-orange-500 hover:bg-orange-400 hover:text-white'
|
||||||
@click="handleClick(item.value)"
|
]"
|
||||||
>
|
@click="handleClick(item.value)"
|
||||||
<Icon v-if="item.type === 'icon'"
|
>
|
||||||
:name="item.icon"
|
<Icon v-if="item.type === 'icon'"
|
||||||
class="h-4 w-4"
|
:name="item.icon"
|
||||||
/>
|
class="h-4 w-4"
|
||||||
<img v-else-if="item.type === 'image'" :src="item.icon" class="h-[24px] w-[24px] object-contain" />
|
/>
|
||||||
{{ item.label }}
|
<img v-else-if="item.type === 'image'" :src="item.icon" class="h-[24px] w-[24px] object-contain" />
|
||||||
</Button>
|
{{ item.label }}
|
||||||
</div>
|
</Button>
|
||||||
<div class="flex flex-wrap gap-2 mb-2">
|
</div>
|
||||||
<Button
|
<div class="flex flex-wrap gap-2 mb-2">
|
||||||
v-for="item in itemsTwo"
|
<Button
|
||||||
:key="item.value"
|
v-for="item in itemsTwo"
|
||||||
:class="[
|
:key="item.value"
|
||||||
'flex items-center gap-2 rounded-lg border px-3 py-1 text-sm font-medium transition-colors',
|
:class="[
|
||||||
activeMenu === item.value
|
'flex items-center gap-2 rounded-lg border px-3 py-1 text-sm font-medium transition-colors',
|
||||||
? 'border-orange-300 bg-orange-400 text-white'
|
activeMenu === item.value
|
||||||
: 'border-orange-300 bg-white text-orange-500 hover:bg-orange-400 hover:text-white'
|
? 'border-orange-300 bg-orange-400 text-white'
|
||||||
]"
|
: 'border-orange-300 bg-white text-orange-500 hover:bg-orange-400 hover:text-white'
|
||||||
@click="handleClick(item.value)"
|
]"
|
||||||
>
|
@click="handleClick(item.value)"
|
||||||
<Icon
|
>
|
||||||
:name="item.icon"
|
<Icon
|
||||||
class="h-4 w-4"
|
:name="item.icon"
|
||||||
/>
|
class="h-4 w-4"
|
||||||
{{ item.label }}
|
/>
|
||||||
</Button>
|
{{ item.label }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -154,7 +154,7 @@ onMounted(async () => {
|
|||||||
///// Functions
|
///// Functions
|
||||||
function handleClick(type: string) {
|
function handleClick(type: string) {
|
||||||
if (type === 'draft') {
|
if (type === 'draft') {
|
||||||
router.back()
|
router.push(`/${props.classCode}/encounter`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,27 +181,13 @@ async function getData() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<div class="bg-white p-4 dark:bg-slate-800 2xl:p-5">
|
<div class="bg-white dark:bg-slate-800">
|
||||||
<div class="mb-4 flex">
|
<div class="p-3 2xl:p-4 border-b border-slate-300 dark:border-slate-700">
|
||||||
<div>
|
<ContentNavBa label="Kembali Ke Daftar" @click="handleClick" />
|
||||||
<ContentNavBa
|
|
||||||
label="Kembali"
|
|
||||||
@click="handleClick"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="ms-auto pe-3 pt-1 text-end text-xl 2xl:text-2xl font-semibold">
|
|
||||||
Pasien: {{ data.patient.person.name }} --- No. RM: {{ data.patient.number }}
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<ContentSwitcher
|
<ContentSwitcher :active="1" class="h-[130px] 2xl:h-[160px]">
|
||||||
:active="1"
|
|
||||||
:height="150"
|
|
||||||
>
|
|
||||||
<template v-slot:content1>
|
<template v-slot:content1>
|
||||||
<EncounterPatientInfo
|
<EncounterPatientInfo v-if="isShowPatient" :data="data" />
|
||||||
v-if="isShowPatient"
|
|
||||||
:data="data"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:content2>
|
<template v-slot:content2>
|
||||||
<EncounterHistoryButtonMenu v-if="isShowPatient" />
|
<EncounterHistoryButtonMenu v-if="isShowPatient" />
|
||||||
|
|||||||
@@ -1,40 +1,33 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
height?: number
|
height?: number
|
||||||
|
class?: string
|
||||||
activeTab?: 1 | 2
|
activeTab?: 1 | 2
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const classVal = computed(() => {
|
||||||
|
return props.class ? props.class : ''
|
||||||
|
})
|
||||||
const activeTab = ref(props.activeTab || 1)
|
const activeTab = ref(props.activeTab || 1)
|
||||||
|
|
||||||
function handleClick(value: 1 | 2) {
|
function switchActiveTab() {
|
||||||
activeTab.value = value
|
activeTab.value = activeTab.value === 1 ? 2 : 1
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="content-switcher" :style="`height: ${height || 200}px`">
|
<div :class="`content-switcher ${classVal}`" :style="height ? `height:${200}px` : ''">
|
||||||
<div :class="`${activeTab === 1 ? 'active' : 'inactive'}`">
|
<div class="wrapper">
|
||||||
<div class="content-wrapper">
|
<div :class="`item item-1 ${activeTab === 1 ? 'active' : 'inactive'}`">
|
||||||
<div>
|
<slot name="content1" />
|
||||||
<slot name="content1" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content-nav">
|
<div :class="`nav border-slate-300 ${ activeTab == 1 ? 'border-l' : 'border-r'}`">
|
||||||
<button @click="handleClick(1)">
|
<button @click="switchActiveTab()" class="!p-0 w-full h-full">
|
||||||
<Icon name="i-lucide-chevron-right" />
|
<Icon :name="activeTab == 1 ? 'i-lucide-chevron-left' : 'i-lucide-chevron-right'" class="text-3xl" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div :class="`item item-2 ${activeTab === 2 ? 'active' : 'inactive'}`">
|
||||||
<div :class="`${activeTab === 2 ? 'active' : 'inactive'}`">
|
<slot name="content2" />
|
||||||
<div class="content-nav">
|
|
||||||
<button @click="handleClick(2)">
|
|
||||||
<Icon name="i-lucide-chevron-left" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="content-wrapper">
|
|
||||||
<div>
|
|
||||||
<slot name="content2" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,45 +35,24 @@ function handleClick(value: 1 | 2) {
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
.content-switcher {
|
.content-switcher {
|
||||||
@apply flex overflow-hidden gap-3
|
@apply overflow-hidden
|
||||||
}
|
}
|
||||||
.content-switcher > * {
|
.wrapper {
|
||||||
@apply border border-slate-300 rounded-md flex overflow-hidden
|
@apply flex w-[200%] h-full
|
||||||
|
}
|
||||||
|
.item {
|
||||||
|
@apply w-[calc(50%-60px)]
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-wrapper {
|
.item-1.active {
|
||||||
@apply p-4 2xl:p-5 overflow-hidden grow
|
@apply ms-0 transition-all duration-500 ease-in-out
|
||||||
}
|
}
|
||||||
.inactive .content-wrapper {
|
.item-1.inactive {
|
||||||
@apply p-0 w-0
|
@apply -ms-[calc(50%-60px)] transition-all duration-500 ease-in-out
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-nav {
|
.nav {
|
||||||
@apply h-full flex flex-row items-center justify-center content-center !text-2xl overflow-hidden
|
@apply h-full w-[60px] flex flex-row items-center justify-center content-center !text-2xl overflow-hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-nav button {
|
|
||||||
@apply pt-2 px-2 h-full w-full
|
|
||||||
}
|
|
||||||
|
|
||||||
/* .content-switcher .inactive > .content-wrapper {
|
|
||||||
@apply w-0 p-0 opacity-0 transition-all duration-500 ease-in-out
|
|
||||||
} */
|
|
||||||
.content-switcher .inactive {
|
|
||||||
@apply w-16 transition-all duration-500 ease-in-out
|
|
||||||
}
|
|
||||||
.content-switcher .inactive > .content-nav {
|
|
||||||
@apply w-full transition-all duration-100 ease-in-out
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-switcher .active {
|
|
||||||
@apply grow transition-all duration-500 ease-in-out
|
|
||||||
}
|
|
||||||
.content-switcher .active > .content-nav {
|
|
||||||
@apply w-0 transition-all duration-100 ease-in-out
|
|
||||||
}
|
|
||||||
/* .content-switcher .active > .content-wrapper {
|
|
||||||
@apply w-full delay-1000 transition-all duration-1000 ease-in-out
|
|
||||||
} */
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -53,8 +53,8 @@ const settingClass = computed(() => {
|
|||||||
'[&_.cell]:2xl:flex',
|
'[&_.cell]:2xl:flex',
|
||||||
][getBreakpointIdx(props.cellFlexPoint)]
|
][getBreakpointIdx(props.cellFlexPoint)]
|
||||||
cls += ' [&_.label]:flex-shrink-0 ' + [
|
cls += ' [&_.label]:flex-shrink-0 ' + [
|
||||||
'[&_.label]:md:w-12 [&_.label]:xl:w-20',
|
'[&_.label]:md:w-16 [&_.label]:xl:w-20',
|
||||||
'[&_.label]:md:w-16 [&_.label]:xl:w-24',
|
'[&_.label]:md:w-20 [&_.label]:xl:w-24',
|
||||||
'[&_.label]:md:w-24 [&_.label]:xl:w-32',
|
'[&_.label]:md:w-24 [&_.label]:xl:w-32',
|
||||||
'[&_.label]:md:w-32 [&_.label]:xl:w-40',
|
'[&_.label]:md:w-32 [&_.label]:xl:w-40',
|
||||||
'[&_.label]:md:w-44 [&_.label]:xl:w-52',
|
'[&_.label]:md:w-44 [&_.label]:xl:w-52',
|
||||||
|
|||||||
@@ -62,17 +62,19 @@ const defaultKeys: Record<string, any> = {
|
|||||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||||
unit: 'all',
|
unit: 'all',
|
||||||
},
|
},
|
||||||
earlyNurseryAssessment: {
|
// NOTE : HIDDEN UNTIL IT IS READY
|
||||||
id: 'early-nursery-assessment',
|
// earlyNurseryAssessment: {
|
||||||
title: 'Pengkajian Awal Keperawatan',
|
// id: 'early-nursery-assessment',
|
||||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
// title: 'Pengkajian Awal Keperawatan',
|
||||||
unit: 'all',
|
// classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||||
},
|
// unit: 'all',
|
||||||
|
// },
|
||||||
earlyMedicalAssessment: {
|
earlyMedicalAssessment: {
|
||||||
id: 'early-medical-assessment',
|
id: 'early-medical-assessment',
|
||||||
title: 'Pengkajian Awal Medis',
|
title: 'Pengkajian Awal Medis',
|
||||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||||
unit: 'all',
|
unit: 'all',
|
||||||
|
afterId: 'early-medical-assessment',
|
||||||
},
|
},
|
||||||
earlyMedicalRehabAssessment: {
|
earlyMedicalRehabAssessment: {
|
||||||
id: 'rehab-medical-assessment',
|
id: 'rehab-medical-assessment',
|
||||||
@@ -81,20 +83,27 @@ const defaultKeys: Record<string, any> = {
|
|||||||
unit: 'rehab',
|
unit: 'rehab',
|
||||||
afterId: 'early-medical-assessment',
|
afterId: 'early-medical-assessment',
|
||||||
},
|
},
|
||||||
functionAssessment: {
|
fkr: {
|
||||||
id: 'function-assessment',
|
id: 'fkr',
|
||||||
title: 'Asesmen Fungsi',
|
title: 'FKR',
|
||||||
classCode: ['ambulatory'],
|
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
||||||
unit: 'rehab',
|
unit: 'all',
|
||||||
afterId: 'rehab-medical-assessment',
|
|
||||||
},
|
|
||||||
therapyProtocol: {
|
|
||||||
id: 'therapy-protocol',
|
|
||||||
classCode: ['ambulatory'],
|
|
||||||
title: 'Protokol Terapi',
|
|
||||||
unit: 'rehab',
|
|
||||||
afterId: 'function-assessment',
|
|
||||||
},
|
},
|
||||||
|
// NOTE: Replaced by FRK
|
||||||
|
// functionAssessment: {
|
||||||
|
// id: 'function-assessment',
|
||||||
|
// title: 'Asesmen Fungsi',
|
||||||
|
// classCode: ['ambulatory'],
|
||||||
|
// unit: 'rehab',
|
||||||
|
// afterId: 'rehab-medical-assessment',
|
||||||
|
// },
|
||||||
|
// therapyProtocol: {
|
||||||
|
// id: 'therapy-protocol',
|
||||||
|
// classCode: ['ambulatory'],
|
||||||
|
// title: 'Protokol Terapi',
|
||||||
|
// unit: 'rehab',
|
||||||
|
// afterId: 'function-assessment',
|
||||||
|
// },
|
||||||
chemotherapyProtocol: {
|
chemotherapyProtocol: {
|
||||||
id: 'chemotherapy-protocol',
|
id: 'chemotherapy-protocol',
|
||||||
title: 'Protokol Kemoterapi',
|
title: 'Protokol Kemoterapi',
|
||||||
@@ -217,12 +226,6 @@ const defaultKeys: Record<string, any> = {
|
|||||||
classCode: ['ambulatory', 'emergency'],
|
classCode: ['ambulatory', 'emergency'],
|
||||||
unit: 'all',
|
unit: 'all',
|
||||||
},
|
},
|
||||||
fkr: {
|
|
||||||
id: 'fkr',
|
|
||||||
title: 'FKR',
|
|
||||||
classCode: ['ambulatory', 'emergency', 'inpatient'],
|
|
||||||
unit: 'all',
|
|
||||||
},
|
|
||||||
refBack: {
|
refBack: {
|
||||||
id: 'reference-back',
|
id: 'reference-back',
|
||||||
title: 'PRB',
|
title: 'PRB',
|
||||||
|
|||||||
Reference in New Issue
Block a user