From ae697caf654611d789df95d5eb70a7a67e5b4823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=83=81=ED=98=84?= Date: Wed, 15 Nov 2023 17:36:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=81=EC=A0=91=EC=9E=85=EB=A0=A5=20code?= =?UTF-8?q?=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/laanc/step/LaancStep1.js | 28 +++++++++++-------- src/containers/laanc/LaancPlanContainer.js | 32 ++++++++-------------- src/modules/laanc/models/laancModels.ts | 12 ++++---- 3 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/components/laanc/step/LaancStep1.js b/src/components/laanc/step/LaancStep1.js index b0b57fe..f26a4e1 100644 --- a/src/components/laanc/step/LaancStep1.js +++ b/src/components/laanc/step/LaancStep1.js @@ -706,14 +706,18 @@ export default function LaancStep1({ placeholder='' > - - - - - - - - + + + + + + + + + + + + @@ -724,8 +728,8 @@ export default function LaancStep1({ { const { name, value } = e.target; @@ -735,10 +739,10 @@ export default function LaancStep1({ value }); }} - value={data.areaList[0].selffltMethod} + value={data.areaList[0].fltMothoeRm} placeholder='직접입력 선택 후 활성화' disabled={ - data.areaList[0].fltMethod === '직접입력' ? false : true + data.areaList[0].fltMethod === '00' ? false : true } /> diff --git a/src/containers/laanc/LaancPlanContainer.js b/src/containers/laanc/LaancPlanContainer.js index 96238ea..958d2cd 100644 --- a/src/containers/laanc/LaancPlanContainer.js +++ b/src/containers/laanc/LaancPlanContainer.js @@ -30,7 +30,6 @@ export default function LaancPlanContainer({ const [step, setStep] = useState(1); const [detailData, setDetailData] = useState(initFlightBas.initDetail); - const [finalDetailData, setFinalDetailData] = useState({}); const [centeredModal, setCenteredModal] = useState(false); const [isErrorModal, setIsErrorModal] = useState({ isOpen: false, @@ -95,13 +94,6 @@ export default function LaancPlanContainer({ } }, [[laancElev]]); - //비행 방식 직접 입력칸 작성 시 api 호출 부분 - useEffect(() => { - if (Object.getOwnPropertyNames(finalDetailData).length != 0) { - dispatch(LaancAction.LAANC_FLIGHT_Approval.request(finalDetailData)); - } - }, [finalDetailData]); - // laanc 승인 api 200 시 step 이동 const handlerLaanc = async () => { if (laancArea && laancElev[0]) { @@ -222,7 +214,7 @@ export default function LaancPlanContainer({ const updateData = { ...prevState[arrName][0], [name]: value, - selffltMethod: '' + fltMothoeRm: '' }; arr[0] = updateData; return { @@ -411,6 +403,17 @@ export default function LaancPlanContainer({ desc: '비행방식를 입력해 주세요.' }); + return false; + } else if ( + detailData.areaList[0].fltMethod === '00' && + !detailData.areaList[0].fltMothoeRm + ) { + // 비행 방식 직접 입력칸 활성화 후 작성 시 조건문 + setIsErrorModal({ + isOpen: true, + title: '필수값 입력 오류', + desc: '비행방식을 입력해 주세요.' + }); return false; } else if (validateAircraftWeightCode) { setIsErrorModal({ @@ -427,17 +430,6 @@ export default function LaancPlanContainer({ desc: '기체 신고 번호를 입력해 주세요.' }); return false; - } else if (detailData.areaList[0].selffltMethod) { - // 비행 방식 직접 입력칸 활성화 후 작성 시 조건문 - setFinalDetailData({ - ...detailData, - areaList: [ - { - ...detailData.areaList[0], - fltMethod: detailData.areaList[0].selffltMethod - } - ] - }); } else { handlerLaanc(); } diff --git a/src/modules/laanc/models/laancModels.ts b/src/modules/laanc/models/laancModels.ts index 5c0b28b..856e5cf 100644 --- a/src/modules/laanc/models/laancModels.ts +++ b/src/modules/laanc/models/laancModels.ts @@ -92,7 +92,7 @@ export const LaancFlightData = { planSno: 0, areaType: '', fltMethod: '', - selffltMethod: '', + fltMothoeRm: '', bufferZone: 0, concatBufferZone: 0, fltElev: 0, @@ -137,7 +137,7 @@ export const LaancFlightData = { planSno: 0, areaType: '', fltMethod: '', - selffltMethod: '', + fltMothoeRm: '', bufferZone: 0, concatBufferZone: 0, fltElev: 0, @@ -290,7 +290,7 @@ export interface FlightPlanAreaData { bufferZone: number; concatBufferZone: number; fltElev: number; - selffltMethod: string; + fltMothoeRm: string; createUserId?: string; createDt?: string; updateUserId?: string; @@ -408,7 +408,7 @@ export const laancControlData = { planSno: 0, areaType: '', fltMethod: '', - selffltMethod: '', + fltMothoeRm: '', bufferZone: 0, concatBufferZone: 0, fltElev: 0, @@ -519,7 +519,7 @@ export const initFlightBas = { planSno: 0, areaType: '', fltMethod: '', - selffltMethod: '', + fltMothoeRm: '', bufferZone: 0, concatBufferZone: 0, fltElev: 0, @@ -564,7 +564,7 @@ export const initFlightBas = { planSno: 0, areaType: '', fltMethod: '', - selffltMethod: '', + fltMothoeRm: '', bufferZone: 0, concatBufferZone: 0, fltElev: 0,