Merge branch 'dev' into feature/yj-layoutSetup
This commit is contained in:
commit
a08c609caa
@ -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,22 @@ 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 +82,19 @@ 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 +115,19 @@ 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()
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import {
|
|||||||
roofDisplaySelector,
|
roofDisplaySelector,
|
||||||
roofMaterialsSelector,
|
roofMaterialsSelector,
|
||||||
selectedRoofMaterialSelector,
|
selectedRoofMaterialSelector,
|
||||||
|
settingModalFirstOptionsState,
|
||||||
} from '@/store/settingAtom'
|
} from '@/store/settingAtom'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
@ -58,6 +59,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
|
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
|
||||||
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState)
|
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState)
|
||||||
const resetPoints = useResetRecoilState(outerLinePointsState)
|
const resetPoints = useResetRecoilState(outerLinePointsState)
|
||||||
|
const [settingModalFirstOptions, setSettingModalFirstOptions] = useRecoilState(settingModalFirstOptionsState)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
/** 배치면 초기설정에서 선택한 지붕재 배열 설정 */
|
/** 배치면 초기설정에서 선택한 지붕재 배열 설정 */
|
||||||
@ -433,6 +435,19 @@ export function useRoofAllocationSetting(id) {
|
|||||||
setEditingLines([])
|
setEditingLines([])
|
||||||
closeAll()
|
closeAll()
|
||||||
setSelectedMenu('surface')
|
setSelectedMenu('surface')
|
||||||
|
//지붕면 완성 후 실측치 로 보이도록 수정
|
||||||
|
setSettingModalFirstOptions((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
dimensionDisplay: prev.dimensionDisplay.map((item, index) => {
|
||||||
|
if (index === 1) {
|
||||||
|
return { ...item, selected: true }
|
||||||
|
} else {
|
||||||
|
return { ...item, selected: false }
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/** 모듈 선택 데이터 초기화 */
|
/** 모듈 선택 데이터 초기화 */
|
||||||
// modifyModuleSelectionData()
|
// modifyModuleSelectionData()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user