From de9e87b5867305f514d18791ac2d15bb996bd421 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 24 Feb 2025 14:33:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A1=EC=A7=80=EB=B6=95=20=EB=8C=80?= =?UTF-8?q?=EC=9D=91=EC=9E=91=EC=97=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 3304d180..14bf6447 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -48,6 +48,9 @@ export const useTrestle = () => { surfaces.forEach((surface) => { const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId) const roofMaterialIndex = parent.roofMaterial.index + if (+roofSizeSet === 3) { + return true + } const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction if (!construction) { alert('앞에서 셋팅 안됨') @@ -678,14 +681,17 @@ export const useTrestle = () => { const roofMaterialIndex = parent.roofMaterial.index const { nameJp: roofMaterialIdMulti } = roofMaterial const moduleSelection = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex) - const { constTp: constructSpecification, constTpJp: constructSpecificationMulti } = moduleSelection.construction - const { - trestleMkrCd, - constMthdCd: supportMethodId, - roofBaseCd, - trestleMkrCdJp: supportMeaker, - constMthdCdJp: supportMethodIdMulti, - } = moduleSelection.trestle + let construction = moduleSelection?.construction + let constructSpecification = +roofSizeSet === 3 ? null : construction.constTp + let constructSpecificationMulti = +roofSizeSet === 3 ? null : construction.constTpJp + + const trestle = moduleSelection?.trestle + + let trestleMkrCd = +roofSizeSet === 3 ? null : trestle.trestleMkrCd + let supportMethodId = +roofSizeSet === 3 ? null : trestle.constMthdCd + let roofBaseCd = +roofSizeSet === 3 ? null : trestle.roofBaseCd + let supportMeaker = +roofSizeSet === 3 ? null : trestle.trestleMkrCdJp + let supportMethodIdMulti = +roofSizeSet === 3 ? null : trestle.constMthdCdJp const modules = surface.modules const moduleList = modules.map((module) => { @@ -700,16 +706,16 @@ export const useTrestle = () => { return { roofSurfaceId: surface.id, roofSurface: directionText.replace(/[0-9]/g, ''), - roofMaterialId: roofMaterial.roofMatlCd, + roofMaterialId: +roofSizeSet === 3 ? '陸屋根' : roofMaterial.roofMatlCd, // 육지붕의 경우 지붕재 ID 값이 없기 때문에 임의 값 지정 supportMethodId, constructSpecification, constructSpecificationMulti, - roofMaterialIdMulti, + roofMaterialIdMulti: +roofSizeSet === 3 ? '陸屋根' : roofMaterialIdMulti, supportMethodIdMulti, supportMeaker, - slope, + slope: +roofSizeSet === 3 ? 0 : slope, classType: currentAngleType === 'slope' ? '0' : '1', - angle: getDegreeByChon(slope), + angle: +roofSizeSet === 3 ? 0 : getDegreeByChon(slope), azimuth: getAzimuth(parent), moduleList, }