fix: SelectedItemsDetailInput 수정 모드에서 다중 레코드 로드 오류 수정

DynamicComponentRenderer에 selected-items-detail-input groupedData 전달 추가
SelectedItemsDetailInput에서 groupedData 우선 사용하도록 변경
ScreenModal editData 배열 처리 시 formData/selectedData 분리 저장
TextInput 수정 모드에서 채번 규칙 스킵 로직 추가
This commit is contained in:
SeongHyun Kim
2026-01-09 17:42:33 +09:00
parent 23c9604672
commit f8fb7d687e
4 changed files with 49 additions and 15 deletions

View File

@@ -51,6 +51,10 @@ export const TextInputComponent: React.FC<TextInputComponentProps> = ({
// 숨김 상태 (props에서 전달받은 값 우선 사용)
const isHidden = props.hidden !== undefined ? props.hidden : component.hidden || componentConfig.hidden || false;
// 수정 모드 여부 확인 (originalData가 있으면 수정 모드)
const originalData = props.originalData || (props as any)._originalData;
const isEditMode = originalData && Object.keys(originalData).length > 0;
// 자동생성된 값 상태
const [autoGeneratedValue, setAutoGeneratedValue] = useState<string>("");
@@ -99,6 +103,16 @@ export const TextInputComponent: React.FC<TextInputComponentProps> = ({
return;
}
// 🆕 수정 모드일 때는 채번 규칙 스킵 (기존 값 유지)
if (isEditMode) {
console.log("⏭️ 수정 모드 - 채번 규칙 스킵:", {
columnName: component.columnName,
originalValue: originalData?.[component.columnName],
});
hasGeneratedRef.current = true; // 생성 완료로 표시하여 재실행 방지
return;
}
if (testAutoGeneration.enabled && testAutoGeneration.type !== "none") {
// 폼 데이터에 이미 값이 있으면 자동생성하지 않음
const currentFormValue = formData?.[component.columnName];
@@ -171,7 +185,7 @@ export const TextInputComponent: React.FC<TextInputComponentProps> = ({
};
generateAutoValue();
}, [testAutoGeneration.enabled, testAutoGeneration.type, component.columnName, isInteractive]);
}, [testAutoGeneration.enabled, testAutoGeneration.type, component.columnName, isInteractive, isEditMode]);
// 실제 화면에서 숨김 처리된 컴포넌트는 렌더링하지 않음
if (isHidden && !isDesignMode) {