feat(TableSection): 테이블 컬럼 부모값 받기 기능 추가
TableColumnConfig에 receiveFromParent, parentFieldName 속성 추가 allComponents에서 부모 화면 필드 자동 추출 컬럼 설정에 "부모값" 스위치 및 부모 필드 선택 UI 추가 handleAddItems()에서 부모값 자동 적용 로직 구현
This commit is contained in:
@@ -621,6 +621,14 @@ export function TableSectionRenderer({
|
||||
if (col.defaultValue !== undefined && newItem[col.field] === undefined) {
|
||||
newItem[col.field] = col.defaultValue;
|
||||
}
|
||||
|
||||
// 부모에서 값 받기 (receiveFromParent)
|
||||
if (col.receiveFromParent) {
|
||||
const parentField = col.parentFieldName || col.field;
|
||||
if (formData[parentField] !== undefined) {
|
||||
newItem[col.field] = formData[parentField];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newItem;
|
||||
|
||||
Reference in New Issue
Block a user