From 8feefb0b7e0223a54c0605bc0ab411c4705e2699 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 20 Jun 2025 14:22:23 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9E=99=20=EC=97=86=EC=9D=8C=EC=9D=98=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EB=AA=A8=EB=93=88=20=EC=B5=9C=EB=8C=80=20?= =?UTF-8?q?=EB=8B=A8=EC=88=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 // 퍼센트로 변경 -- 2.47.2