Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into dev
This commit is contained in:
commit
cb960baa0c
@ -22,7 +22,7 @@ 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'
|
import { corridorDimensionSelector, settingModalFirstOptionsState } from '@/store/settingAtom'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 메뉴 처리 훅
|
* 메뉴 처리 훅
|
||||||
@ -37,22 +37,11 @@ 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 [corridorDimension, setCorridorDimension] = useRecoilState(corridorDimensionSelector)
|
||||||
const handleMenu = (type) => {
|
const handleMenu = (type) => {
|
||||||
if (type === 'outline') {
|
if (type === 'outline') {
|
||||||
// 지붕 덮개 메뉴의 경우는 복도치수로 적용한다.
|
// 지붕 덮개 메뉴의 경우는 복도치수로 적용한다.
|
||||||
setSettingModalFirstOptions((prev) => {
|
setCorridorDimension(0)
|
||||||
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} />)
|
||||||
@ -83,18 +72,7 @@ export default function useMenu() {
|
|||||||
|
|
||||||
if (type === 'surface') {
|
if (type === 'surface') {
|
||||||
// 배치면 메뉴의 경우는 실치수로 적용한다.
|
// 배치면 메뉴의 경우는 실치수로 적용한다.
|
||||||
setSettingModalFirstOptions((prev) => {
|
setCorridorDimension(1)
|
||||||
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} />)
|
||||||
@ -116,18 +94,7 @@ export default function useMenu() {
|
|||||||
|
|
||||||
if (type === 'module') {
|
if (type === 'module') {
|
||||||
// 모듈,회로 구성 메뉴의 경우는 실치수로 적용한다.
|
// 모듈,회로 구성 메뉴의 경우는 실치수로 적용한다.
|
||||||
setSettingModalFirstOptions((prev) => {
|
setCorridorDimension(1)
|
||||||
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()
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import {
|
|||||||
roofMaterialsSelector,
|
roofMaterialsSelector,
|
||||||
selectedRoofMaterialSelector,
|
selectedRoofMaterialSelector,
|
||||||
settingModalFirstOptionsState,
|
settingModalFirstOptionsState,
|
||||||
|
corridorDimensionSelector,
|
||||||
} 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'
|
||||||
@ -59,7 +60,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)
|
const [corridorDimension, setCorridorDimension] = useRecoilState(corridorDimensionSelector)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
/** 배치면 초기설정에서 선택한 지붕재 배열 설정 */
|
/** 배치면 초기설정에서 선택한 지붕재 배열 설정 */
|
||||||
@ -436,18 +437,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
closeAll()
|
closeAll()
|
||||||
setSelectedMenu('surface')
|
setSelectedMenu('surface')
|
||||||
//지붕면 완성 후 실측치 로 보이도록 수정
|
//지붕면 완성 후 실측치 로 보이도록 수정
|
||||||
setSettingModalFirstOptions((prev) => {
|
setCorridorDimension(1)
|
||||||
return {
|
|
||||||
...prev,
|
|
||||||
dimensionDisplay: prev.dimensionDisplay.map((item, index) => {
|
|
||||||
if (index === 1) {
|
|
||||||
return { ...item, selected: true }
|
|
||||||
} else {
|
|
||||||
return { ...item, selected: false }
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
/** 모듈 선택 데이터 초기화 */
|
/** 모듈 선택 데이터 초기화 */
|
||||||
// modifyModuleSelectionData()
|
// modifyModuleSelectionData()
|
||||||
|
|||||||
@ -221,6 +221,22 @@ export const corridorDimensionSelector = selector({
|
|||||||
const settingModalFirstOptions = get(settingModalFirstOptionsState)
|
const settingModalFirstOptions = get(settingModalFirstOptionsState)
|
||||||
return settingModalFirstOptions.dimensionDisplay.find((option) => option.selected)
|
return settingModalFirstOptions.dimensionDisplay.find((option) => option.selected)
|
||||||
},
|
},
|
||||||
|
set: ({ set }, newValue) => {
|
||||||
|
//0 : 복도치수 , 1 : 실제치수
|
||||||
|
|
||||||
|
set(settingModalFirstOptionsState, (prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
dimensionDisplay: prev.dimensionDisplay.map((item, index) => {
|
||||||
|
if (index === newValue) {
|
||||||
|
return { ...item, selected: true }
|
||||||
|
} else {
|
||||||
|
return { ...item, selected: false }
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
dangerouslyAllowMutability: true,
|
dangerouslyAllowMutability: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user