Browse Source

드론 관제 -> 드론 클릭 풀리는 현상 및 코드 정리

ctrlDraw
김장현 2 years ago
parent
commit
b9f01387f5
  1. 2
      src/containers/analysis/history/AnalysisHistoryContainer.js
  2. 42
      src/views/control/main/ControlMain.js
  3. 18
      src/views/control/report/ControlReportDetail.js

2
src/containers/analysis/history/AnalysisHistoryContainer.js

@ -91,7 +91,7 @@ export const AnalysisHistoryContainer = props => {
// const param = params;
// param.groupId = groupId;
console.log(groupId);
dispatch(FlightAction.FLIGHT_PLAN_GROUP_SELECT({ groupId: groupId }));
// groupId sessionStorage에 보관 (1 브라우저 1 tab에만 유효)

42
src/views/control/main/ControlMain.js

@ -31,8 +31,8 @@ const ControlMain = () => {
const [alarm, setAlarm] = useState(false);
const [oepnReportList, setOpenReportList] = useState(false);
const [openReportDetail, setOpenReportDetail] = useState(false);
const [openWeatherList, setOpenWeatherList] = useState(false);
// const [openReportDetail, setOpenReportDetail] = useState(false);
// const [openWeatherList, setOpenWeatherList] = useState(false);
const [openAlarmList, setOpenAlarmList] = useState(false);
@ -41,29 +41,29 @@ const ControlMain = () => {
const openMenu = val => {
if (val === 'reportList') {
setOpenReportList(true);
setOpenReportDetail(false);
setOpenWeatherList(false);
// setOpenReportDetail(false);
// setOpenWeatherList(false);
setOpenAlarmList(false);
} else if (val === 'weatherList') {
setOpenReportList(false);
setOpenReportDetail(false);
setOpenWeatherList(true);
// setOpenReportDetail(false);
// setOpenWeatherList(true);
setOpenAlarmList(false);
} else if (val === 'alarmList') {
dispatch(objectUnClickAction());
setOpenReportList(false);
setOpenReportDetail(false);
setOpenWeatherList(false);
// setOpenReportDetail(false);
// setOpenWeatherList(false);
setOpenAlarmList(true);
setAlarm(false);
}
};
const openReportDetailParam = val => {
setOpenReportDetail(true);
};
// const openReportDetailParam = val => {
// setOpenReportDetail(true);
// };
const handlerLogout = () => {
dispatch(Actions.logout.request());
@ -81,6 +81,18 @@ const ControlMain = () => {
}
}, [controlGpList]);
useEffect(() => {
if (isClickObject) {
setOpenReportList(false);
setOpenAlarmList(false);
}
}, [isClickObject]);
const handlerClose = () => {
setOpenReportList(true);
dispatch(objectUnClickAction());
};
return (
<>
<ControlAlarmNotice />
@ -131,22 +143,22 @@ const ControlMain = () => {
{oepnReportList ? (
<ControlReportList
openReportDetailParam={openReportDetailParam}
// openReportDetailParam={openReportDetailParam}
setOpenReportList={setOpenReportList}
/>
) : (
<div />
)}
{isClickObject ? (
<ControlReportDetail setOpenReportDetail={setOpenReportDetail} />
<ControlReportDetail handlerClose={handlerClose} />
) : (
<div />
)}
{openWeatherList ? (
{/* {openWeatherList ? (
<WeatherList setOpenWeatherList={setOpenWeatherList} />
) : (
<div />
)}
)} */}
{openAlarmList ? (
<ControlAlarmList setOpenAlarmList={setOpenAlarmList} />

18
src/views/control/report/ControlReportDetail.js

@ -11,7 +11,10 @@ import {
GET_ARCTFT_TYPE_CD,
GET_WGHT_TYPE_CD
} from '../../../utility/CondeUtil';
import { controlGpLogAction, controlweatherAction } from '../../../modules/control/gp';
import {
controlGpLogAction,
controlweatherAction
} from '../../../modules/control/gp';
import ControlAlarmDetail from '../alarm/ControlAlarmDetail';
import axios from '../../../modules/utils/customAxiosUtil';
import {
@ -35,7 +38,6 @@ const ControlReportDetail = props => {
//const { controlWheather } = useSelector(state => state.ControlGpWeatherState);
const { controlGpWarnLog } = useSelector(state => state.controlGpLogState);
function weathericon() {
if (controlDetail) {
let wheatherDetail = controlDetail.items.item;
@ -58,10 +60,6 @@ const ControlReportDetail = props => {
}
}, [historyModal]);
const handlerClose = () => {
dispatch(objectUnClickAction());
};
const nullMessage = val => {
if (val) {
return val;
@ -78,7 +76,7 @@ const ControlReportDetail = props => {
className='btn-icon'
color='primary'
// onClick={() => props.setOpenReportDetail(false)}
onClick={() => handlerClose()}
onClick={() => props.handlerClose()}
>
<X size={20} />
</button>
@ -290,7 +288,9 @@ const ControlReportDetail = props => {
</thead>
<tbody>
<tr>
<td>{controlDetail?.items.item[0].baseTime.substring(0, 2)}</td>
<td>
{controlDetail?.items.item[0].baseTime.substring(0, 2)}
</td>
<td>{weathericon()}</td>
<td>{controlDetail?.items.item[12].fcstValue}</td>
<td>
@ -313,7 +313,7 @@ const ControlReportDetail = props => {
setHistoryModal={setHistoryModal}
controlGpWarnLog={controlGpWarnLog}
/>
</div >
</div>
);
};

Loading…
Cancel
Save