diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 017e025e..71fdb0bf 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -123,6 +123,13 @@ export default function CanvasMenu(props) { if (pathname !== '/floor-plan') router.push('/floor-plan') } + useEffect(() => { + console.log('addedRoofs', addedRoofs) + }, [addedRoofs]) + useEffect(() => { + console.log('selectedRoofMaterial', selectedRoofMaterial) + }, [selectedRoofMaterial]) + const changeSelectedRoofMaterial = (e) => { setBasicSetting({ ...basicSetting, selectedRoofMaterial: e }) } @@ -307,14 +314,16 @@ export default function CanvasMenu(props) { - {addedRoofs.length > 0 && ( + {isObjectNotEmpty(selectedRoofMaterial) && addedRoofs.length > 0 && (
{ }
diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index 6e526018..77d49d5e 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -47,6 +47,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set fetchBasicSettings() const raftCodeList = findCommonCode('203800') setRaftCodes(raftCodeList) + console.log('raftCodeList', raftCodeList) }, []) useEffect(() => { @@ -78,9 +79,8 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set } const handleRafterChange = (value) => { - console.log('🚀 ~ handleRafterChange ~ value:', value) const selectedRafter = raftCodes.find((raft) => raft.clCode === value) - setCurrentRoofMaterial({ ...currentRoofMaterial, raft: selectedRafter }) + setCurrentRoofMaterial({ ...currentRoofMaterial, raft: selectedRafter.clCode }) } const handleSaveBtn = () => { @@ -93,12 +93,12 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set // raft: roofRef.rafter.current?.value, selected: true, layout: roofLayout, + index: 0, } const newAddedRoofs = [...addedRoofs] if (addedRoofs.length === 1) { - newAddedRoofs[0] = roofInfo - + newAddedRoofs[0] = { ...roofInfo } setAddedRoofs(newAddedRoofs) } @@ -244,6 +244,9 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set })} value={currentRoofMaterial} onChange={(e) => handleRoofTypeChange(e.roofMatlCd)} + sourceKey="id" + targetKey="id" + showKey="name" /> {/* + {raftCodes.length > 0 && ( +
+ handleRafterChange(e.clCode)} + sourceKey="clCode" + targetKey={currentRoofMaterial.raft ? 'raft' : 'raftBaseCd'} + showKey="clCodeNm" + /> + {/* */} -
+ + )} )} {currentRoofMaterial && ['C', 'R'].includes(currentRoofMaterial.roofPchAuth) && ( diff --git a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx index 3a485b0e..95f99be3 100644 --- a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx @@ -51,13 +51,15 @@ export default function RoofAllocationSetting(props) { {getMessage('modal.roof.alloc.select.roof.material')}
{ // const selected = roofMaterials.find((roofMaterial) => roofMaterial.roofMatlCd === e.id) setCurrentRoofMaterial(e) }} + showKey={'roofMatlNm'} + sourceKey={'roofMatlCd'} + targetKey={'roofMatlCd'} />