feat (patient): add edit page

This commit is contained in:
Abizrh
2025-08-08 20:38:16 +07:00
parent d9fb2cff0c
commit 376af79449
15 changed files with 193 additions and 2 deletions
@@ -0,0 +1,9 @@
<script setup lang="ts"></script>
<template>
<div>entry form</div>
<div>
<PubNavFooterCs />
</div>
</template>
View File
+5
View File
@@ -0,0 +1,5 @@
<script setup lang="ts"></script>
<template>
<AppPatientEntryForm />
</template>
+26
View File
@@ -0,0 +1,26 @@
<script setup lang="ts">
const refSearchNav = {
onClick: () => {
console.log('onClick dari parent')
},
onInput: (val: string) => {
console.log('>>>', val)
},
onClear: () => {
// refresh page
},
}
const hreaderPrep: HeaderPrep = {
title: 'Pasien',
icon: 'bi bi-journal-check',
addNav: {
label: 'Tambah',
onClick: () => (window.location.pathname = '/emergency/patient/add'),
},
}
</script>
<template>
<PubNavHeaderPrep :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" icon="i-lucide-add" />
</template>
+2 -2
View File
@@ -9,9 +9,9 @@ const navMenu: any[] = [
link: '/',
},
{
title: 'Home',
title: 'Pasien',
icon: 'i-lucide-home',
link: '/',
link: '/patient',
},
],
},
+12
View File
@@ -0,0 +1,12 @@
<script setup lang="ts"></script>
<template>
<div class="flex justify-between">
<div>
<Button variant="outline" size="sm">
<Icon name="i-lucide-pencil" class="mr-1" />
Edit
</Button>
</div>
</div>
</template>
+39
View File
@@ -0,0 +1,39 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '../types.ts'
const props = defineProps<{
prep: HeaderPrep
refSearchNav: RefSearchNav
}>()
function emitSearchNavClick() {
props.refSearchNav.onClick()
}
function onInput(event: Event) {
props.refSearchNav.onInput((event.target as HTMLInputElement).value)
}
</script>
<template>
<header>
<div class="flex items-center justify-between">
<div class="flex items-center">
<div class="ml-3 text-lg font-bold text-gray-900">
{{ prep.title }}
</div>
</div>
<div class="flex items-center">
<div class="ml-3 text-lg text-gray-900">
<Input
type="text"
placeholder="Search"
class="w-full rounded-md border border-gray-300 bg-white px-4 py-2 text-gray-900 sm:text-sm"
@click="emitSearchNavClick"
@input="onInput"
/>
</div>
</div>
</div>
</header>
</template>
+84
View File
@@ -0,0 +1,84 @@
import type { ComponentType } from '@unovis/ts'
export interface ListItemDto {
id: number
name: string
code: string
}
export interface RecComponent {
idx?: number
rec: object
props?: any
component: ComponentType
}
export interface Col {
span?: number
classVal?: string
style?: string
width?: number // specific for width
widthUnit?: string // specific for width
}
export interface Th {
label: string
colSpan?: number
rowSpan?: number
classVal?: string
childClassVal?: string
style?: string
childStyle?: string
hideOnSm?: boolean
}
export interface ButtonNav {
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'negative' | 'ghost' | 'link'
classVal?: string
classValExt?: string
icon?: string
label: string
onClick?: () => void
}
export interface QuickSearchNav {
inputClass?: string
inputPlaceHolder?: string
btnClass?: string
btnIcon?: string
btnLabel?: string
mainField?: string
searchParams: object
onSubmit?: (searchParams: object) => void
}
export interface RefSearchNav {
onInput: (val: string) => void
onClick: () => void
onClear: () => void
}
// prepared header for relatively common usage
export interface HeaderPrep {
title?: string
icon?: string
refSearchNav?: RefSearchNav
quickSearchNav?: QuickSearchNav
filterNav?: ButtonNav
addNav?: ButtonNav
printNav?: ButtonNav
}
export interface KeyLabel {
key: string
label: string
}
export type FuncRecUnknown = (rec: unknown, idx: number) => unknown
export type FuncComponent = (rec: unknown, idx: number) => RecComponent
export type RecStrFuncUnknown = Record<string, FuncRecUnknown>
export type RecStrFuncComponent = Record<string, FuncComponent>
export interface KeyNames {
key: string
label: string
}
@@ -0,0 +1,3 @@
<template>
<div>detail pasien</div>
</template>
@@ -0,0 +1,3 @@
<template>
<div>edit pasien</div>
</template>
+3
View File
@@ -0,0 +1,3 @@
<template>
<FlowPatientAdd />
</template>
+7
View File
@@ -0,0 +1,7 @@
<script setup lang="ts"></script>
<template>
<div>
<FlowPatientList />
</div>
</template>