지붕덮개 메뉴 - 복도치수 적용
그 외 메뉴 - 실치수 적용
This commit is contained in:
parent
bcc91e7609
commit
a3b62db4fa
@ -16,12 +16,13 @@ import { usePopup } from '@/hooks/usePopup'
|
|||||||
import { useState } from 'react'
|
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 { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { canvasState, 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 { usePolygon } from '@/hooks/usePolygon'
|
||||||
import { useOrientation } from '@/hooks/module/useOrientation'
|
import { useOrientation } from '@/hooks/module/useOrientation'
|
||||||
|
import { settingModalFirstOptionsState } from '@/store/settingAtom'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 메뉴 처리 훅
|
* 메뉴 처리 훅
|
||||||
@ -36,8 +37,21 @@ export default function useMenu() {
|
|||||||
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
||||||
const { clear: trestleClear, setAllModuleSurfaceIsComplete } = useTrestle()
|
const { clear: trestleClear, setAllModuleSurfaceIsComplete } = useTrestle()
|
||||||
const { nextStep } = useOrientation()
|
const { nextStep } = useOrientation()
|
||||||
|
const [settingModalFirstOptions, setSettingModalFirstOptions] = useRecoilState(settingModalFirstOptionsState)
|
||||||
const handleMenu = (type) => {
|
const handleMenu = (type) => {
|
||||||
if (type === 'outline') {
|
if (type === 'outline') {
|
||||||
|
setSettingModalFirstOptions((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
dimensionDisplay: prev.dimensionDisplay.map((item, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
return { ...item, selected: true }
|
||||||
|
} else {
|
||||||
|
return { ...item, selected: false }
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
})
|
||||||
switch (currentMenu) {
|
switch (currentMenu) {
|
||||||
case MENU.ROOF_COVERING.EXTERIOR_WALL_LINE:
|
case MENU.ROOF_COVERING.EXTERIOR_WALL_LINE:
|
||||||
addPopup(popupId, 1, <WallLineSetting id={popupId} />)
|
addPopup(popupId, 1, <WallLineSetting id={popupId} />)
|
||||||
@ -67,6 +81,18 @@ export default function useMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'surface') {
|
if (type === 'surface') {
|
||||||
|
setSettingModalFirstOptions((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
dimensionDisplay: prev.dimensionDisplay.map((item, index) => {
|
||||||
|
if (index === 1) {
|
||||||
|
return { ...item, selected: true }
|
||||||
|
} else {
|
||||||
|
return { ...item, selected: false }
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
})
|
||||||
switch (currentMenu) {
|
switch (currentMenu) {
|
||||||
// case MENU.BATCH_CANVAS.SLOPE_SETTING:
|
// case MENU.BATCH_CANVAS.SLOPE_SETTING:
|
||||||
// addPopup(popupId, 1, <Slope id={popupId} />)
|
// addPopup(popupId, 1, <Slope id={popupId} />)
|
||||||
@ -87,6 +113,18 @@ export default function useMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'module') {
|
if (type === 'module') {
|
||||||
|
setSettingModalFirstOptions((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
dimensionDisplay: prev.dimensionDisplay.map((item, index) => {
|
||||||
|
if (index === 1) {
|
||||||
|
return { ...item, selected: true }
|
||||||
|
} else {
|
||||||
|
return { ...item, selected: false }
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
})
|
||||||
switch (currentMenu) {
|
switch (currentMenu) {
|
||||||
case MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING:
|
case MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING:
|
||||||
trestleClear()
|
trestleClear()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user