Browse Source

Laanc 문구 수정 및 고도값 focus 수정

pull/2/head
sanguu516(박상현) 11 months ago
parent
commit
5b6fc55561
  1. 31
      src/views/laanc/LaancStep1.js

31
src/views/laanc/LaancStep1.js

@ -107,12 +107,24 @@ export default function LaancStep1({
const handleInputClick = type => { const handleInputClick = type => {
// Input 요소가 포커스될 때 커서를 맨 뒤로 이동 // Input 요소가 포커스될 때 커서를 맨 뒤로 이동
if (fltElevRef.current && type === 'fltElev') { if (
fltElevRef.current &&
type === 'fltElev' &&
data.areaList[0].coordList[0].lat != 0
) {
const input = fltElevRef.current; const input = fltElevRef.current;
const inputValue = input.value; const inputValue = input.value;
input.setSelectionRange(inputValue.length - 1, inputValue.length - 1); input.setSelectionRange(inputValue.length - 1, inputValue.length - 1);
input.focus(); input.focus();
} else if (data.areaList[0].coordList[0].lat === 0) {
fltElevRef.current.blur();
setIsErrorModal({
isOpen: true,
title: '비행 구역 설정',
desc: '비행 구역 설정을 먼저 설정 해 주세요'
});
return false;
} }
if (bufferZoneRef.current && type === 'bufferZone') { if (bufferZoneRef.current && type === 'bufferZone') {
const input = bufferZoneRef.current; const input = bufferZoneRef.current;
@ -156,7 +168,10 @@ export default function LaancStep1({
const handleBlur = (value, type) => { const handleBlur = (value, type) => {
switch (type) { switch (type) {
case 'fltElev': case 'fltElev':
if (parseInt(value.replace('/^0+/', 'm', ''), 10) <= 150) { if (
parseInt(value.replace('/^0+/', 'm', ''), 10) <= 150 &&
data.areaList[0].coordList[0].lat != 0
) {
setIsErrorModal({ setIsErrorModal({
isOpen: true, isOpen: true,
title: '고도 알림', title: '고도 알림',
@ -168,24 +183,24 @@ export default function LaancStep1({
</> </>
) )
}); });
} else { } else if (data.areaList[0].coordList[0].lat != 0) {
handleChange({ handleChange({
type: 'area', type: 'area',
name: 'fltElev', name: 'fltElev',
value: 0 value: 0
}); });
setIsErrorModal({ setIsLaancModal({
isOpen: true, isOpen: true,
title: '고도 재설정 알림', title: '고도 재설정 알림',
desc: ( desc: (
<> <>
설정하신 고도가 150m를 초과하였습니다. 설정하신 고도가 150m를 초과하였습니다.
<br /> <br />
150m를 초과 아래로 문의하시기 바랍니다. 아래 링크를 통해 담당자와 협의 부탁드립니다.
<br />
항공안전기술원 1234-1234
</> </>
) ),
type: '처리부서안내 바로가기',
url: 'https://drone.onestop.go.kr/introduce/systemintro3 '
}); });
} }
case 'fltMethod': case 'fltMethod':

Loading…
Cancel
Save