From 0b81e9c1ddcb65b2a06f26fbd052d91f788b15c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Wed, 4 Mar 2026 21:56:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[process]=20=EA=B3=B5=EC=A0=95=20?= =?UTF-8?q?=EB=8B=A8=EA=B3=84=EC=97=90=20=EA=B2=80=EC=82=AC=EB=B2=94?= =?UTF-8?q?=EC=9C=84(InspectionScope)=20=EC=84=A4=EC=A0=95=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 전수검사/샘플링/그룹 유형 선택 UI - 샘플링 시 샘플 크기(n) 입력 - options JSON으로 API 저장/복원 --- .../process-management/StepForm.tsx | 55 +++++++++++++++++++ src/components/process-management/actions.ts | 35 ++++++++++++ src/types/process.ts | 31 +++++++++++ 3 files changed, 121 insertions(+) diff --git a/src/components/process-management/StepForm.tsx b/src/components/process-management/StepForm.tsx index 27d45d07..9d88d383 100644 --- a/src/components/process-management/StepForm.tsx +++ b/src/components/process-management/StepForm.tsx @@ -30,12 +30,16 @@ import type { StepConnectionType, StepCompletionType, InspectionSetting, + InspectionScope, + InspectionScopeType, } from '@/types/process'; import { STEP_CONNECTION_TYPE_OPTIONS, STEP_COMPLETION_TYPE_OPTIONS, STEP_CONNECTION_TARGET_OPTIONS, DEFAULT_INSPECTION_SETTING, + DEFAULT_INSPECTION_SCOPE, + INSPECTION_SCOPE_TYPE_OPTIONS, } from '@/types/process'; import { createProcessStep, updateProcessStep } from './actions'; import type { DetailConfig } from '@/components/templates/IntegratedDetailTemplate/types'; @@ -108,6 +112,9 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) { const [inspectionSetting, setInspectionSetting] = useState( initialData?.inspectionSetting || DEFAULT_INSPECTION_SETTING ); + const [inspectionScope, setInspectionScope] = useState( + initialData?.inspectionScope || DEFAULT_INSPECTION_SCOPE + ); // 모달 상태 const [isInspectionSettingOpen, setIsInspectionSettingOpen] = useState(false); @@ -137,6 +144,7 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) { connectionTarget: connectionType === '팝업' ? connectionTarget : undefined, completionType, inspectionSetting: isInspectionEnabled ? inspectionSetting : undefined, + inspectionScope: isInspectionEnabled ? inspectionScope : undefined, }; setIsLoading(true); @@ -237,6 +245,52 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) { + {isInspectionEnabled && ( + <> +
+ + +
+ {inspectionScope.type === 'sampling' && ( +
+ + + setInspectionScope((prev) => ({ + ...prev, + sampleSize: Math.max(1, parseInt(e.target.value) || 1), + })) + } + placeholder="검사할 개소 수" + /> +
+ )} + + )}