From efd968e71891c8d6a3eae09ab5b8f4cb5f576c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?qkr7828=28=EB=B0=95=EC=9E=AC=EC=9A=B0=29?= Date: Mon, 8 Aug 2022 10:48:01 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A1=B0=EC=A2=85=EC=82=AC=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=ED=95=84=ED=84=B0=EA=B8=B0=EB=8A=A5=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/plan/FlightPlanPilot.js | 9 +++++---- .../basis/flight/plan/FlightPlanPilotContainer.js | 14 +++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanPilot.js b/src/components/basis/flight/plan/FlightPlanPilot.js index 1b42f5de..ef4d7846 100644 --- a/src/components/basis/flight/plan/FlightPlanPilot.js +++ b/src/components/basis/flight/plan/FlightPlanPilot.js @@ -2,8 +2,10 @@ 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'; +import { AiOutlineSearch } from 'react-icons/ai'; -const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEvent, setInputVal }) => { +const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEvent, onChange, inputVal }) => { + const columns = [ {id: 'groupNm', name: '그룹 명', cell: row => (
{row.groupNm}
)}, {id: 'memberName', name: '성명', cell: row => (
{row.memberName}
)}, @@ -18,7 +20,6 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEve } } ]; - return ( <>
@@ -56,8 +57,8 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEve type='text' id='memberName' name='memberName' - // value={props.params.groupNm} - onChange={(e) => {setInputVal(e.target.value)}} + value={inputVal} + onChange={onChange} bsSize='sm' // onKeyPress={props.onKeyPress} placeholder='성명을 입력하세요' diff --git a/src/containers/basis/flight/plan/FlightPlanPilotContainer.js b/src/containers/basis/flight/plan/FlightPlanPilotContainer.js index 1c112307..f145e653 100644 --- a/src/containers/basis/flight/plan/FlightPlanPilotContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanPilotContainer.js @@ -8,6 +8,7 @@ const FlightPlanPilotContainer = ({handleModal, type}) => { const { pilotList, selectGroup } = useSelector(state => state.flightState); const [returnPilot, setReturnPilot] = useState(''); const [inputVal , setInputVal] = useState(''); + const [text, setText] = useState(''); /* 조종사 조회 */ @@ -35,18 +36,20 @@ const FlightPlanPilotContainer = ({handleModal, type}) => { }, []) useEffect(()=> { - console.log('>>>>') if(pilotList) { onTest(); } },[pilotList]) - + const onChange = (e) => { + setInputVal(e.target.value); + }; const onClickEvent= (e)=> { - setInputVal(e.target.value); + onTest(); + setInputVal(''); } const onTest = () => { @@ -56,8 +59,7 @@ const FlightPlanPilotContainer = ({handleModal, type}) => { if(inputVal==''){ setReturnPilot(unit) }else if(unit.memberName.includes(inputVal)){ - //이부분 문제있어서 임시로 inputVal값과 동일한 값을 넣어둠... 해결해야함...아악 - setReturnPilot(unit) + setReturnPilot(MATCHVALUE) }else if (inputVal != ''){ setReturnPilot('') } @@ -68,9 +70,11 @@ const FlightPlanPilotContainer = ({handleModal, type}) => { handleSelectPilot={handleSelectPilot} handleSearch={handleSearch} onClickEvent={onClickEvent} + onChange={onChange} pilotList={pilotList} returnPilot={returnPilot} setInputVal={setInputVal} + inputVal={inputVal} /> )