Browse Source

.

feature/flight-practice
노승철 2 years ago
parent
commit
6babfe2f8f
  1. 58
      src/components/basis/flight/plan/FlightPlanAreaForm.js
  2. 45
      src/components/basis/flight/plan/FlightPlanForm.js
  3. 12
      src/containers/basis/flight/plan/FlightPlanAreaContainer.js
  4. 23
      src/containers/basis/flight/plan/FlightPlanDetailContainer.js

58
src/components/basis/flight/plan/FlightPlanAreaForm.js

@ -32,63 +32,7 @@ const FlightPlanAreaForm = (props) => {
</div>
<dl>
<dt>
<div className='search-info-box'>
<Row>
<Col className='list-input' lg={6} md={6} sm={12}>
<FormGroup>
<Label for='test'>
<span className='necessary'>*</span>
</Label>
<Input
type='text'
id='address'
name='address'
size='sm'
placeholder=''
innerRef={props.data}
readOnly
// className={classnames({
// 'is-invalid': props.errors.address
// })}
/>
{/* {props.errors && props.errors.address && (
<FormFeedback>
{props.errors.address.message}
</FormFeedback>
)} */}
</FormGroup>
</Col>
</Row>
</div>
<div className='search-info-box'>
<Row>
<Col className='list-input' lg={6} md={6} sm={12}>
<FormGroup>
<Label for='test'>
<span className='necessary'>*</span>
</Label>
<Input
type='text'
id='coodinates'
name='coodinates'
size='sm'
placeholder=''
readOnly
innerRef={props.data}
// className={classnames({
// 'is-invalid': props.errors.coodinates
// })}
/>
{/* {props.errors && props.errors.coodinates && (
<FormFeedback>
{props.errors.coodinates.message}
</FormFeedback>
)} */}
</FormGroup>
</Col>
</Row>
</div>
<dt>
<div className='search-info-box'>
<Row>
<Col className='list-input' lg={6} md={6} sm={12}>

45
src/components/basis/flight/plan/FlightPlanForm.js

@ -44,7 +44,7 @@ const FlightPlanForm = (props) => {
<Row>
<Col className='list-input' lg={4} md={6} sm={12}>
<FormGroup>
<Label for='test'>성명</Label>
<Label for='test'><span className='necessary'>*</span></Label>
<Input
type='text'
id='applicantNm'
@ -57,7 +57,7 @@ const FlightPlanForm = (props) => {
</Col>
<Col className='list-input' lg={4} md={6} sm={12}>
<FormGroup>
<Label for='test'>생년월일</Label>
<Label for='test'><span className='necessary'>*</span></Label>
<Input
type='text'
id='applicantBirthDt'
@ -67,10 +67,14 @@ const FlightPlanForm = (props) => {
placeholder=''
/>
</FormGroup>
</Col>
</Col>
</Row>
</div>
<div className='search-info-box'>
<Row>
<Col className='list-input' lg={4} md={6} sm={12}>
<FormGroup>
<Label for='test'>전화번호</Label>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input
type='text'
id='applicantPhone'
@ -81,10 +85,9 @@ const FlightPlanForm = (props) => {
/>
</FormGroup>
</Col>
<Col className='list-input' lg={4} md={6} sm={12}>
<FormGroup>
<Label for='test'>팩스번호</Label>
<Label for='test'><span className='necessary'></span> </Label>
<Input
type='text'
id='applicantPhone'
@ -94,15 +97,16 @@ const FlightPlanForm = (props) => {
placeholder=''
/>
</FormGroup>
</Col>
</Row>
</div>
</Col>
</Row>
</div>
<div className='search-info-box'>
{/* <div className='search-info-box'>
<Row>
<Col className='list-input' lg={4} md={6} sm={12}>
<FormGroup>
<Label for='test'>주소</Label>
<Label for='test'><span className='necessary'>*</span></Label>
<Input
type='text'
id='applicantAddress'
@ -115,7 +119,7 @@ const FlightPlanForm = (props) => {
</Col>
<Col className='list-input' lg={4} md={6} sm={12}>
<FormGroup>
<Label for='test'>상세주소</Label>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input
type='text'
id='applicantAddress'
@ -127,7 +131,7 @@ const FlightPlanForm = (props) => {
</FormGroup>
</Col>
</Row>
</div>
</div> */}
</dt>
<dt>
@ -273,7 +277,8 @@ const FlightPlanForm = (props) => {
id='ownerNm'
name='ownerNm'
size='sm'
placeholder=''
placeholder=''
readOnly
/>
</FormGroup>
</Col>
@ -287,7 +292,8 @@ const FlightPlanForm = (props) => {
id='ownerNm'
name='ownerNm'
size='sm'
placeholder=''
placeholder=''
readOnly
/>
</FormGroup>
</Col>
@ -305,7 +311,8 @@ const FlightPlanForm = (props) => {
id='ownerNm'
name='ownerNm'
size='sm'
placeholder=''
placeholder=''
readOnly
/>
</FormGroup>
</Col>
@ -320,7 +327,8 @@ const FlightPlanForm = (props) => {
id='ownerNm'
name='ownerNm'
size='sm'
placeholder='m'
placeholder='m'
readOnly
/>
</div>
<div className='m_ft_box'>
@ -329,7 +337,8 @@ const FlightPlanForm = (props) => {
id='ownerNm'
name='ownerNm'
size='sm'
placeholder='ft'
placeholder='ft'
readOnly
/>
</div>
</FormGroup>

12
src/containers/basis/flight/plan/FlightPlanAreaContainer.js

@ -16,18 +16,12 @@ const FlightPlanAreaContainer = (props) => {
const { areaList } = useSelector(state => state.flightState);
const [airArea, setAirArea] = useState(null);
const validSchema = yup.object().shape({
// address: yup.string().trim().required('주소가 올바르지 않습니다.'),
// coodinates: yup.string().trim().required('좌표가 올바르지 않습니다.'),
// radius: yup.string().trim().required('반경을 입력해 주세요.'),
// altitude_m: yup.string().trim().required('고도(m)를 입력해 주세요.'),
// altitude_ft: yup.string().trim().required('고도(ft)를 입력해 주세요.'),
const validSchema = yup.object().shape({
});
const { register, getValues, setValue, errors, handleSubmit } = useForm({
defaultValues: {
address: '',
coodinates: '',
defaultValues: {
coodinates: [],
radius: '',
altitude_m: '',
altitude_ft: '',

23
src/containers/basis/flight/plan/FlightPlanDetailContainer.js

@ -5,18 +5,34 @@ import { FlightPlanAreaModal } from '../../../../components/basis/flight/plan/Fl
import FlightPlanAreaContainer from './FlightPlanAreaContainer';
import {useHistory} from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
import * as yup from 'yup';
import { yupResolver } from '@hookform/resolvers/yup';
import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction';
import { useForm } from 'react-hook-form';
const FlightPlanDetailContainer = () => {
const dispatch = useDispatch();
const history = useHistory();
const { flightPlanArea } = useSelector(state => state.flightState);
const [areaInfo, setAreaInfo] = useState();
const [modal, setModal] = useState({
isOpen: false,
title: '',
});
/* Form Validation Checking */
const validSchema = yup.object().shape({
});
const {} = useForm({
defaultValues: {
coodinates: [],
radius: '',
altitude_m: '',
altitude_ft: '',
},
resolver: yupResolver(validSchema)
})
const saveFlightPlanArea = () => {
console.log('비행 구역 설정 저장');
@ -30,13 +46,14 @@ const FlightPlanDetailContainer = () => {
}
useEffect(() => {
setAreaInfo(flightPlanArea);
}, [flightPlanArea]);
return (
<CustomDetailLayout title={"비행 계획 신청서"}>
<FlightPlanForm
openModal={openModal}
areaInfo={areaInfo}
/>
<FlightPlanAreaModal
modal={modal}

Loading…
Cancel
Save