From 9699ccbe0305e60d34f18eb4ddd09a1d45cb4a44 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Wed, 4 Dec 2024 14:58:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A1=EC=A7=80=EB=B6=95=20=EC=9E=91?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/BasicSetting.jsx | 45 ++++++++++++------- .../floor-plan/modal/basic/step/Placement.jsx | 9 +++- .../modal/basic/step/pitch/PitchPlacement.jsx | 40 +++++++++++++++-- 3 files changed, 73 insertions(+), 21 deletions(-) diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx index af5d9037..c6dee35b 100644 --- a/src/components/floor-plan/modal/basic/BasicSetting.jsx +++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx @@ -20,7 +20,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { const orientationRef = useRef(null) const { initEvent } = useEvent() // const { initEvent } = useContext(EventContext) - const { makeModuleInstArea, manualModuleSetup, autoModuleSetup } = useModuleBasicSetting() + const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting() const handleBtnNextStep = () => { if (tabNum === 1) { orientationRef.current.handleNextStep() @@ -28,20 +28,16 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { setTabNum(tabNum + 1) } - useEffect(() => { - makeModuleInstArea() //기붕 모듈설치면 생성 - - return () => { - initEvent() //모듈설치면 선택 이벤트 삭제 - } - }, []) - const placementRef = { isChidori: useRef('false'), setupLocation: useRef('center'), isMaxSetup: useRef('false'), } + const placementFlatRef = { + setupLocation: useRef('south'), + } + return (
@@ -66,7 +62,9 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { {/*배치면 초기설정 - 입력방법: 육지붕*/} {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && tabNum === 2 && } - {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && tabNum === 3 && } + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && tabNum === 3 && ( + + )}
{tabNum !== 1 && ( @@ -80,14 +78,29 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { Next )} + {tabNum === 3 && ( <> - - + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && ( + <> + + + + )} + {canvasSetting.roofSizeSet && canvasSetting.roofSizeSet === 3 && ( + <> + + + + )} )}
diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index 13c48a08..a087f3dc 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -1,5 +1,6 @@ +import { forwardRef, useEffect, useState } from 'react' import { useMessage } from '@/hooks/useMessage' -import { forwardRef, useState } from 'react' +import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' const Placement = forwardRef((props, refs) => { const { getMessage } = useMessage() @@ -7,6 +8,12 @@ const Placement = forwardRef((props, refs) => { const [setupLocation, setSetupLocation] = useState('center') const [isMaxSetup, setIsMaxSetup] = useState('false') + const { makeModuleInstArea } = useModuleBasicSetting() + + useEffect(() => { + makeModuleInstArea() + }, []) + const moduleData = { header: [ { type: 'check', name: '', prop: 'check', width: 70 }, diff --git a/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx b/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx index a2dcd556..239e0a82 100644 --- a/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx +++ b/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx @@ -1,7 +1,16 @@ +import { forwardRef, useState, useEffect } from 'react' import { useMessage } from '@/hooks/useMessage' +import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' -export default function PitchPlacement() { +const PitchPlacement = forwardRef((props, refs) => { const { getMessage } = useMessage() + const [setupLocation, setSetupLocation] = useState('south') + const { makeModuleInstArea } = useModuleBasicSetting() + + useEffect(() => { + makeModuleInstArea() + }, []) + const moduleData = { header: [ { type: 'check', name: '', prop: 'check', width: 70 }, @@ -24,6 +33,12 @@ export default function PitchPlacement() { }, ], } + + const handleSetupLocation = (e) => { + setSetupLocation(e.target.value) + refs.setupLocation.current = e.target.value + } + return ( <>
@@ -88,11 +103,26 @@ export default function PitchPlacement() {
- +
- +
@@ -102,4 +132,6 @@ export default function PitchPlacement() {
) -} +}) + +export default PitchPlacement