From 35708f65e9f5186aa41af9281c87206497731cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Fri, 9 May 2025 15:36:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=EB=B3=84=20?= =?UTF-8?q?=EA=B0=80=EB=8C=80=EC=A0=95=EB=B3=B4=20=EC=A0=80=EC=9E=A5=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Trestle.jsx | 22 +++++++++---------- src/hooks/module/useModuleTrestle.js | 11 +++++----- 2 files 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 e1cca8db..44a68236 100644 --- a/src/components/floor-plan/modal/basic/step/Trestle.jsx +++ b/src/components/floor-plan/modal/basic/step/Trestle.jsx @@ -92,7 +92,7 @@ const Trestle = forwardRef((props, ref) => { useEffect(() => { if (raftBaseList.length > 0) { - setSelectedRaftBase(raftBaseList.find((raft) => raft.clCode === trestleState?.raftBaseCd) ?? null) + setSelectedRaftBase(raftBaseList.find((raft) => raft.clCode === selectedRoof?.raft) ?? null) } else { setSelectedRaftBase(null) } @@ -157,7 +157,7 @@ const Trestle = forwardRef((props, ref) => { length: e, moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raftBaseCd: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode, }, }) } @@ -169,7 +169,7 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raftBaseCd: e.clCode, + raft: e.clCode, }, }) } @@ -181,7 +181,7 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raftBaseCd: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode, trestleMkrCd: e.trestleMkrCd, }, }) @@ -194,7 +194,7 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raftBaseCd: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode, trestleMkrCd: selectedTrestle.trestleMkrCd, constMthdCd: e.constMthdCd, }, @@ -208,7 +208,7 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raftBaseCd: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode, trestleMkrCd: selectedTrestle.trestleMkrCd, constMthdCd: selectedConstMthd.constMthdCd, roofBaseCd: e.roofBaseCd, @@ -229,7 +229,7 @@ const Trestle = forwardRef((props, ref) => { roof: { moduleTpCd: selectedModules.itemTp ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '', - raftBaseCd: selectedRaftBase?.clCode, + raft: selectedRaftBase?.clCode, trestleMkrCd: selectedTrestle.trestleMkrCd, constMthdCd: selectedConstMthd.constMthdCd, roofBaseCd: selectedRoofBase.roofBaseCd, @@ -266,6 +266,7 @@ const Trestle = forwardRef((props, ref) => { ridgeMargin, kerabaMargin, roofIndex: selectedRoof.index, + raft: selectedRaftBase?.clCode, trestle: { hajebichi: hajebichi, length: lengthBase, @@ -302,6 +303,7 @@ const Trestle = forwardRef((props, ref) => { ridgeMargin, kerabaMargin, roofIndex: roof.index, + raft: selectedRaftBase?.clCode, trestle: { length: lengthBase, hajebichi: hajebichi, @@ -374,7 +376,7 @@ const Trestle = forwardRef((props, ref) => { } } if (['C', 'R'].includes(roof.raftAuth)) { - if (!roof?.raftBaseCd) { + if (!roof?.raft) { Swal.fire({ title: getMessage('modal.module.basic.settting.module.error6', [roof.nameJp]), // 서까래 간격을 입력해주세요. icon: 'warning', @@ -477,7 +479,7 @@ const Trestle = forwardRef((props, ref) => { addRoof: newRoofs[index], trestle: { ...roof.trestle, - raftBaseCd: roof.raftBaseCd, + raft: roof.raftBaseCd, }, construction: { // ...constructionList.find((construction) => newAddedRoofs[index].construction.constTp === construction.constTp), @@ -502,8 +504,6 @@ const Trestle = forwardRef((props, ref) => { return false } - const onMarginCheck = (target, data) => {} - useImperativeHandle(ref, () => ({ isComplete, })) diff --git a/src/hooks/module/useModuleTrestle.js b/src/hooks/module/useModuleTrestle.js index e89d6089..0143e92e 100644 --- a/src/hooks/module/useModuleTrestle.js +++ b/src/hooks/module/useModuleTrestle.js @@ -25,7 +25,7 @@ const trestleReducer = (state, action) => { moduleTpCd: action.roof.module?.itemTp ?? '', roofMatlCd: action.roof?.roofMatlCd ?? '', hajebichi: action.roof?.hajebichi ?? 0, - raftBaseCd: action.roof?.raft ?? null, + raft: action.roof?.raft ?? null, trestleMkrCd: action.roof.trestle?.trestleMkrCd ?? null, constMthdCd: action.roof.trestle?.constMthdCd ?? null, constTp: action.roof.construction?.constTp ?? null, @@ -72,7 +72,6 @@ export function useModuleTrestle(props) { useEffect(() => { const raftCodeList = findCommonCode(RAFT_BASE_CODE) - setRaftBaseList(raftCodeList) setTrestleList([]) setConstMthdList([]) @@ -150,7 +149,7 @@ export function useModuleTrestle(props) { getTrestleList({ moduleTpCd: trestleState?.moduleTpCd ?? '', roofMatlCd: trestleState?.roofMatlCd ?? '', - raftBaseCd: trestleState?.raftBaseCd ?? '', + raftBaseCd: trestleState?.raft ?? '', }) .then((res) => { if (res?.data) setTrestleList(res.data) @@ -166,7 +165,7 @@ export function useModuleTrestle(props) { getTrestleList({ moduleTpCd: trestleState?.moduleTpCd ?? '', roofMatlCd: trestleState?.roofMatlCd ?? '', - raftBaseCd: trestleState?.raftBaseCd ?? '', + raftBaseCd: trestleState?.raft ?? '', trestleMkrCd: trestleState?.trestleMkrCd ?? '', }) .then((res) => { @@ -183,7 +182,7 @@ export function useModuleTrestle(props) { getTrestleList({ moduleTpCd: trestleState?.moduleTpCd ?? '', roofMatlCd: trestleState?.roofMatlCd ?? '', - raftBaseCd: trestleState?.raftBaseCd ?? '', + raftBaseCd: trestleState?.raft ?? '', trestleMkrCd: trestleState?.trestleMkrCd ?? '', constMthdCd: trestleState?.constMthdCd ?? '', }) @@ -209,7 +208,7 @@ export function useModuleTrestle(props) { stdWindSpeed: trestleState.stdWindSpeed ?? '', stdSnowLd: trestleState.stdSnowLd ?? '', inclCd: trestleState.inclCd ?? '', - raftBaseCd: trestleState.raftBaseCd ?? '', + raftBaseCd: trestleState.raft ?? '', roofPitch: Math.round(trestleState.roofPitch) ?? '', }) .then((res) => {