From a0cca5fbca70fcb1665823dde421284fb18f1327 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Tue, 10 Jun 2025 10:34:51 +0900 Subject: [PATCH 1/6] =?UTF-8?q?[1092]=20:=20[=E7=89=B9=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E7=B5=84=E3=81=BF=E5=90=88=E3=82=8F=E3=81=9B=E3=81=AE=E6=99=82?= =?UTF-8?q?=E3=80=81=E5=9B=9E=E8=B7=AF=E5=89=B2=E4=BB=98=E5=BE=8C=E3=81=AE?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=83=AD=E3=83=BC=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E3=81=8C=E7=B5=82=E3=82=8F=E3=82=89=E3=81=AA?= =?UTF-8?q?=E3=81=84]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [작업내용] : 가대 생성시 api 호출 부분에 try catch로 로딩바 제거 로직 추가 --- src/hooks/common/useMasterController.js | 11 ++++++++--- src/hooks/usePlan.js | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index 21220726..dae68c69 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -212,9 +212,14 @@ export function useMasterController() { } const getQuotationItem = async (params) => { - return await post({ url: '/api/v1/master/getQuotationItem', data: params }).then((res) => { - return res - }) + return await post({ url: '/api/v1/master/getQuotationItem', data: params }) + .then((res) => { + return res + }) + .catch((error) => { + console.log('🚀 ~ getQuotationItem ~ error:', error) + setIsGlobalLoading(false) + }) } /** diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 52c60f80..ba8776d4 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -343,6 +343,7 @@ export function usePlan(params = {}) { }) .catch((error) => { swalFire({ text: error.message, icon: 'error' }) + setIsGlobalLoading(false) }) return rtn } From 6d78a45ebfadc076c4710570967e730ffb0c0a9d Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 10 Jun 2025 11:01:53 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[1099]=20:=20=E3=80=90HANASYS=20DESIGN?= =?UTF-8?q?=E3=80=91=E5=BC=B7=E5=8C=96=E6=96=BD=E5=B7=A5=E3=83=BB=E5=A4=9A?= =?UTF-8?q?=E9=9B=AA=E6=96=BD=E5=B7=A5=E3=81=A7=E5=8D=83=E9=B3=A5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E3=81=A7=E3=81=8D=E3=82=8B=E3=83=A2=E3=82=B8=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=AE=E7=A9=8D=E7=AE=97=E3=81=8C=E3=81=8A?= =?UTF-8?q?=E3=81=8B=E3=81=97=E3=81=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 지지금구 설치 이상 수정 --- src/hooks/module/useTrestle.js | 49 +++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 0aea8bfc..761ce983 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -53,6 +53,7 @@ export const useTrestle = () => { } }) surfaces.forEach((surface) => { + getSameLineModules(surface) const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId) const roofMaterialIndex = parent.roofMaterial.index if (+roofSizeSet === 3) { @@ -1573,7 +1574,9 @@ export const useTrestle = () => { drawBracketWithOutRack(module, rackIntvlPct, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) if (rackQty === 3 && !findSamePointInBottom(exposedBottomModules, module)) { // 해당 모듈과 같은 위치 맨 아래에 모듈이 없는 경우 하나 더 설치 필요 - drawBracketWithOutRack(module, rackIntvlPct / 3, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) + if (module.level % 2 !== 0) { + drawBracketWithOutRack(module, rackIntvlPct / 3, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) + } } if (rackQty === 4) { drawBracketWithOutRack(module, rackIntvlPct / 3, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) @@ -1581,10 +1584,13 @@ export const useTrestle = () => { }) rightExposedHalfBottomPoints.forEach((module) => { + console.log('rightmodule.level', module.level) drawBracketWithOutRack(module, rackIntvlPct, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) if (rackQty === 3 && !findSamePointInBottom(exposedBottomModules, module, direction)) { // 해당 모듈과 같은 위치 맨 아래에 모듈이 없는 경우 하나 더 설치 필요 - drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) + if (module.level % 2 === 0) { + drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) + } } if (rackQty === 4) { drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) @@ -2545,23 +2551,11 @@ export const useTrestle = () => { return result } - // 가장 왼쪽에 있는 모듈을 기준으로 같은 단에 있는 모듈들 파라미터 생성 - const getMostLeftModules = (surface, exposedBottomModules) => { + const getSameLineModules = (surface) => { const { direction, modules, isChidory } = surface - const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId) - const roofMaterialIndex = parent.roofMaterial.index - const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction - let isEaveBar = construction.setupCover - let isSnowGuard = construction.setupSnowCover - let { rackYn, cvrPlvrYn, moduleIntvlHor, moduleIntvlVer, rackQty, lessSupFitQty } = surface.trestleDetail - - if (rackYn === 'N') { - rackQty = lessSupFitQty - } // 같은 단에 있는 모듈들의 리스트 let sameLineModuleList = [] - let result = [] if (direction === 'south') { // 모듈의 top으로 groupBy @@ -2612,6 +2606,30 @@ export const useTrestle = () => { sameLineModuleList = Object.values(groupedByLeft).sort((a, b) => a[0].left - b[0].left) } + sameLineModuleList.forEach((modules, index) => { + modules.forEach((module) => { + module.set({ level: index + 1 }) // 각 모듈에 level 속성 추가 + }) + }) + + return sameLineModuleList + } + + // 가장 왼쪽에 있는 모듈을 기준으로 같은 단에 있는 모듈들 파라미터 생성 + const getMostLeftModules = (surface, exposedBottomModules) => { + const { direction, modules, isChidory } = surface + const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId) + const roofMaterialIndex = parent.roofMaterial.index + const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction + let isEaveBar = construction.setupCover + let isSnowGuard = construction.setupSnowCover + let { rackYn, cvrPlvrYn, moduleIntvlHor, moduleIntvlVer, rackQty, lessSupFitQty } = surface.trestleDetail + let result = [] + if (rackYn === 'N') { + rackQty = lessSupFitQty + } + const sameLineModuleList = getSameLineModules(surface, exposedBottomModules) + sameLineModuleList.forEach((modules, index) => { const moduleRowResultData = { seq: index, @@ -2659,6 +2677,7 @@ export const useTrestle = () => { bottomLeftModule, bottomRightModule, } = findSideModule(module, surface) + if (bottomModule) { moduleRowResultData.touchedSurfaceCnt++ if (rackYn === 'N') { From 4ca3e4eae65e9cf70a829a4717d0484cb6f38cea Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 10 Jun 2025 11:06:17 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[1085]=20:=20=E3=80=90HANASYS=20DESIGN?= =?UTF-8?q?=E3=80=91=E6=9E=B6=E5=8F=B0=E8=A1=A8=E7=A4=BA=E3=81=AE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 가대의 경우도 25% 적용할 수 있도록 수정 --- src/hooks/module/useTrestle.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 761ce983..e2a40068 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -1060,7 +1060,8 @@ export const useTrestle = () => { const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId) const degree = getDegreeByChon(roof.roofMaterial.pitch) - + rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경 + rackIntvlPct = 100 / rackIntvlPct // 퍼센트로 변경 const moduleLeft = lastX ?? left const moduleTop = lastY ?? top From 68980a8acabbd16bb1d0b844804226d6ed7fea28 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 10 Jun 2025 13:16:41 +0900 Subject: [PATCH 4/6] =?UTF-8?q?seq=EB=8A=94=201=EB=B6=80=ED=84=B0=20?= =?UTF-8?q?=EC=8B=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index e2a40068..04d2a264 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -2633,7 +2633,7 @@ export const useTrestle = () => { sameLineModuleList.forEach((modules, index) => { const moduleRowResultData = { - seq: index, + seq: index + 1, moduleItemId: modules[0].moduleInfo.itemId, moduleTpCd: modules[0].moduleInfo.itemTp, moduleCnt: modules.length, From 08606adae6a2ae53c1dbcea793e2095bfce63653 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 10 Jun 2025 13:58:59 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EC=B2=98=EB=A7=88=EC=BB=A4=EB=B2=84=20?= =?UTF-8?q?=EC=B5=9C=EB=8C=80=20=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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 04d2a264..1ce415ef 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -68,6 +68,7 @@ export const useTrestle = () => { let moduleRowsTotCnt = 0 let isEaveBar = construction.setupCover let isSnowGuard = construction.setupSnowCover + let cvrLmtRow = construction.cvrLmtRow const direction = parent.direction const rack = surface.trestleDetail.rack let { rackQty, rackIntvlPct, rackYn, cvrPlvrYn, lessSupFitIntvlPct, lessSupFitQty } = surface.trestleDetail @@ -150,6 +151,10 @@ export const useTrestle = () => { if (isEaveBar) { // 처마력바설치 true인 경우 설치 exposedBottomModules.forEach((module) => { + const level = module.level + if (level > cvrLmtRow) { + return + } const bottomPoints = findTopTwoPoints([...module.getCurrentPoints()], direction) if (!bottomPoints) return const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], { @@ -168,6 +173,10 @@ export const useTrestle = () => { if (isChidory && cvrPlvrYn === 'Y') { leftExposedHalfBottomModules.forEach((module) => { + const level = module.level + if (level > cvrLmtRow) { + return + } const bottomPoints = findTopTwoPoints([...module.getCurrentPoints()], direction) let barPoints = [] //설치해야할 반처마커버 포인트를 방향에 따라 설정 @@ -198,6 +207,10 @@ export const useTrestle = () => { }) rightExposedHalfBottomPoints.forEach((module) => { + const level = module.level + if (level > cvrLmtRow) { + return + } const bottomPoints = findTopTwoPoints([...module.points], direction) let barPoints = [] //설치해야할 반처마커버 포인트를 방향에 따라 설정 From 765cc9c43fd2475e727834e40befce3482e2cb33 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 10 Jun 2025 14:04:19 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=EC=B2=98=EB=A7=88=EC=BB=A4=EB=B2=84=20?= =?UTF-8?q?=EC=B5=9C=EB=8C=80=20=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 | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 1ce415ef..643b8e03 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -2637,6 +2637,7 @@ export const useTrestle = () => { const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction let isEaveBar = construction.setupCover let isSnowGuard = construction.setupSnowCover + let cvrLmtRow = construction.cvrLmtRow let { rackYn, cvrPlvrYn, moduleIntvlHor, moduleIntvlVer, rackQty, lessSupFitQty } = surface.trestleDetail let result = [] if (rackYn === 'N') { @@ -2678,6 +2679,7 @@ export const useTrestle = () => { } // 모듈 하면,최하면 등 구해야함 modules.forEach((module, index) => { + const level = module.level // 해당 모듈 주변에 다른 모듈이 있는지 확인 let { bottomModule, @@ -2735,10 +2737,12 @@ export const useTrestle = () => { } if (cvrPlvrYn === 'Y') { - moduleRowResultData.eavesHalfCnt++ - if (bottomLeftModule || bottomRightModule || halfBottomLeftModule || halfBottomRightModule) { - //처마커버 한개 노출 추가 - moduleRowResultData.exposedSideEavesCnt++ + if (level <= cvrLmtRow) { + moduleRowResultData.eavesHalfCnt++ + if (bottomLeftModule || bottomRightModule || halfBottomLeftModule || halfBottomRightModule) { + //처마커버 한개 노출 추가 + moduleRowResultData.exposedSideEavesCnt++ + } } } } else { @@ -2747,13 +2751,15 @@ export const useTrestle = () => { moduleRowResultData.exposedBottomBracketCnt += rackQty } if (isEaveBar) { - moduleRowResultData.eavesCnt++ - if ((rightModule && !leftModule) || (!rightModule && leftModule)) { - // 둘중 하나가 없는경우는 처마커버 노출 추가 - moduleRowResultData.exposedSideEavesCnt++ - } else if (!rightModule && !leftModule) { - // 양쪽 둘다 없는경우는 처마커버 노출 2개 추가 - moduleRowResultData.exposedSideEavesCnt += 2 + if (level <= cvrLmtRow) { + moduleRowResultData.eavesCnt++ + if ((rightModule && !leftModule) || (!rightModule && leftModule)) { + // 둘중 하나가 없는경우는 처마커버 노출 추가 + moduleRowResultData.exposedSideEavesCnt++ + } else if (!rightModule && !leftModule) { + // 양쪽 둘다 없는경우는 처마커버 노출 2개 추가 + moduleRowResultData.exposedSideEavesCnt += 2 + } } } }