feat/procedure-room-order: wip #3
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
@@ -0,0 +1,54 @@
|
||||
import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import type { ProcedureRoomOrder } from '~/models/procedure-room-order'
|
||||
|
||||
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
||||
|
||||
export const config: Config = {
|
||||
cols: [{}, {}, {}, {}, {}, { width: 50 }],
|
||||
|
||||
headers: [[
|
||||
{ label: 'Tgl. Order' },
|
||||
{ label: 'No. Order' },
|
||||
{ label: 'Ruangan' },
|
||||
{ label: 'Status' },
|
||||
{ label: 'Resume' },
|
||||
{ label: '' },
|
||||
]],
|
||||
|
||||
keys: ['date', 'number', 'room', 'status', 'resume', 'action'],
|
||||
|
||||
delKeyNames: [
|
||||
{ key: 'createdAt', label: 'Tgl. Order' },
|
||||
{ key: 'id', label: 'No. Order' },
|
||||
],
|
||||
|
||||
parses: {
|
||||
date: (rec: any) => {
|
||||
const recX = rec as ProcedureRoomOrder
|
||||
return recX.createdAt ? recX.createdAt.substring(0, 10) : ''
|
||||
|
||||
},
|
||||
number: (rec: any) => {
|
||||
const recX = rec as ProcedureRoomOrder
|
||||
return `ORT-${recX.id}`
|
||||
},
|
||||
room: (rec: any) => {
|
||||
const recX = rec as ProcedureRoomOrder
|
||||
return recX.procedureRoom?.infra?.name || '--belum terdata0--'
|
||||
},
|
||||
},
|
||||
|
||||
components: {
|
||||
action(rec, idx) {
|
||||
const res: RecComponent = {
|
||||
idx,
|
||||
rec: rec as object,
|
||||
component: action,
|
||||
}
|
||||
return res
|
||||
},
|
||||
},
|
||||
|
||||
htmls: {},
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
// Components
|
||||
import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vue'
|
||||
|
||||
// Types
|
||||
import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type'
|
||||
|
||||
// Configs
|
||||
import { config } from './list.cfg'
|
||||
import type { Config } from '~/components/pub/my-ui/data-table'
|
||||
|
||||
interface Props {
|
||||
data: any[]
|
||||
paginationMeta: PaginationMeta
|
||||
tableConfig?: Config
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
tableConfig: () => config,
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
pageChange: [page: number]
|
||||
}>()
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
emit('pageChange', page)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-4">
|
||||
<PubMyUiDataTable
|
||||
v-bind="props.tableConfig"
|
||||
:rows="data"
|
||||
:skeleton-size="paginationMeta?.pageSize"
|
||||
/>
|
||||
<PaginationView :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user