diff --git a/.gitignore b/.gitignore index 4a7f73a2..5bdfc11f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ logs .env .env.* !.env.example + +.vscode \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 4b1147d4..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:3000", - "webRoot": "${workspaceFolder}" - } - ] -} diff --git a/app/assets/css/main.css b/app/assets/css/main.css index cab62d6e..17502027 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -174,7 +174,7 @@ body { } body, table, label { - @apply md:!text-xs 2xl:!text-sm; + @apply md:!text-xs 2xl:!text-sm; } /* Container */ diff --git a/app/components/app/assesment-function/list-cfg.ts b/app/components/app/assesment-function/list-cfg.ts index 460cacd9..a11537a7 100644 --- a/app/components/app/assesment-function/list-cfg.ts +++ b/app/components/app/assesment-function/list-cfg.ts @@ -1,119 +1,114 @@ -import type { - Col, - KeyLabel, - RecComponent, - RecStrFuncComponent, - RecStrFuncUnknown, - Th, -} from '~/components/pub/my-ui/data/types' import { defineAsyncComponent } from 'vue' +import type { Config, RecComponent } from '~/components/pub/my-ui/data-table' type SmallDetailDto = any const action = defineAsyncComponent(() => import('~/components/pub/my-ui/data/dropdown-action-dud.vue')) -export const cols: Col[] = [ - {}, - {}, - {}, - { width: 100 }, - { width: 120 }, - {}, - {}, - {}, - { width: 100 }, - { width: 100 }, - {}, - { width: 50 }, -] - -export const header: Th[][] = [ - [ - { label: 'Nama' }, - { label: 'Rekam Medis' }, - { label: 'KTP' }, - { label: 'Tgl Lahir' }, - { label: 'Umur' }, - { label: 'JK' }, - { label: 'Pendidikan' }, - { label: 'Status' }, - { label: '' }, +export const config: Config = { + cols: [ + {}, + {}, + {}, + { width: 100 }, + { width: 120 }, + {}, + {}, + {}, + { width: 100 }, + { width: 100 }, + {}, + { width: 50 }, ], -] -export const keys = [ - 'name', - 'medicalRecord_number', - 'identity_number', - 'birth_date', - 'patient_age', - 'gender', - 'education', - 'status', - 'action', -] + headers: [ + [ + { label: 'Nama' }, + { label: 'Rekam Medis' }, + { label: 'KTP' }, + { label: 'Tgl Lahir' }, + { label: 'Umur' }, + { label: 'JK' }, + { label: 'Pendidikan' }, + { label: 'Status' }, + { label: '' }, + ], + ], -export const delKeyNames: KeyLabel[] = [ - { key: 'code', label: 'Kode' }, - { key: 'name', label: 'Nama' }, -] + keys: [ + 'name', + 'medicalRecord_number', + 'identity_number', + 'birth_date', + 'patient_age', + 'gender', + 'education', + 'status', + 'action', + ], -export const funcParsed: RecStrFuncUnknown = { - name: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}` - }, - identity_number: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (recX.identity_number?.substring(0, 5) === 'BLANK') { - return '(TANPA NIK)' - } - return recX.identity_number - }, - birth_date: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (typeof recX.birth_date == 'object' && recX.birth_date) { - return (recX.birth_date as Date).toLocaleDateString() - } else if (typeof recX.birth_date == 'string') { - return (recX.birth_date as string).substring(0, 10) - } - return recX.birth_date - }, - patient_age: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return recX.birth_date?.split('T')[0] - }, - gender: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') { - return 'Tidak Diketahui' - } - return recX.gender_code - }, - education: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - if (typeof recX.education_code == 'number' && recX.education_code >= 0) { - return recX.education_code - } else if (typeof recX.education_code) { - return recX.education_code - } - return '-' - }, -} + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], -export const funcComponent: RecStrFuncComponent = { - action(rec, idx) { - const res: RecComponent = { - idx, - rec: rec as object, - component: action, - } - return res + parses: { + name: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return `${recX.firstName} ${recX.middleName || ''} ${recX.lastName || ''}` + }, + identity_number: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (recX.identity_number?.substring(0, 5) === 'BLANK') { + return '(TANPA NIK)' + } + return recX.identity_number + }, + birth_date: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (typeof recX.birth_date == 'object' && recX.birth_date) { + return (recX.birth_date as Date).toLocaleDateString() + } else if (typeof recX.birth_date == 'string') { + return (recX.birth_date as string).substring(0, 10) + } + return recX.birth_date + }, + patient_age: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.birth_date?.split('T')[0] + }, + gender: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (typeof recX?.gender_code !== 'number' && recX?.gender_code !== '') { + return 'Tidak Diketahui' + } + return recX.gender_code + }, + education: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + if (typeof recX.education_code == 'number' && recX.education_code >= 0) { + return recX.education_code + } else if (typeof recX.education_code) { + return recX.education_code + } + return '-' + }, }, -} -export const funcHtml: RecStrFuncUnknown = { - patient_address(_rec) { - return '-' + components: { + action(rec: unknown, idx: number) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, }, -} + + htmls: { + patient_address(rec: unknown) { + return '-' + }, + }, +} \ No newline at end of file diff --git a/app/components/app/assesment-function/list.vue b/app/components/app/assesment-function/list.vue index b9a74929..58b4f1bd 100644 --- a/app/components/app/assesment-function/list.vue +++ b/app/components/app/assesment-function/list.vue @@ -1,5 +1,5 @@ diff --git a/app/components/app/bed/list-cfg.ts b/app/components/app/bed/list-cfg.ts index 8e940723..825db939 100644 --- a/app/components/app/bed/list-cfg.ts +++ b/app/components/app/bed/list-cfg.ts @@ -1,44 +1,44 @@ -import type { - Col, - KeyLabel, - RecComponent, - RecStrFuncComponent, - RecStrFuncUnknown, - Th, -} from '~/components/pub/my-ui/data/types' +import type { Config, RecComponent } 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 cols: Col[] = [{}, {}, {}, { width: 50 }] +export const config: Config = { + cols: [{}, {}, {}, { width: 50 }], -export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Kamar' }, { label: '' }]] + headers: [[ + { label: 'Kode' }, + { label: 'Nama' }, + { label: 'Kamar' }, + { label: '' }, + ]], -export const keys = ['code', 'name', 'parent', 'action'] + keys: ['code', 'name', 'parent', 'action'], -export const delKeyNames: KeyLabel[] = [ - { key: 'code', label: 'Kode' }, - { key: 'name', label: 'Nama' }, -] + delKeyNames: [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, + ], -export const funcParsed: RecStrFuncUnknown = { - parent: (rec: unknown): unknown => { - const recX = rec as SmallDetailDto - return recX.parent?.name || '-' + parses: { + parent: (rec: unknown): unknown => { + const recX = rec as SmallDetailDto + return recX.parent?.name || '-' + }, }, -} -export const funcComponent: RecStrFuncComponent = { - action(rec, idx) { - const res: RecComponent = { - idx, - rec: rec as object, - component: action, - } - return res + components: { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, }, -} -export const funcHtml: RecStrFuncUnknown = {} + htmls: {}, +} diff --git a/app/components/app/bed/list.vue b/app/components/app/bed/list.vue index f8b4bf29..19642581 100644 --- a/app/components/app/bed/list.vue +++ b/app/components/app/bed/list.vue @@ -6,7 +6,7 @@ import PaginationView from '~/components/pub/my-ui/pagination/pagination-view.vu import type { PaginationMeta } from '~/components/pub/my-ui/pagination/pagination.type' // Configs -import { cols, funcComponent, funcHtml, funcParsed, header, keys } from './list-cfg' +import { config } from './list-cfg' interface Props { data: any[] @@ -27,13 +27,8 @@ function handlePageChange(page: number) {