50 lines
1.0 KiB
TypeScript
50 lines
1.0 KiB
TypeScript
import type { Config } from '~/components/pub/my-ui/data-table'
|
|
import { defineAsyncComponent } from 'vue'
|
|
|
|
type SmallDetailDto = any
|
|
|
|
const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue'))
|
|
|
|
export const config: Config = {
|
|
cols: [{}, {}, {}, { width: 50 }],
|
|
|
|
headers: [
|
|
[
|
|
{ label: 'Kode' },
|
|
{ label: 'Nama' },
|
|
{ label: 'Instalasi' },
|
|
{ label: '' },
|
|
],
|
|
],
|
|
|
|
keys: ['code', 'name', 'installation', 'action'],
|
|
|
|
delKeyNames: [
|
|
{ key: 'code', label: 'Kode' },
|
|
{ key: 'name', label: 'Nama' },
|
|
],
|
|
|
|
parses: {
|
|
name: (rec: unknown): unknown => {
|
|
const recX = rec as SmallDetailDto
|
|
return `${recX.name}`.trim()
|
|
},
|
|
installation: (rec: unknown): unknown => {
|
|
const recX = rec as SmallDetailDto
|
|
return recX.installation?.name || recX.Installation?.name || '-'
|
|
},
|
|
},
|
|
|
|
components: {
|
|
action(rec, idx) {
|
|
return {
|
|
idx,
|
|
rec: rec as object,
|
|
component: action,
|
|
}
|
|
},
|
|
},
|
|
|
|
htmls: {},
|
|
}
|