65 lines
1.5 KiB
Vue
65 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import type { DataTableLoader } from '~/components/pub/my-ui/data-table/type'
|
|
import type { HeaderPrep, RefSearchNav } from '~/components/pub/my-ui/data/types'
|
|
import AssesmentFunctionList from '~/components/app/assesment-function/list.vue'
|
|
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
|
|
|
|
const props = defineProps<{
|
|
label: string
|
|
}>()
|
|
|
|
const data = ref([])
|
|
|
|
const refSearchNav: RefSearchNav = {
|
|
onClick: () => {
|
|
// open filter modal
|
|
},
|
|
onInput: (_val: string) => {
|
|
// filter patient list
|
|
},
|
|
onClear: () => {
|
|
// clear url param
|
|
},
|
|
}
|
|
|
|
// Loading state management
|
|
const isLoading = reactive<DataTableLoader>({
|
|
isTableLoading: false,
|
|
})
|
|
const recId = ref<number>(0)
|
|
const recAction = ref<string>('')
|
|
const recItem = ref<any>(null)
|
|
|
|
const hreaderPrep: HeaderPrep = {
|
|
title: props.label,
|
|
icon: 'i-lucide-users',
|
|
addNav: {
|
|
label: 'Tambah',
|
|
onClick: () => navigateTo('/rehab/registration-queue/sep-prosedur/add'),
|
|
},
|
|
}
|
|
|
|
async function getPatientList() {
|
|
const resp = await xfetch('/api/v1/patient')
|
|
if (resp.success) {
|
|
data.value = (resp.body as Record<string, any>).data
|
|
}
|
|
}
|
|
|
|
onMounted(() => {
|
|
getPatientList()
|
|
})
|
|
|
|
provide('rec_id', recId)
|
|
provide('rec_action', recAction)
|
|
provide('rec_item', recItem)
|
|
provide('table_data_loader', isLoading)
|
|
</script>
|
|
|
|
<template>
|
|
<Header :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" />
|
|
<div class="my-4 flex flex-1 flex-col gap-4 md:gap-8">
|
|
<AssesmentFunctionList :data="data" />
|
|
</div>
|
|
</template>
|