diff --git a/src/app/api/image/canvas/route.js b/src/app/api/image/canvas/route.js index 347c88df..9f4e3f52 100644 --- a/src/app/api/image/canvas/route.js +++ b/src/app/api/image/canvas/route.js @@ -100,14 +100,11 @@ const resizeImage = async (image) => { let finalWidth = Math.round(image.bitmap.width * scale) let finalHeight = Math.round(image.bitmap.height * scale) - - if (scale < 0.6) { - finalWidth = targetImageWidth - finalHeight = targetImageHeight - } - // 실제 리사이즈 실행 - image.resize({ w: finalWidth, h: finalHeight }) + if (scale >= 0.6) { + // 실제 리사이즈 실행 + image.resize({ w: finalWidth, h: finalHeight }) + } //배경 이미지를 생성 const mixedImage = new Jimp({ width: convertStandardWidth, height: convertStandardHeight, color: 0xffffffff }) diff --git a/src/components/estimate/popup/DocDownOptionPop.jsx b/src/components/estimate/popup/DocDownOptionPop.jsx index f534fbda..f5a967f1 100644 --- a/src/components/estimate/popup/DocDownOptionPop.jsx +++ b/src/components/estimate/popup/DocDownOptionPop.jsx @@ -6,6 +6,7 @@ import { useRecoilValue } from 'recoil' import { floorPlanObjectState, estimateState } from '@/store/floorPlanObjectAtom' import { usePathname, useSearchParams } from 'next/navigation' import { QcastContext } from '@/app/QcastProvider' +import { sessionStore } from '@/store/commonAtom' export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) { const { setIsGlobalLoading } = useContext(QcastContext) @@ -30,7 +31,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown // recoil 물건번호 const objectRecoil = useRecoilValue(floorPlanObjectState) const estimateRecoilState = useRecoilValue(estimateState) - + const sessionState = useRecoilValue(sessionStore) //문서 다운로드 const handleFileDown = async () => { const url = '/api/estimate/excel-download' @@ -67,6 +68,8 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown schWeightFlg: schWeightFlg, schDrawingFlg: defaultSchDrawingFlg, pwrGnrSimType: 'D', //default 화면에 안보여줌 + userId: sessionState.userId ? sessionState.userId : "", + saleStoreId: sessionState.storeId ? sessionState.storeId : "", } const options = { responseType: 'blob' } diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 50e35342..f7ad4d7c 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -122,12 +122,46 @@ export default function CircuitTrestleSetting({ id }) { canvas.set({ zoom: 1 }) canvas.viewportTransform = [1, 0, 0, 1, 0, 0] + canvas.renderAll() + + // roof polygon들의 중간점 계산 + const roofPolygons = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) let x, y + x = 0 //canvas.width / 2 + y = 1000 //canvas.height / 2 - x = canvas.width / 2 - y = canvas.height / 2 + /*if (roofPolygons.length > 0) { + let minX = Infinity, + minY = Infinity, + maxX = -Infinity, + maxY = -Infinity - canvas.zoomToPoint(new fabric.Point(x, y), 0.5) + roofPolygons.forEach((obj) => { + const boundingRect = obj.getBoundingRect() + minX = Math.min(minX, boundingRect.left) + minY = Math.min(minY, boundingRect.top) + maxX = Math.max(maxX, boundingRect.left + boundingRect.width) + maxY = Math.max(maxY, boundingRect.top + boundingRect.height) + }) + + x = (minX + maxX) / 2 + y = (minY + maxY) / 2 + } else { + // roof polygon이 없으면 기본 중앙점 사용 + x = canvas.width / 2 + y = canvas.height / 2 + } + + if (x > 1600) { + x = 0 + y = 0 + } + if (y > 1600) { + x = 0 + y = 0 + }*/ + + canvas.zoomToPoint(new fabric.Point(x, y), 0.4) changeFontSize('lengthText', '28') changeFontSize('circuitNumber', '28') changeFontSize('flowText', '28') diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index fd8f3a12..57d402bb 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -232,6 +232,9 @@ export function useModuleBasicSetting(tabNum) { //가대 상세 데이터 기준으로 모듈 설치 배치면 생성 const makeModuleInstArea = (roof, trestleDetail) => { //지붕 객체 반환 + if (!roof.pitch) { + return + } if (tabNum == 3) { if (!roof) { diff --git a/src/hooks/roofcover/useOuterLineWall.js b/src/hooks/roofcover/useOuterLineWall.js index 24f9d3d1..e5f14cc1 100644 --- a/src/hooks/roofcover/useOuterLineWall.js +++ b/src/hooks/roofcover/useOuterLineWall.js @@ -30,7 +30,6 @@ import { calculateAngle } from '@/util/qpolygon-utils' import { fabric } from 'fabric' import { outlineDisplaySelector } from '@/store/settingAtom' import { usePopup } from '@/hooks/usePopup' -import PropertiesSetting from '@/components/floor-plan/modal/outerlinesetting/PropertiesSetting' import Big from 'big.js' import RoofShapeSetting from '@/components/floor-plan/modal/roofShape/RoofShapeSetting' import { useObject } from '@/hooks/useObject' @@ -147,7 +146,7 @@ export function useOuterLineWall(id, propertiesId) { const mouseDown = (e) => { let pointer = getIntersectMousePoint(e) - pointer = { x: Big(pointer.x).round(1).toNumber(), y: Big(pointer.y).round(1).toNumber() } + pointer = { x: Big(pointer.x).toNumber(), y: Big(pointer.y).toNumber() } if (points.length === 0) { setPoints((prev) => [...prev, pointer]) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index e5c56854..328687fe 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -1164,6 +1164,8 @@ export const usePolygon = () => { if (startFlag && endFlag) { if (!representLines.includes(line) && line.attributes.type === LINE_TYPE.WALLLINE.EAVES) { representLines.push(line) + } else if (!representLines.includes(line) && line.attributes.type === LINE_TYPE.WALLLINE.HIPANDGABLE) { + representLines.push(line) } } }) diff --git a/src/styles/_modal.scss b/src/styles/_modal.scss index c90372bf..f62c8592 100644 --- a/src/styles/_modal.scss +++ b/src/styles/_modal.scss @@ -150,7 +150,7 @@ $alert-color: #101010; position: absolute; top: 0; left: 0; - width: 5px; + width: 15px; height: 100%; background-color: #000; cursor: pointer; @@ -159,7 +159,7 @@ $alert-color: #101010; position: absolute; top: 0; right: 0; - width: 5px; + width: 15px; height: 100%; background-color: #000; cursor: pointer; @@ -235,7 +235,7 @@ $alert-color: #101010; .modal-foot{ display: block; width: 100%; - padding: 5px 0; + padding: 15px 0; background-color: #000; cursor: pointer; } @@ -344,7 +344,7 @@ $alert-color: #101010; top: 50%; right: 0; transform: translateY(-50%); - + } } .input-grid{ @@ -646,7 +646,7 @@ $alert-color: #101010; .outline-wrap{ padding: 24px 0; border-top: 1px solid #424242; - + .outline-inner{ display: flex; align-items: center; @@ -666,7 +666,7 @@ $alert-color: #101010; .outline-form{ display: flex; align-items: center; - + span{ width: 60px; flex: none; @@ -1311,7 +1311,7 @@ $alert-color: #101010; width: 200px; height: 200px; border-radius: 50%; - + .circle { position: absolute; width: 10px; @@ -1760,7 +1760,7 @@ $alert-color: #101010; &::-webkit-scrollbar { width: 2px; background-color: transparent; - + } &::-webkit-scrollbar-thumb { background-color: #fff; @@ -1771,7 +1771,7 @@ $alert-color: #101010; } } } - } + } } } @@ -1945,7 +1945,7 @@ $alert-color: #101010; min-height: 80px; background-color: #fff; } - + } // 치수선 설정 @@ -2232,11 +2232,11 @@ $alert-color: #101010; padding-left: 0; padding-bottom: 5px; } - } + } } - } - } -} + } + } +} .keraba-flex{ display: flex; align-items: center; @@ -2321,7 +2321,7 @@ $alert-color: #101010; flex-direction: column; flex: 1; - + } .compas-table-box{ background-color: #3D3D3D;