fix: 수주등록 항목추가 시 정보출력 가능하게 수정
문제: - 조건부 컨테이너 내부의 modal-repeater-table 컴포넌트가 데이터 업데이트 불가 - ConditionalSectionViewer가 RealtimePreview에 formData/onFormDataChange 미전달 해결: - ConditionalSectionViewer.tsx: RealtimePreview에 formData, onFormDataChange props 추가 - DynamicComponentRenderer.tsx: 디버깅 로그 정리 - ScreenModal.tsx: 디버깅 로그 정리 영향: - 수주 등록 화면 품목 추가 기능 정상 작동 - 조건부 컨테이너 내부 모든 폼 컴포넌트 데이터 바인딩 정상화 Refs: #수주관리 #modal-repeater-table #ConditionalContainer
This commit is contained in:
@@ -262,7 +262,14 @@ export const DynamicComponentRenderer: React.FC<DynamicComponentRendererProps> =
|
||||
|
||||
// 컴포넌트의 columnName에 해당하는 formData 값 추출
|
||||
const fieldName = (component as any).columnName || component.id;
|
||||
const currentValue = formData?.[fieldName] || "";
|
||||
|
||||
// modal-repeater-table은 배열 데이터를 다루므로 빈 배열로 초기화
|
||||
let currentValue;
|
||||
if (componentType === "modal-repeater-table") {
|
||||
currentValue = formData?.[fieldName] || [];
|
||||
} else {
|
||||
currentValue = formData?.[fieldName] || "";
|
||||
}
|
||||
|
||||
// onChange 핸들러 - 컴포넌트 타입에 따라 다르게 처리
|
||||
const handleChange = (value: any) => {
|
||||
@@ -274,13 +281,14 @@ export const DynamicComponentRenderer: React.FC<DynamicComponentRendererProps> =
|
||||
}
|
||||
|
||||
if (onFormDataChange) {
|
||||
// modal-repeater-table은 배열 데이터를 다룸
|
||||
if (componentType === "modal-repeater-table") {
|
||||
onFormDataChange(fieldName, actualValue);
|
||||
}
|
||||
// RepeaterInput 같은 복합 컴포넌트는 전체 데이터를 전달
|
||||
// 단순 input 컴포넌트는 (fieldName, value) 형태로 전달받음
|
||||
if (componentType === "repeater-field-group" || componentType === "repeater") {
|
||||
// fieldName과 함께 전달
|
||||
else if (componentType === "repeater-field-group" || componentType === "repeater") {
|
||||
onFormDataChange(fieldName, actualValue);
|
||||
} else {
|
||||
// 이미 fieldName이 포함된 경우는 그대로 전달
|
||||
onFormDataChange(fieldName, actualValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user