Files
simrsx-fe/app/components/app/subspecialist-position/list.cfg.ts
T
Khafid Prayoga ba0ac753b2 feat(subspecialist-position): implement crud operations for subspecialist positions
- Add new handler, service, and schema files for subspecialist position
- Update list configuration and entry form components
- Modify list view to display subspecialist position data
- Include subspecialist relation in position model
2025-10-31 14:57:45 +07:00

66 lines
1.6 KiB
TypeScript

import type { Config, RecComponent } from '~/components/pub/my-ui/data-table'
import { defineAsyncComponent } from 'vue'
import type { SubSpecialistPosition } from '~/models/subspecialist-position'
type SmallDetailDto = any
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-ud.vue'))
export const config: Config = {
cols: [{}, {}, {}, {}, {}, { width: 50 }],
headers: [
[
{ label: 'Kode Posisi' },
{ label: 'Nama Posisi' },
{ label: 'Nama Sub Spesialis ' },
{ label: 'Karyawan' },
{ label: 'Status Kepala' },
{ label: '' },
],
],
keys: ['code', 'name', 'subspecialist', 'employee', 'head', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
],
parses: {
subspecialist: (rec: unknown): unknown => {
const recX = rec as SubSpecialistPosition
return recX.subspecialist?.name || '-'
},
employee: (rec: unknown): unknown => {
const recX = rec as SubSpecialistPosition
const fullName = [recX.employee?.person.frontTitle, recX.employee?.person.name, recX.employee?.person.endTitle]
.filter(Boolean)
.join(' ')
.trim()
return fullName || '-'
},
head: (rec: unknown): unknown => {
const recX = rec as SmallDetailDto
return recX.headStatus ? 'Ya' : 'Tidak'
},
},
components: {
action(rec, idx) {
const res: RecComponent = {
idx,
rec: rec as object,
component: action,
props: {
size: 'sm',
},
}
return res
},
},
htmls: {},
}