📌fix: 견적서 생성 호출시 로딩바 추가
This commit is contained in:
parent
62b86764d5
commit
18b9cafbce
@ -72,10 +72,10 @@ export default async function RootLayout({ children }) {
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
</QcastProvider>
|
||||
)}
|
||||
<QModal />
|
||||
<PopupManager />
|
||||
</QcastProvider>
|
||||
)}
|
||||
</body>
|
||||
</html>
|
||||
</GlobalDataProvider>
|
||||
|
||||
@ -24,6 +24,7 @@ import { useCircuitTrestle } from '@/hooks/useCirCuitTrestle'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
import { useImgLoader } from '@/hooks/floorPlan/useImgLoader'
|
||||
import { usePlan } from '@/hooks/usePlan'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
|
||||
const ALLOCATION_TYPE = {
|
||||
AUTO: 'auto',
|
||||
@ -56,6 +57,8 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
const { handleCanvasToPng } = useImgLoader()
|
||||
const { saveCanvas } = usePlan()
|
||||
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
|
||||
const {
|
||||
makers,
|
||||
setMakers,
|
||||
@ -324,6 +327,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
|
||||
// 회로할당(승압설정) 저장 버튼 클릭 시
|
||||
const onApply = async () => {
|
||||
setIsGlobalLoading(true)
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
|
||||
@ -4,6 +4,8 @@ import { useCanvas } from '../useCanvas'
|
||||
import { useAxios } from '../useAxios'
|
||||
import { usePlan } from '../usePlan'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { useContext } from 'react'
|
||||
|
||||
/**
|
||||
* 이미지 로더 hook
|
||||
@ -13,7 +15,7 @@ export function useImgLoader() {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { currentCanvasPlan } = usePlan()
|
||||
const { post } = useAxios()
|
||||
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
/**
|
||||
* 이미지 저장 시 왼쪽 위, 오른쪽 아래 좌표
|
||||
* return [start, end]
|
||||
@ -39,6 +41,7 @@ export function useImgLoader() {
|
||||
* @param {integer} type 1: 모듈만 있는 상태, 2: 가대까지 올린 상태
|
||||
*/
|
||||
const handleCanvasToPng = async (type) => {
|
||||
try {
|
||||
removeMouseLines()
|
||||
|
||||
canvas.getObjects('image').forEach((obj) => {
|
||||
@ -81,6 +84,10 @@ export function useImgLoader() {
|
||||
console.log('🚀 ~ handleCanvasToPng ~ result:', result)
|
||||
|
||||
return result
|
||||
} catch (e) {
|
||||
setIsGlobalLoading(false)
|
||||
console.log('🚀 ~ handleCanvasToPng ~ e:', e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -598,6 +598,7 @@ export const useTrestle = () => {
|
||||
console.error(e)
|
||||
// clear()
|
||||
setViewCircuitNumberTexts(true)
|
||||
setIsGlobalLoading(false)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@ export function useEstimate() {
|
||||
moveEstimate(planNo, objectNo)
|
||||
})
|
||||
.catch((error) => {
|
||||
setIsGlobalLoading(false)
|
||||
swalFire({ text: error.message, icon: 'error' })
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user