Merge branch 'dev' into dev-yj
This commit is contained in:
commit
0861b7b70f
@ -33,7 +33,7 @@ export default function CanvasFrame() {
|
||||
const currentMenu = useRecoilValue(currentMenuState)
|
||||
const { floorPlanState } = useContext(FloorPlanContext)
|
||||
const { contextMenu, handleClick } = useContextMenu()
|
||||
const { currentCanvasPlan } = usePlan()
|
||||
const { plans, currentCanvasPlan } = usePlan()
|
||||
const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
const resetModuleStatisticsState = useResetRecoilState(moduleStatisticsState)
|
||||
@ -46,11 +46,14 @@ export default function CanvasFrame() {
|
||||
const loadCanvas = () => {
|
||||
if (canvas) {
|
||||
canvas?.clear() // 캔버스를 초기화합니다.
|
||||
if (currentCanvasPlan?.canvasStatus && floorPlanState.objectNo === currentCanvasPlan.objectNo) {
|
||||
canvas?.loadFromJSON(JSON.parse(currentCanvasPlan.canvasStatus), function () {
|
||||
canvasLoadInit() //config된 상태로 캔버스 객체를 그린다
|
||||
canvas?.renderAll() // 캔버스를 다시 그립니다.
|
||||
})
|
||||
if (currentCanvasPlan) {
|
||||
const plan = plans.find((plan) => plan.id === currentCanvasPlan.id)
|
||||
if (plan?.canvasStatus && floorPlanState.objectNo === currentCanvasPlan.objectNo) {
|
||||
canvas?.loadFromJSON(JSON.parse(plan.canvasStatus), function () {
|
||||
canvasLoadInit() //config된 상태로 캔버스 객체를 그린다
|
||||
canvas?.renderAll() // 캔버스를 다시 그립니다.
|
||||
})
|
||||
}
|
||||
}
|
||||
gridInit()
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ import { useEstimate } from '@/hooks/useEstimate'
|
||||
import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
import { useImgLoader } from '@/hooks/floorPlan/useImgLoader'
|
||||
import { usePlan } from '@/hooks/usePlan'
|
||||
|
||||
const ALLOCATION_TYPE = {
|
||||
AUTO: 'auto',
|
||||
@ -53,6 +54,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
const [seletedOption, setSeletedOption] = useState(null)
|
||||
|
||||
const { handleCanvasToPng } = useImgLoader()
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
const {
|
||||
makers,
|
||||
@ -345,6 +347,9 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
if (result) {
|
||||
handleCanvasToPng(2)
|
||||
setViewCircuitNumberTexts(true)
|
||||
// 캔버스 저장
|
||||
await saveCanvas(false)
|
||||
// 견적서 저장
|
||||
await saveEstimate(result)
|
||||
}
|
||||
// removeNotAllocationModules()
|
||||
|
||||
@ -5,7 +5,6 @@ import { useRecoilValue } from 'recoil'
|
||||
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
import { usePlan } from '@/hooks/usePlan'
|
||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { currentCanvasPlanState } from '@/store/canvasAtom'
|
||||
@ -20,7 +19,6 @@ export function useEstimate() {
|
||||
|
||||
const { promisePost } = useAxios()
|
||||
const { swalFire } = useSwal()
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
/**
|
||||
* 도면 견적서 저장
|
||||
@ -58,8 +56,7 @@ export function useEstimate() {
|
||||
|
||||
await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData })
|
||||
.then(async () => {
|
||||
// 견적서 저장이 완료되면 캔버스 저장 후 견적서 페이지로 이동
|
||||
await saveCanvas(false)
|
||||
// 견적서 저장이 완료되면 견적서 페이지로 이동
|
||||
moveEstimate(planNo, objectNo)
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user