Browse Source

조종사조회 필터기능 오류 수정

pull/2/head
qkr7828(박재우) 2 years ago
parent
commit
efd968e718
  1. 9
      src/components/basis/flight/plan/FlightPlanPilot.js
  2. 14
      src/containers/basis/flight/plan/FlightPlanPilotContainer.js

9
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 => (<div>{row.groupNm}</div>)},
{id: 'memberName', name: '성명', cell: row => (<div>{row.memberName}</div>)},
@ -18,7 +20,6 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEve
}
}
];
return (
<>
<div className='pal-card-box'>
@ -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='성명을 입력하세요'

14
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}
/>
)

Loading…
Cancel
Save