지붕재할당 수정 후 배치면초기설정 적용 수정

This commit is contained in:
changkyu choi 2025-01-15 18:14:57 +09:00
parent b0f145ef4e
commit b5f702b74b
2 changed files with 12 additions and 6 deletions

View File

@ -59,11 +59,11 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return
const raftCodeList = findCommonCode('203800') const raftCodeList = findCommonCode('203800')
setRaftCodes(raftCodeList) setRaftCodes(raftCodeList)
if (addedRoofs.length > 0) { if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) {
setCurrentRoof({ ...currentRoof, roofSizeSet: addedRoofs[0].roofSizeSet, roofAngleSet: addedRoofs[0].roofAngleSet }) setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet })
} else if (basicSetting.roofSizeSet.length > 0) { } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) {
setCurrentRoof({ ...currentRoof, roofSizeSet: basicSetting.roofSizeSet, roofAngleSet: basicSetting.roofAngleSet }) setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet })
} }
}, []) }, [])

View File

@ -156,7 +156,13 @@ export function useRoofAllocationSetting(id) {
} }
setCurrentRoofList(selectRoofs) setCurrentRoofList(selectRoofs)
setBasicSetting({ ...basicSetting, roofsData: roofsArray }) //setBasicSetting({ ...basicSetting, roofsData: roofsArray })
setBasicSetting({
...basicSetting,
roofSizeSet: res[0].roofSizeSet,
roofAngleSet: res[0].roofAngleSet,
roofsData: roofsArray,
})
}) })
} catch (error) { } catch (error) {
console.error('Data fetching error:', error) console.error('Data fetching error:', error)