From 4bd65f72073c868ce011962b7ede3672f8b13679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:54:18 +0900 Subject: [PATCH 01/39] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=20=ED=8D=BC=EB=B8=94=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContextRoofAllocationSetting.jsx | 95 ++++++++--------- .../roofAllocation/RoofAllocationSetting.jsx | 100 +++++++++--------- 2 files changed, 95 insertions(+), 100 deletions(-) diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx index 88188887..7bbad312 100644 --- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx @@ -115,22 +115,25 @@ export default function ContextRoofAllocationSetting(props) { )} -
-
- {getMessage('slope')} -
- { - handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) - }} - defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} - /> + {roof.raftAuth && ( +
+
+ {getMessage('modal.placement.initial.setting.rafter')} + {raftCodes.length > 0 && ( +
+ +
+ )}
- {pitchText}
-
+ )} + {(roof.widAuth || roof.lenAuth) && ( <> {roof.widAuth && ( @@ -155,43 +158,37 @@ export default function ContextRoofAllocationSetting(props) { )} )} - {(roof.raftAuth || roof.roofPchAuth) && ( - <> - {roof.raftAuth && ( -
-
- {getMessage('modal.placement.initial.setting.rafter')} - {raftCodes.length > 0 && ( -
- -
- )} -
+ {roof.roofPchAuth && ( +
+
+ {getMessage('hajebichi')} +
+
- )} - {roof.roofPchAuth && ( -
-
- {getMessage('hajebichi')} -
- -
-
-
- )} - +
+
)} +
+
+ {getMessage('slope')} +
+ { + handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) + }} + defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} + /> +
+ {pitchText} +
+
-
-
- {getMessage('slope')} -
- { - handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) - }} - defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} - /> + + {roof.raftAuth && ( +
+
+ {getMessage('modal.placement.initial.setting.rafter')} + {raftCodes.length > 0 && ( +
+ handleChangeRaft(e, index)} + /> +
+ )}
- {pitchText}
-
+ )} + {(roof.widAuth || roof.lenAuth) && ( <> {roof.widAuth && ( @@ -169,45 +174,38 @@ export default function RoofAllocationSetting(props) { )} )} - {(roof.raftAuth || roof.roofPchAuth) && ( - <> - {roof.raftAuth && ( -
-
- {getMessage('modal.placement.initial.setting.rafter')} - {raftCodes.length > 0 && ( -
- handleChangeRaft(e, index)} - /> -
- )} -
+ {roof.roofPchAuth && ( +
+
+ {getMessage('hajebichi')} +
+ handleChangeInput(e, 'hajebichi', index)} + value={parseInt(roof.hajebichi)} + readOnly={roof.roofPchAuth === 'R'} + />
- )} - {roof.roofPchAuth && ( -
-
- {getMessage('hajebichi')} -
- handleChangeInput(e, 'hajebichi', index)} - value={parseInt(roof.hajebichi)} - readOnly={roof.roofPchAuth === 'R'} - /> -
-
-
- )} - +
+
)} +
+
+ {getMessage('slope')} +
+ { + handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) + }} + defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} + /> +
+ {pitchText} +
+
+
+
+ { + setPasswordVisible(passwordVisible) + }} + onFocus={() => setSecFocus(true)} + onBlur={() => setSecFocus(false)} + /> + +
+
+ { + setChkLoginId(e.target.checked) + }} + /> + +
+
+ +
+
+ +
+
+ +
+
+ + {getMessage('login.guide.text')} +
+ {getMessage('login.guide.sub1')} {getMessage('login.guide.join.btn')} + {getMessage('login.guide.sub2')} +
+ + )} + {!autoLoginParam && passwordReset === 2 && ( + <> +
+
+ {getMessage('login.init_password.title')} + {getMessage('login.init_password.sub_title')}
{ - setUserId(e.target.value) + setCheckId(e.target.value) }} onFocus={() => setIdFocus(true)} onBlur={() => setIdFocus(false)} @@ -177,146 +284,58 @@ export default function Login() {
-
+
{ - setPasswordVisible(passwordVisible) + setCheckEmail(e.target.value) }} + placeholder={getMessage('login.init_password.email.placeholder')} onFocus={() => setSecFocus(true)} onBlur={() => setSecFocus(false)} />
-
- { - setChkLoginId(e.target.checked) +
+
-
- -
-
-
- -
-
- - {getMessage('login.guide.text')} -
- {getMessage('login.guide.sub1')} {getMessage('login.guide.join.btn')} - {getMessage('login.guide.sub2')} -
- - )} - {!autoLoginParam && passwordReset === 2 && ( - <> -
-
- {getMessage('login.init_password.title')} - {getMessage('login.init_password.sub_title')}
-
-
- { - setCheckId(e.target.value) - }} - onFocus={() => setIdFocus(true)} - onBlur={() => setIdFocus(false)} - /> - -
-
- { - setCheckEmail(e.target.value) - }} - placeholder={getMessage('login.init_password.email.placeholder')} - onFocus={() => setSecFocus(true)} - onBlur={() => setSecFocus(false)} - /> - -
-
- - -
-
-
- - )} - {autoLoginParam && } + + )} + {autoLoginParam && } +
+
COPYRIGHT©2024 Hanwha Japan All Rights Reserved.
-
COPYRIGHT©2024 Hanwha Japan All Rights Reserved.
-
+ ) } From f47b2684fbc61478d5f1fb3a147c5e6a2c7cb9c7 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 5 Feb 2025 18:53:50 +0900 Subject: [PATCH 07/39] =?UTF-8?q?=EC=9D=98=EB=AF=B8=EC=97=86=EB=8A=94=20QP?= =?UTF-8?q?olygon=20lengthText=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/qpolygon-utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/qpolygon-utils.js b/src/util/qpolygon-utils.js index 643c640d..edb8574c 100644 --- a/src/util/qpolygon-utils.js +++ b/src/util/qpolygon-utils.js @@ -235,6 +235,7 @@ export default function offsetPolygon(vertices, offset) { const arcSegments = 0 const originPolygon = new QPolygon(vertices, { fontSize: 0 }) + originPolygon.setViewLengthText(false) if (offset > 0) { let result = createMarginPolygon(polygon, offset, arcSegments).vertices From 0c8631c44d9a7dec43d1b169d7753bd838aea459 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 5 Feb 2025 19:53:42 +0900 Subject: [PATCH 08/39] =?UTF-8?q?=EB=94=94=EC=8A=A4=ED=94=8C=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=20=EC=84=A4=EC=A0=95=20=3D>=20=ED=95=A0=EB=8B=B9?= =?UTF-8?q?=ED=91=9C=EC=8B=9C,=20=ED=9A=8C=EB=A1=9C=20=EB=B2=88=ED=98=B8?= =?UTF-8?q?=20=ED=91=9C=EC=8B=9C=20,=EA=B0=80=EB=8C=80=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/useRoof.js | 4 +++- src/hooks/option/useCanvasSetting.js | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hooks/common/useRoof.js b/src/hooks/common/useRoof.js index 0b5e5a6b..14407aa9 100644 --- a/src/hooks/common/useRoof.js +++ b/src/hooks/common/useRoof.js @@ -16,7 +16,9 @@ export function useRoof() { .filter((polygon) => polygon.name === 'roof') .forEach((polygon) => { if (allocDisplay) { - setSurfaceShapePattern(polygon, roofDisplay.column) + if (polygon.roofMaterial) { + setSurfaceShapePattern(polygon, roofDisplay.column, false, polygon.roofMaterial, true) + } } else { polygon.set('fill', null) } diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 29287689..287349bc 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -727,7 +727,7 @@ export function useCanvasSetting() { for (let i = 0; i < option1.length; i++) { switch (option1[i].column) { case 'allocDisplay': //할당 표시 - optionName = ['1'] + // useRoof에서 작업 완료 break case 'outlineDisplay': //외벽선 표시 optionName = ['outerLine', POLYGON_TYPE.WALL] @@ -742,19 +742,19 @@ export function useCanvasSetting() { optionName = ['commonText'] break case 'circuitNumDisplay': //회로번호 표시 - optionName = ['7'] + optionName = ['circuitNumber'] break case 'flowDisplay': //흐름방향 표시 optionName = ['arrow', 'flowText'] break case 'trestleDisplay': //가대 표시 - optionName = ['8'] + optionName = ['rack', 'smartRack', 'bracket'] break case 'imageDisplay': //이미지 표시 optionName = ['9'] break case 'totalDisplay': //집계표 표시 - optionName = ['10'] + // 작업할 필요 없음 break } // 표시 선택 상태(true/false) From faf3ead51480dd3c68f083c4392f5ce479ba43b6 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 5 Feb 2025 19:54:14 +0900 Subject: [PATCH 09/39] =?UTF-8?q?=EA=B0=80=EB=8C=80=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 287349bc..b36ff30c 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -748,7 +748,7 @@ export function useCanvasSetting() { optionName = ['arrow', 'flowText'] break case 'trestleDisplay': //가대 표시 - optionName = ['rack', 'smartRack', 'bracket'] + optionName = ['rack', 'smartRack', 'bracket', 'eaveBar', 'halfEaveBar'] break case 'imageDisplay': //이미지 표시 optionName = ['9'] From 77c1c9c3a0d42be60b6cf462c8770f3db73b02f2 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 5 Feb 2025 20:04:39 +0900 Subject: [PATCH 10/39] =?UTF-8?q?optionName=20=EC=9E=88=EC=96=B4=EC=95=BC?= =?UTF-8?q?=20=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index b36ff30c..07f46740 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -727,7 +727,7 @@ export function useCanvasSetting() { for (let i = 0; i < option1.length; i++) { switch (option1[i].column) { case 'allocDisplay': //할당 표시 - // useRoof에서 작업 완료 + optionName = [] break case 'outlineDisplay': //외벽선 표시 optionName = ['outerLine', POLYGON_TYPE.WALL] @@ -755,6 +755,7 @@ export function useCanvasSetting() { break case 'totalDisplay': //집계표 표시 // 작업할 필요 없음 + optionName = [] break } // 표시 선택 상태(true/false) From aabd464b8882304e9a085ecd2cd29111c577b7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Wed, 5 Feb 2025 20:21:16 +0900 Subject: [PATCH 11/39] =?UTF-8?q?circuitNumber=20visible=20selector=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/circuitTrestle/step/StepUp.jsx | 4 +++- .../circuitTrestle/step/type/PassivityCircuitAllocation.jsx | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 65e35583..90d40c2f 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -12,6 +12,7 @@ import { useMasterController } from '@/hooks/common/useMasterController' import { v4 as uuidv4 } from 'uuid' import { globalLocaleStore } from '@/store/localeAtom' import { POLYGON_TYPE } from '@/common/common' +import { circuitNumDisplaySelector } from '@/store/settingAtom' export default function StepUp(props) { const { @@ -43,7 +44,7 @@ export default function StepUp(props) { // 선택된 값들을 저장할 상태 추가 const [selectedValues, setSelectedValues] = useState({}) - + const isDisplayCircuitNumber = useRecoilValue(circuitNumDisplaySelector) // useCanvasPopupStatusController(6) // const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore) // if (Object.keys(canvasPopupStatusState[6]).length !== 0) { @@ -323,6 +324,7 @@ export default function StepUp(props) { name: 'circuitNumber', parentId: targetModule.id, circuitInfo: module.pcsItemId, + visible: isDisplayCircuitNumber, }) targetModule.circuit = moduleCircuitText targetModule.pcsItemId = module.pcsItemId diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index ff1e7cb8..1c5595a6 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -7,6 +7,7 @@ import { useSwal } from '@/hooks/useSwal' import { canvasState } from '@/store/canvasAtom' import { moduleStatisticsState } from '@/store/circuitTrestleAtom' import { selectedModuleState } from '@/store/selectedModuleOptions' +import { circuitNumDisplaySelector } from '@/store/settingAtom' import { useContext, useEffect, useState } from 'react' import { useRecoilState, useRecoilValue } from 'recoil' @@ -29,6 +30,7 @@ export default function PassivityCircuitAllocation(props) { const [targetModules, setTargetModules] = useState([]) const { setModuleStatisticsData } = useModule() const { getPcsManualConfChk } = useMasterController() + const isDisplayCircuitNumber = useRecoilValue(circuitNumDisplaySelector) useEffect(() => { console.log('header, rows', header, rows) @@ -215,6 +217,7 @@ export default function PassivityCircuitAllocation(props) { name: 'circuitNumber', parentId: obj.id, circuitInfo: selectedPcs, + visible: isDisplayCircuitNumber, }) obj.set({ strokeWidth: 0.3, From 7fe794b8791e7dcf21b0e8fa88366a4346e86933 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 5 Feb 2025 20:21:25 +0900 Subject: [PATCH 12/39] =?UTF-8?q?=EA=B0=80=EB=8C=80=20visible=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index c04bb3ce..2df04fdc 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -5,7 +5,7 @@ import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { getDegreeByChon } from '@/util/canvas-util' import { v4 as uuidv4 } from 'uuid' import { useMasterController } from '@/hooks/common/useMasterController' -import { basicSettingState } from '@/store/settingAtom' +import { basicSettingState, trestleDisplaySelector } from '@/store/settingAtom' import { useSwal } from '@/hooks/useSwal' // 회로 및 가대설정 @@ -15,6 +15,7 @@ export const useTrestle = () => { const { getQuotationItem } = useMasterController() const currentAngleType = useRecoilValue(currentAngleTypeSelector) const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet + const isTrestleDisplay = useRecoilValue(trestleDisplaySelector) const { swalFire } = useSwal() const apply = () => { try { @@ -135,6 +136,7 @@ export const useTrestle = () => { selectable: false, surfaceId: surface.id, parentId: module.id, + visible: isTrestleDisplay, }) canvas.add(eaveBar) canvas.renderAll() @@ -165,6 +167,7 @@ export const useTrestle = () => { selectable: false, surfaceId: surface.id, parentId: module.id, + visible: isTrestleDisplay, }) canvas.add(halfEaveBar) canvas.renderAll() @@ -193,6 +196,7 @@ export const useTrestle = () => { strokeWidth: 4, selectable: false, parentId: module.id, + visible: isTrestleDisplay, }) canvas.add(halfEaveBar) canvas.renderAll() @@ -918,7 +922,7 @@ export const useTrestle = () => { offsetX: 0, offsetY: 0, }, - + visible: isTrestleDisplay, parentId: module.id, surfaceId: surface.id, supFitQty, @@ -952,6 +956,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen, @@ -992,6 +997,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen: rackLength, @@ -1022,6 +1028,7 @@ export const useTrestle = () => { surfaceId: surface.id, strokeWidth: 4, selectable: false, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen, @@ -1062,6 +1069,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen: rackLength, @@ -1090,6 +1098,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, strokeWidth: 4, selectable: false, supFitQty, @@ -1130,6 +1139,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, supFitQty, supFitIntvlPct, rackLen, @@ -1158,6 +1168,7 @@ export const useTrestle = () => { }, parentId: module.id, surfaceId: surface.id, + visible: isTrestleDisplay, strokeWidth: 4, selectable: false, supFitQty, @@ -1209,6 +1220,7 @@ export const useTrestle = () => { fill: 'green', name: 'bracket', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, width: bracketLength, height: bracketLength, @@ -1228,6 +1240,7 @@ export const useTrestle = () => { fill: 'green', name: 'bracket', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, width: bracketLength, height: bracketLength, @@ -1246,6 +1259,7 @@ export const useTrestle = () => { top: y2 - bracketLength / 3, fill: 'green', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, name: 'bracket', width: bracketLength, @@ -1266,6 +1280,7 @@ export const useTrestle = () => { fill: 'green', name: 'bracket', parentId: rack.parentId, + visible: isTrestleDisplay, surfaceId: surface.id, width: bracketLength, height: bracketLength, @@ -1431,6 +1446,7 @@ export const useTrestle = () => { width: 10, height: 10, selectable: false, + visible: isTrestleDisplay, }) canvas.add(bracket) canvas.renderAll() From ec835750f6016ab7d0e6023489e59cf240aa5fc2 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Wed, 5 Feb 2025 20:51:30 +0900 Subject: [PATCH 13/39] =?UTF-8?q?=ED=9A=8C=EB=A1=9C=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=88=98=EB=8F=99=ED=9A=8C=EB=A1=9C=20=ED=95=A0=EB=8B=B9=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/circuitTrestle/step/StepUp.jsx | 137 ++++++++++++------ src/hooks/common/useMasterController.js | 13 ++ 2 files changed, 105 insertions(+), 45 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 90d40c2f..30d40de5 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -12,7 +12,6 @@ import { useMasterController } from '@/hooks/common/useMasterController' import { v4 as uuidv4 } from 'uuid' import { globalLocaleStore } from '@/store/localeAtom' import { POLYGON_TYPE } from '@/common/common' -import { circuitNumDisplaySelector } from '@/store/settingAtom' export default function StepUp(props) { const { @@ -33,7 +32,7 @@ export default function StepUp(props) { const [moduleTabs, setModuleTabs] = useState({}) const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수 const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) - const { getPcsVoltageStepUpList, getPcsAutoRecommendList, getPcsVoltageChk } = useMasterController() + const { getPcsVoltageStepUpList, getPcsAutoRecommendList, getPcsVoltageChk, getPcsConnOptionItemList } = useMasterController() const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) @@ -52,20 +51,19 @@ export default function StepUp(props) { // } useEffect(() => { - // PCS 승압설정 정보 조회 + console.log(allocationType) + if (allocationType === 'auto') { - fetchStepUpData() + // PCS 자동 승압설정 정보 조회 + fetchAutoStepUpData() } else { - // 1-1 2-2 - canvas - .getObjects() - .filter((obj) => obj.name === POLYGON_TYPE.MODULE && obj.circuit) - .map((module) => module.circuitNumber) + // PCS 수동 승압설정 정보 조회 + fetchPassiStepUpData() } }, []) - // PCS 승압설정 정보 조회 - const fetchStepUpData = async () => { + // PCS 자동 승압설정 정보 조회 + const fetchAutoStepUpData = async () => { try { const params = { ...props.getOptYn(), // 옵션 Y/N @@ -107,6 +105,89 @@ export default function StepUp(props) { } } + // PCS 수동 승압설정 정보 조회 + const fetchPassiStepUpData = async () => { + try { + // 1-1 2-2 + // canvas + // .getObjects() + // .filter((obj) => obj.name === POLYGON_TYPE.MODULE && obj.circuit) + // .map((module) => module.circuitNumber) + + // 모듈 데이터 가져오기 + const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE) + + // PCS별 회로 정보를 저장할 객체 + const pcsSummary = {} + + // 각 모듈을 순회하며 PCS별 회로 정보 수집 + modules.forEach((module) => { + if (!module.circuit || !module.pcsItemId) return + + if (!pcsSummary[module.pcsItemId]) { + pcsSummary[module.pcsItemId] = { + circuits: {}, + totalModules: 0, + } + } + + const circuitNumber = module.circuitNumber + if (!pcsSummary[module.pcsItemId].circuits[circuitNumber]) { + pcsSummary[module.pcsItemId].circuits[circuitNumber] = 0 + } + pcsSummary[module.pcsItemId].circuits[circuitNumber]++ + pcsSummary[module.pcsItemId].totalModules++ + }) + + const params = { + useModuleItemList: props.getUseModuleItemList(), + pcsItemList: getSelectedPcsItemList(), + } + + // PCS 접속함 및 옵션 목록 조회 + getPcsConnOptionItemList(params).then((res) => { + if (res?.result.code === 200 && res?.data) { + // PCS 아이템 리스트에 serQtyList 추가 + const pcsItemListWithSerQty = res.data.pcsItemList.map((pcsItem) => { + const pcsData = pcsSummary[pcsItem.itemId] || { circuits: {}, totalModules: 0 } + const circuitCounts = Object.values(pcsData.circuits) + return { + ...pcsItem, + serQtyList: [ + { + // 한 회로당 최대 모듈 수 + serQty: circuitCounts.length > 0 ? Math.max(...circuitCounts) : 0, + // 회로 개수 + paralQty: Object.keys(pcsData.circuits).length || 0, + rmdYn: 'Y', + usePossYn: 'Y', + roofSurfaceList: props.getRoofSurfaceList(), + }, + ], + } + }) + + // Update res.data with modified pcsItemList + res.data.pcsItemList = pcsItemListWithSerQty + setSelectedModels(pcsItemListWithSerQty) + + const dataArray = Array.isArray(res.data) ? res.data : [res.data] + const stepUpListData = formatStepUpListData(dataArray) + + // PCS 승압설정 정보 SET + setStepUpListData(stepUpListData) + + // PCS 옵션 조회 + const formattedOptCodes = formatOptionCodes(res.data.optionList) + setOptCodes(formattedOptCodes) + setSeletedOption(formattedOptCodes[0]) + } + }) + } catch (error) { + console.error('Error fetching step up data:', error) + } + } + // PCS 옵션 조회 const formatOptionCodes = (optionList = []) => { return optionList?.map((opt) => ({ @@ -125,40 +206,6 @@ export default function StepUp(props) { selectedPcsItem: formatPcsItemList(stepUps.pcsItemList), })) - // 초기 추천 값들을 selectedValues에 저장 - const initialSelectedValues = {} - formattedData.forEach((stepUp) => { - stepUp.pcsItemList.forEach((pcsItem, pcsIdx) => { - const pcsKey = `${pcsItem.goodsNo}_${pcsIdx}` - - // 추천 값(rmdYn === 'Y') 찾기 - const recommendedRow = pcsItem.serQtyList.find((item) => item.rmdYn === 'Y') - if (recommendedRow) { - const selectionData = { - stepUpId: pcsItem.goodsNo, - pcsInfo: { - itemId: pcsItem.itemId, - goodsNo: pcsItem.goodsNo, - pcsMkrCd: pcsItem.pcsMkrCd, - pcsSerCd: pcsItem.pcsSerCd, - }, - allocation: { - serQty: recommendedRow.serQty, - paralQty: recommendedRow.paralQty, - }, - } - - initialSelectedValues[pcsItem.goodsNo] = { - ...initialSelectedValues[pcsItem.goodsNo], - [pcsKey]: selectionData, - } - } - }) - }) - - // 초기 추천 값들을 selectedValues에 저장 - setSelectedValues(initialSelectedValues) - return formattedData } diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index 85236e9c..2c488c83 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -241,6 +241,18 @@ export function useMasterController() { return await put({ url: '/api/object/update-object-date', data: params }) } + /** + * PCS 접속함 및 옵션 목록 조회 + * @param {사용된 모듈 아이템 목록} useModuleItemList + * @param {PCS 제품 목록} pcsItemList + * @returns + */ + const getPcsConnOptionItemList = async (params = null) => { + return await post({ url: '/api/v1/master/getPcsConnOptionItemList', data: params }).then((res) => { + return res + }) + } + return { getRoofMaterialList, getModuleTypeItemList, @@ -255,5 +267,6 @@ export function useMasterController() { getPcsVoltageStepUpList, updateObjectDate, getQuotationItem, + getPcsConnOptionItemList, } } From a20b0663017ec8880198ff4bd58124c190cd1450 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 5 Feb 2025 21:03:59 +0900 Subject: [PATCH 14/39] =?UTF-8?q?=F0=9F=9A=A8fix:=20=EB=88=84=EB=9D=BD?= =?UTF-8?q?=EB=90=9C=20=EC=9E=84=ED=8F=AC=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 30d40de5..969c7506 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -12,6 +12,7 @@ import { useMasterController } from '@/hooks/common/useMasterController' import { v4 as uuidv4 } from 'uuid' import { globalLocaleStore } from '@/store/localeAtom' import { POLYGON_TYPE } from '@/common/common' +import { circuitNumDisplaySelector } from '@/store/settingAtom' export default function StepUp(props) { const { From 2e2ba9135393a849045b56843e66dc5ab104b4fc Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 6 Feb 2025 09:33:12 +0900 Subject: [PATCH 15/39] =?UTF-8?q?=EB=A6=AC=EC=BD=94=EC=9D=BC=20undefined?= =?UTF-8?q?=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 517e2c35..142f9393 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -373,7 +373,7 @@ export default function CanvasMenu(props) { useEffect(() => { if (isObjectNotEmpty(estimateRecoilState)) { if (estimateRecoilState?.createUser === 'T01') { - if (sessionState.userId !== 'T01') { + if (sessionState.storeId !== 'T01') { setButtonStyle1('none') setButtonStyle2('none') setButtonStyle3('none') @@ -404,7 +404,7 @@ export default function CanvasMenu(props) { } } } - }, [estimateRecoilState]) + }, [estimateRecoilState.tempFlg, estimateRecoilState.lockFlg]) /** * 견적서 잠금 / 해제 @@ -415,7 +415,6 @@ export default function CanvasMenu(props) { */ const handleEstimateLockController = (estimateRecoilState) => { swalFire({ - // text: estimateRecoilState.lockFlg === '0' ? getMessage('estimate.detail.lock.alertMsg') : getMessage('estimate.detail.unlock.alertMsg'), html: estimateRecoilState.lockFlg === '0' ? getMessage('estimate.detail.lock.alertMsg') : getMessage('estimate.detail.unlock.alertMsg'), confirmButtonText: estimateRecoilState.lockFlg === '1' ? getMessage('estimate.detail.unlock.confirmBtnName') : '', type: 'confirm', @@ -572,20 +571,17 @@ export default function CanvasMenu(props) { {menuNumber === 5 && ( <>
- {/* From ae57338aab3ed5fabcf99e97fe489c0796211f32 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 6 Feb 2025 16:16:42 +0900 Subject: [PATCH 33/39] =?UTF-8?q?#578=20[=ED=9A=8C=EB=A1=9C]=EA=B0=80=20?= =?UTF-8?q?=ED=95=A0=EB=8B=B9=EB=90=98=EC=A7=80=20=EC=95=8A=EC=9D=80=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=EA=B4=80=EB=A0=A8=EA=B1=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 9 +++++++-- src/hooks/module/useTrestle.js | 17 ++++++++++++++++- src/hooks/useMouse.js | 4 ++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 31f3aaa4..ef3229cb 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -30,7 +30,7 @@ const ALLOCATION_TYPE = { export default function CircuitTrestleSetting({ id }) { const { getMessage } = useMessage() const { closePopup } = usePopup() - const { apply } = useTrestle() + const { apply, hideCircuitNumberTexts } = useTrestle() const { swalFire } = useSwal() const { saveEstimate } = useEstimate() const canvas = useRecoilValue(canvasState) @@ -450,11 +450,16 @@ export default function CircuitTrestleSetting({ id }) { obj.pcses = getStepUpListData() }) + hideCircuitNumberTexts() + + //TODO : 이미지 저장 + const result = await apply() if (result) { + // TODO : 이미지 저장 await saveEstimate(result) } - removeNotAllocationModules() + // removeNotAllocationModules() } const removeNotAllocationModules = () => { diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 916e28d7..c47f99c0 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -18,6 +18,11 @@ export const useTrestle = () => { const isTrestleDisplay = useRecoilValue(trestleDisplaySelector) const { swalFire } = useSwal() const apply = () => { + const notAllocationModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE && !obj.circuit) + if (notAllocationModules.length > 0) { + swalFire({ text: '回路番号が設定されていないモジュールがあります。 番号を設定しなおすか、 パネルを削除してください。', icon: 'error' }) + return null + } try { //처마력바가 체크되어 있는 경우 exposedBottomPoints를 이용해 처마력바 그려줘야함. // exposedBottomPoints는 노출 최하면 들의 centerPoint 배열. @@ -2227,5 +2232,15 @@ export const useTrestle = () => { }) } - return { apply, getTrestleParams, clear } + // 전모듈 의 회로번호 visible false 처리 + // 가대 설치 전 필요 + const hideCircuitNumberTexts = () => { + const circuitNumberTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber') + circuitNumberTexts.forEach((text) => { + text.visible = false + }) + canvas.renderAll() + } + + return { apply, getTrestleParams, clear, hideCircuitNumberTexts } } diff --git a/src/hooks/useMouse.js b/src/hooks/useMouse.js index 033fea59..e88b4cb0 100644 --- a/src/hooks/useMouse.js +++ b/src/hooks/useMouse.js @@ -11,10 +11,10 @@ export function useMouse() { const mouseLines = canvas.getObjects().filter((obj) => obj.name === 'mouseLine') if (mouseLines.length < 2) { - return pointer + return { x: Math.round(pointer.x), y: Math.round(pointer.y) } } - return getInterSectionLineNotOverCoordinate(mouseLines[0], mouseLines[1]) || pointer + return getInterSectionLineNotOverCoordinate(mouseLines[0], mouseLines[1]) || { x: Math.round(pointer.x), y: Math.round(pointer.y) } } return { From 6cbce58f59df8194eb1503bf099ca8a31f278745 Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Thu, 6 Feb 2025 16:35:52 +0900 Subject: [PATCH 34/39] =?UTF-8?q?refactor:=20=EC=BA=94=EB=B2=84=EC=8A=A4?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=20=EC=8B=9C=20=EC=96=BC=EB=9F=BF=20?= =?UTF-8?q?=ED=91=9C=EC=B6=9C=20=EC=97=AC=EB=B6=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 2 +- src/hooks/useEstimate.js | 7 ++++++- src/hooks/usePlan.js | 12 ++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index fa06fa08..ed2249b0 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -272,7 +272,7 @@ export default function CanvasMenu(props) { // 저장버튼(btn08) 클릭 시 호출되는 함수 const handleSaveCanvas = async () => { - await saveCanvas() + await saveCanvas(true) } // 나가기 버튼 클릭 diff --git a/src/hooks/useEstimate.js b/src/hooks/useEstimate.js index 3d64d66c..e2ed851d 100644 --- a/src/hooks/useEstimate.js +++ b/src/hooks/useEstimate.js @@ -7,11 +7,13 @@ import { useAxios } from '@/hooks/useAxios' import { useSwal } from '@/hooks/useSwal' import { usePlan } from '@/hooks/usePlan' import { GlobalDataContext } from '@/app/GlobalDataProvider' +import { QcastContext } from '@/app/QcastProvider' import { currentCanvasPlanState } from '@/store/canvasAtom' import { loginUserStore } from '@/store/commonAtom' export function useEstimate() { const { managementStateLoaded } = useContext(GlobalDataContext) + const { setIsGlobalLoading } = useContext(QcastContext) const router = useRouter() const loginUserState = useRecoilValue(loginUserStore) const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) @@ -24,6 +26,9 @@ export function useEstimate() { * 도면 견적서 저장 */ const saveEstimate = async (estimateParam) => { + // 로딩 임시 주석 + // setIsGlobalLoading(true) + const userId = loginUserState.userId const saleStoreId = managementStateLoaded.saleStoreId const objectNo = currentCanvasPlan.objectNo @@ -54,7 +59,7 @@ export function useEstimate() { await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData }) .then(async () => { // 견적서 저장이 완료되면 캔버스 저장 후 견적서 페이지로 이동 - await saveCanvas() + await saveCanvas(false) moveEstimate(planNo, objectNo) }) .catch((error) => { diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index d560dec1..2bb37a1e 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -120,9 +120,9 @@ export function usePlan(params = {}) { /** * 페이지 내 캔버스를 저장 */ - const saveCanvas = async () => { + const saveCanvas = async (saveAlert = true) => { const canvasStatus = currentCanvasData('save') - await putCanvasStatus(canvasStatus) + await putCanvasStatus(canvasStatus, saveAlert) } /** @@ -192,7 +192,7 @@ export function usePlan(params = {}) { /** * id에 해당하는 canvas 데이터를 수정 */ - const putCanvasStatus = async (canvasStatus) => { + const putCanvasStatus = async (canvasStatus, saveAlert = true) => { const planData = { id: currentCanvasPlan.id, bgImageName: currentCanvasPlan?.bgImageName ?? null, @@ -202,7 +202,7 @@ export function usePlan(params = {}) { await promisePut({ url: '/api/canvas-management/canvas-statuses', data: planData }) .then((res) => { setPlans((plans) => plans.map((plan) => (plan.id === currentCanvasPlan.id ? { ...plan, canvasStatus: canvasStatus } : plan))) - swalFire({ text: getMessage('plan.message.save') }) + if (saveAlert) swalFire({ text: getMessage('plan.message.save') }) }) .catch((error) => { swalFire({ text: error.message, icon: 'error' }) @@ -283,7 +283,7 @@ export function usePlan(params = {}) { }) } else { if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { - await saveCanvas() + await saveCanvas(true) } setCurrentCanvasPlan(plans.find((plan) => plan.id === newCurrentId)) setPlans((plans) => plans.map((plan) => ({ ...plan, isCurrent: plan.id === newCurrentId }))) @@ -316,7 +316,7 @@ export function usePlan(params = {}) { */ const handleAddPlan = async (userId, objectNo) => { if (currentCanvasPlan?.id) { - await saveCanvas() + await saveCanvas(true) } JSON.parse(currentCanvasData()).objects.length > 0 ? swalFire({ From 12e183c1330196d8dc23521161b4df3826cf9765 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 6 Feb 2025 16:38:43 +0900 Subject: [PATCH 35/39] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=ED=9B=84=20=EB=8B=A4=EC=8B=9C=20circuitNumber=20vi?= =?UTF-8?q?sible=20true=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/circuitTrestle/CircuitTrestleSetting.jsx | 6 ++++-- src/hooks/module/useTrestle.js | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index ef3229cb..585c339b 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -30,7 +30,7 @@ const ALLOCATION_TYPE = { export default function CircuitTrestleSetting({ id }) { const { getMessage } = useMessage() const { closePopup } = usePopup() - const { apply, hideCircuitNumberTexts } = useTrestle() + const { apply, setViewCircuitNumberTexts } = useTrestle() const { swalFire } = useSwal() const { saveEstimate } = useEstimate() const canvas = useRecoilValue(canvasState) @@ -450,13 +450,15 @@ export default function CircuitTrestleSetting({ id }) { obj.pcses = getStepUpListData() }) - hideCircuitNumberTexts() + setViewCircuitNumberTexts(false) //TODO : 이미지 저장 const result = await apply() if (result) { // TODO : 이미지 저장 + + setViewCircuitNumberTexts(true) await saveEstimate(result) } // removeNotAllocationModules() diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index c47f99c0..441bfcf7 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -2234,13 +2234,13 @@ export const useTrestle = () => { // 전모듈 의 회로번호 visible false 처리 // 가대 설치 전 필요 - const hideCircuitNumberTexts = () => { + const setViewCircuitNumberTexts = (visible) => { const circuitNumberTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber') circuitNumberTexts.forEach((text) => { - text.visible = false + text.visible = visible }) canvas.renderAll() } - return { apply, getTrestleParams, clear, hideCircuitNumberTexts } + return { apply, getTrestleParams, clear, setViewCircuitNumberTexts } } From 70c395662529a91e9e2560dea6f117a5631dad6d Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Thu, 6 Feb 2025 16:55:17 +0900 Subject: [PATCH 36/39] =?UTF-8?q?=F0=9F=93=8Cfix:=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=B6=88=EB=9F=AC=EC=98=A4=EA=B8=B0=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/useRefFiles.js | 57 +++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/src/hooks/common/useRefFiles.js b/src/hooks/common/useRefFiles.js index 027a2d87..a2b16f74 100644 --- a/src/hooks/common/useRefFiles.js +++ b/src/hooks/common/useRefFiles.js @@ -66,15 +66,20 @@ export function useRefFiles() { } const refFileSetting = (file) => { - if (file && ['image/png', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/gif'].includes(file.type)) { - // setRefImage(file) - file.name.split('.').pop() === 'dwg' ? handleUploadConvertRefFile(file) : handleUploadImageRefFile(file) + console.log('🚀 ~ refFileSetting ~ file:', file) + if (file.name.split('.').pop() === 'dwg') { + handleUploadConvertRefFile(file) } else { - swalFire({ - text: '이미지가 아닙니다.', - type: 'alert', - icon: 'error', - }) + if (file && ['image/png', 'image/jpg', 'image/jpeg', 'image/bmp', 'image/gif'].includes(file.type)) { + // file.name.split('.').pop() === 'dwg' ? handleUploadConvertRefFile(file) : handleUploadImageRefFile(file) + handleUploadImageRefFile(file) + } else { + swalFire({ + text: '이미지가 아닙니다.', + type: 'alert', + icon: 'error', + }) + } } } /** @@ -121,14 +126,13 @@ export function useRefFiles() { } const res = await get({ - url: `http://localhost:3000/api/html2canvas?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`, + url: `${process.env.NEXT_PUBLIC_HOST_URL}/map/convert?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`, }) console.log('🚀 ~ handleMapImageDown ~ res:', res) - const file = await readImage(res.fileNm) - console.log('🚀 ~ handleMapImageDown ~ file:', file) - setCurrentBgImage(file) - // handleBackImageLoadToCanvas(`plan-images/${currentCanvasPlan.id}.png`) - // setCurrentCanvasPlan((prev) => ({ ...prev, bgImageName: currentCanvasPlan.id, mapPositionAddress: queryRef.current.value })) + // const file = await readImage(res.fileNm) + // console.log('🚀 ~ handleMapImageDown ~ file:', file) + // setCurrentBgImage(file) + setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${res.filePath}`) } /** @@ -158,7 +162,6 @@ export function useRefFiles() { console.log('🚀 ~ handleUploadImageRefFile ~ res:', res) // const image = await readImage(res.filePath) // console.log('🚀 ~ handleUploadImageRefFile ~ file:', image) - setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${res.filePath}`) setRefImage(file) } @@ -171,15 +174,21 @@ export function useRefFiles() { const formData = new FormData() formData.append('file', file) - await promisePost({ url: converterUrl, data: formData }) - .then((res) => { - convertDwgToPng(res.data.Files[0].FileName, res.data.Files[0].FileData) - swalFire({ text: '파일 변환 성공' }) - setRefImage(res.data.Files[0].FileData) - }) - .catch((err) => { - swalFire({ text: '파일 변환 실패', icon: 'error' }) - }) + const res = await post({ url: converterUrl, data: formData }) + console.log('🚀 ~ handleUploadConvertRefFile ~ res:', res) + const result = await post({ url: `${process.env.NEXT_PUBLIC_HOST_URL}/cad/convert`, data: res }) + console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result) + setCurrentBgImage(`${process.env.NEXT_PUBLIC_HOST_URL}${result.filePath}`) + setRefImage(res.Files[0].FileData) + // await promisePost({ url: converterUrl, data: formData }) + // .then((res) => { + // convertDwgToPng(res.data.Files[0].FileName, res.data.Files[0].FileData) + // swalFire({ text: '파일 변환 성공' }) + // setRefImage(res.data.Files[0].FileData) + // }) + // .catch((err) => { + // swalFire({ text: '파일 변환 실패', icon: 'error' }) + // }) } /** From e01a27b779bcd0350cc2271303bc64838d750664 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Thu, 6 Feb 2025 17:05:38 +0900 Subject: [PATCH 37/39] =?UTF-8?q?=F0=9F=93=8Cfix:=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=84=9C=EB=B2=84=20=EC=A3=BC=EC=86=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 ++- .env.production | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.development b/.env.development index b725379b..cfc50e71 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,8 @@ NEXT_PUBLIC_HOST_URL="http://1.248.227.176:4000" 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_bV5zuYMyyIYFlOb3" +NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_yAS4QDalL9jgQ7vS" 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/.env.production b/.env.production index b26e545c..381c7264 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,8 @@ NEXT_PUBLIC_HOST_URL="http://1.248.227.176:4000" 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_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 From 01b045c5acc478f2e0576f794c8eef197c5c7aec Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 6 Feb 2025 17:30:15 +0900 Subject: [PATCH 38/39] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=20=ED=8C=9D=EC=97=85=20=EC=A0=81=EC=9A=A9=20=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContextRoofAllocationSetting.jsx | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx index 7d909db5..4a911e9e 100644 --- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx @@ -142,7 +142,15 @@ export default function ContextRoofAllocationSetting(props) {
W
- + { + handleChangeInput(e, 'width', index) + }} + />
@@ -152,7 +160,15 @@ export default function ContextRoofAllocationSetting(props) {
L
- + { + handleChangeInput(e, 'length', index) + }} + />
@@ -169,6 +185,7 @@ export default function ContextRoofAllocationSetting(props) { className="input-origin block" value={parseInt(roof.hajebichi)} readOnly={roof.roofPchAuth === 'R'} + onChange={(e) => handleChangeInput(e, 'hajebichi', index)} />
From d923b8acffdf6abbcac9acaecec66eee9088998f Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 6 Feb 2025 17:45:01 +0900 Subject: [PATCH 39/39] =?UTF-8?q?=EC=99=B8=EB=B2=BD=EC=84=A0=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=B0=20=ED=9B=84,=20=EC=A7=80=EB=B6=95=ED=98=95=EC=83=81?= =?UTF-8?q?=20=EC=88=98=EB=8F=99=20=EC=84=A4=EC=A0=95=20=EC=8B=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/roofcover/useRoofAllocationSetting.js | 6 +++--- .../roofcover/useRoofShapePassivitySetting.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 550ce5f5..6fda1692 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -445,9 +445,9 @@ export function useRoofAllocationSetting(id) { setCurrentRoofList(newRoofList) } - const handleChangeInput = (e, type, index) => { + const handleChangeInput = (e, type = '', index) => { const value = e.target.value - if (type === 'pitch') { + /*if (type === 'pitch') { // type이 pitch인 경우 소수점 1자리까지만 입력 가능 const reg = /^[0-9]+(\.[0-9]{0,1})?$/ @@ -481,7 +481,7 @@ export function useRoofAllocationSetting(id) { } return - } + }*/ const newRoofList = currentRoofList.map((roof, idx) => { if (idx === index) { diff --git a/src/hooks/roofcover/useRoofShapePassivitySetting.js b/src/hooks/roofcover/useRoofShapePassivitySetting.js index c51da066..33d5d953 100644 --- a/src/hooks/roofcover/useRoofShapePassivitySetting.js +++ b/src/hooks/roofcover/useRoofShapePassivitySetting.js @@ -203,6 +203,20 @@ export function useRoofShapePassivitySetting(id) { const roofBases = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) const exceptObjs = canvas.getObjects().filter((obj) => obj.name !== 'outerLine' && obj.parent?.name !== 'outerLine') const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') + + let checkedAllSetting = true + + lines.forEach((line) => { + if (!line.attributes) { + checkedAllSetting = false + } + }) + + if (!checkedAllSetting) { + swalFire({ text: '설정이 완료되지 않은 외벽선이 있습니다.', icon: 'warning' }) + return + } + exceptObjs.forEach((obj) => { canvas.remove(obj) })