From 75549b66b57a7eed52800e32d9170fdefb6074e6 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 25 Mar 2025 11:10:56 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EC=8B=9C=20canvas=20=EC=A0=80=EC=9E=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/placementShape/PlacementShapeSetting.jsx | 5 ++++- src/hooks/module/useTrestle.js | 1 - src/hooks/roofcover/useRoofAllocationSetting.js | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index 25ca72b8..e2e499b6 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -19,6 +19,7 @@ import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util' import { usePolygon } from '@/hooks/usePolygon' import { canvasState } from '@/store/canvasAtom' import { useRoofFn } from '@/hooks/common/useRoofFn' +import { usePlan } from '@/hooks/usePlan' /** * 지붕 레이아웃 @@ -45,6 +46,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla const { setSurfaceShapePattern } = useRoofFn() const canvas = useRecoilValue(canvasState) const roofDisplay = useRecoilValue(roofDisplaySelector) + const { saveCanvas } = usePlan() const roofRef = { roofCd: useRef(null), @@ -205,7 +207,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla /** * 배치면초기설정 저장 버튼 클릭 */ - const handleSaveBtn = () => { + const handleSaveBtn = async () => { const roofInfo = { ...currentRoof, planNo: basicSetting.planNo, @@ -254,6 +256,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla /* 저장 후 화면 닫기 */ closePopup(id) + await saveCanvas(false) } return ( diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index be795814..a584876c 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -60,7 +60,6 @@ export const useTrestle = () => { } const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction if (!construction) { - swalFire({ text: 'construction 존재안함', icon: 'error' }) return } diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index cfc73b81..2b9c9494 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -27,6 +27,7 @@ import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' import { outerLinePointsState } from '@/store/outerLineAtom' import { QcastContext } from '@/app/QcastProvider' +import { usePlan } from '@/hooks/usePlan' export function useRoofAllocationSetting(id) { const canvas = useRecoilValue(canvasState) @@ -52,6 +53,7 @@ export function useRoofAllocationSetting(id) { const { swalFire } = useSwal() const { setIsGlobalLoading } = useContext(QcastContext) const { setSurfaceShapePattern } = useRoofFn() + const { saveCanvas } = usePlan() const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) const resetPoints = useResetRecoilState(outerLinePointsState) @@ -225,6 +227,7 @@ export function useRoofAllocationSetting(id) { await post({ url: `/api/canvas-management/roof-allocation-settings`, data: patternData }).then((res) => { swalFire({ text: getMessage(res.returnMessage) }) setIsGlobalLoading(false) + saveCanvas(false) }) //Recoil 설정