feat(sep): add list component

This commit is contained in:
riefive
2025-09-09 13:30:51 +07:00
parent 266d5f740b
commit e6442a0d31
4 changed files with 273 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
import type { Col, KeyLabel, RecComponent, RecStrFuncComponent, Th } from '~/components/pub/custom-ui/data/types'
import { defineAsyncComponent } from 'vue'
type SepDto = any
const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue'))
export const cols: Col[] = [
{ width: 120 }, // TGL. SEP
{ width: 150 }, // NO. SEP
{ width: 120 }, // PELAYANAN
{ width: 100 }, // JALUR
{ width: 150 }, // NO. RM
{ width: 200 }, // NAMA PASIEN
{ width: 150 }, // NO. KARTU BPJS
{ width: 150 }, // NO. SURAT KONTROL
{ width: 150 }, // TGL SURAT KONTROL
{ width: 150 }, // KLINIK TUJUAN
{ width: 200 }, // DPJP
{ width: 200 }, // DIAGNOSIS AWAL
{ width: 100 }, // AKSI
]
export const header: Th[][] = [
[
{ label: 'TGL. SEP' },
{ label: 'NO. SEP' },
{ label: 'PELAYANAN' },
{ label: 'JALUR' },
{ label: 'NO. RM' },
{ label: 'NAMA PASIEN' },
{ label: 'NO. KARTU BPJS' },
{ label: 'NO. SURAT KONTROL' },
{ label: 'TGL SURAT KONTROL' },
{ label: 'KLINIK TUJUAN' },
{ label: 'DPJP' },
{ label: 'DIAGNOSIS AWAL' },
{ label: 'AKSI' },
],
]
export const keys = [
'tgl_sep',
'no_sep',
'pelayanan',
'jalur',
'no_rm',
'nama_pasien',
'no_kartu_bpjs',
'no_surat_kontrol',
'tgl_surat_kontrol',
'klinik_tujuan',
'dpjp',
'diagnosis_awal',
'action',
]
export const delKeyNames: KeyLabel[] = [
{ key: 'no_sep', label: 'NO. SEP' },
{ key: 'nama_pasien', label: 'Nama Pasien' },
]
export const funcParsed: Record<string, (row: any, ...args: any[]) => any> = {
}
export const funcComponent: RecStrFuncComponent = {
action(rec, idx) {
const res: RecComponent = {
idx,
rec: rec as object,
component: action,
}
return res
},
}
export const funcHtml: Record<string, (row: any, ...args: any[]) => any> = {}
+34
View File
@@ -0,0 +1,34 @@
<script setup lang="ts">
import { cols, header, keys, funcParsed, funcComponent, funcHtml } from './list-cfg'
interface SepData {
tgl_sep: string
no_sep: string
pelayanan: string
jalur: string
no_rm: string
nama_pasien: string
no_kartu_bpjs: string
no_surat_kontrol: string
tgl_surat_kontrol: string
klinik_tujuan: string
dpjp: string
diagnosis_awal: string
}
const props = defineProps<{
data: SepData[]
}>()
</script>
<template>
<PubBaseDataTable
:cols="cols"
:header="header"
:keys="keys"
:rows="props.data"
:funcParsed="funcParsed"
:funcComponent="funcComponent"
:funcHtml="funcHtml"
/>
</template>