feat(subspecialist): enhance specialist details with unit and installation info
- Update Unit interface to allow null installation - Include specialist.Unit and specialist.Unit.Installation in API includes - Add Unit and Installation fields to subspecialist detail view - Simplify list configuration headers and update keys for specialist name
This commit is contained in:
@@ -32,6 +32,18 @@ defineProps<{
|
||||
<DetailRow label="Spesialis">
|
||||
{{ [subspecialist.specialist?.code, subspecialist.specialist?.name].filter(Boolean).join(' / ') || '-' }}
|
||||
</DetailRow>
|
||||
<DetailRow label="Unit">
|
||||
{{
|
||||
[subspecialist.specialist?.unit?.code, subspecialist.specialist?.unit?.name].filter(Boolean).join(' / ') || '-'
|
||||
}}
|
||||
</DetailRow>
|
||||
<DetailRow label="Instalasi">
|
||||
{{
|
||||
[subspecialist.specialist?.unit?.installation?.code, subspecialist.specialist?.unit?.installation?.name]
|
||||
.filter(Boolean)
|
||||
.join(' / ') || '-'
|
||||
}}
|
||||
</DetailRow>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -8,16 +8,9 @@ const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dr
|
||||
export const config: Config = {
|
||||
cols: [{}, {}, {}, { width: 50 }],
|
||||
|
||||
headers: [
|
||||
[
|
||||
{ label: 'Kode' },
|
||||
{ label: 'Nama' },
|
||||
{ label: 'Specialis' },
|
||||
{ label: '' },
|
||||
],
|
||||
],
|
||||
headers: [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Specialis' }, { label: '' }]],
|
||||
|
||||
keys: ['code', 'name', 'specialist', 'action'],
|
||||
keys: ['code', 'name', 'specialist.name', 'action'],
|
||||
|
||||
delKeyNames: [
|
||||
{ key: 'code', label: 'Kode' },
|
||||
|
||||
@@ -121,7 +121,7 @@ const headerPrep: HeaderPrep = {
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const result = await getDetailSubSpecialist(props.subspecialistId, {
|
||||
includes: 'specialist',
|
||||
includes: 'specialist,specialist.Unit,specialist.Unit.Installation',
|
||||
})
|
||||
if (result.success) {
|
||||
subSpecialist.value = result.body.data || {}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ export interface Unit extends Base {
|
||||
name: string
|
||||
installation_id?: number | string | null
|
||||
|
||||
installation?: Installation
|
||||
installation?: Installation | null
|
||||
}
|
||||
|
||||
export function genUnit(): Unit {
|
||||
|
||||
Reference in New Issue
Block a user