diff --git a/.env.production b/.env.production index 990adb32..09bb27d3 100644 --- a/.env.production +++ b/.env.production @@ -7,5 +7,7 @@ SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" # NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_bV5zuYMyyIYFlOb3" NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_yAS4QDalL9jgQ7vS" -NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="https://q-order.q-cells.jp/eos/login/autoLogin" -NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="https://q-musubi.q-cells.jp/qm/login/autoLogin" \ No newline at end of file +# NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="https://q-order.q-cells.jp/eos/login/autoLogin" +# NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="https://q-musubi.q-cells.jp/qm/login/autoLogin" +NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="http://q-order-stg.q-cells.jp:8120/eos/login/autoLogin" +NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="http://q-musubi-stg.q-cells.jp:8120/qm/login/autoLogin" \ No newline at end of file diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index 68e5cf7a..ddce32a6 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -29,6 +29,7 @@ import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupSta import { useCanvasSetting } from '@/hooks/option/useCanvasSetting' import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { useEvent } from '@/hooks/useEvent' +import { compasDegAtom } from '@/store/orientationAtom' export default function CanvasFrame() { const canvasRef = useRef(null) @@ -45,6 +46,7 @@ export default function CanvasFrame() { const resetSelectedMakerState = useResetRecoilState(selectedMakerState) const resetSeriesState = useResetRecoilState(seriesState) const resetModelsState = useResetRecoilState(modelsState) + const resetCompasDeg = useResetRecoilState(compasDegAtom) const resetSelectedModelsState = useResetRecoilState(selectedModelsState) const resetPcsCheckState = useResetRecoilState(pcsCheckState) const { handleModuleSelectionTotal } = useCanvasPopupStatusController() @@ -103,6 +105,7 @@ export default function CanvasFrame() { resetSelectedMakerState() resetSeriesState() resetModelsState() + resetCompasDeg() resetSelectedModelsState() resetPcsCheckState() } diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 44a0d02e..355fedc2 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -730,7 +730,7 @@ export function useModuleBasicSetting(tabNum) { tempModule.setCoords() //좌표 재정렬 if (turf.booleanContains(turfPolygon, tempTurfModule) || turf.booleanWithin(tempTurfModule, turfPolygon)) { //마우스 클릭시 set으로 해당 위치에 셀을 넣음 - const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //겹치는지 확인 + const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module, true))) //겹치는지 확인 if (!isOverlap) { canvas?.remove(tempModule) @@ -2205,12 +2205,13 @@ export function useModuleBasicSetting(tabNum) { if (turf.booleanWithin(tempTurfModule, turfPolygon)) { //마우스 클릭시 set으로 해당 위치에 셀을 넣음 - const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //겹치는지 확인 + const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module, true))) //겹치는지 확인 if (!isOverlap) { moduleOptions.surfaceId = trestlePolygon.id let manualModule = new QPolygon(tempModule.points, { ...moduleOptions, moduleInfo: checkedModule[0] }) canvas?.add(manualModule) - manualDrawModules.push(tempModule) + manualDrawModules.push(manualModule) + setModuleStatisticsData() } else { swalFire({ text: getMessage('module.place.overlab') }) } @@ -2626,62 +2627,6 @@ export function useModuleBasicSetting(tabNum) { return isDisjoint } - const getModuleStatistics = () => { - const surfaces = canvas.getObjects().filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name) - // console.log('🚀 ~ getModuleStatistics ~ surfaces:', surfaces) - let totalWpout = 0 - let moduleInfo = {} - const rows = surfaces.map((surface) => { - let wpOut = 0 - moduleInfo = {} - surface.modules.forEach((module) => { - if (!moduleInfo[module.moduleInfo.itemId]) { - moduleInfo[module.moduleInfo.itemId] = { name: module.moduleInfo.itemNm, amount: 0, id: module.moduleInfo.itemId } - } - wpOut += +module.moduleInfo.wpOut - - moduleInfo[module.moduleInfo.itemId].amount++ - }) - totalWpout += wpOut - // console.log('🚀 ~ moduleData.rows=surfaces.map ~ module:', module) - const rowObject = {} - Object.keys(moduleInfo).forEach((key) => { - rowObject[key] = moduleInfo[key].amount - }) - return { - ...rowObject, // 총 발전량 = 발전량 * 모듈 개수 - ...surface, - name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, // 지붕면 - // powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }), - wpOut: (wpOut / 1000).toFixed(3), - } - }) - - // console.log('🚀 ~ getModuleStatistics ~ rows:', rows) - // console.log('🚀 ~ getModuleStatistics ~ moduleInfo:', moduleInfo) - const header = [ - { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'name' }, - ...Object.keys(moduleInfo).map((key) => { - return { name: moduleInfo[key].name, prop: key } - }), - { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' }, - ] - let footer = [getMessage('modal.panel.batch.statistic.total')] - let footerData = {} - rows.forEach((row) => { - Object.keys(moduleInfo).map((key) => { - if (!footerData[key]) footerData[key] = 0 - footerData[key] += row[key] - }) - }) - Object.keys(footerData).forEach((key) => { - footer.push(footerData[key]) - }) - footer.push((totalWpout / 1000).toFixed(3)) - // console.log({ header: header, rows, footer: footer }) - setModuleStatistics({ header: header, rows, footer: footer }) - } - /** * 모듈의 너비와 높이를 계산하는 함수 * @param {object} maxLengthLine 최대 길이 라인