Dev cleaning (#106)

This commit is contained in:
Munawwirul Jamal
2025-10-08 00:03:36 +07:00
committed by GitHub
parent 7fdd5c61f0
commit 3eb9dde21d
892 changed files with 51326 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import EarlyMedicalAssesmentList from './list.vue'
import EarlyMedicalAssesmentForm from './form.vue'
const { mode, openForm, backToList } = useQueryMode('mode')
</script>
<template>
<div>
<EarlyMedicalAssesmentList v-if="mode === 'list'" @add="openForm" />
<EarlyMedicalAssesmentForm v-else @back="backToList" />
</div>
</template>
+36
View File
@@ -0,0 +1,36 @@
<script setup lang="ts">
import Entry from '~/components/app/soapi/entry.vue'
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
const isOpen = ref(false)
const data = ref([])
const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
})
async function getPatientList() {
isLoading.isTableLoading = true
const resp = await xfetch('/api/v1/patient')
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
}
isLoading.isTableLoading = false
}
onMounted(() => {
getPatientList()
})
function handleClick(type: string) {
console.log(type)
isOpen.value = true
}
provide('table_data_loader', isLoading)
</script>
<template>
<Entry type="early" :exclude-fields="['prim-compl', 'sec-compl']" @click="handleClick" />
<Dialog v-model:open="isOpen" title="Pilih Prosedur" size="xl" prevent-outside>
<AppIcdMultiselectPicker :data="data" />
</Dialog>
</template>
+66
View File
@@ -0,0 +1,66 @@
<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/soapi/list.vue'
import Header from '~/components/pub/my-ui/nav-header/prep.vue'
const props = defineProps<{
label: string
}>()
const emits = defineEmits(['add', 'edit'])
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: () => emits('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>