From 29f8f22c2676cb23fddc8dea603187a37503b9ec Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 20 Feb 2025 16:24:29 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EB=A1=9C?= =?UTF-8?q?=EB=94=A9=EB=B0=94=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 553b3613..1ed413cf 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -221,6 +221,7 @@ export default function CanvasMenu(props) { await reloadCanvasStatus(objectNo, pid) break case 5: + setIsGlobalLoading(true) promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data @@ -230,6 +231,9 @@ export default function CanvasMenu(props) { setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) setIsGlobalLoading(false) router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`) + if (pathname === '/floor-plan/estimate/5') { + setIsGlobalLoading(false) + } } else { setIsGlobalLoading(false) swalFire({ text: getMessage('estimate.menu.move.valid1') }) From 010b34f5fb89d5ad2b02a844750e8060d8173c0a Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 20 Feb 2025 16:32:54 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=B0=9C=EC=A0=84=20=EC=8B=9C=EB=AE=AC?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EA=B0=81=EB=8F=84=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 66 +++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 248568b5..17f58814 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -710,7 +710,7 @@ export const useTrestle = () => { slope, classType: currentAngleType === 'slope' ? '0' : '1', angle: getDegreeByChon(slope), - azimuth: surfaceCompass ?? moduleCompass ?? 0, + azimuth: getAzimuth(surface), moduleList, } }) @@ -726,6 +726,70 @@ export const useTrestle = () => { return { itemList, northArrangement, roofSurfaceList, circuitItemList } } + const getAzimuth = (surface) => { + const { moduleCompass, surfaceCompass, direction } = surface + + if (surfaceCompass) { + if (surfaceCompass > 180) { + return surfaceCompass - 360 + } + return surfaceCompass + } + + switch (direction) { + case 'south': { + if (moduleCompass < 0) { + return -1 * moduleCompass + } else if (moduleCompass === 0) { + return 0 + } else if (moduleCompass < 180) { + return -1 * moduleCompass + } else if (moduleCompass === 180) { + return 180 + } + } + case 'north': { + if (moduleCompass < 0) { + return -1 * (180 + moduleCompass) + } else if (moduleCompass === 0) { + return 180 + } else if (moduleCompass < 180) { + return 180 - moduleCompass + } else if (moduleCompass === 180) { + return 0 + } + } + case 'west': { + if (moduleCompass > -180 && moduleCompass < -90) { + return -180 - (90 + moduleCompass) + } else if (moduleCompass < 0) { + return 180 - (90 + moduleCompass) + } else if (moduleCompass === 0) { + return 90 + } else if (moduleCompass < 180) { + return 90 - moduleCompass + } else if (moduleCompass === 180) { + return -90 + } + } + case 'east': { + if (moduleCompass < 0) { + return -(90 + moduleCompass) + } else if (moduleCompass === 0) { + return -90 + } else if (moduleCompass < 90) { + return -180 + (90 - moduleCompass) + } else if (moduleCompass < 180) { + return 180 + (90 - moduleCompass) + } else if (moduleCompass === 180) { + return 90 + } + } + } + + return 0 + } + const getNorthArrangement = () => { const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) let northArrangement = '0'