저장 후 바로 회로설정 선택 시 방위 설정 안되있는 경우 처리 추가
This commit is contained in:
parent
5d37f0feac
commit
c95267e1bd
@ -17,17 +17,21 @@ import { useState } from 'react'
|
|||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { currentMenuState } from '@/store/canvasAtom'
|
import { canvasState, currentMenuState } from '@/store/canvasAtom'
|
||||||
import { MENU } from '@/common/common'
|
import { MENU } from '@/common/common'
|
||||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||||
|
import { usePolygon } from '@/hooks/usePolygon'
|
||||||
|
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||||
|
|
||||||
export default function useMenu() {
|
export default function useMenu() {
|
||||||
const menus = []
|
const menus = []
|
||||||
const currentMenu = useRecoilValue(currentMenuState)
|
const currentMenu = useRecoilValue(currentMenuState)
|
||||||
|
const canvas = useRecoilValue(canvasState)
|
||||||
const [popupId, setPopupId] = useState(uuidv4())
|
const [popupId, setPopupId] = useState(uuidv4())
|
||||||
const { addPopup } = usePopup()
|
const { addPopup } = usePopup()
|
||||||
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
||||||
const { clear: trestleClear } = useTrestle()
|
const { clear: trestleClear } = useTrestle()
|
||||||
|
const { nextStep } = useOrientation()
|
||||||
const handleMenu = (type) => {
|
const handleMenu = (type) => {
|
||||||
if (type === 'outline') {
|
if (type === 'outline') {
|
||||||
switch (currentMenu) {
|
switch (currentMenu) {
|
||||||
@ -85,6 +89,10 @@ export default function useMenu() {
|
|||||||
addPopup(popupId, 1, <BasicSetting id={popupId} />)
|
addPopup(popupId, 1, <BasicSetting id={popupId} />)
|
||||||
break
|
break
|
||||||
case MENU.MODULE_CIRCUIT_SETTING.CIRCUIT_TRESTLE_SETTING:
|
case MENU.MODULE_CIRCUIT_SETTING.CIRCUIT_TRESTLE_SETTING:
|
||||||
|
const hasModules = canvas.getObjects().some((obj) => obj.name === 'module')
|
||||||
|
if (hasModules) {
|
||||||
|
nextStep()
|
||||||
|
}
|
||||||
addPopup(popupId, 1, <CircuitTrestleSetting id={popupId} />)
|
addPopup(popupId, 1, <CircuitTrestleSetting id={popupId} />)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@ -646,7 +646,12 @@ export const useTrestle = () => {
|
|||||||
const params = { trestles, pcses, modules }
|
const params = { trestles, pcses, modules }
|
||||||
|
|
||||||
//견적서 itemList 조회
|
//견적서 itemList 조회
|
||||||
const { data: itemList, data2, result } = await getQuotationItem(params)
|
const { data, data2, result } = await getQuotationItem(params)
|
||||||
|
let itemList
|
||||||
|
if (!data) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
itemList = data
|
||||||
|
|
||||||
if (result.resultCode === 'E') {
|
if (result.resultCode === 'E') {
|
||||||
swalFire({ text: result.resultMsg, icon: 'error' })
|
swalFire({ text: result.resultMsg, icon: 'error' })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user