Merge branch 'dev' of https://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
c298e31bbd
@ -18,7 +18,12 @@ import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
|||||||
import { usePlan } from '@/hooks/usePlan'
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
import { usePopup, closeAll } from '@/hooks/usePopup'
|
import { usePopup, closeAll } from '@/hooks/usePopup'
|
||||||
|
|
||||||
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
export default function Simulator() {
|
export default function Simulator() {
|
||||||
|
// global 로딩바
|
||||||
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
const { floorPlanState } = useContext(FloorPlanContext)
|
const { floorPlanState } = useContext(FloorPlanContext)
|
||||||
const { objectNo, pid } = floorPlanState
|
const { objectNo, pid } = floorPlanState
|
||||||
const { selectedPlan } = usePlan()
|
const { selectedPlan } = usePlan()
|
||||||
@ -136,9 +141,12 @@ export default function Simulator() {
|
|||||||
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
||||||
|
|
||||||
const fetchObjectDetail = async (objectNo, currentPid) => {
|
const fetchObjectDetail = async (objectNo, currentPid) => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
|
|
||||||
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${currentPid}`
|
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${currentPid}`
|
||||||
|
|
||||||
const resultData = await get({ url: apiUrl })
|
const resultData = await get({ url: apiUrl })
|
||||||
|
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
setObjectDetail(resultData)
|
setObjectDetail(resultData)
|
||||||
if (resultData.hatsudenryouAll) {
|
if (resultData.hatsudenryouAll) {
|
||||||
@ -161,12 +169,14 @@ export default function Simulator() {
|
|||||||
setModuleInfoList(resultData.roofModuleList)
|
setModuleInfoList(resultData.roofModuleList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setIsGlobalLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 시뮬레이션 안내사항 조회
|
// 시뮬레이션 안내사항 조회
|
||||||
const [content, setContent] = useState('')
|
const [content, setContent] = useState('')
|
||||||
|
|
||||||
const fetchSimulatorNotice = async () => {
|
const fetchSimulatorNotice = async () => {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
get({ url: '/api/pwrGnrSimulation/guideInfo' }).then((res) => {
|
get({ url: '/api/pwrGnrSimulation/guideInfo' }).then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
setContent(res.data.replaceAll('\n', '<br/>'))
|
setContent(res.data.replaceAll('\n', '<br/>'))
|
||||||
@ -174,6 +184,7 @@ export default function Simulator() {
|
|||||||
setContent(getMessage('common.message.no.data'))
|
setContent(getMessage('common.message.no.data'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
setIsGlobalLoading(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 차트 데이터 변경 시, list type 셋팅
|
// 차트 데이터 변경 시, list type 셋팅
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user