From 0e548907cc97dee47f9477219289f15c3a30f34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?scnoh=28=EB=85=B8=EC=8A=B9=EC=B2=A0=29?= Date: Tue, 26 Jul 2022 18:45:42 +0900 Subject: [PATCH] . --- .../basis/flight/plan/FlightPlanPilot.js | 136 ++++++++++++++++++ .../flight/plan/FlightPlanPilotContainer.js | 41 ++++++ 2 files changed, 177 insertions(+) create mode 100644 src/components/basis/flight/plan/FlightPlanPilot.js create mode 100644 src/containers/basis/flight/plan/FlightPlanPilotContainer.js diff --git a/src/components/basis/flight/plan/FlightPlanPilot.js b/src/components/basis/flight/plan/FlightPlanPilot.js new file mode 100644 index 00000000..d35a1324 --- /dev/null +++ b/src/components/basis/flight/plan/FlightPlanPilot.js @@ -0,0 +1,136 @@ +import React from 'react'; +import {Button, Card, CardBody, Col, CustomInput, Row, FormGroup, Input, Label} from 'reactstrap'; +import {Search} from 'react-feather'; +import {GridDatabase} from '../../../crud/grid/GridDatatable'; + +const FlightPlanPilot = ({ pilotList, handleSelectPilot }) => { + const columns = [ + {id: 'groupNm', name: '그룹 명', cell: row => (
{row.groupNm}
)}, + {id: 'memberName', name: '성명', cell: row => (
{row.memberName}
)}, + {id: 'hpno', name: '핸드폰 번호', cell: row => (
{row.hpno}
)}, + {id: 'email', name: '이메일', cell: row => (
{row.email}
)}, + { + id: 'selectPilot', name: '선택', cell: row => { + return { + handleSelectPilot(row.cstmrSno) + } + }>선택; + } + } + ]; + + return ( + <> +
+ + +
+
+

검색조건

+
+
+ + + 검색 + +
+
+ + +
+
+
+
+
그룹 명
+
+
+ + + + + + + + +
+
+
+
+
성명
+
+
+ + + + + + + + +
+
+
+
+
+
+
+
+ + +
+
+
+ + +
+
+

조종사 목록

+ 검색결과 총 {!!pilotList ? pilotList.length : 0}건 +
+
+
+ +
+ + {/* 검색된 데이터가 없습니다. */} +
+
+
+ +
+
+ + ) + +} + +export default FlightPlanPilot; \ No newline at end of file diff --git a/src/containers/basis/flight/plan/FlightPlanPilotContainer.js b/src/containers/basis/flight/plan/FlightPlanPilotContainer.js new file mode 100644 index 00000000..38bf19c6 --- /dev/null +++ b/src/containers/basis/flight/plan/FlightPlanPilotContainer.js @@ -0,0 +1,41 @@ +import React, {useEffect, useState} from 'react'; +import {useDispatch, useSelector} from 'react-redux'; +import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction'; +import FlightPlanPilot from '../../../../components/basis/flight/plan/FlightPlanPilot'; + +const FlightPlanPilotContainer = ({handleModal, type}) => { + const dispatch = useDispatch(); + const { pilotList } = useSelector(state => state.flightState); + + + /* 조종사 조회 */ + const handleSearch = () => { + // group id 하드코딩 + dispatch(Actions.FLIGHT_PLAN_PILOT_LIST.request("D1682A")); + } + + /* 조종사 선택 */ + const handleSelectPilot = (cstmrSno) => { + handleModal({target: 'area', isOpen: false}); + + const pilot = pilotList.find(pilot => { + return pilot.cstmrSno === cstmrSno; + }); + /* 파일럿 정보 Redux 저장 */ + dispatch(Actions.PILOT_SELECT(pilot)); + } + + useEffect(() => { + handleSearch(); + }, []) + + + return ( + + ) +} + +export default FlightPlanPilotContainer; \ No newline at end of file