From fc9623d76dfe874f8c3670afdd9abf9669939d4a Mon Sep 17 00:00:00 2001 From: ysCha Date: Mon, 23 Feb 2026 16:48:16 +0900 Subject: [PATCH] =?UTF-8?q?[1480]=20=EC=84=A4=EC=A0=95=EA=B0=92=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20(=EC=9D=B4=EC=A0=84=ED=94=8C=EB=9E=9C?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20->=20=ED=98=84=ED=94=8C=EB=9E=9C=EC=A0=80?= =?UTF-8?q?=EC=9E=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placementShape/PlacementShapeSetting.jsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index 14ff26e1..87ad753c 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -16,7 +16,7 @@ import { globalLocaleStore } from '@/store/localeAtom' import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util' import { usePolygon } from '@/hooks/usePolygon' -import { canvasState, canvasSettingState, currentMenuState } from '@/store/canvasAtom' +import { canvasState, canvasSettingState, currentCanvasPlanState, currentMenuState } from '@/store/canvasAtom' import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { MENU, POLYGON_TYPE } from '@/common/common' import { useRoofFn } from '@/hooks/common/useRoofFn' @@ -52,6 +52,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla const { setSurfaceShapePattern } = useRoofFn() const canvas = useRecoilValue(canvasState) const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState) + const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const roofDisplay = useRecoilValue(roofDisplaySelector) const { setPolygonLinesActualSize } = usePolygon() @@ -123,6 +124,15 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla if (openPoint && openPoint === 'canvasMenus') fetchBasicSettings(planNo, openPoint) }, []) + /** + * 현재 활성 플랜이 변경될 때 currentRoof.planNo 업데이트 + */ + useEffect(() => { + if (currentCanvasPlan?.planNo && currentRoof) { + setCurrentRoof(prev => ({ ...prev, planNo: currentCanvasPlan.planNo })) + } + }, [currentCanvasPlan?.planNo]) + /** * 배치면초기설정 데이터 조회 후 화면 오픈 */ @@ -132,7 +142,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla setRaftCodes(raftCodeList) setCurrentRoof({ ...addedRoofs[0], - planNo: planNo, + planNo: currentCanvasPlan?.planNo || planNo, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet, }) @@ -221,7 +231,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla const handleSaveBtn = async () => { const roofInfo = { ...currentRoof, - planNo: basicSetting.planNo, + planNo: currentCanvasPlan?.planNo || basicSetting.planNo, roofCd: roofRef.roofCd.current?.value, width: roofRef.width.current?.value, length: roofRef.length.current?.value, @@ -244,6 +254,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla */ basicSettingSave({ ...basicSetting, + planNo: currentCanvasPlan?.planNo || basicSetting.planNo, /** * 선택된 지붕재 정보 */