dev #665
@ -16,7 +16,7 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
||||
|
||||
import { getChonByDegree, getDegreeByChon } from '@/util/canvas-util'
|
||||
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 { MENU, POLYGON_TYPE } from '@/common/common'
|
||||
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 canvas = useRecoilValue(canvasState)
|
||||
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
||||
|
||||
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)
|
||||
}, [])
|
||||
|
||||
/**
|
||||
* 현재 활성 플랜이 변경될 때 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)
|
||||
setCurrentRoof({
|
||||
...addedRoofs[0],
|
||||
planNo: planNo,
|
||||
planNo: currentCanvasPlan?.planNo || planNo,
|
||||
roofSizeSet: String(basicSetting.roofSizeSet),
|
||||
roofAngleSet: basicSetting.roofAngleSet,
|
||||
})
|
||||
@ -221,7 +231,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
const handleSaveBtn = async () => {
|
||||
const roofInfo = {
|
||||
...currentRoof,
|
||||
planNo: basicSetting.planNo,
|
||||
planNo: currentCanvasPlan?.planNo || basicSetting.planNo,
|
||||
roofCd: roofRef.roofCd.current?.value,
|
||||
width: roofRef.width.current?.value,
|
||||
length: roofRef.length.current?.value,
|
||||
@ -244,6 +254,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
||||
*/
|
||||
basicSettingSave({
|
||||
...basicSetting,
|
||||
planNo: currentCanvasPlan?.planNo || basicSetting.planNo,
|
||||
/**
|
||||
* 선택된 지붕재 정보
|
||||
*/
|
||||
|
||||
@ -1059,7 +1059,7 @@ export function useModule() {
|
||||
}
|
||||
|
||||
const isOutsideSurface = (module, moduleSetupSurface) => {
|
||||
return !checkModuleDisjointSurface(polygonToTurfPolygon(module, true), polygonToTurfPolygon(moduleSetupSurface, true))
|
||||
return !checkModuleDisjointSurface(polygonToTurfPolygon(module, true), polygonToTurfPolygon(moduleSetupSurface, true), 0.5)
|
||||
}
|
||||
|
||||
const getRowModules = (target) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user