diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 098f4c7e..f6556af2 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -1555,7 +1555,28 @@ export const useTrestle = () => { //랙 없음 인 경우 지지금구 설치 const installBracketWithOutRack = (surface, exposedBottomModules, leftExposedHalfBottomModules, rightExposedHalfBottomPoints, isChidory) => { - let { rackQty, rackIntvlPct, moduleIntvlHor, moduleIntvlVer, lessSupFitQty, lessSupFitIntvlPct } = surface.trestleDetail + let { rackQty, rackIntvlPct, moduleIntvlHor, moduleIntvlVer, lessSupFitQty, lessSupFitIntvlPct, moduleMaxRows } = surface.trestleDetail + const checkList = [] + + exposedBottomModules.forEach((module) => { + checkList.push(module.leftRows, module.rightRows, module.centerRows) + }) + + leftExposedHalfBottomModules.forEach((module) => { + checkList.push(module.leftRows, module.rightRows, module.centerRows) + }) + + rightExposedHalfBottomPoints.forEach((module) => { + checkList.push(module.leftRows, module.rightRows, module.centerRows) + }) + const isAllCheckMaxRows = checkList.every((item) => item <= moduleMaxRows) + + if (!isAllCheckMaxRows) { + const msg = `段数の上限は${moduleMaxRows}段です。 上限より上の段には設置できません` + swalFire({ title: msg, type: 'alert' }) + throw new Error('moduleMaxRows exceeded') + } + rackQty = lessSupFitQty rackIntvlPct = lessSupFitIntvlPct const direction = surface.direction @@ -1647,6 +1668,7 @@ export const useTrestle = () => { // 랙 없음의 지지금구를 그린다. const drawBracketWithOutRack = (module, rackIntvlPct, count, l, direction, moduleIntvlHor, moduleIntvlVer) => { const { leftFindModuleList, rightFindModuleList, centerFindModuleList } = module + rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경 rackIntvlPct = 100 / rackIntvlPct // 퍼센트로 변경