Browse Source

feat/운항과 테이블 select box 추가

master
sanguu516 4 weeks ago
parent
commit
2515f9c616
  1. 74
      src/components/flight/OperationApprovalsTable.js
  2. 20
      src/configs/constants.ts
  3. 10
      src/containers/flight/OperationApprovalsContainer.js

74
src/components/flight/OperationApprovalsTable.js

@ -1,9 +1,8 @@
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { Button, Card } from '@component/ui'; import { Button, Card, CustomInput } from '@component/ui';
import { openModal } from '@src/redux/features/comn/message/messageSlice'; import { openModal } from '@src/redux/features/comn/message/messageSlice';
import { FaAngleDown, FaAngleUp } from 'react-icons/fa'; import { Form, Input, Select, Table } from 'antd';
import { Form, Input, Table, Typography } from 'antd';
import { import {
updateLaancAprv, updateLaancAprv,
getLaancAprvList, getLaancAprvList,
@ -13,6 +12,11 @@ import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst';
import OperationModal from './OperationModal'; import OperationModal from './OperationModal';
import ScrollContainer from 'react-indiana-drag-scroll'; import ScrollContainer from 'react-indiana-drag-scroll';
import OperationCheckBoxModal from './OperationCheckBoxModal'; import OperationCheckBoxModal from './OperationCheckBoxModal';
import {
CityCategories,
DistrictCategories,
FlightCategory
} from '@configs/constants';
export default function OperationApprovalsTable(props) { export default function OperationApprovalsTable(props) {
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -54,6 +58,7 @@ export default function OperationApprovalsTable(props) {
// 유효성 기체 데이터 // 유효성 기체 데이터
const [validData, setValidData] = useState(); const [validData, setValidData] = useState();
const [reviewedTypeValue, setReviewedTypeValue] = useState('');
useEffect(() => { useEffect(() => {
let approvalCdValue = { S: 0, F: 0, C: 0, U: 0 }; let approvalCdValue = { S: 0, F: 0, C: 0, U: 0 };
@ -448,10 +453,46 @@ export default function OperationApprovalsTable(props) {
dataIndex: 'reviewedType', dataIndex: 'reviewedType',
align: 'center', align: 'center',
width: '130px', width: '130px',
render: reviewedType => { render: (reviewedType, record) => {
const handleMouseDown = e => {
e.stopPropagation(); // 이벤트 전파 중지
};
return ( return (
<> <>
<>{handlerReviewed(reviewedType, 'operation')}</> <Select
type='select'
id='reviewedType'
style={{
width: 100
}}
value={reviewedType}
onClick={handleMouseDown}
onChange={e => updateReviewedType(e, record.planAreaSno)}
>
<option key={1} value={'W'}>
대기
</option>
<option key={2} value={'U'}>
불필요
</option>
<option key={3} value={'Q'}>
검토 요청
</option>
<option key={4} value={'C'}>
검토요청취소
</option>
<option key={5} value={'S'}>
검토요청처리
</option>
<option key={6} value={'A'}>
재검토요청
</option>
<option key={7} value={'R'}>
완료
</option>
</Select>
{/* <>{handlerReviewed(reviewedType, 'operation')}</> */}
</> </>
); );
} }
@ -533,6 +574,29 @@ export default function OperationApprovalsTable(props) {
}; };
}); });
const updateReviewedType = async (value, planAreaSno) => {
console.log('>>', planAreaSno);
try {
await dispatch(
updateLaancAprvReview({
planAreaSnoList: [planAreaSno],
reviewedType: value
})
);
props.handlerSearch(
props.filterId,
{ startDate: props.startDate, endDate: props.endDate },
props.filterArea
);
} catch (error) {
return handlerErrorModal(
'검토 실패',
'검토를 요청을 실패하였습니다. 다시 시도해주세요.',
false
);
}
};
const handleSave = async row => { const handleSave = async row => {
try { try {
const updateRes = await dispatch( const updateRes = await dispatch(

20
src/configs/constants.ts

@ -237,20 +237,22 @@ export type DistrictCategory =
// 비행 확인 상태 // 비행 확인 상태
export const FlightCategory = { export const FlightCategory = {
Control: { Control: {
: '전체', : '완료',
: '검토완료', : '검토완료',
: '검토요청', : '검토대기',
: '검토재요청', : '재검토',
: '요청반려' : '검토취소',
: '요청처리'
}, },
Operation: { Operation: {
: '전체', : '전체',
: '검토완료', : '완료',
: '검토요청', : '검토요청',
: '검토재요청', : '재검토요청',
: '검토대기', : '대기',
: '검토불필요', : '불필요',
: '검토요청취소' : '검토요청취소',
: '검토요청처리'
} }
}; };

10
src/containers/flight/OperationApprovalsContainer.js

@ -275,18 +275,20 @@ export default function OperationApprovalsContainer({ mode }) {
const checkSearch = text => { const checkSearch = text => {
switch (text) { switch (text) {
case '검토완료': case '완료':
return 'R'; return 'R';
case '검토요청': case '검토요청':
return 'A'; return 'A';
case '검토대기': case '대기':
return 'W'; return 'W';
case '검토불필요': case '불필요':
return 'U'; return 'U';
case '검토요청': case '검토요청':
return 'Q'; return 'Q';
case '검토요청취소': case '검토요청취소':
return 'C'; return 'C';
case '검토요청처리':
return 'S';
} }
}; };
const handlerSearch = (search, searchDate, filterArea) => { const handlerSearch = (search, searchDate, filterArea) => {

Loading…
Cancel
Save