Compare commits
4 Commits
2327d6e97c
...
e14e0bd029
| Author | SHA1 | Date |
|---|---|---|
|
|
e14e0bd029 | |
|
|
c3379ec4c2 | |
|
|
3fd7fdcb58 | |
|
|
055094308d |
|
|
@ -921,11 +921,12 @@ export class TableManagementService {
|
||||||
...layout.properties,
|
...layout.properties,
|
||||||
widgetType: inputType,
|
widgetType: inputType,
|
||||||
inputType: inputType,
|
inputType: inputType,
|
||||||
// componentConfig 내부의 type도 업데이트
|
// componentConfig 내부의 type, inputType, webType 모두 업데이트
|
||||||
componentConfig: {
|
componentConfig: {
|
||||||
...layout.properties?.componentConfig,
|
...layout.properties?.componentConfig,
|
||||||
type: newComponentType,
|
type: newComponentType,
|
||||||
inputType: inputType,
|
inputType: inputType,
|
||||||
|
webType: inputType, // 프론트엔드 SelectBasicComponent에서 카테고리 로딩 여부 판단에 사용
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -941,7 +942,7 @@ export class TableManagementService {
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`화면 레이아웃 업데이트: screen_id=${layout.screen_id}, component_id=${layout.component_id}, widgetType=${inputType}, componentType=${newComponentType}`
|
`화면 레이아웃 업데이트: screen_id=${layout.screen_id}, component_id=${layout.component_id}, widgetType=${inputType}, webType=${inputType}, componentType=${newComponentType}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ interface EditModalState {
|
||||||
dataflowConfig?: any;
|
dataflowConfig?: any;
|
||||||
dataflowTiming?: string;
|
dataflowTiming?: string;
|
||||||
}; // 🆕 모달 내부 저장 버튼의 제어로직 설정
|
}; // 🆕 모달 내부 저장 버튼의 제어로직 설정
|
||||||
|
menuObjid?: number; // 🆕 메뉴 OBJID (카테고리 스코프용)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EditModalProps {
|
interface EditModalProps {
|
||||||
|
|
@ -91,6 +92,7 @@ export const EditModal: React.FC<EditModalProps> = ({ className }) => {
|
||||||
buttonConfig: undefined,
|
buttonConfig: undefined,
|
||||||
buttonContext: undefined,
|
buttonContext: undefined,
|
||||||
saveButtonConfig: undefined,
|
saveButtonConfig: undefined,
|
||||||
|
menuObjid: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [screenData, setScreenData] = useState<{
|
const [screenData, setScreenData] = useState<{
|
||||||
|
|
@ -234,7 +236,7 @@ export const EditModal: React.FC<EditModalProps> = ({ className }) => {
|
||||||
// 전역 모달 이벤트 리스너
|
// 전역 모달 이벤트 리스너
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleOpenEditModal = async (event: CustomEvent) => {
|
const handleOpenEditModal = async (event: CustomEvent) => {
|
||||||
const { screenId, title, description, modalSize, editData, onSave, groupByColumns, tableName, isCreateMode, buttonConfig, buttonContext } = event.detail;
|
const { screenId, title, description, modalSize, editData, onSave, groupByColumns, tableName, isCreateMode, buttonConfig, buttonContext, menuObjid } = event.detail;
|
||||||
|
|
||||||
// 🆕 모달 내부 저장 버튼의 제어로직 설정 조회
|
// 🆕 모달 내부 저장 버튼의 제어로직 설정 조회
|
||||||
let saveButtonConfig: EditModalState["saveButtonConfig"] = undefined;
|
let saveButtonConfig: EditModalState["saveButtonConfig"] = undefined;
|
||||||
|
|
@ -258,6 +260,7 @@ export const EditModal: React.FC<EditModalProps> = ({ className }) => {
|
||||||
buttonConfig, // 🆕 버튼 설정
|
buttonConfig, // 🆕 버튼 설정
|
||||||
buttonContext, // 🆕 버튼 컨텍스트
|
buttonContext, // 🆕 버튼 컨텍스트
|
||||||
saveButtonConfig, // 🆕 모달 내부 저장 버튼의 제어로직 설정
|
saveButtonConfig, // 🆕 모달 내부 저장 버튼의 제어로직 설정
|
||||||
|
menuObjid, // 🆕 메뉴 OBJID (카테고리 스코프용)
|
||||||
});
|
});
|
||||||
|
|
||||||
// 편집 데이터로 폼 데이터 초기화
|
// 편집 데이터로 폼 데이터 초기화
|
||||||
|
|
@ -1079,6 +1082,8 @@ export const EditModal: React.FC<EditModalProps> = ({ className }) => {
|
||||||
id: modalState.screenId!,
|
id: modalState.screenId!,
|
||||||
tableName: screenData.screenInfo?.tableName,
|
tableName: screenData.screenInfo?.tableName,
|
||||||
}}
|
}}
|
||||||
|
// 🆕 메뉴 OBJID 전달 (카테고리 스코프용)
|
||||||
|
menuObjid={modalState.menuObjid}
|
||||||
// 🆕 그룹 데이터가 있거나 UniversalFormModal이 없으면 EditModal.handleSave 사용
|
// 🆕 그룹 데이터가 있거나 UniversalFormModal이 없으면 EditModal.handleSave 사용
|
||||||
// groupData가 있으면 일괄 저장을 위해 반드시 EditModal.handleSave 사용
|
// groupData가 있으면 일괄 저장을 위해 반드시 EditModal.handleSave 사용
|
||||||
onSave={shouldUseEditModalSave ? handleSave : undefined}
|
onSave={shouldUseEditModalSave ? handleSave : undefined}
|
||||||
|
|
|
||||||
|
|
@ -1213,13 +1213,14 @@ export const InteractiveDataTable: React.FC<InteractiveDataTableProps> = ({
|
||||||
description: editModalDescription,
|
description: editModalDescription,
|
||||||
modalSize: "lg",
|
modalSize: "lg",
|
||||||
editData: initialData,
|
editData: initialData,
|
||||||
|
menuObjid, // 🆕 메뉴 OBJID 전달 (카테고리 스코프용)
|
||||||
onSave: () => {
|
onSave: () => {
|
||||||
loadData(); // 테이블 데이터 새로고침
|
loadData(); // 테이블 데이터 새로고침
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
window.dispatchEvent(event);
|
window.dispatchEvent(event);
|
||||||
}, [selectedRows, data, getDisplayColumns, component.addModalConfig, component.editModalConfig, loadData]);
|
}, [selectedRows, data, getDisplayColumns, component.addModalConfig, component.editModalConfig, loadData, menuObjid]);
|
||||||
|
|
||||||
// 수정 폼 데이터 변경 핸들러
|
// 수정 폼 데이터 변경 핸들러
|
||||||
const handleEditFormChange = useCallback((columnName: string, value: any) => {
|
const handleEditFormChange = useCallback((columnName: string, value: any) => {
|
||||||
|
|
@ -2720,6 +2721,7 @@ export const InteractiveDataTable: React.FC<InteractiveDataTableProps> = ({
|
||||||
screenId={saveModalScreenId}
|
screenId={saveModalScreenId}
|
||||||
modalSize={component.addModalConfig?.modalSize || "lg"}
|
modalSize={component.addModalConfig?.modalSize || "lg"}
|
||||||
initialData={saveModalData}
|
initialData={saveModalData}
|
||||||
|
menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달 (카테고리 스코프용)
|
||||||
onSaveSuccess={() => {
|
onSaveSuccess={() => {
|
||||||
// 저장 성공 시 테이블 새로고침
|
// 저장 성공 시 테이블 새로고침
|
||||||
loadData(currentPage, searchValues); // 현재 페이지로 다시 로드
|
loadData(currentPage, searchValues); // 현재 페이지로 다시 로드
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ interface SaveModalProps {
|
||||||
modalSize?: "sm" | "md" | "lg" | "xl" | "full";
|
modalSize?: "sm" | "md" | "lg" | "xl" | "full";
|
||||||
initialData?: any; // 수정 모드일 때 기존 데이터
|
initialData?: any; // 수정 모드일 때 기존 데이터
|
||||||
onSaveSuccess?: () => void; // 저장 성공 시 콜백 (테이블 새로고침용)
|
onSaveSuccess?: () => void; // 저장 성공 시 콜백 (테이블 새로고침용)
|
||||||
|
menuObjid?: number; // 🆕 메뉴 OBJID (카테고리 스코프용)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -33,6 +34,7 @@ export const SaveModal: React.FC<SaveModalProps> = ({
|
||||||
modalSize = "lg",
|
modalSize = "lg",
|
||||||
initialData,
|
initialData,
|
||||||
onSaveSuccess,
|
onSaveSuccess,
|
||||||
|
menuObjid,
|
||||||
}) => {
|
}) => {
|
||||||
const { user, userName } = useAuth(); // 현재 사용자 정보 가져오기
|
const { user, userName } = useAuth(); // 현재 사용자 정보 가져오기
|
||||||
const [formData, setFormData] = useState<Record<string, any>>(initialData || {});
|
const [formData, setFormData] = useState<Record<string, any>>(initialData || {});
|
||||||
|
|
@ -373,6 +375,7 @@ export const SaveModal: React.FC<SaveModalProps> = ({
|
||||||
}));
|
}));
|
||||||
}}
|
}}
|
||||||
hideLabel={false}
|
hideLabel={false}
|
||||||
|
menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달 (카테고리 스코프용)
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<DynamicComponentRenderer
|
<DynamicComponentRenderer
|
||||||
|
|
@ -385,6 +388,7 @@ export const SaveModal: React.FC<SaveModalProps> = ({
|
||||||
}}
|
}}
|
||||||
screenId={screenId}
|
screenId={screenId}
|
||||||
tableName={screenData.tableName}
|
tableName={screenData.tableName}
|
||||||
|
menuObjid={menuObjid} // 🆕 메뉴 OBJID 전달 (카테고리 스코프용)
|
||||||
userId={user?.userId} // ✅ 사용자 ID 전달
|
userId={user?.userId} // ✅ 사용자 ID 전달
|
||||||
userName={user?.userName} // ✅ 사용자 이름 전달
|
userName={user?.userName} // ✅ 사용자 이름 전달
|
||||||
companyCode={user?.companyCode} // ✅ 회사 코드 전달
|
companyCode={user?.companyCode} // ✅ 회사 코드 전달
|
||||||
|
|
|
||||||
|
|
@ -299,12 +299,14 @@ const SelectBasicComponent: React.FC<SelectBasicComponentProps> = ({
|
||||||
tableName: component.tableName,
|
tableName: component.tableName,
|
||||||
columnName: component.columnName,
|
columnName: component.columnName,
|
||||||
webType,
|
webType,
|
||||||
|
menuObjid, // 🆕 menuObjid 로깅 추가
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoadingCategories(true);
|
setIsLoadingCategories(true);
|
||||||
|
|
||||||
import("@/lib/api/tableCategoryValue").then(({ getCategoryValues }) => {
|
import("@/lib/api/tableCategoryValue").then(({ getCategoryValues }) => {
|
||||||
getCategoryValues(component.tableName!, component.columnName!)
|
// 🆕 menuObjid를 4번째 파라미터로 전달 (카테고리 스코프 적용)
|
||||||
|
getCategoryValues(component.tableName!, component.columnName!, false, menuObjid)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("🔍 [SelectBasic] 카테고리 API 응답:", response);
|
console.log("🔍 [SelectBasic] 카테고리 API 응답:", response);
|
||||||
|
|
||||||
|
|
@ -324,6 +326,7 @@ const SelectBasicComponent: React.FC<SelectBasicComponentProps> = ({
|
||||||
activeValuesCount: activeValues.length,
|
activeValuesCount: activeValues.length,
|
||||||
options,
|
options,
|
||||||
sampleOption: options[0],
|
sampleOption: options[0],
|
||||||
|
menuObjid, // 🆕 menuObjid 로깅 추가
|
||||||
});
|
});
|
||||||
|
|
||||||
setCategoryOptions(options);
|
setCategoryOptions(options);
|
||||||
|
|
@ -339,7 +342,7 @@ const SelectBasicComponent: React.FC<SelectBasicComponentProps> = ({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [webType, component.tableName, component.columnName]);
|
}, [webType, component.tableName, component.columnName, menuObjid]); // 🆕 menuObjid 의존성 추가
|
||||||
|
|
||||||
// 디버깅: menuObjid가 제대로 전달되는지 확인
|
// 디버깅: menuObjid가 제대로 전달되는지 확인
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue