diff --git a/src/views/control/main/ControlMain.js b/src/views/control/main/ControlMain.js index 136d8b93..19208d68 100644 --- a/src/views/control/main/ControlMain.js +++ b/src/views/control/main/ControlMain.js @@ -1,12 +1,5 @@ import { useEffect, useState } from 'react'; -import { - Sun, - Map, - Navigation2, - Cloud, - CloudRain, - CloudSnow -} from 'react-feather'; +import { Map } from 'react-feather'; import { AiOutlinePoweroff } from 'react-icons/ai'; import { Card } from 'reactstrap'; import '../../../assets/css/custom.css'; @@ -27,8 +20,8 @@ import { laancModeAction } from '../../../modules/control/map/actions/controlMapActions'; import Dddd from '../setting/Dddd'; - import ControlMenuLeft from '../menu/ControlMenuLeft'; +import ControlTopPackage from '../menu/ControlTopPackage'; const ControlMain = () => { const dispatch = useDispatch(); @@ -39,9 +32,7 @@ const ControlMain = () => { const { controlGpList, controlGroupAuthInfo } = useSelector( state => state.controlGpState ); - const { controlDetail, controlWheather } = useSelector( - state => state.controlGpDtlState - ); + const { controlGpCountDrone, controlGpCountFlight } = useSelector( state => state.controlGpCountState ); @@ -134,20 +125,6 @@ const ControlMain = () => { ny: 126.793722 }; - const weathericon = () => { - if (controlWheather) { - let wheatherDetail = controlWheather.items.item; - let skyDetail = wheatherDetail[6].fcstValue; - if (skyDetail == 1 || skyDetail == 2 || skyDetail == 4) { - return ; - } else if (skyDetail == 3) { - return ; - } else if (wheatherDetail[5].fcstValue == 1) { - return ; - } else return ; - } - }; - const handlerLaanc = () => { dispatch(laancModeAction(!isLaanc)); }; @@ -192,97 +169,16 @@ const ControlMain = () => { : 'main-data main-data-test' } > -
- -
- - {!isClickObject - ? '김포공항' - : !controlDetail?.stAreaNm - ? `${controlDetail?.res.area1} ${controlDetail?.res.area2} ${controlDetail?.res.area3} ${controlDetail?.res.landNm} ${controlDetail?.res.landNum} ` - : controlDetail?.stAreaNm} - -  {weathericon()} -
-
-
- 기온 - - {!isClickObject - ? controlWheather?.items.item[12].fcstValue - : controlDetail?.items.item[12].fcstValue} - ℃ - -
-
- 풍향 - - - -
-
- 풍속 - - {!isClickObject - ? controlWheather?.items.item[4].fcstValue - : controlDetail?.items.item[4].fcstValue}{' '} - m/s - -
-
-
-
-
- -
- 비행중인 기체 -
-
-
- 드론 - {/* {controlGpList ? controlGpList.length : 0} */} - {/* - {controlGpCountDrone?.length > 0 - ? controlGpCountDrone?.length - : 0} - */} - {droneCount} -
-
- UAM - {uamCount} -
-
- 항공기 - {/* 2147대 */} - - {controlGpCountFlight?.length > 0 - ? controlGpCountFlight?.length - : 0} - -
-
-
-
-
- -
- LAANC 시스템 -
-
-
- 승인요청 바로가기 -
-
-
-
+ {/* top components start */} + {isLaanc ? null : ( + + )} + {/* top components end */} {oepnReportList ? ( state.controlGpDtlState + ); + const { isClickObject } = useSelector(state => state.controlMapReducer); + + const weatherIcon = () => { + if (controlWheather) { + let wheatherDetail = controlWheather.items.item; + let skyDetail = wheatherDetail[6].fcstValue; + if (skyDetail == 1 || skyDetail == 2 || skyDetail == 4) { + return ; + } else if (skyDetail == 3) { + return ; + } else if (wheatherDetail[5].fcstValue == 1) { + return ; + } else return ; + } + }; + + return ( + <> +
+ +
+ + {!isClickObject + ? '김포공항' + : !controlDetail?.stAreaNm + ? `${controlDetail?.res.area1} ${controlDetail?.res.area2} ${controlDetail?.res.area3} ${controlDetail?.res.landNm} ${controlDetail?.res.landNum} ` + : controlDetail?.stAreaNm} + +  {weatherIcon()} +
+
+
+ 기온 + + {!isClickObject + ? controlWheather?.items.item[12].fcstValue + : controlDetail?.items.item[12].fcstValue} + ℃ + +
+
+ 풍향 + + + +
+
+ 풍속 + + {!isClickObject + ? controlWheather?.items.item[4].fcstValue + : controlDetail?.items.item[4].fcstValue}{' '} + m/s + +
+
+
+
+
+ +
+ 비행중인 기체 +
+
+
+ 드론 + {dronCnt} +
+
+ UAM + {uamCnt} +
+
+ 항공기 + {flightCnt} +
+
+
+
+
+ +
+ LAANC 시스템 +
+
+
+ 승인요청 바로가기 +
+
+
+
+ + ); +} + +export default ControlTopPackage;