From eac19c76203c1ba4574c3a1a34761943f517bf0a Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 10:36:27 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20&=20=EB=B0=9C?= =?UTF-8?q?=EC=A0=84=EC=8B=9C=EB=AE=AC=EB=A0=88=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=20=EA=B4=80=EB=A0=A8=20pid=20=EC=85=8B?= =?UTF-8?q?=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 14 +++++++++----- src/hooks/usePlan.js | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index c5fb9194..19db2fde 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -44,6 +44,7 @@ import JA from '@/locales/ja.json' import { MENU } from '@/common/common' import { QcastContext } from '@/app/QcastProvider' + export default function CanvasMenu(props) { const { menuNumber, setMenuNumber } = props const pathname = usePathname() @@ -101,6 +102,8 @@ export default function CanvasMenu(props) { const { setIsGlobalLoading } = useContext(QcastContext) + //임시 + const { selectedPlan } = usePlan() const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => { const url = '/api/estimate/excel-download' @@ -168,14 +171,14 @@ export default function CanvasMenu(props) { break case 5: // let pid = urlParams.get('pid') - promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data - if (estimateDetail.docNo) { + if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { setMenuNumber(menu.index) setCurrentMenu(menu.title) setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) - router.push(`/floor-plan/estimate/5?pid=${pid}&objectNo=${objectNo}`) + router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) } else { swalFire({ text: getMessage('estimate.menu.move.valid1') }) } @@ -183,13 +186,14 @@ export default function CanvasMenu(props) { }) break case 6: - promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data + //docno tempFlg0 if (estimateDetail.docNo) { setMenuNumber(menu.index) setCurrentMenu(menu.title) - router.push(`/floor-plan/simulator/${menu.index}?pid=${pid}&objectNo=${objectNo}`) + router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) } else { swalFire({ text: getMessage('simulator.menu.move.valid1') }) } diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index fb743828..10c1dc2d 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -215,7 +215,6 @@ export function usePlan(params = {}) { const estimateDetail = res.data if (pathname === '/floor-plan/estimate/5') { if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { - console.log('이동') res.data.resetFlag = 'N' if (res.data.itemList.length > 0) { From 6021fa537c257178b6c2e193450a3225f4f241c6 Mon Sep 17 00:00:00 2001 From: LEEYONGJAE Date: Fri, 17 Jan 2025 10:46:52 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AE=AC?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EB=A9=94=EB=89=B4=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=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 | 3 +- src/components/simulator/Simulator.jsx | 38 +++++++++--------------- src/hooks/usePlan.js | 9 ++++-- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 19db2fde..012b62e9 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -189,8 +189,7 @@ export default function CanvasMenu(props) { promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data - //docno tempFlg0 - if (estimateDetail.docNo) { + if (estimateDetail.tempFlg === '0') { setMenuNumber(menu.index) setCurrentMenu(menu.title) router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) diff --git a/src/components/simulator/Simulator.jsx b/src/components/simulator/Simulator.jsx index ef752582..249398c4 100644 --- a/src/components/simulator/Simulator.jsx +++ b/src/components/simulator/Simulator.jsx @@ -16,26 +16,18 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { convertNumberToPriceDecimal } from '@/util/common-utils' import { usePlan } from '@/hooks/usePlan' -import { usePopup } from '@/hooks/usePopup' -// import { useSearchParams } from 'next/navigation' +import { usePopup, closeAll } from '@/hooks/usePopup' export default function Simulator() { const { floorPlanState } = useContext(FloorPlanContext) const { objectNo, pid } = floorPlanState - - // const searchParams = useSearchParams() - // const objectNo = searchParams.get('objectNo') - // const pid = searchParams.get('pid') const { selectedPlan } = usePlan() const chartRef = useRef(null) // 캔버스 메뉴 넘버 셋팅 const { setMenuNumber } = useCanvasMenu() - - useEffect(() => { - setMenuNumber(6) - }, []) + const { closeAll } = usePopup() const { get } = useAxios() const { getMessage } = useMessage() @@ -43,12 +35,6 @@ export default function Simulator() { // 차트 관련 const [chartData, setChartData] = useState([]) - const { closeAll } = usePopup() - - useEffect(() => { - closeAll() - }, []) - const data = { labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], datasets: [ @@ -114,7 +100,6 @@ export default function Simulator() { } useEffect(() => { - console.log('🚀 ~ useEffect ~ selectedPlan:', selectedPlan) /* 초기화 작업 */ setChartData([]) setObjectDetail({}) @@ -125,11 +110,13 @@ export default function Simulator() { setHatsudenryouPeakcutAll([]) setHatsudenryouPeakcutAllSnow([]) - if (objectNo) { - fetchObjectDetail(objectNo) + if (objectNo && pid && selectedPlan) { + fetchObjectDetail(objectNo, selectedPlan.ordering) fetchSimulatorNotice() setPwrGnrSimType('D') setPwrRecoil({ ...pwrRecoil, type: 'D' }) + setMenuNumber(6) + closeAll() } }, [objectNo, pid, selectedPlan]) @@ -148,8 +135,8 @@ export default function Simulator() { const [hatsudenryouPeakcutAll, setHatsudenryouPeakcutAll] = useState([]) const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([]) - const fetchObjectDetail = async (objectNo) => { - const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${pid}` + const fetchObjectDetail = async (objectNo, currentPid) => { + const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${currentPid}` const resultData = await get({ url: apiUrl }) if (resultData) { @@ -234,7 +221,7 @@ export default function Simulator() { {/* 시스템용량 */}
-
{getMessage('simulator.title.sub3')}
+
{getMessage('simulator.title.sub3')}
{objectDetail.capacity ? `${convertNumberToPriceDecimal(objectDetail.capacity)} kW` : ''}
{/* 연간예측발전량 */} @@ -257,7 +244,7 @@ export default function Simulator() { {/* 적설조건 */}
{getMessage('simulator.title.sub7')}
-
{objectDetail.snowfall} cm
+
{objectDetail.snowfall ? `${objectDetail.snowfall}cm` : ''}
{/* 풍속조건 */}
@@ -356,7 +343,10 @@ export default function Simulator() { {/* 지붕면 */} {moduleInfo.roofSurface} {/* 경사각 */} - {convertNumberToPriceDecimal(moduleInfo.slopeAngle)}{moduleInfo.classType == 0 ? "寸":"º"} + + {convertNumberToPriceDecimal(moduleInfo.slopeAngle)} + {moduleInfo.classType == 0 ? '寸' : 'º'} + {/* 방위각(도) */} {convertNumberToPriceDecimal(moduleInfo.azimuth)} {/* 태양전지모듈 */} diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 10c1dc2d..a0733e57 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -237,9 +237,12 @@ export function usePlan(params = {}) { swalFire({ text: getMessage('estimate.menu.move.valid1') }) } } else { - //발전시뮬레이션 - // 클릭한 플랜 탭으로 이동 - // updateCurrentPlan(newCurrentId) + // 발전시뮬레이션 + if (estimateDetail.tempFlg === '0') { + updateCurrentPlan(newCurrentId) + } else { + swalFire({ text: getMessage('simulator.menu.move.valid1') }) + } } } }) From b47ae97dd1174b1db30d7919c69a57268c9365e8 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 11:01:41 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=EC=8B=9C=20saleStoreId=20=EC=85=8B=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/Stuff.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx index f55815fb..987be2f1 100644 --- a/src/components/management/Stuff.jsx +++ b/src/components/management/Stuff.jsx @@ -219,6 +219,10 @@ export default function Stuff() { pageSize: stuffSearchParams?.pageSize ? stuffSearchParams.pageSize : 100, } + if (!params.saleStoreId) { + params.saleStoreId = session.storeId + } + async function fetchData() { const apiUrl = `/api/object/list?${queryStringFormatter(params)}` await get({ @@ -271,6 +275,10 @@ export default function Stuff() { stuffSearchParams.schSortType = defaultSortType stuffSearchParams.pageNo = stuffSearchParams.pageNo + if (!stuffSearchParams.saleStoreId) { + stuffSearchParams.saleStoreId = session.storeId + } + async function fetchData() { const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}` await get({ url: apiUrl }).then((res) => { @@ -301,6 +309,9 @@ export default function Stuff() { stuffSearchParams.schSortType = defaultSortType setPageNo(1) + if (!params.saleStoreId) { + stuffSearchParams.saleStoreId = session.storeId + } async function fetchData() { const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}` await get({ url: apiUrl }).then((res) => { From 558594e450ba19345a0c211aa419d1036bbae999 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 17 Jan 2025 11:11:47 +0900 Subject: [PATCH 4/5] =?UTF-8?q?currentRoofList=20=EC=98=A4=EB=A5=98=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 --- .../ContextRoofAllocationSetting.jsx | 231 +++++++++--------- .../roofcover/useRoofAllocationSetting.js | 2 +- 2 files changed, 117 insertions(+), 116 deletions(-) diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx index e8942948..1d5bc188 100644 --- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx @@ -79,133 +79,134 @@ export default function ContextRoofAllocationSetting(props) {
- {currentRoofList.map((roof, index) => { - return ( -
-
- - -
-
-
-
-
- handleChangeRoofMaterial(e, index)} - /> -
- {index === 0 && {getMessage('modal.roof.alloc.default.roof.material')}} - {index !== 0 && } -
+ {currentRoofList.length > 0 && + currentRoofList.map((roof, index) => { + return ( +
+
+ +
-
-
- {getMessage('slope')} -
- { - handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) - }} - defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} - /> +
+
+
+
+ handleChangeRoofMaterial(e, index)} + /> +
+ {index === 0 && {getMessage('modal.roof.alloc.default.roof.material')}} + {index !== 0 && }
- {pitchText}
-
- {(roof.widAuth || roof.lenAuth) && (
- {roof.widAuth && ( -
- W -
- -
+
+ {getMessage('slope')} +
+ { + handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) + }} + defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} + />
- )} - {roof.lenAuth && ( -
- L -
- -
-
- )} + {pitchText} +
- )} - {(roof.raftAuth || roof.roofPchAuth) && ( -
- {roof.raftAuth && ( -
+ {(roof.widAuth || roof.lenAuth) && ( +
+ {roof.widAuth && (
- {getMessage('modal.placement.initial.setting.rafter')} - {raftCodes.length > 0 && ( -
- -
- )} -
-
- )} - {roof.roofPchAuth && ( -
-
- {getMessage('hajebichi')} -
- + W +
+
-
- )} -
- )} -
-
- - + )} + {roof.lenAuth && ( +
+ L +
+ +
+
+ )} +
+ )} + {(roof.raftAuth || roof.roofPchAuth) && ( +
+ {roof.raftAuth && ( +
+
+ {getMessage('modal.placement.initial.setting.rafter')} + {raftCodes.length > 0 && ( +
+ +
+ )} +
+
+ )} + {roof.roofPchAuth && ( +
+
+ {getMessage('hajebichi')} +
+ +
+
+
+ )} +
+ )} +
+
+ + +
-
- ) - })} + ) + })}