가대 그릴 수 없는 경우 alert 추가
This commit is contained in:
parent
6195e7fb4a
commit
62983ca643
@ -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)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user