From 904b7afd3869fc8f93419b387fa63780bb80ab0e Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 10:35:14 +0900 Subject: [PATCH 1/8] =?UTF-8?q?#1085=20=E3=80=90HANASYS=20DESIGN=E3=80=91?= =?UTF-8?q?=E6=9E=B6=E5=8F=B0=E8=A1=A8=E7=A4=BA=E3=81=AE=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=20=EC=A7=80=EC=A7=80?= =?UTF-8?q?=EA=B8=88=EA=B5=AC=20=EC=9C=84=EC=B9=98=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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 8a41149d..0aea8bfc 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -1627,6 +1627,8 @@ export const useTrestle = () => { // 랙 없음의 지지금구를 그린다. const drawBracketWithOutRack = (module, rackIntvlPct, count, l, direction, moduleIntvlHor, moduleIntvlVer) => { const { leftFindModuleList, rightFindModuleList, centerFindModuleList } = module + rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경 + rackIntvlPct = 100 / rackIntvlPct // 퍼센트로 변경 let { width, height, left, top } = module let startPointX @@ -1641,14 +1643,14 @@ export const useTrestle = () => { break } else if (direction === 'east') { startPointX = left + width - startPointY = top + height - height / rackIntvlPct + startPointY = top + height - height / rackIntvlPct - 10 break } else if (direction === 'west') { startPointX = left startPointY = top + height / rackIntvlPct break } else if (direction === 'north') { - startPointX = left + width - width / rackIntvlPct + startPointX = left + width - width / rackIntvlPct - 10 startPointY = top break } @@ -1657,7 +1659,7 @@ export const useTrestle = () => { case 'R': { // 오른쪽부분 시작 점 if (direction === 'south') { - startPointX = left + width - width / rackIntvlPct + startPointX = left + width - width / rackIntvlPct - 10 startPointY = top + height / 2 + height / 2 break } else if (direction === 'east') { @@ -1666,7 +1668,7 @@ export const useTrestle = () => { break } else if (direction === 'west') { startPointX = left - startPointY = top + height - height / rackIntvlPct + startPointY = top + height - height / rackIntvlPct - 10 break } else if (direction === 'north') { startPointX = left + width / rackIntvlPct From ab93c5ffe5193288d8395fb00b683fe876b163c9 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 11:06:28 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=EC=8B=A4=EC=B8=A1=EC=B9=98=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EC=A0=84=ED=99=98=20=EC=95=88=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 558bec36..b83d4ac4 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -1193,7 +1193,7 @@ export const usePolygon = () => { }) canvas.add(roof) - // addLengthText(roof) + addLengthText(roof) canvas.remove(polygon) canvas.renderAll() }) From bcb8a11d5a8e1448d0c34842e918a309f2ac50a2 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 15:45:30 +0900 Subject: [PATCH 3/8] =?UTF-8?q?zoom=EA=B0=92=EC=97=90=20=EB=94=B0=EB=9D=BC?= =?UTF-8?q?=20mouseLine=20=EC=95=88=EA=B7=B8=EB=A0=A4=EC=A7=80=EB=8A=94=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useEvent.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index 9f9e4ea0..f3c6dee8 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -1,4 +1,4 @@ -import { useRef } from 'react' +import { useEffect, useRef } from 'react' import { useRecoilValue, useSetRecoilState } from 'recoil' import { canvasState, canvasZoomState, currentMenuState, textModeState } from '@/store/canvasAtom' import { fabric } from 'fabric' @@ -25,6 +25,7 @@ export function useEvent() { const setCanvasZoom = useSetRecoilState(canvasZoomState) const gridColor = useRecoilValue(gridColorState) const isGridDisplay = useRecoilValue(gridDisplaySelector) + const zoom = useRecoilValue(canvasZoomState) const { adsorptionPointAddMode, adsorptionPointMode, adsorptionRange, getAdsorptionPoints, adsorptionPointAddModeStateEvent } = useAdsorptionPoint() const { dotLineGridSetting, interval, getClosestLineGrid } = useDotLineGrid() @@ -59,6 +60,12 @@ export function useEvent() { addDefaultEvent() } + useEffect(() => { + if (canvas) { + addCanvasMouseEventListener('mouse:move', defaultMouseMoveEvent) + } + }, [zoom]) + const addDefaultEvent = () => { //default Event 추가 addCanvasMouseEventListener('mouse:move', defaultMouseMoveEvent) @@ -280,7 +287,7 @@ export function useEvent() { } const drawMouseLine = (pointer) => { - const horizontalLine = new fabric.Line([-4 * canvas.width, pointer.y, 4 * canvas.width, pointer.y], { + const horizontalLine = new fabric.Line([-2 * canvas.width, pointer.y, 2 * canvas.width, pointer.y], { stroke: 'red', strokeWidth: 1, selectable: false, @@ -288,7 +295,7 @@ export function useEvent() { }) // 세로선 - const verticalLine = new fabric.Line([pointer.x, -4 * canvas.height, pointer.x, 4 * canvas.height], { + const verticalLine = new fabric.Line([pointer.x, -2 * canvas.height, pointer.x, 2 * canvas.height], { stroke: 'red', strokeWidth: 1, selectable: false, From 5395dff08170332b68eb891c2ebbfe50793c6664 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 15:52:20 +0900 Subject: [PATCH 4/8] =?UTF-8?q?=ED=95=B4=EB=8B=B9=20=EB=A9=94=EB=89=B4?= =?UTF-8?q?=EA=B0=80=20mouseMove=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=EB=A5=BC=20?= =?UTF-8?q?=EA=B0=96=EA=B3=A0=20=EC=9E=88=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useEvent.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index f3c6dee8..ea941d1e 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -15,7 +15,8 @@ import { useDotLineGrid } from '@/hooks/useDotLineGrid' import { useTempGrid } from '@/hooks/useTempGrid' import { gridColorState } from '@/store/gridAtom' import { gridDisplaySelector } from '@/store/settingAtom' -import { POLYGON_TYPE } from '@/common/common' +import { MENU, POLYGON_TYPE } from '@/common/common' +import useMenu from '@/hooks/common/useMenu' export function useEvent() { const canvas = useRecoilValue(canvasState) @@ -61,7 +62,8 @@ export function useEvent() { } useEffect(() => { - if (canvas) { + const whiteMenus = [MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH, MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING] + if (canvas && !whiteMenus.includes(currentMenu)) { addCanvasMouseEventListener('mouse:move', defaultMouseMoveEvent) } }, [zoom]) From acdec6d2f2b4f1acf69fd16d1fc5b759c1767428 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 15:55:35 +0900 Subject: [PATCH 5/8] =?UTF-8?q?mouseMove=ED=95=B4=EB=8B=B9=20=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=EB=A9=94=EB=89=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index ea941d1e..8b7b687d 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -62,7 +62,7 @@ export function useEvent() { } useEffect(() => { - const whiteMenus = [MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH, MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING] + const whiteMenus = [MENU.BATCH_CANVAS.SURFACE_SHAPE_BATCH, MENU.BATCH_CANVAS.OBJECT_BATCH, MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING] if (canvas && !whiteMenus.includes(currentMenu)) { addCanvasMouseEventListener('mouse:move', defaultMouseMoveEvent) } From 32884830c82f65e3c97b3830be20c86f42442ae1 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 17:21:03 +0900 Subject: [PATCH 6/8] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=EC=84=A4=EC=A0=95=20=EC=8B=9C=20=EC=84=9C=EA=B9=8C?= =?UTF-8?q?=EB=9E=98=20=EA=B0=92=20=EC=9D=B4=EC=83=81=20=ED=98=84=EC=83=81?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placementShape/PlacementShapeSetting.jsx | 4 ++-- src/hooks/option/useCanvasSetting.js | 23 +++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index 0ac134ef..91332f43 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -227,7 +227,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla console.log('save Info', { ...basicSetting, selectedRoofMaterial: { - roofInfo, + ...newAddedRoofs[0], }, }) @@ -240,7 +240,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla * 선택된 지붕재 정보 */ selectedRoofMaterial: { - roofInfo, + ...newAddedRoofs[0], }, }) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 1c7c0e39..6d0d5acf 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -498,11 +498,26 @@ export function useCanvasSetting(executeEffect = true) { roofSeq: 0, roofMatlCd: params.roofsData.roofMatlCd === null || params.roofsData.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : params.roofsData.roofMatlCd, - roofWidth: params.roofsData.roofWidth === null || params.roofsData.roofWidth === undefined ? 0 : params.roofsData.roofWidth, - roofHeight: params.roofsData.roofHeight === null || params.roofsData.roofHeight === undefined ? 0 : params.roofsData.roofHeight, + roofWidth: + params.selectedRoofMaterial.width === null || params.selectedRoofMaterial.width === undefined + ? !params.selectedRoofMaterial.widBase + ? 0 + : params.roofsData.widBase + : params.selectedRoofMaterial.width, + roofHeight: + params.selectedRoofMaterial.height === null || params.selectedRoofMaterial.height === undefined + ? !params.selectedRoofMaterial.lenBase + ? 0 + : params.selectedRoofMaterial.lenBase + : params.roofsData.roofHeight, roofHajebichi: - params.roofsData.roofHajebichi === null || params.roofsData.roofHajebichi === undefined ? 0 : params.roofsData.roofHajebichi, - roofGap: params.roofsData.roofGap === null || params.roofsData.roofGap === undefined ? 'HEI_455' : params.roofsData.roofGap, + params.selectedRoofMaterial.hajebichi === null || params.selectedRoofMaterial.hajebichi === undefined + ? 0 + : params.selectedRoofMaterial.hajebichi, + roofGap: + params.selectedRoofMaterial.raft === null || params.selectedRoofMaterial.raft === undefined + ? params.selectedRoofMaterial.raftBaseCd + : params.roofsData.raft, roofLayout: params.roofsData.roofLayout === null || params.roofsData.roofLayout === undefined ? 'P' : params.roofsData.roofLayout, roofPitch: params.roofsData.roofPitch === null || params.roofsData.roofPitch === undefined ? 0 : params.roofsData.roofPitch, roofAngle: params.roofsData.roofAngle === null || params.roofsData.roofAngle === undefined ? 0 : params.roofsData.roofAngle, From 9d91533922c8a028d8710fe5ce5db09a97a52c31 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 4 Jun 2025 17:31:42 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=EC=84=A4=EC=A0=95=20=EC=8B=9C=20=EC=84=9C=EA=B9=8C?= =?UTF-8?q?=EB=9E=98=20=EA=B0=92=20=EC=9D=B4=EC=83=81=20=ED=98=84=EC=83=81?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 6d0d5acf..db374c7f 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -502,18 +502,18 @@ export function useCanvasSetting(executeEffect = true) { params.selectedRoofMaterial.width === null || params.selectedRoofMaterial.width === undefined ? !params.selectedRoofMaterial.widBase ? 0 - : params.roofsData.widBase - : params.selectedRoofMaterial.width, + : Number(params.roofsData.widBase) + : Number(params.selectedRoofMaterial.width), roofHeight: params.selectedRoofMaterial.height === null || params.selectedRoofMaterial.height === undefined ? !params.selectedRoofMaterial.lenBase ? 0 - : params.selectedRoofMaterial.lenBase - : params.roofsData.roofHeight, + : Number(params.selectedRoofMaterial.lenBase) + : Number(params.roofsData.roofHeight), roofHajebichi: params.selectedRoofMaterial.hajebichi === null || params.selectedRoofMaterial.hajebichi === undefined ? 0 - : params.selectedRoofMaterial.hajebichi, + : Number(params.selectedRoofMaterial.hajebichi), roofGap: params.selectedRoofMaterial.raft === null || params.selectedRoofMaterial.raft === undefined ? params.selectedRoofMaterial.raftBaseCd From 31bf7529701a1ca87e4ee72b836e2acc9fb9c2d0 Mon Sep 17 00:00:00 2001 From: ysCha Date: Wed, 4 Jun 2025 19:17:53 +0900 Subject: [PATCH 8/8] selectedPlan?.planNo?? currentPid or pid --- src/components/estimate/Estimate.jsx | 2 +- src/components/floor-plan/CanvasMenu.jsx | 8 ++++---- src/components/simulator/Simulator.jsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 9a60fd0e..e59dd9ff 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -154,7 +154,7 @@ export default function Estimate({}) { useEffect(() => { // console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan) - if (selectedPlan) initEstimate(selectedPlan.planNo) + if (selectedPlan) initEstimate(selectedPlan?.planNo?? currentPid) }, [selectedPlan]) useEffect(() => { diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 5d2d1030..b876d517 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -241,7 +241,7 @@ export default function CanvasMenu(props) { return } setIsGlobalLoading(true) - promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan?.planNo??pid}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data if (estimateDetail.estimateDate !== null) { @@ -249,7 +249,7 @@ export default function CanvasMenu(props) { setCurrentMenu(menu.title) setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) setIsGlobalLoading(false) - router.push(`/floor-plan/estimate/5?pid=${selectedPlan.planNo}&objectNo=${objectNo}`) + router.push(`/floor-plan/estimate/5?pid=${selectedPlan?.planNo??pid}&objectNo=${objectNo}`) if (pathname === '/floor-plan/estimate/5') { setIsGlobalLoading(false) } @@ -262,13 +262,13 @@ export default function CanvasMenu(props) { break case 'simulation': setIsGlobalLoading(true) - promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan?.planNo??pid}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data if (estimateDetail.estimateDate !== null && estimateDetail.docNo) { setSelectedMenu(menu.type) setCurrentMenu(menu.title) - router.push(`/floor-plan/simulator/6?pid=${selectedPlan.planNo}&objectNo=${objectNo}`) + router.push(`/floor-plan/simulator/6?pid=${selectedPlan?.planNo??pid}&objectNo=${objectNo}`) if (pathname === '/floor-plan/simulator/6') { setIsGlobalLoading(false) } diff --git a/src/components/simulator/Simulator.jsx b/src/components/simulator/Simulator.jsx index 6683ff9e..94307e8d 100644 --- a/src/components/simulator/Simulator.jsx +++ b/src/components/simulator/Simulator.jsx @@ -114,7 +114,7 @@ export default function Simulator() { setHatsudenryouPeakcutAllSnow([]) if (objectNo && pid && selectedPlan) { - fetchObjectDetail(objectNo, selectedPlan.planNo) + fetchObjectDetail(objectNo, selectedPlan?.planNo??pid) fetchSimulatorNotice() setPwrGnrSimType('D') setPwrRecoil({ ...pwrRecoil, type: 'D' })