[st] feat: 검증 항목 상세 폼 유효성 작업

This commit is contained in:
2026-02-19 10:50:04 +09:00
parent f31826da5a
commit d474af5688
2 changed files with 71 additions and 61 deletions
@@ -100,11 +100,6 @@ export function VerificationTargetDialog({
}
placeholder="선택"
/>
{errors.statsCd && (
<p className="text-xs text-red-500">
{errors.statsCd.message}
</p>
)}
</div>
)}
/>
@@ -147,11 +142,6 @@ export function VerificationTargetDialog({
{...field}
placeholder="스키마명"
/>
{errors.schmNm && (
<p className="text-xs text-red-500">
{errors.schmNm.message}
</p>
)}
</div>
)}
/>
@@ -172,11 +162,6 @@ export function VerificationTargetDialog({
{...field}
placeholder="테이블명"
/>
{errors.tblNm && (
<p className="text-xs text-red-500">
{errors.tblNm.message}
</p>
)}
</div>
)}
/>
@@ -200,11 +185,6 @@ export function VerificationTargetDialog({
{...field}
placeholder="컬럼명"
/>
{errors.colNm && (
<p className="text-xs text-red-500">
{errors.colNm.message}
</p>
)}
</div>
)}
/>
@@ -225,11 +205,6 @@ export function VerificationTargetDialog({
{...field}
placeholder="PK 키"
/>
{errors.pkColNm && (
<p className="text-xs text-red-500">
{errors.pkColNm.message}
</p>
)}
</div>
)}
/>
@@ -248,6 +223,8 @@ export function VerificationTargetDialog({
<div className="space-y-1">
<Input
type="number"
min="0"
max="1"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
@@ -260,7 +237,7 @@ export function VerificationTargetDialog({
: null,
)
}
placeholder="(0 ~ 1)"
placeholder="(0 ~ 1, 0.1 단위)"
/>
</div>
)}
@@ -277,6 +254,8 @@ export function VerificationTargetDialog({
<div className="space-y-1">
<Input
type="number"
min="0"
max="0.5"
step="0.1"
value={field.value ?? ""}
onChange={(e) =>
@@ -289,7 +268,7 @@ export function VerificationTargetDialog({
: null,
)
}
placeholder="(0 ~ 0.5)"
placeholder="(0 ~ 0.5, 0.1 단위)"
/>
</div>
)}
@@ -306,21 +285,26 @@ export function VerificationTargetDialog({
name="scopCntCntVl"
control={control}
render={({ field }) => (
<Input
type="number"
step="0.05"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
/>
<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>
@@ -332,21 +316,26 @@ export function VerificationTargetDialog({
name="thrsCntVl"
control={control}
render={({ field }) => (
<Input
type="number"
step="1"
value={field.value ?? ""}
onChange={(e) =>
field.onChange(
e.target.value
? Number(
e.target
.value,
)
: null,
)
}
/>
<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>
@@ -10,10 +10,31 @@ export const verificationTargetManagementSchema = z.object({
tblNm: z.string().min(1, "테이블명을 입력해주세요"),
colNm: z.string().min(1, "컬럼명을 입력해주세요"),
pkColNm: z.string().min(1, "PK 키를 입력해주세요"),
ipcrCntVl: z.number().optional().nullable(),
pctlCrtrVl: z.number().optional().nullable(),
scopCntCntVl: z.number().optional().nullable(),
thrsCntVl: z.number().optional().nullable(),
ipcrCntVl: z
.number()
.min(0, "중요도 계수는 0 이상이어야 합니다")
.max(1, "중요도 계수는 1 이하여야 합니다")
.nullable()
.optional(),
pctlCrtrVl: z
.number()
.min(0, "백분위수 기준값은 0 이상이어야 합니다")
.max(0.5, "백분위수 기준값은 0.5 이하여야 합니다")
.nullable()
.optional(),
scopCntCntVl: z
.number()
.min(0, "스케일 조정 계수는 0 이상이어야 합니다")
.max(1, "스케일 조정 계수는 1 이하여야 합니다")
.nullable()
.optional(),
thrsCntVl: z
.number()
.int("임계 계수는 정수여야 합니다")
.min(0, "임계 계수는 0 이상이어야 합니다")
.max(100, "임계 계수는 100 이하여야 합니다")
.nullable()
.optional(),
useYn: z.string().optional(),
vrfcTrgtNm: z.string().optional().nullable(),
rgtr: z.string().optional().nullable(),