Compare commits
No commits in common. "d1045fa0dfed952db49e0465965d81b9c8b69c28" and "4bf90e7dfbd6be44e0729dd2a550ad471c9a236e" have entirely different histories.
d1045fa0df
...
4bf90e7dfb
@ -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, currentCanvasPlanState, currentMenuState } from '@/store/canvasAtom'
|
import { canvasState, canvasSettingState, 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,7 +52,6 @@ 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()
|
||||||
@ -124,15 +123,6 @@ 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])
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 배치면초기설정 데이터 조회 후 화면 오픈
|
* 배치면초기설정 데이터 조회 후 화면 오픈
|
||||||
*/
|
*/
|
||||||
@ -142,7 +132,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
setRaftCodes(raftCodeList)
|
setRaftCodes(raftCodeList)
|
||||||
setCurrentRoof({
|
setCurrentRoof({
|
||||||
...addedRoofs[0],
|
...addedRoofs[0],
|
||||||
planNo: currentCanvasPlan?.planNo || planNo,
|
planNo: planNo,
|
||||||
roofSizeSet: String(basicSetting.roofSizeSet),
|
roofSizeSet: String(basicSetting.roofSizeSet),
|
||||||
roofAngleSet: basicSetting.roofAngleSet,
|
roofAngleSet: basicSetting.roofAngleSet,
|
||||||
})
|
})
|
||||||
@ -231,7 +221,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: currentCanvasPlan?.planNo || basicSetting.planNo,
|
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,
|
||||||
@ -254,7 +244,6 @@ 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