Merge branch 'dev' of github.com:dikstub-rssa/simrs-fe into feat/satusehat

This commit is contained in:
Khafid Prayoga
2025-08-25 14:58:45 +07:00
44 changed files with 307 additions and 113 deletions
+7 -5
View File
@@ -1,5 +1,7 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '~/components/pub/nav/types'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
import type { DataTableLoader } from '~/components/pub/base/data-table/type';
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
const data = ref([])
@@ -15,8 +17,8 @@ const refSearchNav: RefSearchNav = {
},
}
const isLoading = reactive({
dataListLoading: false,
const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
})
const recId = ref<number>(0)
@@ -51,10 +53,10 @@ onMounted(() => {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('pull_data', isLoading)
provide('table_data_loader', isLoading)
</script>
<template>
<PubNavHeaderPrep :prep="{ ...headerPrep }" :ref-search-nav="refSearchNav" />
<Header :prep="{ ...headerPrep }" :ref-search-nav="refSearchNav" />
<AppDoctorList v-if="!isLoading.dataListLoading" :data="data" />
</template>
+13 -11
View File
@@ -1,7 +1,10 @@
<script setup lang="ts">
import type { Summary } from '~/components/pub/base/summary-card.type'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/nav/types'
import type { DataTableLoader } from '~/components/pub/base/data-table/type';
import type { Summary } from '~/components/pub/base/summary-card/type'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
import { Calendar, Hospital, UserCheck, UsersRound } from 'lucide-vue-next'
import SummaryCard from '~/components/pub/base/summary-card/summary-card.vue'
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
const data = ref([])
@@ -18,9 +21,9 @@ const refSearchNav: RefSearchNav = {
}
// Loading state management
const isLoading = reactive({
const isLoading = reactive<DataTableLoader>({
summary: false,
dataListLoading: false,
isTableLoading: false,
})
const recId = ref<number>(0)
@@ -83,13 +86,12 @@ async function getPatientSummary() {
}
async function getPatientList() {
isLoading.dataListLoading = true
isLoading.isTableLoading = true
const resp = await xfetch('/api/v1/patient')
console.log('data patient', resp)
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
}
isLoading.dataListLoading = false
isLoading.isTableLoading = false
}
onMounted(() => {
@@ -100,18 +102,18 @@ onMounted(() => {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('pull_data', isLoading)
provide('table_data_loader', isLoading)
</script>
<template>
<PubNavHeaderPrep :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" />
<Header :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" />
<div class="my-4 flex flex-1 flex-col gap-4 md:gap-8">
<div class="grid gap-4 md:grid-cols-2 md:gap-8 lg:grid-cols-4">
<template v-if="isLoading.summary">
<PubBaseSummaryCard v-for="n in 4" :key="n" is-skeleton />
<SummaryCard v-for="n in 4" :key="n" is-skeleton />
</template>
<template v-else>
<PubBaseSummaryCard v-for="card in summaryData" :key="card.title" :stat="card" />
<SummaryCard v-for="card in summaryData" :key="card.title" :stat="card" />
</template>
</div>
<AppPatientList :data="data" />
@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { HeaderPrep, RefSearchNav } from '~/components/pub/nav/types'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
import type { DataTableLoader } from '~/components/pub/base/data-table/type';
import RehabSepProsedurList from '~/components/app/rehab/registration/sep-prosedur/list.vue'
const props = defineProps<{
@@ -21,9 +22,9 @@ const refSearchNav: RefSearchNav = {
}
// Loading state management
const isLoading = reactive({
summary: false,
table: false,
const isLoading = reactive<DataTableLoader>({
isTableLoading: false,
})
const recId = ref<number>(0)
const recAction = ref<string>('')
@@ -40,7 +41,6 @@ const hreaderPrep: HeaderPrep = {
async function getPatientList() {
const resp = await xfetch('/api/v1/patient')
console.log('data patient', resp)
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
}
@@ -53,12 +53,12 @@ onMounted(() => {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('table_data_loader', isLoading)
</script>
<template>
<PubNavHeaderPrep :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" />
<Header :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" />
<div class="my-4 flex flex-1 flex-col gap-4 md:gap-8">
<RehabSepProsedurList :data="data" />
</div>
</template>
/template>
+14 -12
View File
@@ -1,15 +1,17 @@
<script setup lang="ts">
import type { ServiceStatus } from '~/components/pub/base/service-status.type'
import type { Summary } from '~/components/pub/base/summary-card.type'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/nav/types'
import type { DataTableLoader } from '~/components/pub/base/data-table/type';
import type { ServiceStatus } from '~/components/pub/base/service-status/type'
import type { Summary } from '~/components/pub/base/summary-card/type'
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
import { useUrlSearchParams } from '@vueuse/core'
import { CircleCheckBig, CircleDashed, CircleX, Ellipsis, Search, Send } from 'lucide-vue-next'
import Header from '~/components/pub/custom-ui/nav-header/header.vue';
// State management
const data = ref([])
const isLoading = reactive({
const isLoading = reactive<DataTableLoader>({
satusehatConn: true,
dataListLoading: false,
isTableLoading: false,
})
const params = useUrlSearchParams('history', {
@@ -38,7 +40,7 @@ const pagination = ref({
// API function to fetch data
async function fetchData() {
try {
isLoading.dataListLoading = true
isLoading.isTableLoading = true
const response: any = await $fetch('/api/v1/satusehat/list', {
method: 'POST',
body: {
@@ -59,7 +61,7 @@ async function fetchData() {
} catch (error) {
console.error('Error fetching data:', error)
} finally {
isLoading.dataListLoading = false
isLoading.isTableLoading = false
}
}
@@ -161,7 +163,7 @@ onMounted(async () => {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('pull_data', isLoading)
provide('table_data_loader', isLoading)
const tabs = [
{
@@ -206,10 +208,10 @@ const activeTabFilter = computed({
</script>
<template>
<PubNavHeaderPrep :prep="headerPrep" />
<Header :prep="headerPrep" />
<div class="my-4 flex flex-1 flex-col gap-3 md:gap-4">
<PubBaseServiceStatus v-bind="service" />
<AppSatusehatCardSummary :is-loading="isLoading.satusehatConn" :summary-data="summaryData" />
<AppSatusehatCardSummary :is-loading="isLoading.satusehatConn!" :summary-data="summaryData" />
</div>
<div class="rounded-md border p-4">
<h2 class="text-md font-semibold py-2">FHIR Resource</h2>
@@ -298,11 +300,11 @@ const activeTabFilter = computed({
<TabsContent v-for="tab in tabs" :key="`content-${tab.value}`" :value="tab.value">
<div class="rounded-md border p-4">
<!-- <Ellipsis v-if="isLoading.satusehatConn || isLoading.dataList" -->
<!-- class="size-6 animate-pulse text-muted-foreground mx-auto" /> -->
<!-- class="size-6 animate-pulse text-muted-foreground mx-auto" /> -->
<AppSatusehatList v-if="!isLoading.satusehatConn" :data="data" />
<!-- Pagination -->
<div v-if="!isLoading.satusehatConn && !isLoading.dataListLoading && pagination.total > 0"
<div v-if="!isLoading.satusehatConn && !isLoading.isTableLoading && pagination.total > 0"
class="mt-4 flex justify-between items-center">
<div class="text-sm text-muted-foreground">
Menampilkan {{ ((pagination.page - 1) * pagination.limit) + 1 }} -