Browse Source

직접입력 code값 변경

pull/2/head
박상현 10 months ago
parent
commit
ae697caf65
  1. 28
      src/components/laanc/step/LaancStep1.js
  2. 32
      src/containers/laanc/LaancPlanContainer.js
  3. 12
      src/modules/laanc/models/laancModels.ts

28
src/components/laanc/step/LaancStep1.js

@ -706,14 +706,18 @@ export default function LaancStep1({
placeholder='' placeholder=''
> >
<option value=''>= 선택 =</option> <option value=''>= 선택 =</option>
<option value='격자비행'>= 격자비행 =</option>
<option value='군집비행'>= 군집비행 =</option> <option value='07'>= 가시권비행 =</option>
<option value='사진/영상촬영'>= 계기비행 =</option> <option value='05'>= 격자비행 =</option>
<option value='시계비행'>= 시계비행 =</option> <option value='10'>= 군집비행 =</option>
<option value='선화비행'>= 선화비행 =</option> <option value='04'>= 계기비행 =</option>
<option value='수동조종비행'>= 수동조종비행 =</option> <option value='01'>= 시계비행 =</option>
<option value='수직이착륙비행'>= 수직이착륙비행 =</option> <option value='03'>= 선화비행 =</option>
<option value='직접입력'>= 직접입력 =</option> <option value='08'>= 수동조종비행 =</option>
<option value='06'>= 수직이착륙비행 =</option>
<option value='02'>= 자동비행 =</option>
<option value='09'>= 제자리비행 =</option>
<option value='00'>= 직접입력 =</option>
</Input> </Input>
</FormGroup> </FormGroup>
</Col> </Col>
@ -724,8 +728,8 @@ export default function LaancStep1({
</Label> </Label>
<Input <Input
type='text' type='text'
id='selffltMethod' id='fltMothoeRm'
name='selffltMethod' name='fltMothoeRm'
bsSize='sm' bsSize='sm'
onChange={e => { onChange={e => {
const { name, value } = e.target; const { name, value } = e.target;
@ -735,10 +739,10 @@ export default function LaancStep1({
value value
}); });
}} }}
value={data.areaList[0].selffltMethod} value={data.areaList[0].fltMothoeRm}
placeholder='직접입력 선택 후 활성화' placeholder='직접입력 선택 후 활성화'
disabled={ disabled={
data.areaList[0].fltMethod === '직접입력' ? false : true data.areaList[0].fltMethod === '00' ? false : true
} }
/> />
</FormGroup> </FormGroup>

32
src/containers/laanc/LaancPlanContainer.js

@ -30,7 +30,6 @@ export default function LaancPlanContainer({
const [step, setStep] = useState(1); const [step, setStep] = useState(1);
const [detailData, setDetailData] = useState(initFlightBas.initDetail); const [detailData, setDetailData] = useState(initFlightBas.initDetail);
const [finalDetailData, setFinalDetailData] = useState({});
const [centeredModal, setCenteredModal] = useState(false); const [centeredModal, setCenteredModal] = useState(false);
const [isErrorModal, setIsErrorModal] = useState({ const [isErrorModal, setIsErrorModal] = useState({
isOpen: false, isOpen: false,
@ -95,13 +94,6 @@ export default function LaancPlanContainer({
} }
}, [[laancElev]]); }, [[laancElev]]);
//비행 방식 직접 입력칸 작성 시 api 호출 부분
useEffect(() => {
if (Object.getOwnPropertyNames(finalDetailData).length != 0) {
dispatch(LaancAction.LAANC_FLIGHT_Approval.request(finalDetailData));
}
}, [finalDetailData]);
// laanc 승인 api 200 시 step 이동 // laanc 승인 api 200 시 step 이동
const handlerLaanc = async () => { const handlerLaanc = async () => {
if (laancArea && laancElev[0]) { if (laancArea && laancElev[0]) {
@ -222,7 +214,7 @@ export default function LaancPlanContainer({
const updateData = { const updateData = {
...prevState[arrName][0], ...prevState[arrName][0],
[name]: value, [name]: value,
selffltMethod: '' fltMothoeRm: ''
}; };
arr[0] = updateData; arr[0] = updateData;
return { return {
@ -411,6 +403,17 @@ export default function LaancPlanContainer({
desc: '비행방식를 입력해 주세요.' desc: '비행방식를 입력해 주세요.'
}); });
return false;
} else if (
detailData.areaList[0].fltMethod === '00' &&
!detailData.areaList[0].fltMothoeRm
) {
// 비행 방식 직접 입력칸 활성화 후 작성 시 조건문
setIsErrorModal({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행방식을 입력해 주세요.'
});
return false; return false;
} else if (validateAircraftWeightCode) { } else if (validateAircraftWeightCode) {
setIsErrorModal({ setIsErrorModal({
@ -427,17 +430,6 @@ export default function LaancPlanContainer({
desc: '기체 신고 번호를 입력해 주세요.' desc: '기체 신고 번호를 입력해 주세요.'
}); });
return false; return false;
} else if (detailData.areaList[0].selffltMethod) {
// 비행 방식 직접 입력칸 활성화 후 작성 시 조건문
setFinalDetailData({
...detailData,
areaList: [
{
...detailData.areaList[0],
fltMethod: detailData.areaList[0].selffltMethod
}
]
});
} else { } else {
handlerLaanc(); handlerLaanc();
} }

12
src/modules/laanc/models/laancModels.ts

@ -92,7 +92,7 @@ export const LaancFlightData = {
planSno: 0, planSno: 0,
areaType: '', areaType: '',
fltMethod: '', fltMethod: '',
selffltMethod: '', fltMothoeRm: '',
bufferZone: 0, bufferZone: 0,
concatBufferZone: 0, concatBufferZone: 0,
fltElev: 0, fltElev: 0,
@ -137,7 +137,7 @@ export const LaancFlightData = {
planSno: 0, planSno: 0,
areaType: '', areaType: '',
fltMethod: '', fltMethod: '',
selffltMethod: '', fltMothoeRm: '',
bufferZone: 0, bufferZone: 0,
concatBufferZone: 0, concatBufferZone: 0,
fltElev: 0, fltElev: 0,
@ -290,7 +290,7 @@ export interface FlightPlanAreaData {
bufferZone: number; bufferZone: number;
concatBufferZone: number; concatBufferZone: number;
fltElev: number; fltElev: number;
selffltMethod: string; fltMothoeRm: string;
createUserId?: string; createUserId?: string;
createDt?: string; createDt?: string;
updateUserId?: string; updateUserId?: string;
@ -408,7 +408,7 @@ export const laancControlData = {
planSno: 0, planSno: 0,
areaType: '', areaType: '',
fltMethod: '', fltMethod: '',
selffltMethod: '', fltMothoeRm: '',
bufferZone: 0, bufferZone: 0,
concatBufferZone: 0, concatBufferZone: 0,
fltElev: 0, fltElev: 0,
@ -519,7 +519,7 @@ export const initFlightBas = {
planSno: 0, planSno: 0,
areaType: '', areaType: '',
fltMethod: '', fltMethod: '',
selffltMethod: '', fltMothoeRm: '',
bufferZone: 0, bufferZone: 0,
concatBufferZone: 0, concatBufferZone: 0,
fltElev: 0, fltElev: 0,
@ -564,7 +564,7 @@ export const initFlightBas = {
planSno: 0, planSno: 0,
areaType: '', areaType: '',
fltMethod: '', fltMethod: '',
selffltMethod: '', fltMothoeRm: '',
bufferZone: 0, bufferZone: 0,
concatBufferZone: 0, concatBufferZone: 0,
fltElev: 0, fltElev: 0,

Loading…
Cancel
Save