mirror of
https://github.com/faiztyanirh/clqms-shadcn-v1.git
synced 2026-04-28 17:52:31 +07:00
continue testmap & bugfix
This commit is contained in:
parent
60bf81d439
commit
801c0a54f1
@ -8,23 +8,23 @@ export const testMapSchema = z
|
|||||||
HostID: z.string().optional(),
|
HostID: z.string().optional(),
|
||||||
ClientID: z.string().optional()
|
ClientID: z.string().optional()
|
||||||
})
|
})
|
||||||
.superRefine((data, ctx) => {
|
// .superRefine((data, ctx) => {
|
||||||
const hostID = data.HostID;
|
// const hostID = data.HostID;
|
||||||
const clientID = data.ClientID;
|
// const clientID = data.ClientID;
|
||||||
|
|
||||||
if (hostID && clientID && hostID === clientID) {
|
// if (hostID && clientID && hostID === clientID) {
|
||||||
ctx.addIssue({
|
// ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
// code: z.ZodIssueCode.custom,
|
||||||
message: 'ClientID must be different from HostID',
|
// message: 'ClientID must be different from HostID',
|
||||||
path: ['ClientID']
|
// path: ['ClientID']
|
||||||
});
|
// });
|
||||||
ctx.addIssue({
|
// ctx.addIssue({
|
||||||
code: z.ZodIssueCode.custom,
|
// code: z.ZodIssueCode.custom,
|
||||||
message: 'HostID must be different from ClientID',
|
// message: 'HostID must be different from ClientID',
|
||||||
path: ['HostID']
|
// path: ['HostID']
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
export const testMapInitialForm = {
|
export const testMapInitialForm = {
|
||||||
TestMapID: '',
|
TestMapID: '',
|
||||||
|
|||||||
@ -125,10 +125,10 @@
|
|||||||
tempMap,
|
tempMap,
|
||||||
});
|
});
|
||||||
console.log(payload)
|
console.log(payload)
|
||||||
// const result = await formState.save(masterDetail.mode, payload);
|
const result = await formState.save(masterDetail.mode, payload);
|
||||||
|
|
||||||
// toast('Test Map Created!');
|
toast('Test Map Created!');
|
||||||
// masterDetail?.exitForm(true);
|
masterDetail?.exitForm(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const primaryAction = $derived({
|
const primaryAction = $derived({
|
||||||
@ -147,8 +147,15 @@
|
|||||||
...row,
|
...row,
|
||||||
columns: row.columns.map((col) => {
|
columns: row.columns.map((col) => {
|
||||||
if (col.key === 'HostID') {
|
if (col.key === 'HostID') {
|
||||||
if (formState.form.HostType === 'SITE') {
|
if (formState.form.HostType === 'HIS') {
|
||||||
console.log('ini jalan kok');
|
return {
|
||||||
|
...col,
|
||||||
|
type: 'select',
|
||||||
|
optionsEndpoint: `${API.BASE_URL}${API.HOSTAPP}`,
|
||||||
|
valueKey: 'HostAppID',
|
||||||
|
labelKey: 'HostAppName'
|
||||||
|
}
|
||||||
|
} else if (formState.form.HostType === 'SITE') {
|
||||||
return {
|
return {
|
||||||
...col,
|
...col,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@ -156,7 +163,14 @@
|
|||||||
valueKey: 'SiteID',
|
valueKey: 'SiteID',
|
||||||
labelKey: (item) => `${item.SiteCode} - ${item.SiteName}`
|
labelKey: (item) => `${item.SiteCode} - ${item.SiteName}`
|
||||||
};
|
};
|
||||||
|
} else if (formState.form.HostType === 'WST') {
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
type: 'select',
|
||||||
|
optionsEndpoint: `${API.BASE_URL}${API.WORKSTATION}`,
|
||||||
|
valueKey: 'WorkstationID',
|
||||||
|
labelKey: 'WorkstationName'
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return { ...col, type: 'text', optionsEndpoint: undefined };
|
return { ...col, type: 'text', optionsEndpoint: undefined };
|
||||||
}
|
}
|
||||||
@ -184,7 +198,6 @@
|
|||||||
labelKey: (item) => `${item.TestSiteCode} - ${item.TestSiteName}`
|
labelKey: (item) => `${item.TestSiteCode} - ${item.TestSiteName}`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// kalau belum pilih HostID, kembalikan default (misal input biasa)
|
|
||||||
return {
|
return {
|
||||||
...col,
|
...col,
|
||||||
type: 'text',
|
type: 'text',
|
||||||
@ -202,7 +215,6 @@
|
|||||||
labelKey: (item) => `${item.TestSiteCode} - ${item.TestSiteName}`
|
labelKey: (item) => `${item.TestSiteCode} - ${item.TestSiteName}`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// kalau belum pilih HostID, kembalikan default (misal input biasa)
|
|
||||||
return {
|
return {
|
||||||
...col,
|
...col,
|
||||||
type: 'text',
|
type: 'text',
|
||||||
@ -211,8 +223,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return col;
|
return col;
|
||||||
|
|
||||||
return col;
|
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
import ReusableEmpty from "$lib/components/reusable/reusable-empty.svelte";
|
import ReusableEmpty from "$lib/components/reusable/reusable-empty.svelte";
|
||||||
import ReusableDataTable from "$lib/components/reusable/reusable-data-table.svelte";
|
import ReusableDataTable from "$lib/components/reusable/reusable-data-table.svelte";
|
||||||
import MapIcon from "@lucide/svelte/icons/map";
|
import MapIcon from "@lucide/svelte/icons/map";
|
||||||
|
import ArrowLeftIcon from "@lucide/svelte/icons/arrow-left";
|
||||||
|
|
||||||
let props = $props();
|
let props = $props();
|
||||||
|
|
||||||
@ -38,10 +39,13 @@
|
|||||||
>
|
>
|
||||||
<div class={`flex w-full ${props.masterDetail.isFormMode ? "flex-col justify-center h-full items-center" : "flex-col justify-start h-full"}`} >
|
<div class={`flex w-full ${props.masterDetail.isFormMode ? "flex-col justify-center h-full items-center" : "flex-col justify-start h-full"}`} >
|
||||||
{#if props.masterDetail.isFormMode}
|
{#if props.masterDetail.isFormMode}
|
||||||
<span class="flex flex-col items-center justify-center gap-4 tracking-widest font-semibold select-none">
|
<span class="flex flex-col items-center justify-start gap-4 tracking-widest font-semibold select-none h-full">
|
||||||
{#each "TEST MAP".split("") as c}
|
<ArrowLeftIcon />
|
||||||
|
<div class="flex flex-col items-center justify-center flex-grow gap-4">
|
||||||
|
{#each "BACK TO TEST MAP".split("") as c}
|
||||||
<span class="leading-none">{c}</span>
|
<span class="leading-none">{c}</span>
|
||||||
{/each}
|
{/each}
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
import ReusableSearchParam from "$lib/components/reusable/reusable-search-param.svelte";
|
import ReusableSearchParam from "$lib/components/reusable/reusable-search-param.svelte";
|
||||||
import ReusableEmpty from "$lib/components/reusable/reusable-empty.svelte";
|
import ReusableEmpty from "$lib/components/reusable/reusable-empty.svelte";
|
||||||
import ReusableDataTable from "$lib/components/reusable/reusable-data-table.svelte";
|
import ReusableDataTable from "$lib/components/reusable/reusable-data-table.svelte";
|
||||||
|
import ArrowLeftIcon from "@lucide/svelte/icons/arrow-left";
|
||||||
|
|
||||||
let props = $props();
|
let props = $props();
|
||||||
|
|
||||||
@ -34,10 +35,13 @@
|
|||||||
>
|
>
|
||||||
<div class={`flex w-full ${props.masterDetail.isFormMode ? "flex-col justify-center h-full items-center" : "flex-col justify-start h-full"}`} >
|
<div class={`flex w-full ${props.masterDetail.isFormMode ? "flex-col justify-center h-full items-center" : "flex-col justify-start h-full"}`} >
|
||||||
{#if props.masterDetail.isFormMode}
|
{#if props.masterDetail.isFormMode}
|
||||||
<span class="flex flex-col items-center justify-center gap-4 tracking-widest font-semibold select-none">
|
<span class="flex flex-col items-center justify-start gap-4 tracking-widest font-semibold select-none h-full">
|
||||||
{#each "PATIENT".split("") as c}
|
<ArrowLeftIcon />
|
||||||
|
<div class="flex flex-col items-center justify-center flex-grow gap-4">
|
||||||
|
{#each "BACK TO PATIENT".split("") as c}
|
||||||
<span class="leading-none">{c}</span>
|
<span class="leading-none">{c}</span>
|
||||||
{/each}
|
{/each}
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
@ -255,6 +255,7 @@
|
|||||||
formState.form.HostID = '';
|
formState.form.HostID = '';
|
||||||
formState.form.HostTestCode = '';
|
formState.form.HostTestCode = '';
|
||||||
formState.form.HostTestName = '';
|
formState.form.HostTestName = '';
|
||||||
|
formState.selectOptions.HostID = [];
|
||||||
formState.selectOptions.HostTestCode = [];
|
formState.selectOptions.HostTestCode = [];
|
||||||
formState.selectOptions.HostTestName = [];
|
formState.selectOptions.HostTestName = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ export const API = {
|
|||||||
DISCIPLINE: '/api/organization/discipline',
|
DISCIPLINE: '/api/organization/discipline',
|
||||||
DEPARTMENT: '/api/organization/department',
|
DEPARTMENT: '/api/organization/department',
|
||||||
WORKSTATION: '/api/organization/workstation',
|
WORKSTATION: '/api/organization/workstation',
|
||||||
|
HOSTAPP: '/api/organization/hostapp',
|
||||||
TEST: '/api/test',
|
TEST: '/api/test',
|
||||||
TESTMAP: '/api/test/testmap',
|
TESTMAP: '/api/test/testmap',
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user