diff --git a/src/components/flight/ControlApprovalsTable.js b/src/components/flight/ControlApprovalsTable.js index e20d9ae5..4ff7ccb1 100644 --- a/src/components/flight/ControlApprovalsTable.js +++ b/src/components/flight/ControlApprovalsTable.js @@ -41,7 +41,9 @@ export default function ControlApprovalsTable(props) { const [modal, setModal] = useState({ isOpen: false, title: '', - desc: '' + desc: '', + type: '', + row: {} }); // 체크박스 선택 const [checkList, setCheckList] = useState([]); @@ -91,7 +93,13 @@ export default function ControlApprovalsTable(props) { try { const values = await form.validateFields(); - handleSave({ ...record, ...values }); + setModal({ + isOpen: true, + title: '수정 확인', + desc: '데이터를 수정하시겠습니까?', + type: 'edit', + row: { ...record, ...values } + }); } catch (errInfo) {} }; @@ -113,58 +121,6 @@ export default function ControlApprovalsTable(props) { return {childNode}; }; - // 검토 상태 변경 - const handlerReviewed = (value, type) => { - let text = ''; - if (type === 'operation') { - switch (value) { - case 'W': - text = '대기'; - break; - case 'Q': - text = '검토요청'; - break; - case 'R': - text = '재검토요청'; - break; - case 'S': - text = '검토완료'; - break; - case 'C': - text = '검토요청취소'; - break; - case 'U': - text = '불필요'; - break; - case 'P': - text = '검토완료'; - break; - default: - text = '-'; - } - return text; - } else if (type === 'control') { - switch (value) { - case 'R': - text = '재검토'; - break; - case 'W': - text = '검토대기'; - break; - case 'C': - text = '검토취소'; - break; - case 'P': - text = '요청처리'; - break; - - default: - text = '-'; - } - return text; - } - }; - // 데이터 const columns = [ { @@ -493,7 +449,8 @@ export default function ControlApprovalsTable(props) { setModal({ isOpen: true, title: '관제통신과 검토', - desc: '검토완료 하시겠습니까?' + desc: '검토완료 하시겠습니까?', + type: 'review' }); e.stopPropagation(); }} @@ -503,59 +460,11 @@ export default function ControlApprovalsTable(props) { ) : ( '검토완료' )} - - {/* */} ); } }, - // { - // title: <>안전운항과, - // dataIndex: 'reviewedType', - // align: 'center', - // width: '130px', - // render: (reviewedType, record) => { - // return reviewedType !== 'R' ? ( - // <>{handlerReviewed(reviewedType, 'operation')} - // ) : ( - // - // ); - // } - // }, + { title: ( <> @@ -564,11 +473,11 @@ export default function ControlApprovalsTable(props) { 상태 ), - dataIndex: 'planAreaSno', + dataIndex: 'reviewedProcType', width: '100px', align: 'center', - render: planAreaSno => { - return '미전송'; + render: reviewedProcType => { + return reviewedProcType === 'W' ? '미전송' : '전송'; } } ]; @@ -625,7 +534,7 @@ export default function ControlApprovalsTable(props) { ...col, onCell: record => ({ record, - editable: col.editable, + editable: col.editable && record.reviewedProcType === 'W', dataIndex: col.dataIndex, title: col.title, handleSave @@ -988,7 +897,9 @@ export default function ControlApprovalsTable(props) { modal={modal} setModal={setModal} handlerConfirm={() => - updateReviewedType('P', currentPlanAreaSno) + modal.type === 'review' + ? updateReviewedType('P', currentPlanAreaSno) + : handleSave(modal.row) } color='primary' /> @@ -1008,27 +919,3 @@ export default function ControlApprovalsTable(props) { ); } - -const EditableCell = ({ - editing, - dataIndex, - title, - inputType, - record, - index, - children, - ...restProps -}) => { - const inputNode = inputType === 'number' ? : ; - return ( - - {editing ? ( - - {inputNode} - - ) : ( - children - )} - - ); -}; diff --git a/src/components/flight/NewFlightApprovalsReport.js b/src/components/flight/NewFlightApprovalsReport.js index b6e2cb1a..c500b7a6 100644 --- a/src/components/flight/NewFlightApprovalsReport.js +++ b/src/components/flight/NewFlightApprovalsReport.js @@ -106,20 +106,19 @@ export default function NewFlightApprovalsReport(props) {
- + props.setLimitZoneNm(e.target.value)} onKeyPress={handleKeyDown} + value={props.limitZoneNm} > - {props.approvalCd.map(item => ( - - ))} + + +
@@ -296,7 +295,8 @@ export default function NewFlightApprovalsReport(props) { props.handlerSearch( props.filterId, searchDate, - props.filterArea + props.filterArea, + props.limitZoneNm ); }} size='sm' diff --git a/src/components/flight/OperationApprovalsTable.js b/src/components/flight/OperationApprovalsTable.js index 616f0e41..70c42738 100644 --- a/src/components/flight/OperationApprovalsTable.js +++ b/src/components/flight/OperationApprovalsTable.js @@ -15,7 +15,8 @@ import OperationCheckBoxModal from './OperationCheckBoxModal'; import { CityCategories, DistrictCategories, - FlightCategory + FlightCategory, + limitZoneNmCategories } from '@configs/constants'; export default function OperationApprovalsTable(props) { diff --git a/src/containers/flight/ControlApprovalsContainer.js b/src/containers/flight/ControlApprovalsContainer.js index 685d983e..8e61f7e9 100644 --- a/src/containers/flight/ControlApprovalsContainer.js +++ b/src/containers/flight/ControlApprovalsContainer.js @@ -64,13 +64,7 @@ export default function ControlApprovalsContainer({ mode }) { const [reviewedType, setReviewedType] = useState('전체'); const [reviewedProcType, setReviewedProcType] = useState('전체'); - const [approvalCd, setApprovalCd] = useState([ - { name: '전체', value: '', select: false }, - { name: '승인', value: 'S', select: false }, - { name: '미 승인', value: 'F', select: false }, - { name: '비 대상', value: 'U', select: false }, - { name: '조건부 승인', value: 'C', select: false } - ]); + const [limitZoneNm, setLimitZoneNm] = useState(''); // 지역 const [filterArea, setFilterArea] = useState({ @@ -235,7 +229,7 @@ export default function ControlApprovalsContainer({ mode }) { setPopup(popupRef.current); }; - const handlerSearch = (search, searchDate, filterArea) => { + const handlerSearch = (search, searchDate, filterArea, limitZoneNm) => { setStartDate(searchDate.startDate); setEndDate(searchDate.endDate); @@ -246,13 +240,11 @@ export default function ControlApprovalsContainer({ mode }) { ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, sig: filterArea.sig === '전체' ? '' : filterArea.sig, address: filterArea.address, + limitZoneCd: limitZoneNm === '전체' ? '' : limitZoneNm, ...(search !== '' ? { applyNo: search } : {}), ...(reviewedType !== '전체' ? { reviewedType: reviewedType } : {}), ...(reviewedProcType !== '전체' ? { reviewedProcType: reviewedProcType } - : {}), - ...(approvalCd.filter(i => i.select).length > 0 - ? { approvalCd: approvalCd.filter(i => i.select)[0].value } : {}) }) ); @@ -555,30 +547,6 @@ export default function ControlApprovalsContainer({ mode }) { } }; - const handlerApprovalCd = ({ target: { value } }) => { - setApprovalCd( - approvalCd.map(i => { - if (!value) { - return { - ...i, - select: false - }; - } else { - if (i.value === value) { - return { - ...i, - select: true - }; - } - return { - ...i, - select: false - }; - } - }) - ); - }; - const handlerLogout = async () => { const { payload } = await dispatch(setLogout()); @@ -812,8 +780,8 @@ export default function ControlApprovalsContainer({ mode }) { reviewedType={reviewedType} reviewedProcType={reviewedProcType} setReviewedProcType={setReviewedProcType} - approvalCd={approvalCd} - handlerApprovalCd={handlerApprovalCd} + limitZoneNm={limitZoneNm} + setLimitZoneNm={setLimitZoneNm} pageName='control' /> { + const handlerSearch = (search, searchDate, filterArea, limitZoneNm) => { setStartDate(searchDate.startDate); setEndDate(searchDate.endDate); @@ -289,13 +282,11 @@ export default function OperationApprovalsContainer({ mode }) { ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, sig: filterArea.sig === '전체' ? '' : filterArea.sig, address: filterArea.address, + limitZoneCd: limitZoneNm === '전체' ? '' : limitZoneNm, ...(search !== '' ? { applyNo: search } : {}), ...(reviewedType !== '전체' ? { reviewedType: reviewedType } : {}), ...(reviewedProcType !== '전체' ? { reviewedProcType: reviewedProcType } - : {}), - ...(approvalCd.filter(i => i.select).length > 0 - ? { approvalCd: approvalCd.filter(i => i.select)[0].value } : {}) }) ); @@ -672,30 +663,6 @@ export default function OperationApprovalsContainer({ mode }) { } }; - const handlerApprovalCd = ({ target: { value } }) => { - setApprovalCd( - approvalCd.map(i => { - if (!value) { - return { - ...i, - select: false - }; - } else { - if (i.value === value) { - return { - ...i, - select: true - }; - } - return { - ...i, - select: false - }; - } - }) - ); - }; - const handlerLogout = async () => { const { payload } = await dispatch(setLogout()); @@ -944,10 +911,10 @@ export default function OperationApprovalsContainer({ mode }) { setFilterArea={setFilterArea} setReviewedType={setReviewedType} reviewedType={reviewedType} - approvalCd={approvalCd} reviewedProcType={reviewedProcType} setReviewedProcType={setReviewedProcType} - handlerApprovalCd={handlerApprovalCd} + limitZoneNm={limitZoneNm} + setLimitZoneNm={setLimitZoneNm} pageName='operation' />