diff --git a/src/components/basis/flight/plan/FlightPlanPilot.js b/src/components/basis/flight/plan/FlightPlanPilot.js
index bd38999..1b42f5d 100644
--- a/src/components/basis/flight/plan/FlightPlanPilot.js
+++ b/src/components/basis/flight/plan/FlightPlanPilot.js
@@ -3,7 +3,7 @@ import {Button, Card, CardBody, Col, CustomInput, Row, FormGroup, Input, Label}
import {Search} from 'react-feather';
import {GridDatabase} from '../../../crud/grid/GridDatatable';
-const FlightPlanPilot = ({ pilotList, handleSelectPilot }) => {
+const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEvent, setInputVal }) => {
const columns = [
{id: 'groupNm', name: '그룹 명', cell: row => (
{row.groupNm}
)},
{id: 'memberName', name: '성명', cell: row => ({row.memberName}
)},
@@ -33,7 +33,7 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot }) => {
검색
@@ -57,7 +57,7 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot }) => {
id='memberName'
name='memberName'
// value={props.params.groupNm}
- // onChange={props.handlerInput}
+ onChange={(e) => {setInputVal(e.target.value)}}
bsSize='sm'
// onKeyPress={props.onKeyPress}
placeholder='성명을 입력하세요'
@@ -82,7 +82,7 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot }) => {
조종사 목록
- 검색결과 총 {!!pilotList ? pilotList.length : 0}건
+ 검색결과 총 {!!returnPilot ? [returnPilot].length : 0}건
@@ -90,8 +90,8 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot }) => {
diff --git a/src/containers/basis/flight/plan/FlightPlanPilotContainer.js b/src/containers/basis/flight/plan/FlightPlanPilotContainer.js
index 80efada..08b249f 100644
--- a/src/containers/basis/flight/plan/FlightPlanPilotContainer.js
+++ b/src/containers/basis/flight/plan/FlightPlanPilotContainer.js
@@ -6,7 +6,9 @@ import FlightPlanPilot from '../../../../components/basis/flight/plan/FlightPlan
const FlightPlanPilotContainer = ({handleModal, type}) => {
const dispatch = useDispatch();
const { pilotList, selectGroup } = useSelector(state => state.flightState);
-
+ const [returnPilot, setReturnPilot] = useState('');
+ const [inputVal , setInputVal] = useState('');
+
/* 조종사 조회 */
const handleSearch = () => {
@@ -19,7 +21,7 @@ const FlightPlanPilotContainer = ({handleModal, type}) => {
/* 조종사 선택 */
const handleSelectPilot = (cstmrSno) => {
- handleModal({target: 'poilot', isOpen: false});
+ handleModal({target: 'pilot', isOpen: false});
const pilot = pilotList.find(pilot => {
return pilot.cstmrSno === cstmrSno;
@@ -27,16 +29,50 @@ const FlightPlanPilotContainer = ({handleModal, type}) => {
/* 파일럿 정보 Redux 저장 */
dispatch(Actions.PILOT_SELECT(pilot));
}
-
+
useEffect(() => {
handleSearch();
}, [])
-
+ useEffect(()=> {
+ console.log('>>>>')
+ if(pilotList) {
+ onTest();
+ }
+ },[pilotList])
+
+
+
+ const onClickEvent= (e)=> {
+ setInputVal(e.target.value);
+
+ onTest();
+ setInputVal('');
+ }
+
+ const onTest = () => {
+ const [MATCHVALUE] = pilotList.filter((unit) =>
+ unit.memberName.toLowerCase().includes(inputVal));
+ pilotList.filter((unit) =>{
+ if(inputVal==''){
+ setReturnPilot(unit)
+ }else if(unit.memberName.includes(inputVal)){
+ //이부분 문제있어서 임시로 inputVal값과 동일한 값을 넣어둠... 해결해야함...
+ setReturnPilot(unit)
+ }else if (inputVal != ''){
+ setReturnPilot('')
+ }
+ })
+ }
return (
)
}