Browse Source

.

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

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

@ -16,18 +16,12 @@ const FlightPlanAreaContainer = (props) => {
const { areaList } = useSelector(state => state.flightState); const { areaList } = useSelector(state => state.flightState);
const [airArea, setAirArea] = useState(null); const [airArea, setAirArea] = useState(null);
const validSchema = yup.object().shape({ 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 { register, getValues, setValue, errors, handleSubmit } = useForm({ const { register, getValues, setValue, errors, handleSubmit } = useForm({
defaultValues: { defaultValues: {
address: '', coodinates: [],
coodinates: '',
radius: '', radius: '',
altitude_m: '', altitude_m: '',
altitude_ft: '', 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 FlightPlanAreaContainer from './FlightPlanAreaContainer';
import {useHistory} from 'react-router-dom'; import {useHistory} from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux'; 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 FlightPlanDetailContainer = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const history = useHistory(); const history = useHistory();
const { flightPlanArea } = useSelector(state => state.flightState); const { flightPlanArea } = useSelector(state => state.flightState);
const [areaInfo, setAreaInfo] = useState();
const [modal, setModal] = useState({ const [modal, setModal] = useState({
isOpen: false, isOpen: false,
title: '', title: '',
}); });
/* Form Validation Checking */
const validSchema = yup.object().shape({
});
const {} = useForm({
defaultValues: {
coodinates: [],
radius: '',
altitude_m: '',
altitude_ft: '',
},
resolver: yupResolver(validSchema)
})
const saveFlightPlanArea = () => { const saveFlightPlanArea = () => {
console.log('비행 구역 설정 저장'); console.log('비행 구역 설정 저장');
@ -30,13 +46,14 @@ const FlightPlanDetailContainer = () => {
} }
useEffect(() => { useEffect(() => {
setAreaInfo(flightPlanArea);
}, [flightPlanArea]); }, [flightPlanArea]);
return ( return (
<CustomDetailLayout title={"비행 계획 신청서"}> <CustomDetailLayout title={"비행 계획 신청서"}>
<FlightPlanForm <FlightPlanForm
openModal={openModal} openModal={openModal}
areaInfo={areaInfo}
/> />
<FlightPlanAreaModal <FlightPlanAreaModal
modal={modal} modal={modal}

Loading…
Cancel
Save