diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx index 51620935..0d1c36a8 100644 --- a/src/components/floor-plan/modal/basic/BasicSetting.jsx +++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx @@ -12,7 +12,7 @@ import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientatio import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' import { useEvent } from '@/hooks/useEvent' import { moduleSelectionDataState } from '@/store/selectedModuleOptions' -import { addedRoofsState } from '@/store/settingAtom' +import { addedRoofsState, corridorDimensionSelector } from '@/store/settingAtom' import { isObjectNotEmpty } from '@/util/common-utils' import Swal from 'sweetalert2' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' @@ -40,31 +40,40 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { if (tabNum === 1) { orientationRef.current.handleNextStep() } else if (tabNum === 2) { - if (!isObjectNotEmpty(moduleSelectionData.module)) { - Swal.fire({ - title: getMessage('module.not.found'), - icon: 'warning', - }) - return - } + if (canvasSetting.roofSizeSet !== '3') { + if (!isObjectNotEmpty(moduleSelectionData.module)) { + Swal.fire({ + title: getMessage('module.not.found'), + icon: 'warning', + }) + return + } - if (addedRoofs.length !== moduleSelectionData.roofConstructions.length) { - Swal.fire({ - title: getMessage('construction.length.difference'), - icon: 'warning', + if (addedRoofs.length !== moduleSelectionData.roofConstructions.length) { + Swal.fire({ + title: getMessage('construction.length.difference'), + icon: 'warning', + }) + return + } + //물건정보 갱신일 수정 + updateObjectDataApi({ + objectNo: currentCanvasPlan.objectNo, //오브젝트_no + standardWindSpeedId: moduleSelectionData.common.stdWindSpeed, //기준풍속코드 + verticalSnowCover: moduleSelectionData.common.stdSnowLd, //적설량 + surfaceType: moduleSelectionData.common.illuminationTpNm, //면조도구분 + installHeight: moduleSelectionData.common.instHt, //설치높이 + userId: loginUserState.userId, //작성자아아디 }) - return + } else { + if (!isObjectNotEmpty(moduleSelectionData.flatModule)) { + Swal.fire({ + title: getMessage('module.not.found'), + icon: 'warning', + }) + return + } } - - //물건정보 갱신일 수정 - updateObjectDataApi({ - objectNo: currentCanvasPlan.objectNo, //오브젝트_no - standardWindSpeedId: moduleSelectionData.common.stdWindSpeed, //기준풍속코드 - verticalSnowCover: moduleSelectionData.common.stdSnowLd, //적설량 - surfaceType: moduleSelectionData.common.illuminationTpNm, //면조도구분 - installHeight: moduleSelectionData.common.instHt, //설치높이 - userId: loginUserState.userId, //작성자아아디 - }) } setTabNum(tabNum + 1) @@ -88,6 +97,14 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { const res = await updateObjectDate(params) } + useEffect(() => { + if (canvasSetting.roofSizeSet !== '3') { + manualModuleSetup(placementRef) + } else { + manualFlatroofModuleSetup(placementFlatRef) + } + }, [isManualModuleSetup]) + return (
@@ -107,12 +124,12 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
{tabNum === 1 && } {/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/} - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && tabNum === 2 && } - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && tabNum === 3 && } + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != '3' && tabNum === 2 && } + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != '3' && tabNum === 3 && } {/*배치면 초기설정 - 입력방법: 육지붕*/} - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && tabNum === 2 && } - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && tabNum === 3 && ( + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == '3' && tabNum === 2 && } + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == '3' && tabNum === 3 && ( )} @@ -141,9 +158,10 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { )} - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet === 3 && ( + {console.log('canvasSetting.roofSizeSet', canvasSetting.roofSizeSet)} + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && ( <> -