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 {Button, Card, CardBody, Col, CustomInput, Row, FormGroup, Input, Label} from 'reactstrap';
import {Search} from 'react-feather'; import {Search} from 'react-feather';
import {GridDatabase} from '../../../crud/grid/GridDatatable'; 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 = [ const columns = [
{id: 'groupNm', name: '그룹 명', cell: row => (<div>{row.groupNm}</div>)}, {id: 'groupNm', name: '그룹 명', cell: row => (<div>{row.groupNm}</div>)},
{id: 'memberName', name: '성명', cell: row => (<div>{row.memberName}</div>)}, {id: 'memberName', name: '성명', cell: row => (<div>{row.memberName}</div>)},
@ -18,7 +20,6 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEve
} }
} }
]; ];
return ( return (
<> <>
<div className='pal-card-box'> <div className='pal-card-box'>
@ -56,8 +57,8 @@ const FlightPlanPilot = ({ pilotList, handleSelectPilot, returnPilot, onClickEve
type='text' type='text'
id='memberName' id='memberName'
name='memberName' name='memberName'
// value={props.params.groupNm} value={inputVal}
onChange={(e) => {setInputVal(e.target.value)}} onChange={onChange}
bsSize='sm' bsSize='sm'
// onKeyPress={props.onKeyPress} // onKeyPress={props.onKeyPress}
placeholder='성명을 입력하세요' 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 { pilotList, selectGroup } = useSelector(state => state.flightState);
const [returnPilot, setReturnPilot] = useState(''); const [returnPilot, setReturnPilot] = useState('');
const [inputVal , setInputVal] = useState(''); const [inputVal , setInputVal] = useState('');
const [text, setText] = useState('');
/* 조종사 조회 */ /* 조종사 조회 */
@ -35,18 +36,20 @@ const FlightPlanPilotContainer = ({handleModal, type}) => {
}, []) }, [])
useEffect(()=> { useEffect(()=> {
console.log('>>>>')
if(pilotList) { if(pilotList) {
onTest(); onTest();
} }
},[pilotList]) },[pilotList])
const onChange = (e) => {
setInputVal(e.target.value);
};
const onClickEvent= (e)=> { const onClickEvent= (e)=> {
setInputVal(e.target.value);
onTest(); onTest();
setInputVal('');
} }
const onTest = () => { const onTest = () => {
@ -56,8 +59,7 @@ const FlightPlanPilotContainer = ({handleModal, type}) => {
if(inputVal==''){ if(inputVal==''){
setReturnPilot(unit) setReturnPilot(unit)
}else if(unit.memberName.includes(inputVal)){ }else if(unit.memberName.includes(inputVal)){
//이부분 문제있어서 임시로 inputVal값과 동일한 값을 넣어둠... 해결해야함...아악 setReturnPilot(MATCHVALUE)
setReturnPilot(unit)
}else if (inputVal != ''){ }else if (inputVal != ''){
setReturnPilot('') setReturnPilot('')
} }
@ -68,9 +70,11 @@ const FlightPlanPilotContainer = ({handleModal, type}) => {
handleSelectPilot={handleSelectPilot} handleSelectPilot={handleSelectPilot}
handleSearch={handleSearch} handleSearch={handleSearch}
onClickEvent={onClickEvent} onClickEvent={onClickEvent}
onChange={onChange}
pilotList={pilotList} pilotList={pilotList}
returnPilot={returnPilot} returnPilot={returnPilot}
setInputVal={setInputVal} setInputVal={setInputVal}
inputVal={inputVal}
/> />
) )

Loading…
Cancel
Save