[st] feat: 검증 항목 관리 IMR 탭 작업

This commit is contained in:
2026-02-20 17:30:24 +09:00
parent a61b3905d4
commit 1bc0685289
3 changed files with 146 additions and 141 deletions
@@ -37,7 +37,7 @@ const TAB_CONFIG = {
},
} as const;
type TabValue = keyof typeof TAB_CONFIG;
export type TabValue = keyof typeof TAB_CONFIG;
function VerificationArticleManagement() {
const queryClient = useQueryClient();
@@ -248,6 +248,7 @@ function VerificationArticleManagement() {
))}
<VerificationTargetDialog
tabValue={activeTab}
open={dialogOpen}
onOpenChange={setDialogOpen}
data={selectedData}
@@ -23,8 +23,10 @@ import {
import { useEffect } from "react";
import { useForm, Controller } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import type { TabValue } from "./VerificationArticleManagement";
interface VerificationTargetDialogProps {
tabValue: TabValue;
open: boolean;
onOpenChange: (open: boolean) => void;
data: VerificationTargetManagementResponse | null;
@@ -33,6 +35,7 @@ interface VerificationTargetDialogProps {
}
export function VerificationTargetDialog({
tabValue,
open,
onOpenChange,
data,
@@ -51,7 +54,7 @@ export function VerificationTargetDialog({
useEffect(() => {
if (data && open) reset(data);
}, [data, open]);
}, [data, open, reset]);
function onSubmit(formData: VerificationTargetManagementFormData) {
if (!data) return;
@@ -211,135 +214,139 @@ export function VerificationTargetDialog({
</TableCell>
</TableRow>
<TableRow>
<TableHead className="bg-muted font-medium">
중요도 계수(μ)
</TableHead>
<TableCell>
<Controller
name="ipcrCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="1"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 1, 0.1 단위)"
/>
</div>
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium">
백분위수 기준값(pct)
</TableHead>
<TableCell>
<Controller
name="pctlCrtrVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="0.5"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 0.5, 0.1 단위)"
/>
</div>
)}
/>
</TableCell>
</TableRow>
{tabValue !== "IMR" && (
<TableRow>
<TableHead className="bg-muted font-medium">
중요도 계수(μ)
</TableHead>
<TableCell>
<Controller
name="ipcrCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="1"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 1, 0.1 단위)"
/>
</div>
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium">
백분위수 기준값(pct)
</TableHead>
<TableCell>
<Controller
name="pctlCrtrVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="0.5"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 0.5, 0.1 단위)"
/>
</div>
)}
/>
</TableCell>
</TableRow>
)}
<TableRow>
<TableHead className="bg-muted font-medium">
스케일 조정 계수(A)
</TableHead>
<TableCell>
<Controller
name="scopCntCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="1"
step="0.01"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 1, 0.01 단위)"
/>
</div>
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium">
임계 계수(c)
</TableHead>
<TableCell>
<Controller
name="thrsCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="100"
step="1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 100, 1 단위)"
/>
</div>
)}
/>
</TableCell>
</TableRow>
{tabValue !== "IMR" && (
<TableRow>
<TableHead className="bg-muted font-medium">
스케일 조정 계수(A)
</TableHead>
<TableCell>
<Controller
name="scopCntCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="1"
step="0.01"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 1, 0.01 단위)"
/>
</div>
)}
/>
</TableCell>
<TableHead className="bg-muted font-medium">
임계 계수(c)
</TableHead>
<TableCell>
<Controller
name="thrsCntVl"
control={control}
render={({ field }) => (
<div className="space-y-1">
<Input
type="number"
min="0"
max="100"
step="1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
placeholder="(0 ~ 100, 1 단위)"
/>
</div>
)}
/>
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
@@ -116,15 +116,6 @@ export const imrArticleColumnInfo: ColumnInfo = {
editable: false,
sortdisable: false,
},
{
name: "ipcrCntVl",
fieldName: "ipcrCntVl",
header: { text: "μ" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0.###",
},
{
name: "rgtrNm",
fieldName: "rgtrNm",
@@ -145,7 +136,6 @@ export const imrArticleColumnInfo: ColumnInfo = {
"vrfcTrgtNm",
"tblNm",
"colNm",
"ipcrCntVl",
"rgtrNm",
"regDt",
],
@@ -196,5 +186,12 @@ export const validationArticleColumnInfo: ColumnInfo = {
sortdisable: false,
},
],
columnLayout: ["statsNm", "vrfcTrgtNm", "tblNm", "colNm", "rgtrNm", "regDt"],
columnLayout: [
"statsNm",
"vrfcTrgtNm",
"tblNm",
"colNm",
"rgtrNm",
"regDt",
],
};