From 89102719a996a458eee8e921e32513631a09e59b Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 26 Dec 2024 18:00:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=8D=AE=EA=B0=9C=20-=20?= =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0=EB=8B=B9=20list=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 13 +++++-- .../placementShape/PlacementShapeSetting.jsx | 35 +++++++++++-------- .../roofAllocation/RoofAllocationSetting.jsx | 23 +++++++++--- src/hooks/option/useCanvasSetting.js | 5 +-- .../roofcover/useRoofAllocationSetting.js | 3 +- src/store/settingAtom.js | 5 +-- 6 files changed, 55 insertions(+), 29 deletions(-) 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'} />