From 6c6e5845ef0341b4125f19d16837ddcddaefbd86 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: Thu, 3 Apr 2025 10:22:48 +0900
Subject: [PATCH] =?UTF-8?q?=EC=A0=81=EC=84=A4=EB=9F=89,=20=ED=92=8D?=
=?UTF-8?q?=EC=86=8D=20=EB=93=B1=20=EC=88=98=EC=A0=95=ED=96=88=EC=9D=84?=
=?UTF-8?q?=EB=95=8C=20=EC=84=A4=EC=A0=95=ED=95=9C=20roof=20=EC=B4=88?=
=?UTF-8?q?=EA=B8=B0=ED=99=94?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modal/basic/step/Orientation.jsx | 45 +++++++++++++------
1 file changed, 31 insertions(+), 14 deletions(-)
diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx
index 59ff4f37..6dcadde8 100644
--- a/src/components/floor-plan/modal/basic/step/Orientation.jsx
+++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx
@@ -66,12 +66,12 @@ export const Orientation = forwardRef((props, ref) => {
useEffect(() => {
if (selectedSurfaceType) {
console.log(roughnessCodes, selectedSurfaceType)
- setInputRoughness(roughnessCodes.find((code) => code.clCode === moduleSelectionData.common.illuminationTp))
+ setInputRoughness(roughnessCodes.find((code) => code.clCode === managementState?.surfaceTypeValue))
}
}, [selectedSurfaceType])
useEffect(() => {
- if (standardWindSpeed) setInputStandardWindSpeed(windSpeedCodes.find((code) => code.clCode === moduleSelectionData.common.stdWindSpeed))
+ if (standardWindSpeed) setInputStandardWindSpeed(windSpeedCodes.find((code) => code.clCode === managementState?.standardWindSpeedId))
}, [standardWindSpeed])
useEffect(() => {
@@ -181,11 +181,35 @@ export const Orientation = forwardRef((props, ref) => {
}
const handleChangeModule = (e) => {
+ resetRoofs()
+ setSelectedModules(e)
+ }
+
+ const handleChangeRoughness = (e) => {
+ resetRoofs()
+ setInputRoughness(e)
+ }
+
+ const handleChangeInstallHeight = (e) => {
+ resetRoofs()
+ setInputInstallHeight(e)
+ }
+
+ const handleChangeStandardWindSpeed = (e) => {
+ resetRoofs()
+ setInputStandardWindSpeed(e)
+ }
+
+ const handleChangeVerticalSnowCover = (e) => {
+ resetRoofs()
+ setInputVerticalSnowCover(e)
+ }
+
+ const resetRoofs = () => {
const newRoofs = addedRoofs.map((roof) => {
return {
...roof,
lengthBase: null,
- raftBaseCd: null,
trestleMkrCd: null,
constMthdCd: null,
constTp: null,
@@ -201,7 +225,6 @@ export const Orientation = forwardRef((props, ref) => {
}
})
setRoofs(newRoofs)
- setSelectedModules(e)
}
return (
@@ -359,10 +382,7 @@ export const Orientation = forwardRef((props, ref) => {
targetKey={'clCode'}
sourceKey={'clCode'}
showKey={'clCodeNm'}
- onChange={(e) => {
- console.log('🚀 ~ handleChangeModule ~ inputRoughness:', e)
- setInputRoughness(e)
- }}
+ onChange={(e) => handleChangeRoughness(e)}
/>
)}
@@ -374,7 +394,7 @@ export const Orientation = forwardRef((props, ref) => {
type="text"
className="input-origin block"
value={inputInstallHeight}
- onChange={(e) => setInputInstallHeight(e.target.value)}
+ onChange={(e) => handleChangeInstallHeight(e.target.value)}
/>
m
@@ -390,10 +410,7 @@ export const Orientation = forwardRef((props, ref) => {
targetKey={'clCode'}
sourceKey={'clCode'}
showKey={'clCodeNm'}
- onChange={(e) => {
- console.log('🚀 ~ handleChangeModule ~ inputStandardWindSpeed:', e)
- setInputStandardWindSpeed(e)
- }}
+ onChange={(e) => handleChangeStandardWindSpeed(e)}
/>
)}
@@ -405,7 +422,7 @@ export const Orientation = forwardRef((props, ref) => {
type="text"
className="input-origin block"
value={inputVerticalSnowCover}
- onChange={(e) => setInputVerticalSnowCover(e.target.value)}
+ onChange={(e) => handleChangeVerticalSnowCover(e.target.value)}
/>
cm