From a11867a49d48e2a377e465040023fdbea686d8dd Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 31 Jan 2025 15:56:52 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=B5=9C=EB=8C=80=20?= =?UTF-8?q?=EB=8B=A8=EC=88=98=20=EA=B3=84=EC=82=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 5730f574..ccc8e82f 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -182,6 +182,8 @@ export const useTrestle = () => { const horizontal = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlHor : surface.trestleDetail.moduleIntvlVer const vertical = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlVer : surface.trestleDetail.moduleIntvlHor + + let mostRowsModule = 0 // 가장 많은 모듈의 줄 수 // 가대 설치를 위한 가장 아래 모듈로부터 위로 몇단인지 계산 // 오른쪽,왼쪽 둘 다 아래에 아무것도 없는, 처마 커버를 필요로 하는 모듈 exposedBottomModules.forEach((module) => { @@ -299,7 +301,7 @@ export const useTrestle = () => { return rack.value.moduleRows === centerRows })?.value.racks - moduleRowsTotCnt = Math.max(leftRows, rightRows, centerRows) + mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule) if (rackYn === 'Y') { drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn) @@ -361,7 +363,7 @@ export const useTrestle = () => { const leftRacks = rackInfos.find((rack) => { return rack.value.moduleRows === leftRows })?.value.racks - moduleRowsTotCnt = Math.max(leftRows, moduleRowsTotCnt) + mostRowsModule = Math.max(leftRows, mostRowsModule) if (rackYn === 'Y') { drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn) } @@ -415,7 +417,7 @@ export const useTrestle = () => { return rack.value.moduleRows === rightRows })?.value.racks - moduleRowsTotCnt = Math.max(rightRows, moduleRowsTotCnt) + mostRowsModule = Math.max(rightRows, mostRowsModule) // 해당 rack으로 그려준다. if (rackYn === 'Y') { drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn) @@ -424,7 +426,7 @@ export const useTrestle = () => { module.set({ rightRows }) }) - surface.set({ moduleRowsTotCnt }) + surface.set({ moduleRowsTotCnt: mostRowsModule }) if (rackYn === 'N') { // rack이 없을경우 @@ -1642,6 +1644,7 @@ export const useTrestle = () => { if (cvrPlvrYn === 'Y') { moduleRowResultData.eavesHalfCnt++ if (bottomLeftModule || bottomRightModule || halfBottomLeftModule || halfBottomRightModule) { + //처마커버 한개 노출 추가 moduleRowResultData.exposedSideEavesCnt++ } } @@ -1649,10 +1652,10 @@ export const useTrestle = () => { moduleRowResultData.exposedBottomCnt++ if (isEaveBar) { moduleRowResultData.eavesCnt++ - } - - if (!(leftModule && rightModule)) { - moduleRowResultData.exposedSideEavesCnt++ + if ((rightModule && !leftModule) || (!rightModule && leftModule)) { + // 둘중 하나가 없는경우는 처마커버 노출 추가 + moduleRowResultData.exposedSideEavesCnt++ + } } } }