From 446969161850b952b7a5e8a4267fbd3f5499fe3c Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 26 Sep 2025 10:57:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[1237]=20=EB=AA=A8=EB=93=88=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=84=A0=ED=83=9D=20=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Trestle.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Trestle.jsx b/src/components/floor-plan/modal/basic/step/Trestle.jsx index 0bf9bd50..08bed95b 100644 --- a/src/components/floor-plan/modal/basic/step/Trestle.jsx +++ b/src/components/floor-plan/modal/basic/step/Trestle.jsx @@ -23,7 +23,7 @@ const Trestle = forwardRef((props, ref) => { const autoSelectTimeoutRef = useRef(null) // 공통 타임아웃 설정 (밀리초) - const AUTO_SELECT_TIMEOUT = 700 // API 호출 완료 대기 시간 + const AUTO_SELECT_TIMEOUT = 500 // API 호출 완료 대기 시간 const { trestleState, trestleDetail, @@ -66,7 +66,7 @@ const Trestle = forwardRef((props, ref) => { const [flag, setFlag] = useState(false) const tempModuleSelectionData = useRef(null) const [autoSelectStep, setAutoSelectStep] = useState(null) // 'raftBase', 'trestle', 'constMthd', 'roofBase', 'construction' - + const prevHajebichiRef = useRef(); useEffect(() => { if (roofs && roofs.length > 0 && !selectedRoof) { @@ -80,6 +80,15 @@ const Trestle = forwardRef((props, ref) => { if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) { onChangeRaftBase(roofs[0]); } + + if ( + selectedRoof && ["C", "R"].includes(selectedRoof.roofPchAuth) && roofs && roofs.length > 0 && + roofs[0].hajebichi !== prevHajebichiRef.current + ) { + prevHajebichiRef.current = roofs[0].hajebichi; + onChangeHajebichi(roofs[0].hajebichi); + } + //모듈 설치 영역 복구 restoreModuleInstArea() }, [roofs, selectedRoof]) // selectedRoof 추가 From 9786c1fbf726130854bea7fbb4e6532a5acf0a7a Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 26 Sep 2025 18:01:08 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[1306]=20=EA=B0=80=EB=8C=80=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=EC=9D=98=20=EB=B6=88=EB=9F=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Trestle.jsx | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Trestle.jsx b/src/components/floor-plan/modal/basic/step/Trestle.jsx index 08bed95b..13f46a31 100644 --- a/src/components/floor-plan/modal/basic/step/Trestle.jsx +++ b/src/components/floor-plan/modal/basic/step/Trestle.jsx @@ -76,15 +76,10 @@ const Trestle = forwardRef((props, ref) => { } if (selectedRoof && selectedRoof.lenAuth === "C") { onChangeLength(selectedRoof.length); - } - if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) { + }else if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) { onChangeRaftBase(roofs[0]); - } - - if ( - selectedRoof && ["C", "R"].includes(selectedRoof.roofPchAuth) && roofs && roofs.length > 0 && - roofs[0].hajebichi !== prevHajebichiRef.current - ) { + }else if (selectedRoof && ["C", "R"].includes(selectedRoof.roofPchAuth) && roofs && roofs.length > 0 && + roofs[0].hajebichi !== prevHajebichiRef.current ) { prevHajebichiRef.current = roofs[0].hajebichi; onChangeHajebichi(roofs[0].hajebichi); } @@ -289,7 +284,7 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raft: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd, hajebichi: e, }, }) @@ -312,7 +307,8 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raft: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd, + //hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi, trestleMkrCd: e.trestleMkrCd, }, }) @@ -334,7 +330,8 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raft: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd, + //hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi, trestleMkrCd: selectedTrestle?.trestleMkrCd, constMthdCd: e.constMthdCd, }, @@ -366,7 +363,8 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raft: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd, + //hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi, trestleMkrCd: selectedTrestle?.trestleMkrCd, constMthdCd: selectedConstMthd?.constMthdCd, roofBaseCd: e.roofBaseCd, @@ -392,7 +390,8 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raft: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd, + //hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi, trestleMkrCd: selectedTrestle.trestleMkrCd, constMthdCd: selectedConstMthd.constMthdCd, roofBaseCd: selectedRoofBase.roofBaseCd, @@ -429,7 +428,7 @@ const Trestle = forwardRef((props, ref) => { ridgeMargin, kerabaMargin, roofIndex: selectedRoof.index, - raft: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd, trestle: { hajebichi: hajebichi, length: lengthBase, @@ -466,8 +465,8 @@ const Trestle = forwardRef((props, ref) => { ridgeMargin, kerabaMargin, roofIndex: roof.index, - raft: selectedRaftBase?.clCode, - hajebichi: hajebichi, + raft: selectedRaftBase?.clCode ?? selectedRoof?.raft ?? '', + //hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi ?? 0, trestle: { length: lengthBase, hajebichi: hajebichi, @@ -552,7 +551,7 @@ const Trestle = forwardRef((props, ref) => { } if (['C', 'R'].includes(roof.roofPchAuth)) { - if (!roof?.roofPchBase) { + if (!roof?.hajebichi) { Swal.fire({ title: getMessage('modal.module.basic.settting.module.error7', [roof.nameJp]), // 하제비치를 입력해주세요. icon: 'warning',