From e285210927301ea0187b4d5b081da842ef28436b Mon Sep 17 00:00:00 2001 From: ysCha Date: Tue, 5 Aug 2025 11:29:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EB=A9=94=EB=89=B4=EC=9D=98=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EB=8F=99=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roofcover/useRoofAllocationSetting.js | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index db39ac3a..417286e4 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -127,21 +127,25 @@ export function useRoofAllocationSetting(id) { } }) } else { - roofsArray = [ - { - planNo: planNo, - roofApply: true, - roofSeq: 0, - roofMatlCd: 'ROOF_ID_WA_53A', - roofWidth: 265, - roofHeight: 235, - roofHajebichi: 0, - roofGap: 'HEI_455', - roofLayout: 'P', - roofPitch: 4, - roofAngle: 21.8, - }, - ] + if(roofList.length > 0){ + roofsArray = roofList + }else{ + roofsArray = [ + { + planNo: planNo, + roofApply: true, + roofSeq: 0, + roofMatlCd: 'ROOF_ID_WA_53A', + roofWidth: 265, + roofHeight: 235, + roofHajebichi: 0, + roofGap: 'HEI_455', + roofLayout: 'P', + roofPitch: 4, + roofAngle: 21.8, + }, + ] + } } /** @@ -182,6 +186,9 @@ export function useRoofAllocationSetting(id) { roofSizeSet: '' + res[0].roofSizeSet, roofAngleSet: '' + res[0].roofAngleSet, }) + //데이터 동기화 + setCurrentRoofList(selectRoofs) + }) } catch (error) { console.error('Data fetching error:', error) -- 2.47.2 From bab3039d6e669ed5dbf45ef2d362a8deebea913d Mon Sep 17 00:00:00 2001 From: ysCha Date: Tue, 5 Aug 2025 11:29:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=88=AB=EC=9E=90=EC=9E=85=EB=A0=A5=20''?= =?UTF-8?q?=3D>=200=20=EC=9C=BC=EB=A1=9C=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/roofAllocation/ContextRoofAllocationSetting.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx index dd8b7003..01f08028 100644 --- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx @@ -186,7 +186,7 @@ export default function ContextRoofAllocationSetting(props) { handleChangeInput(e, 'hajebichi', index)} /> @@ -205,8 +205,8 @@ export default function ContextRoofAllocationSetting(props) { // handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) handleChangePitch(e, index) }} - value={currentAngleType === 'slope' ? roof.pitch : roof.angle} - defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} + value={currentAngleType === 'slope' ? (roof.pitch || '0') : (roof.angle || '0')} + defaultValue={currentAngleType === 'slope' ? (roof.pitch || '0') : (roof.angle || '0')} /> {pitchText} -- 2.47.2