({
- ...item,
- key: `parent_${item.planSno}`
- }))}
+ dataSource={laancAprvList
+ .map((item, index) =>
+ item.areaList.map((area, index) => ({
+ ...area,
+ key: `${area.planAreaSno}`
+ }))
+ )
+ .flat()}
columns={mergedColumns}
rowClassName={record => {
let className = '';
- if (record.areaList.length <= 1) {
- if (record?.areaList[0]?.approvalCd === 'S') {
- className += 'flight-approval-row editable-row';
- } else if (record.areaList[0].approvalCd === 'F') {
- className +=
- 'flight-not-approval-row editable-row';
- } else if (record.areaList[0].approvalCd === 'C') {
- className +=
- 'flight-condition-approval-row editable-row';
- } else className += 'editable-row';
- }
- if (
- record.areaList.length <= 1 &&
- record.areaList[0].planAreaSno === props.selected
- ) {
- className += ' flight-approval-row-click';
- }
- if (expandedRowKeys.includes(record.key)) {
- className += ' expanded-row';
+ if (record?.approvalCd === 'S') {
+ className += 'flight-approval-row editable-row';
+ } else if (record.approvalCd === 'F') {
+ className += 'flight-not-approval-row editable-row';
+ } else if (record.approvalCd === 'C') {
+ className +=
+ 'flight-condition-approval-row editable-row';
+ } else className += 'editable-row';
+
+ if (props.selected?.length > 0) {
+ if (record.planAreaSno === props.selected[0]) {
+ className += ' flight-approval-row-click';
+ }
}
- if (record.areaList.length > 1) {
+
+ if (record.length > 1) {
className += 'expanded-tr';
}
return className;
@@ -1396,29 +934,10 @@ export default function ControlApprovalsTable(props) {
}}
onRow={record => ({
onClick: event => {
- if (editingKey !== '') {
- return; // edit 상태면 이벤트 실행 안 함
- }
- setSelectedRowKey(record.planAreaSno);
- // 이벤트 버블링을 막기 위해 클릭된 요소가 'Edit' 버튼인지 확인
- if (
- event.target.tagName !== 'BUTTON' &&
- event.target.tagName !== 'A' &&
- !event.target.closest('.ant-input') && // input 요소를 감지
- !event.target.closest('.ant-input-number') // inputNumber 요소를 감지
- ) {
- handleRowClick(record);
- }
+ handleRowClick(record);
}
})}
loading={laancAprvLoading}
- expandable={{
- expandedRowRender,
- expandedRowKeys: expandedRowKeys,
- onExpand: (expanded, record) =>
- handleExpand(record.key),
- rowExpandable: record => record?.areaList?.length > 1
- }}
scroll={{
x: 1700
}}
diff --git a/src/components/flight/NewFlightApprovalsReport.js b/src/components/flight/NewFlightApprovalsReport.js
index ee591a8a..380c3934 100644
--- a/src/components/flight/NewFlightApprovalsReport.js
+++ b/src/components/flight/NewFlightApprovalsReport.js
@@ -94,7 +94,7 @@ export default function NewFlightApprovalsReport(props) {
props.setFilterId(e.target.value)}
onKeyPress={handleKeyDown}
@@ -140,18 +140,18 @@ export default function NewFlightApprovalsReport(props) {
props.setReviewedType(e.target.value)}
+ id='reviewedProcType'
+ value={props.reviewedProcType}
+ onChange={e => props.setReviewedProcType(e.target.value)}
onKeyPress={handleKeyDown}
>
- {Object.values(
+ {Object.entries(
props.pageName === 'control'
? FlightCategory.Control
: FlightCategory.Operation
- ).map(item => (
-
))}
@@ -172,13 +172,13 @@ export default function NewFlightApprovalsReport(props) {
onChange={e => props.setReviewedType(e.target.value)}
onKeyPress={handleKeyDown}
>
- {Object.values(
+ {Object.entries(
props.pageName === 'control'
? FlightCategory.Operation
: FlightCategory.Control
- ).map(item => (
-
))}
diff --git a/src/components/flight/OperationApprovalsTable.js b/src/components/flight/OperationApprovalsTable.js
index b8ad8678..74540e6f 100644
--- a/src/components/flight/OperationApprovalsTable.js
+++ b/src/components/flight/OperationApprovalsTable.js
@@ -59,6 +59,7 @@ export default function OperationApprovalsTable(props) {
const [validData, setValidData] = useState();
const [reviewedTypeValue, setReviewedTypeValue] = useState('');
+
useEffect(() => {
let approvalCdValue = { S: 0, F: 0, C: 0, U: 0 };
@@ -99,12 +100,6 @@ export default function OperationApprovalsTable(props) {
const save = async () => {
try {
const values = await form.validateFields();
- const currentValue = form.getFieldValue(
- `${record.planAreaSno}_${dataIndex}`
- );
-
- console.log('>>', record);
- console.log('>>', currentValue);
handleSave({ ...record, ...values });
} catch (errInfo) {}
@@ -134,50 +129,51 @@ export default function OperationApprovalsTable(props) {
if (type === 'operation') {
switch (value) {
case 'W':
- text = '검토대기';
+ text = '대기';
break;
case 'Q':
text = '검토요청';
break;
case 'A':
- text = '검토재요청';
+ text = '재검토요청';
break;
- case 'R':
- text = '검토완료';
+ case 'S':
+ text = '완료';
break;
case 'C':
- text = '검토취소';
+ text = '검토요청취소';
break;
case 'U':
- text = '검토불필요';
+ text = '불필요';
break;
+ case 'P':
+ text = '검토요청처리';
+ break;
+ default:
+ text = '-';
}
return text;
} else if (type === 'control') {
switch (value) {
case 'R':
- text = '검토완료';
- break;
- case 'Q':
- text = '검토요청';
+ text = '재검토';
break;
case 'W':
- text = '-';
- break;
- case 'A':
- text = '검토재요청';
+ text = '검토대기';
break;
case 'C':
- text = '요청반려';
+ text = '검토취소';
break;
- case 'U':
- text = '-';
+ case 'P':
+ text = '요청처리';
break;
+
+ default:
+ text = '-';
}
return text;
}
};
-
// 데이터
const columns = [
{
@@ -225,7 +221,7 @@ export default function OperationApprovalsTable(props) {
dataIndex: 'zoneNo',
align: 'center',
width: '85px',
- render: zoneNo => <>총{zoneNo}건>
+ render: zoneNo => <>{zoneNo}구역>
},
{
title: <>신청자>,
@@ -463,7 +459,7 @@ export default function OperationApprovalsTable(props) {
type='select'
id='reviewedType'
style={{
- width: 100
+ width: 110
}}
value={reviewedType}
onClick={handleMouseDown}
@@ -481,18 +477,16 @@ export default function OperationApprovalsTable(props) {
-
-
-
-
- {/* <>{handlerReviewed(reviewedType, 'operation')}> */}
>
);
}
@@ -505,15 +499,11 @@ export default function OperationApprovalsTable(props) {
확인결과
>
),
- dataIndex: 'cReviewedType',
+ dataIndex: 'reviewedProcType',
align: 'center',
width: '130px',
- render: cReviewedType => {
- return (
- <>
- <>{handlerReviewed(cReviewedType, 'control')}>
- >
- );
+ render: reviewedProcType => {
+ return <>{handlerReviewed(reviewedProcType, 'control')}>;
}
},
{
@@ -574,9 +564,8 @@ export default function OperationApprovalsTable(props) {
};
});
+ // 운항과 select box 상태 변경
const updateReviewedType = async (value, planAreaSno) => {
- console.log('>>', planAreaSno);
-
try {
await dispatch(
updateLaancAprvReview({
@@ -624,15 +613,6 @@ export default function OperationApprovalsTable(props) {
} catch (errInfo) {
handlerErrorModal(ERROR_TITLE, ERROR_MESSAGE, true);
}
-
- // const newData = [...tempDataSource];
- // newData.map(item => {
- // if (row.hasOwnProperty(item.planAreaSno)) {
- // item.reviewedReason = row[item.planAreaSno];
- // }
- // });
-
- // setTempDataSource(newData);
};
// 단순 메시지 표출 모달
@@ -743,7 +723,7 @@ export default function OperationApprovalsTable(props) {
const checkCondition = {
A: item => item.reviewedType !== 'R' && item.reviewedType !== 'C',
Q: item => item.reviewedType !== 'W',
- R: item => item.reviewedType !== 'U' && item.reviewedType !== 'W'
+ S: item => item.reviewedType !== 'U' && item.reviewedType !== 'W'
};
// 요청 실패 시 에러 메시지
@@ -753,7 +733,7 @@ export default function OperationApprovalsTable(props) {
'검토결과 완료, 검토취소인 신청건만 재 요청이 가능합니다.'
],
Q: ['검토 요청 실패', '검토결과 대기인 신청건만 요청이 가능합니다.'],
- R: [
+ S: [
'검토 완료 실패',
'검토불필요, 검토대기인 신청건만 재 요청이 가능합니다.'
]
@@ -787,12 +767,12 @@ export default function OperationApprovalsTable(props) {
);
}
},
- R: async () => {
+ S: async () => {
try {
await dispatch(
updateLaancAprvReview({
planAreaSnoList: checkList,
- reviewedType: 'R'
+ reviewedType: 'S'
})
);
props.handlerSearch(
@@ -864,7 +844,7 @@ export default function OperationApprovalsTable(props) {
-