중간저장

This commit is contained in:
leeheejin
2025-12-10 10:27:54 +09:00
parent 990f667481
commit 3608d9f9c3
4 changed files with 26 additions and 14 deletions

View File

@@ -48,8 +48,17 @@ export function SimpleRepeaterTableComponent({
allowAdd: propAllowAdd,
maxHeight: propMaxHeight,
// DOM에 전달되면 안 되는 props 명시적 제거 (부모에서 전달될 수 있음)
initialData: _initialData,
originalData: _originalData,
groupedData: _groupedData,
...props
}: SimpleRepeaterTableComponentProps) {
}: SimpleRepeaterTableComponentProps & {
initialData?: any;
originalData?: any;
groupedData?: any;
}) {
// config 또는 component.config 또는 개별 prop 우선순위로 병합
const componentConfig = {
...config,
@@ -265,7 +274,7 @@ export function SimpleRepeaterTableComponent({
useEffect(() => {
const handleSaveRequest = async (event: Event) => {
if (value.length === 0) {
console.warn("⚠️ [SimpleRepeaterTable] 저장할 데이터 없음");
// console.warn("⚠️ [SimpleRepeaterTable] 저장할 데이터 없음");
return;
}
@@ -306,7 +315,7 @@ export function SimpleRepeaterTableComponent({
});
});
console.log("✅ [SimpleRepeaterTable] 테이블별 저장 데이터:", dataByTable);
// console.log("✅ [SimpleRepeaterTable] 테이블별 저장 데이터:", dataByTable);
// CustomEvent의 detail에 테이블별 데이터 추가
if (event instanceof CustomEvent && event.detail) {
@@ -319,10 +328,10 @@ export function SimpleRepeaterTableComponent({
}));
});
console.log("✅ [SimpleRepeaterTable] 저장 데이터 준비:", {
tables: Object.keys(dataByTable),
totalRows: Object.values(dataByTable).reduce((sum, rows) => sum + rows.length, 0),
});
// console.log("✅ [SimpleRepeaterTable] 저장 데이터 준비:", {
// tables: Object.keys(dataByTable),
// totalRows: Object.values(dataByTable).reduce((sum, rows) => sum + rows.length, 0),
// });
}
// 기존 onFormDataChange도 호출 (호환성)