발전 시뮬레이션 초기화 셋팅 값 수정
This commit is contained in:
parent
65a7126a59
commit
757002b0b1
@ -3,6 +3,7 @@
|
||||
import 'chart.js/auto'
|
||||
import { Bar } from 'react-chartjs-2'
|
||||
import dayjs from 'dayjs'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
import { useEffect, useState, useRef, useContext } from 'react'
|
||||
import { useRecoilState } from 'recoil'
|
||||
@ -14,11 +15,16 @@ import { useMessage } from '@/hooks/useMessage'
|
||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||
|
||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||
// import { useSearchParams } from 'next/navigation'
|
||||
|
||||
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 chartRef = useRef(null)
|
||||
|
||||
// 캔버스 메뉴 넘버 셋팅
|
||||
@ -96,6 +102,16 @@ export default function Simulator() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
/* 초기화 작업 */
|
||||
setChartData([])
|
||||
setObjectDetail({})
|
||||
setModuleInfoList([])
|
||||
setPcsInfoList([])
|
||||
setHatsudenryouAll([])
|
||||
setHatsudenryouAllSnow([])
|
||||
setHatsudenryouPeakcutAll([])
|
||||
setHatsudenryouPeakcutAllSnow([])
|
||||
|
||||
if (objectNo) {
|
||||
fetchObjectDetail(objectNo)
|
||||
fetchSimulatorNotice()
|
||||
@ -192,7 +208,8 @@ export default function Simulator() {
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('simulator.title.sub1')}</div>
|
||||
<div className="estimate-name">
|
||||
{objectDetail.objectNo} (Plan No: {pid})
|
||||
{objectDetail.objectNo}
|
||||
{`${objectDetail.planNo ? `(Plan No: ${objectDetail.planNo})` : ''}`}
|
||||
</div>
|
||||
</div>
|
||||
{/* 작성일 */}
|
||||
@ -291,7 +308,7 @@ export default function Simulator() {
|
||||
{chartData.length > 0 ? (
|
||||
<tr>
|
||||
{chartData.map((data) => (
|
||||
<td key={data}>{data}</td>
|
||||
<td key={uuidv4()}>{data}</td>
|
||||
))}
|
||||
</tr>
|
||||
) : (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user