continue dict test refnum

This commit is contained in:
faiztyanirh 2026-02-20 16:59:56 +07:00
parent a54e1b9d23
commit 10b6e5bda3
5 changed files with 36 additions and 9 deletions

View File

@ -25,7 +25,7 @@ export const testInitialForm = {
ReqQtyUnit: "",
CollReq: "",
Method: "",
ExpectedTXT: "",
ExpectedTAT: "",
SeqScr: "",
SeqRpt: "",
VisibleScr: "",
@ -229,7 +229,7 @@ export const testFormFields = [
key: "ExpectedTAT",
label: "Expected TAT",
required: false,
type: "select",
type: "text",
fullWidth: false
},
]

View File

@ -179,7 +179,7 @@
<Tabs.Content value="reference">
<div class="w-full h-full flex items-start">
{#if refComponent === 'numeric'}
<RefNum {refNumState} {refNumFormFields} />
<RefNum {refNumState} {refNumFormFields} refType={formState.form.RefType}/>
{:else if refComponent === 'text'}
<RefTxt {formState} />
{:else}

View File

@ -6,6 +6,21 @@
import { Badge } from "$lib/components/ui/badge/index.js";
let props = $props();
let disabledSign = $derived.by(() => {
const refType = props.refType;
if (refType === "RANGE") return true;
if (refType === "THOLD") return false;
return false;
});
$effect(() => {
if (props.refType) {
props.refNumState.form.NumRefType = props.refType;
}
});
</script>
<div class="flex flex-col gap-4 w-full">
@ -13,6 +28,7 @@
<DictionaryFormRenderer
formState={props.refNumState}
formFields={props.refNumFormFields}
{disabledSign}
/>
<Button
size="sm"
@ -43,8 +59,20 @@
<Table.Cell>Whole Blood</Table.Cell>
<Table.Cell class="font-medium">Female</Table.Cell>
<Table.Cell class="">1Y 0M 0D - 10Y 0M 0D</Table.Cell>
<Table.Cell class="text-muted-foreground">Reference Range</Table.Cell>
<Table.Cell class="font-medium"><Badge>Range</Badge></Table.Cell>
<Table.Cell class="text-muted-foreground"><Badge>Range</Badge></Table.Cell>
<Table.Cell class="font-medium">4 - 10</Table.Cell>
<Table.Cell class="font-medium">L</Table.Cell>
<Table.Cell class="font-medium">Interpretation</Table.Cell>
<Table.Cell class="font-medium">Testing</Table.Cell>
</Table.Row>
<Table.Row
class="cursor-pointer hover:bg-muted/50"
>
<Table.Cell>Whole Blood</Table.Cell>
<Table.Cell class="font-medium">Male</Table.Cell>
<Table.Cell class="">1Y 0M 0D - 10Y 0M 0D</Table.Cell>
<Table.Cell class="text-muted-foreground"><Badge>Threshold</Badge></Table.Cell>
<Table.Cell class="font-medium">10</Table.Cell>
<Table.Cell class="font-medium">L</Table.Cell>
<Table.Cell class="font-medium">Interpretation</Table.Cell>
<Table.Cell class="font-medium">Testing</Table.Cell>

View File

@ -9,8 +9,6 @@
const { masterDetail, formFields, formActions, schema } = props.context;
let test = $derived(masterDetail?.selectedItem?.data);
$inspect(test)
const handlers = {
editTest: () => masterDetail.enterEdit("data"),
};

View File

@ -17,7 +17,7 @@
mode = 'create',
disabledResultTypes = [],
disabledReferenceTypes = [],
...props
disabledSign = false,
} = $props();
let searchQuery = $state({});
@ -87,6 +87,7 @@
validateFieldAsync(key, mode, originalData?.[key]);
}
}}
readonly={key === "NumRefType"}
/>
{:else if type === "email"}
<Input
@ -312,7 +313,7 @@
{#snippet child({ props })}
<InputGroup.Button
{...props}
variant="ghost"
variant="ghost" disabled={disabledSign}
>
{formState.selectOptions?.[key]?.find(
opt => opt.value === formState.form[key]