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