적설량, 풍속 등 수정했을때 설정한 roof 초기화
This commit is contained in:
parent
001143954e
commit
6c6e5845ef
@ -66,12 +66,12 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedSurfaceType) {
|
if (selectedSurfaceType) {
|
||||||
console.log(roughnessCodes, selectedSurfaceType)
|
console.log(roughnessCodes, selectedSurfaceType)
|
||||||
setInputRoughness(roughnessCodes.find((code) => code.clCode === moduleSelectionData.common.illuminationTp))
|
setInputRoughness(roughnessCodes.find((code) => code.clCode === managementState?.surfaceTypeValue))
|
||||||
}
|
}
|
||||||
}, [selectedSurfaceType])
|
}, [selectedSurfaceType])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (standardWindSpeed) setInputStandardWindSpeed(windSpeedCodes.find((code) => code.clCode === moduleSelectionData.common.stdWindSpeed))
|
if (standardWindSpeed) setInputStandardWindSpeed(windSpeedCodes.find((code) => code.clCode === managementState?.standardWindSpeedId))
|
||||||
}, [standardWindSpeed])
|
}, [standardWindSpeed])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -181,11 +181,35 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeModule = (e) => {
|
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) => {
|
const newRoofs = addedRoofs.map((roof) => {
|
||||||
return {
|
return {
|
||||||
...roof,
|
...roof,
|
||||||
lengthBase: null,
|
lengthBase: null,
|
||||||
raftBaseCd: null,
|
|
||||||
trestleMkrCd: null,
|
trestleMkrCd: null,
|
||||||
constMthdCd: null,
|
constMthdCd: null,
|
||||||
constTp: null,
|
constTp: null,
|
||||||
@ -201,7 +225,6 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
setRoofs(newRoofs)
|
setRoofs(newRoofs)
|
||||||
setSelectedModules(e)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -359,10 +382,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
targetKey={'clCode'}
|
targetKey={'clCode'}
|
||||||
sourceKey={'clCode'}
|
sourceKey={'clCode'}
|
||||||
showKey={'clCodeNm'}
|
showKey={'clCodeNm'}
|
||||||
onChange={(e) => {
|
onChange={(e) => handleChangeRoughness(e)}
|
||||||
console.log('🚀 ~ handleChangeModule ~ inputRoughness:', e)
|
|
||||||
setInputRoughness(e)
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -374,7 +394,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={inputInstallHeight}
|
value={inputInstallHeight}
|
||||||
onChange={(e) => setInputInstallHeight(e.target.value)}
|
onChange={(e) => handleChangeInstallHeight(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">m</span>
|
<span className="thin">m</span>
|
||||||
@ -390,10 +410,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
targetKey={'clCode'}
|
targetKey={'clCode'}
|
||||||
sourceKey={'clCode'}
|
sourceKey={'clCode'}
|
||||||
showKey={'clCodeNm'}
|
showKey={'clCodeNm'}
|
||||||
onChange={(e) => {
|
onChange={(e) => handleChangeStandardWindSpeed(e)}
|
||||||
console.log('🚀 ~ handleChangeModule ~ inputStandardWindSpeed:', e)
|
|
||||||
setInputStandardWindSpeed(e)
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -405,7 +422,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={inputVerticalSnowCover}
|
value={inputVerticalSnowCover}
|
||||||
onChange={(e) => setInputVerticalSnowCover(e.target.value)}
|
onChange={(e) => handleChangeVerticalSnowCover(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">cm</span>
|
<span className="thin">cm</span>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user