From aa73d25bb9306802701e52f9761b174e7ea614c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Tue, 18 Oct 2022 15:00:54 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B5=AC=EC=97=AD=20?= =?UTF-8?q?=EB=B0=98=EA=B2=BD=20=EC=A0=95=EC=88=98=20=ED=86=B5=EC=9D=BC=20?= =?UTF-8?q?=EB=B0=8F=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/plan/FlightPlanAreaDetailForm.js | 78 ------------------- .../plan/FlightPlanAreaDetailContainer.js | 12 ++- src/modules/control/gp/apis/controlGpApi.ts | 24 +++--- 3 files changed, 20 insertions(+), 94 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js b/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js index e890bcec..381eb345 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js +++ b/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js @@ -17,7 +17,6 @@ const FlightPlanAreaDetailForm = ({ handleBufferList, data, mapControl, - // test, isDone, isDisabled }) => { @@ -133,62 +132,12 @@ const FlightPlanAreaDetailForm = ({ }); }} /> - {/* {isDisabled || isDone ? ( - { - const { name, value } = e.target; - handleChange({ - name, - value - }); - }} - /> - ) : ( - { - const { name, value } = e.target; - handleChange({ - name, - value - }); - }} - /> - )} */}
적용 - {/* {isDisabled || isDone ? ( - handleBufferList()} - > - 적용 - - ) : ( - handleBufferList()} - > - 적용 - - )} */}
diff --git a/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js b/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js index dcafd4fb..8ee7345f 100644 --- a/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js @@ -70,11 +70,21 @@ const FlightPlanAreaDetailContainer = ({ handleModal, isDone, isDisabled }) => { }; const handleChange = ({ name, value }) => { + let size; + if (name === 'bufferZone') { + const regex = /^[0-9]{0,100}$/; + if (regex.test(value)) { + size = value; + } else { + return; + } + } setAreaDetail(prevState => { const areaList = prevState.map((area, i) => { return { ...area, - [name]: value + ...(value === 'bufferZone' ? { [name]: size } : { [name]: value }) + // [name]: value }; }); diff --git a/src/modules/control/gp/apis/controlGpApi.ts b/src/modules/control/gp/apis/controlGpApi.ts index 66faaf77..7696b380 100644 --- a/src/modules/control/gp/apis/controlGpApi.ts +++ b/src/modules/control/gp/apis/controlGpApi.ts @@ -26,7 +26,7 @@ export const controlGpApi = { const { data }: ResponseControlGpWarnLog = await axios.get( `api/ctr/cntrl/warn/detail/${id}` ); - + return data; }, getDetail: async (id: string) => { @@ -46,30 +46,24 @@ export const controlGpApi = { return null; } - const { data } = await axios.get( - `api/ctr/cntrl/flight_plan/${idntfNum}` - ); - + const { data } = await axios.get(`api/ctr/cntrl/flight_plan/${idntfNum}`); + return data; }, checkPlanContains: async (rq: ControlGpPlanContainsRQ) => { - if(!rq.idntfNum) { - return null; + if (!rq.idntfNum) { + return null; } - const { data } = await axios.post( - `api/ctr/cntrl/contains`, rq - ); + const { data } = await axios.post(`api/ctr/cntrl/contains`, rq); return data; }, getArcrftWarnList: async (id: string) => { - if(!id) return null; + if (!id) return null; + + const { data } = await axios.get(`api/ctr/cntrl/arcrft/warn/list?id=${id}`); - const { data } = await axios.get( - `api/ctr/cntrl/arcrft/warn/list?id=${id}` - ); - return data; } };