Browse Source

feat/요청 고도 추가 및 상단 문구 추가

master
sanguu516 1 month ago
parent
commit
6269783830
  1. 24
      src/components/flight/ControlApprovalsTable.js
  2. 111
      src/components/flight/NewFlightApprovalsReport.js
  3. 120
      src/components/flight/OperationApprovalsTable.js

24
src/components/flight/ControlApprovalsTable.js

@ -337,6 +337,22 @@ export default function ControlApprovalsTable(props) {
return text ? text : '-';
}
},
{
title: (
<>
요청 고도
<br />
(m이하)
</>
),
dataIndex: 'reqElev',
align: 'center',
width: '80px',
editable: true,
render: (text, record) => {
return text ? text : '-';
}
},
{
title: (
<>
@ -678,6 +694,14 @@ export default function ControlApprovalsTable(props) {
return text ? text : <>-</>;
}
},
{
dataIndex: 'reqElev',
align: 'center',
width: '80px',
render: text => {
return text ? text : <>-</>;
}
},
{
dataIndex: 'fltElevMax',
align: 'center',

111
src/components/flight/NewFlightApprovalsReport.js

@ -50,61 +50,76 @@ export default function NewFlightApprovalsReport(props) {
<div className='layer-ti'>
<h4>비행승인 신청 검토결과 현황</h4>
</div>
<div className='layer-ti-sub'>
검색일자 또는 신청번호/검토결과 또는 확인결과를 입력해주세요.
</div>
<div className='input-n'>
<div className='list-input'>
<div className='calendar-flat'>
<Flatpickr
ref={flatPickerRef}
placeholder='날짜를 선택해주세요'
id='searchDate'
options={{
mode: 'range',
defaultDate: [searchDate.startDate, searchDate.endDate]
}}
onChange={date => {
setSearchDate({
startDate: dayjs(date[0]).format('YYYY-MM-DD'),
endDate: dayjs(date[1]).format('YYYY-MM-DD')
});
}}
className='form-control flat-picker bg-transparent border-0 shadow-none'
/>
<Calendar size={14} />
<div className='layer-content'>
<div className='layer-ti'>
<h4>신청일자</h4>
</div>
<div className='calendar-flat'>
<Flatpickr
ref={flatPickerRef}
placeholder='날짜를 선택해주세요'
id='searchDate'
options={{
mode: 'range',
defaultDate: [searchDate.startDate, searchDate.endDate]
}}
onChange={date => {
setSearchDate({
startDate: dayjs(date[0]).format('YYYY-MM-DD'),
endDate: dayjs(date[1]).format('YYYY-MM-DD')
});
}}
className='form-control flat-picker bg-transparent border-0 shadow-none'
/>
<Calendar size={14} />
</div>
</div>
</div>
<div className='list-input'>
<Input
type='text'
bsSize='sm'
placeholder='신청번호 또는 검토결과를 입력해주세요.'
value={props.filterId}
onChange={e => props.setFilterId(e.target.value)}
onKeyPress={handleKeyDown}
/>
<div className='layer-content'>
<div className='layer-ti'>
<h4>신청번호</h4>
</div>
<Input
type='text'
bsSize='sm'
placeholder='신청번호 또는 검토결과를 입력해주세요.'
value={props.filterId}
onChange={e => props.setFilterId(e.target.value)}
onKeyPress={handleKeyDown}
/>
</div>
</div>
<div className='list-input'>
<CustomInput
type='select'
bsSize='sm'
id='reviewedType'
placeholder='확인결과를 입력해주세요.'
value={props.reviewedType}
onChange={e => props.setReviewedType(e.target.value)}
onKeyPress={handleKeyDown}
>
{Object.values(
props.pageName === 'control'
? FlightCategory.Control
: FlightCategory.Operation
).map(item => (
<option key={item} value={item}>
{item}
</option>
))}
</CustomInput>
<div className='layer-content'>
<div className='layer-ti'>
<h4>검토결과</h4>
</div>
<CustomInput
type='select'
bsSize='sm'
id='reviewedType'
placeholder='확인결과를 입력해주세요.'
value={props.reviewedType}
onChange={e => props.setReviewedType(e.target.value)}
onKeyPress={handleKeyDown}
>
{Object.values(
props.pageName === 'control'
? FlightCategory.Control
: FlightCategory.Operation
).map(item => (
<option key={item} value={item}>
{item}
</option>
))}
</CustomInput>
</div>
</div>
</div>
</div>

120
src/components/flight/OperationApprovalsTable.js

@ -6,7 +6,8 @@ import { FaAngleDown, FaAngleUp } from 'react-icons/fa';
import { Form, Input, Table, Typography } from 'antd';
import {
updateLaancAprv,
getLaancAprvList
getLaancAprvList,
updateLaancAprvReview
} from '@src/redux/features/laanc/laancThunk';
import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst';
import OperationModal from './OperationModal';
@ -322,6 +323,22 @@ export default function OperationApprovalsTable(props) {
return text ? text : '-';
}
},
{
title: (
<>
요청 고도
<br />
(m이하)
</>
),
dataIndex: 'reqElev',
align: 'center',
width: '80px',
editable: true,
render: (text, record) => {
return text ? text : '-';
}
},
{
title: (
<>
@ -659,6 +676,14 @@ export default function OperationApprovalsTable(props) {
return text ? text : <>-</>;
}
},
{
dataIndex: 'reqElev',
align: 'center',
width: '80px',
render: text => {
return text ? text : <>-</>;
}
},
{
dataIndex: 'fltElevMax',
align: 'center',
@ -788,6 +813,7 @@ export default function OperationApprovalsTable(props) {
approvalCd: item.approvalCd,
planAreaSno: item.planAreaSno,
planSno: item.planSno,
reqElev: item.reqElev,
addr1: item.addr1,
addr2: item.addr2,
addr3: item.addr3,
@ -1083,15 +1109,12 @@ export default function OperationApprovalsTable(props) {
setIsModal(!ismodal);
// }
};
// 부모 체크박스
const rowSelection = {
selectedRowKeys: checkList,
getCheckboxProps: record => {
const allChildrenReviewed = record.areaList.every(
child => child.reviewedType !== 'R'
);
return {
disabled: allChildrenReviewed,
name: record.key
};
},
@ -1100,9 +1123,9 @@ export default function OperationApprovalsTable(props) {
const key = record.key;
if (key.startsWith('parent_')) {
const childKeys = record.areaList
.filter(child => child.reviewedType === 'R')
.map(child => `child_${record.planSno}_${child.planAreaSno}`);
const childKeys = record.areaList.map(
child => `child_${record.planSno}_${child.planAreaSno}`
);
if (selected) {
newCheckList.push(key, ...childKeys);
@ -1119,16 +1142,12 @@ export default function OperationApprovalsTable(props) {
const newCheckList = selected
? laancAprvList.flatMap(parent => {
const parentKey = `parent_${parent.planSno}`;
const selectableChildren = parent.areaList.filter(
child => child.reviewedType === 'R'
);
const childKeys = selectableChildren.map(
const childKeys = parent.areaList.map(
child => `child_${parent.planSno}_${child.planAreaSno}`
);
return selectableChildren.length > 0
? [parentKey, ...childKeys]
: [];
return parent.areaList.length > 0 ? [parentKey, ...childKeys] : [];
})
: [];
@ -1143,10 +1162,8 @@ export default function OperationApprovalsTable(props) {
// 부모 키 업데이트
laancAprvList.forEach(parent => {
const parentKey = `parent_${parent.planSno}`;
const selectableChildren = parent.areaList.filter(
child => child.reviewedType === 'R'
);
const childKeys = selectableChildren.map(
const childKeys = parent.areaList.map(
child => `child_${parent.planSno}_${child.planAreaSno}`
);
const allSelectableChildrenChecked = childKeys.every(key =>
@ -1156,7 +1173,7 @@ export default function OperationApprovalsTable(props) {
newList.includes(key)
);
if (allSelectableChildrenChecked && selectableChildren.length > 0) {
if (allSelectableChildrenChecked && parent.areaList.length > 0) {
if (!newList.includes(parentKey)) {
newList.push(parentKey);
}
@ -1175,7 +1192,6 @@ export default function OperationApprovalsTable(props) {
const childRowSelection = {
selectedRowKeys: checkList.filter(key => key.startsWith('child_')),
getCheckboxProps: record => ({
disabled: record.reviewedType !== 'R',
name: record.key
}),
@ -1193,11 +1209,13 @@ export default function OperationApprovalsTable(props) {
};
// 체크박스 업데이트 함수
const handleCheckbox = async () => {
const handleCheckbox = async type => {
if (checkList.length === 0) {
return handlerErrorModal(
'재검토 요청 실패',
'재검토 항목을 선택해주세요.',
type === 'R' ? '재 요청 요청 실패' : '검토 요청 실패',
type === 'R'
? '재 요청 항목을 선택해주세요.'
: '검토 항목을 선택해주세요.',
false
);
}
@ -1217,10 +1235,51 @@ export default function OperationApprovalsTable(props) {
)
);
setCheckData(res);
setIsCheckBoxModal(true);
if (type === 'A') {
const check = !res.some(item => item.approvalCd !== 'R');
if (!check) {
return handlerErrorModal(
'재 요청 요청 실패',
'검토결과 완료인 신청건만 재 요청이 가능합니다.'
);
} else {
setCheckData(res);
setIsCheckBoxModal(true);
}
} else if (type === 'R') {
const check = res.some(
item => item.approvalCd !== 'R' && item.approvalCd !== 'C'
);
if (!check) {
return handlerErrorModal(
'검토 요청 실패',
'검토결과 대기인 신청건만 요청이 가능합니다.'
);
} else {
try {
dispatch(
updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' })
).then(() => {
props.handlerSearch(
props.filterId,
{
startDate: props.startDate,
endDate: props.endDate
},
props.filterArea
);
});
setCheckList([]);
} catch (error) {
return handlerErrorModal(
'검토 실패',
'검토를 요청을 실패하였습니다. 다시 시도해주세요.',
false
);
}
}
}
};
return (
<div className='layer-content'>
<div className='layer-ti'>
@ -1265,8 +1324,11 @@ export default function OperationApprovalsTable(props) {
</span>
</div>
<div className='download'>
<Button color='primary' size='sm' onClick={handleCheckbox}>
재검토 요청
<Button color='primary' size='sm' onClick={() => handleCheckbox('R')}>
검토 요청
</Button>
<Button color='primary' size='sm' onClick={() => handleCheckbox('A')}>
요청
</Button>
</div>
</div>

Loading…
Cancel
Save