Compare commits
2 Commits
4bf90e7dfb
...
d1045fa0df
| Author | SHA1 | Date | |
|---|---|---|---|
| d1045fa0df | |||
| 9ada34c020 |
@ -16,7 +16,7 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
|||||||
|
|
||||||
import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util'
|
import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util'
|
||||||
import { usePolygon } from '@/hooks/usePolygon'
|
import { usePolygon } from '@/hooks/usePolygon'
|
||||||
import { canvasState, canvasSettingState, currentMenuState } from '@/store/canvasAtom'
|
import { canvasState, canvasSettingState, currentCanvasPlanState, currentMenuState } from '@/store/canvasAtom'
|
||||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||||
import { MENU, POLYGON_TYPE } from '@/common/common'
|
import { MENU, POLYGON_TYPE } from '@/common/common'
|
||||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||||
@ -52,6 +52,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
const { setSurfaceShapePattern } = useRoofFn()
|
const { setSurfaceShapePattern } = useRoofFn()
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
||||||
|
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||||
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
||||||
|
|
||||||
const { setPolygonLinesActualSize } = usePolygon()
|
const { setPolygonLinesActualSize } = usePolygon()
|
||||||
@ -123,6 +124,15 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
if (openPoint && openPoint === 'canvasMenus') fetchBasicSettings(planNo, openPoint)
|
if (openPoint && openPoint === 'canvasMenus') fetchBasicSettings(planNo, openPoint)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재 활성 플랜이 변경될 때 currentRoof.planNo 업데이트
|
||||||
|
*/
|
||||||
|
useEffect(() => {
|
||||||
|
if (currentCanvasPlan?.planNo && currentRoof) {
|
||||||
|
setCurrentRoof(prev => ({ ...prev, planNo: currentCanvasPlan.planNo }))
|
||||||
|
}
|
||||||
|
}, [currentCanvasPlan?.planNo])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 배치면초기설정 데이터 조회 후 화면 오픈
|
* 배치면초기설정 데이터 조회 후 화면 오픈
|
||||||
*/
|
*/
|
||||||
@ -132,7 +142,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
setRaftCodes(raftCodeList)
|
setRaftCodes(raftCodeList)
|
||||||
setCurrentRoof({
|
setCurrentRoof({
|
||||||
...addedRoofs[0],
|
...addedRoofs[0],
|
||||||
planNo: planNo,
|
planNo: currentCanvasPlan?.planNo || planNo,
|
||||||
roofSizeSet: String(basicSetting.roofSizeSet),
|
roofSizeSet: String(basicSetting.roofSizeSet),
|
||||||
roofAngleSet: basicSetting.roofAngleSet,
|
roofAngleSet: basicSetting.roofAngleSet,
|
||||||
})
|
})
|
||||||
@ -221,7 +231,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
const handleSaveBtn = async () => {
|
const handleSaveBtn = async () => {
|
||||||
const roofInfo = {
|
const roofInfo = {
|
||||||
...currentRoof,
|
...currentRoof,
|
||||||
planNo: basicSetting.planNo,
|
planNo: currentCanvasPlan?.planNo || basicSetting.planNo,
|
||||||
roofCd: roofRef.roofCd.current?.value,
|
roofCd: roofRef.roofCd.current?.value,
|
||||||
width: roofRef.width.current?.value,
|
width: roofRef.width.current?.value,
|
||||||
length: roofRef.length.current?.value,
|
length: roofRef.length.current?.value,
|
||||||
@ -244,6 +254,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
*/
|
*/
|
||||||
basicSettingSave({
|
basicSettingSave({
|
||||||
...basicSetting,
|
...basicSetting,
|
||||||
|
planNo: currentCanvasPlan?.planNo || basicSetting.planNo,
|
||||||
/**
|
/**
|
||||||
* 선택된 지붕재 정보
|
* 선택된 지붕재 정보
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user