diff --git a/src/containers/basis/flight/aprv/FlightPlanAprvContainer_bdf.js b/src/containers/basis/flight/aprv/FlightPlanAprvContainer_bdf.js new file mode 100644 index 00000000..fef28aab --- /dev/null +++ b/src/containers/basis/flight/aprv/FlightPlanAprvContainer_bdf.js @@ -0,0 +1,178 @@ +import React, {useEffect, useState} from 'react'; +import {Col, Row, Button} from 'reactstrap'; +import {CustomMainLayout} from '../../../../components/layout/CustomMainLayout'; +import moment from 'moment/moment'; +import FlightPlanAprvSearch from '../../../../components/basis/flight/aprv/FlightPlanAprvSearch'; +import FlightPlanAprvGrid from '../../../../components/basis/flight/aprv/FlightPlanAprvGrid'; +import FlightPlanGrid from '../../../../components/basis/flight/plan/FlightPlanGrid'; +import {useDispatch, useSelector, shallowEqual} from 'react-redux'; +import * as FlightAction from '../../../../modules/basis/flight/actions/basisFlightAction'; +import {useHistory} from 'react-router-dom'; +import FlightPlanGroupGrid from '../../../../components/basis/flight/plan/FlightPlanGroupGrid'; +import { JOIN_LIST } from '../../../../modules/basis/group/actions/basisGroupAction'; + +const initSearchData = { + schFltStDt: moment().set({'date': 1, 'h': 0, 'm': 0, 's': 0}).format('YYYY-MM-DD HH:mm:ss'), + schFltEndDt: moment().set({'h': 23, 'm': 59, 's': 59}).format('YYYY-MM-DD HH:mm:ss'), + aprvlYn: 'N', + groupId: '', + cstmrSno: 0, +}; + + +const FlightPlanAprvContainer_Df = () => { + const dispatch = useDispatch(); + const history = useHistory(); + const [searchData, setSearchData] = useState(initSearchData); + const [selPlanSnoList, setSelPlanSnoList] = useState([]); + const {list: aprvList, aprvProc, selectGroup} = useSelector(state => state.flightState); + const { joinList, joinListCount } = useSelector(state => state.groupState); + const { user } = useSelector(state => state.authState, shallowEqual); + + + const handleGroupSelect = ({ groupId, groupNm, groupAuthCd }) => { + // 권한 상관 없이 모두 조회 가능 + const param = searchData; + + param.cstmrSno = user.cstmrSno; + param.groupId = groupId; + + dispatch(FlightAction.FLIGHT_PLAN_GROUP_SELECT( {cstmrSno: user.cstmrSno, groupId: groupId, groupNm: groupNm} )); + + // groupId sessionStorage에 보관 (1 브라우저 1 tab에만 유효) + sessionStorage.setItem('groupId', groupId); + sessionStorage.setItem('cstmrSno', user.cstmrSno); + + setSearchData(prevState => { + return { + ...prevState, + cstmrSno: user.cstmrSno, + groupId: groupId + } + }); + + dispatch(FlightAction.FLIGHT_PLAN_LIST.request(param)); + } + + const handlerGroupCancel = () => { + dispatch(FlightAction.FLIGHT_PLAN_GROUP_SELECT( {cstmrSno: 0, groupId: '', groupNm: ''} )); + } + + + const handleMoveDetail = (id) => { + history.push(`/basis/flight/plan/detail/${id}`) + } + + const columns = [ + {id: 'planSno', name: '번호', cell: (row, i) => (