fix(button-actions): 출하계획 모달 데이터 전달 오류 수정
- handleModal: context.selectedRowsData를 selectedData로 복원하여 출하계획 등 모달에서 사용 가능 - handleOpenModalWithData: modalDataStore 데이터를 selectedData/selectedIds로 이벤트에 포함 - ButtonConfigPanel: split-panel-layout2 타입 소스 테이블 감지 지원 추가 - ButtonConfigPanel: column_name/display_name 컬럼 형식 폴백 추가 - ButtonConfigPanel: currentTableName 폴백으로 테이블명 감지 안정성 향상 - ButtonConfigPanel: 필드 매핑 UI를 세로 배치로 변경하여 가독성 개선
This commit is contained in:
parent
cee9903f94
commit
4cff9e4cec
|
|
@ -880,6 +880,44 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
|||
return;
|
||||
}
|
||||
|
||||
// 모달 액션인데 선택된 데이터가 있으면 경고 메시지 표시하고 중단
|
||||
// (신규 등록 모달에서 선택된 데이터가 초기값으로 전달되는 것을 방지)
|
||||
if (processedConfig.action.type === "modal" && effectiveSelectedRowsData && effectiveSelectedRowsData.length > 0) {
|
||||
toast.warning("신규 등록 시에는 테이블에서 선택된 항목을 해제해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 수정(edit) 액션 검증
|
||||
if (processedConfig.action.type === "edit") {
|
||||
// 선택된 데이터가 없으면 경고
|
||||
if (!effectiveSelectedRowsData || effectiveSelectedRowsData.length === 0) {
|
||||
toast.warning("수정할 항목을 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
// groupByColumns 설정이 있으면 해당 컬럼 값이 유일한지 확인
|
||||
const groupByColumns = processedConfig.action.groupByColumns;
|
||||
if (groupByColumns && groupByColumns.length > 0 && effectiveSelectedRowsData.length > 1) {
|
||||
// 첫 번째 그룹핑 컬럼 기준으로 중복 체크 (예: order_no)
|
||||
const groupByColumn = groupByColumns[0];
|
||||
const uniqueValues = new Set(
|
||||
effectiveSelectedRowsData.map((row: any) => row[groupByColumn]).filter(Boolean)
|
||||
);
|
||||
|
||||
if (uniqueValues.size > 1) {
|
||||
// 컬럼명을 한글로 변환 (order_no -> 수주번호)
|
||||
const columnLabels: Record<string, string> = {
|
||||
order_no: "수주번호",
|
||||
shipment_no: "출하번호",
|
||||
purchase_no: "구매번호",
|
||||
};
|
||||
const columnLabel = columnLabels[groupByColumn] || groupByColumn;
|
||||
toast.warning(`${columnLabel} 하나만 선택해주세요. (현재 ${uniqueValues.size}개 선택됨)`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 🆕 모든 컴포넌트의 설정 수집 (parentDataMapping 등)
|
||||
const componentConfigs: Record<string, any> = {};
|
||||
if (allComponents && Array.isArray(allComponents)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue