Merge branch 'dev' into dev-yj
This commit is contained in:
commit
fcccadd47f
@ -605,7 +605,7 @@ export const useTrestle = () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
// 에러 발생시 가대 초기화
|
// 에러 발생시 가대 초기화
|
||||||
console.error(e)
|
console.error(e)
|
||||||
// clear()
|
clear()
|
||||||
setViewCircuitNumberTexts(true)
|
setViewCircuitNumberTexts(true)
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
return false
|
return false
|
||||||
@ -988,12 +988,20 @@ export const useTrestle = () => {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// rack을 그린다.
|
||||||
const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => {
|
const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => {
|
||||||
if (!rackInfos) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const { width, height, left, top, lastX, lastY, surfaceId } = module
|
const { width, height, left, top, lastX, lastY, surfaceId } = module
|
||||||
const surface = canvas.getObjects().find((obj) => obj.id === surfaceId)
|
const surface = canvas.getObjects().find((obj) => obj.id === surfaceId)
|
||||||
|
if (!rackInfos) {
|
||||||
|
const maxRows = surface.trestleDetail.moduleMaxRows
|
||||||
|
const maxCols = surface.trestleDetail.moduleMaxCols
|
||||||
|
const msg = `選択した家で設置可能
|
||||||
|
モジュールの最大段数は${maxRows}、最大列数は${maxCols}です。
|
||||||
|
上限より上部に取り付けたモジュールを削除してください。`
|
||||||
|
swalFire({ title: msg, type: 'alert' })
|
||||||
|
throw new Error('rackInfos is null')
|
||||||
|
}
|
||||||
|
|
||||||
const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId)
|
const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId)
|
||||||
const degree = getDegreeByChon(roof.roofMaterial.pitch)
|
const degree = getDegreeByChon(roof.roofMaterial.pitch)
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
|||||||
import { compasDegAtom } from '@/store/orientationAtom'
|
import { compasDegAtom } from '@/store/orientationAtom'
|
||||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
||||||
|
import { useCanvasMenu } from './common/useCanvasMenu'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 플랜 처리 훅
|
* 플랜 처리 훅
|
||||||
@ -58,6 +59,7 @@ export function usePlan(params = {}) {
|
|||||||
const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom)
|
const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom)
|
||||||
const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState)
|
const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState)
|
||||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState)
|
||||||
|
const { selectedMenu, setSelectedMenu } = useCanvasMenu()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 마우스 포인터의 가이드라인 제거
|
* 마우스 포인터의 가이드라인 제거
|
||||||
@ -224,6 +226,7 @@ export function usePlan(params = {}) {
|
|||||||
fetchBasicSettings(newPlan.planNo, null)
|
fetchBasicSettings(newPlan.planNo, null)
|
||||||
} else {
|
} else {
|
||||||
if (isCopy) {
|
if (isCopy) {
|
||||||
|
const currentSelectedMenu = selectedMenu
|
||||||
/* 복제 플랜 생성인 경우 현재 캔버스 데이터를 복제 */
|
/* 복제 플랜 생성인 경우 현재 캔버스 데이터를 복제 */
|
||||||
newPlan.canvasStatus = currentCanvasData()
|
newPlan.canvasStatus = currentCanvasData()
|
||||||
newPlan.bgImageName = currentCanvasPlan?.bgImageName ?? null
|
newPlan.bgImageName = currentCanvasPlan?.bgImageName ?? null
|
||||||
@ -284,6 +287,10 @@ export function usePlan(params = {}) {
|
|||||||
roofSurfaceList.forEach((surface) => {
|
roofSurfaceList.forEach((surface) => {
|
||||||
surface.modules = modules.filter((module) => module.surfaceId === surface.id)
|
surface.modules = modules.filter((module) => module.surfaceId === surface.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
setSelectedMenu(currentSelectedMenu)
|
||||||
|
} else {
|
||||||
|
setSelectedMenu('placement')
|
||||||
}
|
}
|
||||||
setCurrentCanvasPlan(newPlan)
|
setCurrentCanvasPlan(newPlan)
|
||||||
setPlans((plans) => [...plans.map((plan) => ({ ...plan, isCurrent: false })), newPlan])
|
setPlans((plans) => [...plans.map((plan) => ({ ...plan, isCurrent: false })), newPlan])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user