feat/device-order: adjustment wip

This commit is contained in:
Andrian Roshandy
2025-11-16 11:21:02 +07:00
parent cbe1883c9f
commit 7253272681
4 changed files with 110 additions and 42 deletions

No files matched your search

+23 -12
View File
@@ -1,13 +1,20 @@
import type { Config } from '~/components/pub/my-ui/data-table'
import type { DeviceOrder } from '~/models/device-order'
import { defineAsyncComponent } from 'vue'
// import type {} from
// import { defineAsyncComponent } from 'vue'
// const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
export const config: Config = {
cols: [{ width: 120 }, { }, { }, { width: 50 }],
headers: [[{ label: 'Tanggal' }, { label: 'DPJP' }, { label: 'Alat Kesehatan' }, { label: '' }]],
keys: ['createdAt', 'encounter.doctor.person.name', 'items', 'action'],
cols: [{ width: 120 }, { }, { }, { }, { width: 50 }],
headers: [[
{ label: 'Tanggal' },
{ label: 'DPJP' },
{ label: 'Alat Kesehatan' },
{ label: 'Status' },
{ label: '' }]],
keys: ['createdAt', 'doctor.employee.person.name', 'items', 'status_code', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
@@ -18,13 +25,17 @@ export const config: Config = {
const recX = rec as DeviceOrder
return recX.items?.length || 0
},
}
// funcParsed: {
// parent: (rec: unknown): unknown => {
// const recX = rec as SmallDetailDto
// return recX.parent?.name || '-'
// },
// },
},
parses: {
createdAt: (rec: unknown): unknown => {
const recX = rec as DeviceOrder
return recX.createdAt ? new Date(recX.createdAt).toLocaleDateString() : '-'
},
// parent: (rec: unknown): unknown => {
// const recX = rec as SmallDetailDto
// return recX.parent?.name || '-'
// },
},
// funcComponent: {
// action(rec: object, idx: any) {
// const res: RecComponent = {
+3 -5
View File
@@ -8,12 +8,10 @@ import type { PaginationMeta } from '~/components/pub/my-ui/pagination/paginatio
// Configs
import { config } from './list.config'
interface Props {
defineProps<{
data: any[]
paginationMeta: PaginationMeta
}
defineProps<Props>()
}>()
const emit = defineEmits<{
pageChange: [page: number]
@@ -28,7 +26,7 @@ function handlePageChange(page: number) {
<div class="space-y-4">
<PubMyUiDataTable
v-bind="config"
:rows="[]"
:rows="data"
/>
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
</div>