fix(universal-form-modal): 옵셔널 필드 그룹 연동 필드 기본값 설정
- 모달 초기화 시 optionalFieldGroups의 triggerField에 기본값 설정 - triggerValueOnRemove 값을 기본값으로 사용 (비활성화 상태 기본값) - 수정 모드에서는 기존 데이터 값 유지
This commit is contained in:
parent
ccbbf46faf
commit
0810debd2b
|
|
@ -390,6 +390,19 @@ export function UniversalFormModalComponent({
|
||||||
|
|
||||||
newFormData[field.columnName] = value;
|
newFormData[field.columnName] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 옵셔널 필드 그룹의 연동 필드 기본값 설정
|
||||||
|
// triggerValueOnRemove 값을 기본값으로 사용 (옵셔널 그룹이 비활성화 상태일 때의 기본값)
|
||||||
|
if (section.optionalFieldGroups) {
|
||||||
|
for (const group of section.optionalFieldGroups) {
|
||||||
|
if (group.triggerField && group.triggerValueOnRemove !== undefined) {
|
||||||
|
// effectiveInitialData에 해당 값이 없는 경우에만 기본값 설정
|
||||||
|
if (!effectiveInitialData || effectiveInitialData[group.triggerField] === undefined) {
|
||||||
|
newFormData[group.triggerField] = group.triggerValueOnRemove;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue