[1070] : [[도면] 신규물건 작성할 때 이전 도면값을 유지하고 있음]
[작업내용] : 도면 이동시 canvas 데이터 초기화
This commit is contained in:
parent
74e65ec5c6
commit
f8a46c30fa
@ -76,8 +76,12 @@ export default function CanvasFrame() {
|
|||||||
}
|
}
|
||||||
initEvent()
|
initEvent()
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
setSelectedMenu(null)
|
||||||
}
|
}
|
||||||
Object.keys(currentCanvasPlan).length > 0 && canvas && handleModuleSelectionTotal()
|
Object.keys(currentCanvasPlan).length > 0 && canvas && handleModuleSelectionTotal()
|
||||||
|
} else {
|
||||||
|
setSelectedMenu(null)
|
||||||
}
|
}
|
||||||
gridInit()
|
gridInit()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,17 @@
|
|||||||
import { useContext, useEffect, useState } from 'react'
|
import { useContext, useEffect, useState } from 'react'
|
||||||
import { usePathname, useRouter } from 'next/navigation'
|
import { usePathname, useRouter } from 'next/navigation'
|
||||||
|
|
||||||
import { useRecoilState, useResetRecoilState } from 'recoil'
|
import { useRecoilState, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||||
|
|
||||||
import { canvasState, currentCanvasPlanState, plansState, canvasSettingState, currentObjectState, moduleSetupSurfaceState } from '@/store/canvasAtom'
|
import {
|
||||||
|
canvasState,
|
||||||
|
currentCanvasPlanState,
|
||||||
|
plansState,
|
||||||
|
canvasSettingState,
|
||||||
|
currentObjectState,
|
||||||
|
moduleSetupSurfaceState,
|
||||||
|
currentMenuState,
|
||||||
|
} from '@/store/canvasAtom'
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
@ -33,7 +41,7 @@ export function usePlan(params = {}) {
|
|||||||
const { floorPlanState } = useContext(FloorPlanContext)
|
const { floorPlanState } = useContext(FloorPlanContext)
|
||||||
|
|
||||||
const [selectedPlan, setSelectedPlan] = useState(null)
|
const [selectedPlan, setSelectedPlan] = useState(null)
|
||||||
|
const setCurrentMenu = useSetRecoilState(currentMenuState)
|
||||||
const [canvas, setCanvas] = useRecoilState(canvasState)
|
const [canvas, setCanvas] = useRecoilState(canvasState)
|
||||||
|
|
||||||
const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState)
|
const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState)
|
||||||
@ -577,8 +585,10 @@ export function usePlan(params = {}) {
|
|||||||
* plan canvasStatus 초기화
|
* plan canvasStatus 초기화
|
||||||
*/
|
*/
|
||||||
const resetCanvasStatus = () => {
|
const resetCanvasStatus = () => {
|
||||||
setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: null }))
|
setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: null, objectNo: null, planNo: null, id: null }))
|
||||||
setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: null })))
|
setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: null })))
|
||||||
|
setCurrentMenu(null)
|
||||||
|
setSelectedMenu(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user