-
-
{props.title} 상세정보
-
-
- {props.groupData.type === 'update' ? (
-
최종 수정일자 : {props.groupData.updateDt}
- ) : null}
+
-
-
-
-
+
+
+
+
+
);
};
diff --git a/src/components/map/naver/dron/DronToast.js b/src/components/map/naver/dron/DronToast.js
index 76e1fc1..de18578 100644
--- a/src/components/map/naver/dron/DronToast.js
+++ b/src/components/map/naver/dron/DronToast.js
@@ -6,34 +6,41 @@ import Avatar from '../../../../@core/components/avatar';
import { Bell, Check, X, AlertTriangle, Info } from 'react-feather'
import { controlGpDtlAction, controlGpFlightPlanAction } from '../../../../modules/control/gp';
import { objectClickAction, objectUnClickAction } from '../../../../modules/control/map/actions/controlMapActions';
+import 'react-toastify/dist/ReactToastify.css';
const DronToast = () => {
- const dispatch = useDispatch();
+ const dispatch = useDispatch();
const { controlGpList } = useSelector(state => state.controlGpState);
+ const { controlGpArcrftWarnList } = useSelector(state => state.controlGpLogState);
const [toastId, setToastId] = useState();
useEffect(() => {
- if (controlGpList) {
+ if (controlGpArcrftWarnList) {
+ console.log("===================================")
+ console.log('tastID : ', toastId);
if (!toastId) {
- controlGpList.forEach(gps => {
- // console.log("===================================")
+ controlGpArcrftWarnList.forEach(warn => {
// console.log("Warn ==> ", gps.controlWarnCd);
// console.log("Noti ==> ", gps.controlWarnNotyCd);
- if (gps.controlWarnCd && gps.controlWarnNotyCd) {
+ if (warn.controlWarnCd) {
+ console.log('warn CD : ', warn.controlWarnCd);
const id = toast.info(
toastRender(
- `${gps.objectId} 비정상 상황 알림`,
+ `${warn.idntfNum} 비정상 상황 알림`,
`경로 상에 비행 구역을 이탈했습니다.`
),
{
autoClose: false,
hideProgressBar: true,
position: toast.POSITION.BOTTOM_RIGHT,
- onClick: props => {
+ onClick: () => {
+ setToastId(null);
+ handleNotiClick(warn.controlId, warn.idntfNum);
+ },
+ onClose: () => {
setToastId(null);
- handleNotiClick(gps.controlId, gps.objectId);
}
}
)
@@ -43,7 +50,7 @@ const DronToast = () => {
})
}
}
- }, [controlGpList]);
+ }, [controlGpArcrftWarnList]);
const handleNotiClick = (controlId, idntfNum) => {
dispatch(objectClickAction(controlId));
@@ -73,23 +80,7 @@ const DronToast = () => {
)
}
- return (
- //
- //
- //
- //
} />
- //
- // {/* {title} */}
- //
- //
- //
-
- //
- //
- // {/* {message} */}
- //
- //
- //
+ return (
null
)
diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js
index cc4df95..43a6a58 100644
--- a/src/containers/analysis/history/AnalysisHistoryContainer.js
+++ b/src/containers/analysis/history/AnalysisHistoryContainer.js
@@ -8,12 +8,19 @@ import { CustomMainLayout } from '../../../components/layout/CustomMainLayout';
import * as Actions from '../../../modules/analysis/history/actions/analysisHistoryAction';
import FlightPlanGroupGrid from '../../../components/basis/flight/plan/FlightPlanGroupGrid';
import { JOIN_LIST } from '../../../modules/basis/group/actions/basisGroupAction';
-import { Col, Row, Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
+import {
+ Col,
+ Row,
+ Button,
+ Modal,
+ ModalHeader,
+ ModalBody,
+ ModalFooter
+} from 'reactstrap';
import * as FlightAction from '../../../modules/basis/flight/actions/basisFlightAction';
import { useHistory } from 'react-router-dom';
import { MessageErrorModal } from '../../../components/message/MessageErrorModal';
-
export const AnalysisHistoryContainer = props => {
const { data, count, searchParams } = useSelector(
state => state.analysisHistoryState
@@ -23,12 +30,15 @@ export const AnalysisHistoryContainer = props => {
endDate: moment().subtract(0, 'day').format('YYYY-MM-DD'),
// stDate: moment().set({ 'date': 1, 'h': 0, 'm': 0, 's': 0 }).format('YYYY-MM-DD HH:mm:ss'),
// endDate: moment().set({ 'h': 23, 'm': 59, 's': 59 }).format('YYYY-MM-DD HH:mm:ss'),
- groupId: '',
-
+ groupId: ''
};
const [searchData, setSearchData] = useState(initSearchData);
- const { list: aprvList, aprvProc, selectGroup } = useSelector(state => state.flightState);
+ const {
+ list: aprvList,
+ aprvProc,
+ selectGroup
+ } = useSelector(state => state.flightState);
const { joinList, joinListCount } = useSelector(state => state.groupState);
const { user } = useSelector(state => state.authState, shallowEqual);
@@ -42,6 +52,42 @@ export const AnalysisHistoryContainer = props => {
color: ''
});
+ useEffect(() => {
+ if (aprvProc && aprvProc.result > 0) {
+ handleSearch(searchData);
+ }
+ }, [aprvProc]);
+
+ useEffect(() => {
+ if (user?.cstmrSno) {
+ dispatch(
+ JOIN_LIST.request({
+ cstmrSno: user?.cstmrSno
+ })
+ );
+ }
+ }, [user]);
+
+ useEffect(() => {
+ setParams({
+ ...params,
+ stDate: '',
+ endDate: '',
+ search1: '',
+ groupId: searchData.groupId
+ });
+ }, [searchData.groupId]);
+
+ useEffect(() => {
+ handlerGroupCancel();
+ }, []);
+
+ const onKeyPress = e => {
+ if (e.key == 'Enter') {
+ handlerSearch();
+ }
+ };
+
const handleGroupSelect = ({ groupId }) => {
// 권한 상관 없이 모두 조회 가능
const param = searchData;
@@ -54,47 +100,33 @@ export const AnalysisHistoryContainer = props => {
sessionStorage.setItem('groupId', groupId);
sessionStorage.setItem('cstmrSno', user.cstmrSno);
- setIsClick(0)
+ setIsClick(0);
setSearchData(prevState => {
return {
...prevState,
// cstmrSno: user.cstmrSno,
groupId: groupId
- }
+ };
});
- //dispatch(Actions.list.request({ searchParams: param }));
- }
+ dispatch(Actions.LIST_INITAL());
+ };
const handlerGroupCancel = () => {
- dispatch(FlightAction.FLIGHT_PLAN_GROUP_SELECT({ cstmrSno: 0, groupId: '', groupNm: '', endDate: '', stDate: '' }));
- setIsClick(0)
-
- }
-
-
-
- useEffect(() => {
- if (aprvProc && aprvProc.result > 0) {
- handleSearch(searchData);
- }
- }, [aprvProc])
-
- useEffect(() => {
- if (user?.cstmrSno) {
- dispatch(
- JOIN_LIST.request({
- cstmrSno: user?.cstmrSno
- })
- );
- }
- }, [user])
-
+ dispatch(
+ FlightAction.FLIGHT_PLAN_GROUP_SELECT({
+ cstmrSno: 0,
+ groupId: '',
+ groupNm: '',
+ endDate: '',
+ stDate: ''
+ })
+ );
+ setIsClick(0);
+ };
const dispatch = useDispatch();
const titleName = '비행이력 현황';
-
-
const excelHeaders = [
{ label: '일자', key: 'cntrlStDt' },
{ label: '식별번호', key: 'idntfNum' },
@@ -207,32 +239,8 @@ export const AnalysisHistoryContainer = props => {
endDate: moment().subtract(-1, 'day').format('YYYY-MM-DD'),
search1: '',
groupId: searchData.groupId
-
});
- useEffect(() => {
- setParams({
- ...params,
- stDate: '',
- endDate: '',
- search1: '',
- groupId: searchData.groupId
- });
- }, [searchData.groupId]);
-
-
- useEffect(() => {
- if (data) return;
- }, [searchParams]);
-
- const onKeyPress = e => {
- if (e.key == 'Enter') {
- handlerSearch();
- }
- };
-
- // useEffect(() => { }, [params]);
-
const handlerSearch = () => {
if (!params.stDate || !params.endDate) {
setModal({
@@ -240,18 +248,15 @@ export const AnalysisHistoryContainer = props => {
title: '필수값 입력 오류',
desc: '올바른 일자를 입력해 주세요.',
color: 'modal-danger'
- })
- }
- else if (!params.groupId) {
+ });
+ } else if (!params.groupId) {
setModal({
isOpen: true,
title: '필수값 입력 오류',
desc: '그룹 선택 해주세요.',
color: 'modal-danger'
- })
- }
- else
- dispatch(Actions.list.request({ searchParams: params }));
+ });
+ } else dispatch(Actions.list.request({ searchParams: params }));
};
const handlerInput = (type, val) => {
@@ -263,9 +268,9 @@ export const AnalysisHistoryContainer = props => {
setParams({
...params,
stDate: moment(val[0]).format('YYYY-MM-DD'),
- endDate: moment(val[1]).format('YYYY-MM-DD'),
+ endDate: moment(val[1]).format('YYYY-MM-DD')
});
- setIsClick(-1)
+ setIsClick(-1);
}
}
};
@@ -274,7 +279,6 @@ export const AnalysisHistoryContainer = props => {
setIsClick(val);
};
return (
-
@@ -302,13 +306,11 @@ export const AnalysisHistoryContainer = props => {
searchData={searchData}
/>
>
-
) : (
나의 그룹 목록에서 상세보기를 클릭하세요.
)}
-
{selectGroup.cstmrSno !== 0 ? (
@@ -320,15 +322,11 @@ export const AnalysisHistoryContainer = props => {
excelHeaders={excelHeaders}
count={count}
pagination={true}
-
/>
>
-
) : (
-
-
+
)}
-
@@ -357,6 +355,5 @@ export const AnalysisHistoryContainer = props => {
-
);
};
diff --git a/src/containers/basis/group/BasisGroupDetailContainer.js b/src/containers/basis/group/BasisGroupDetailContainer.js
index 6fa4f1f..8239212 100644
--- a/src/containers/basis/group/BasisGroupDetailContainer.js
+++ b/src/containers/basis/group/BasisGroupDetailContainer.js
@@ -61,12 +61,32 @@ export const BasisGroupDetailContainer = () => {
dispatch(Actions.GROUP_DETAIL.request(id));
};
- const handlerCreate = () => {
- dispatch(Actions.GROUP_CREATE.request(groupData));
+ const handlerCreate = data => {
+ const saveData = {
+ createDt: '',
+ cstmrSno: groupData.cstmrSno,
+ groupId: groupData.groupId,
+ groupNm: data.groupNm,
+ groupTypeCd: groupData.groupTypeCd,
+ type: groupData.type,
+ updateDt: ''
+ };
+ // dispatch(Actions.GROUP_CREATE.request(groupData));
+ dispatch(Actions.GROUP_CREATE.request(saveData));
};
- const handlerUpdate = () => {
- dispatch(Actions.GROUP_UPDATE.request(groupData));
+ const handlerUpdate = data => {
+ const saveData = {
+ createDt: groupData.createDt,
+ cstmrSno: groupData.cstmrSno,
+ groupId: groupData.groupId,
+ groupNm: data.groupNm,
+ groupTypeCd: groupData.groupTypeCd,
+ type: groupData.type,
+ updateDt: groupData.updateDt
+ };
+ // dispatch(Actions.GROUP_UPDATE.request(groupData));
+ dispatch(Actions.GROUP_UPDATE.request(saveData));
};
const handlerDelete = () => {
dispatch(Actions.GROUP_DELETE.request(groupData.groupId));
@@ -81,29 +101,33 @@ export const BasisGroupDetailContainer = () => {
return;
};
- const handlerInput = e => {
- const { name, value } = e.target;
- if (name == 'groupNm') {
- const regex = /^[ㄱ-힣A-Za-z0-9]{0,11}$/;
- if (regex.test(value)) {
- setGroupData({
- ...groupData,
- [name]: value
- });
- }
- }
+ const handlerSave = data => {
+ groupData.type === 'create' ? handlerCreate(data) : handlerUpdate(data);
};
+ // const handlerInput = e => {
+ // const { name, innerRef } = e.target;
+ // if (name == 'groupNm') {
+ // // const regex = /^[ㄱ-힣A-Za-z0-9]{0,11}$/;
+ // // if (regex.test(innerRef)) {
+ // console.log(innerRef);
+ // setGroupData({
+ // ...groupData,
+ // [name]: innerRef
+ // });
+ // // }
+ // }
+ // };
+
return (