From 7c1e054e6484a4c444fc8c9ff0792272dbd22d77 Mon Sep 17 00:00:00 2001 From: sanguu516 Date: Fri, 16 Aug 2024 11:35:26 +0900 Subject: [PATCH] =?UTF-8?q?feat/=EA=B2=80=EC=83=89=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EB=AC=B8=EA=B5=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/ControlApprovalsTable.js | 14 ++++-- .../flight/OperationApprovalsTable.js | 46 +++++++++++++++---- src/configs/constants.ts | 10 ++-- .../flight/ControlApprovalsContainer.js | 10 ++-- .../flight/OperationApprovalsContainer.js | 6 ++- 5 files changed, 63 insertions(+), 23 deletions(-) diff --git a/src/components/flight/ControlApprovalsTable.js b/src/components/flight/ControlApprovalsTable.js index 20fe641b..47fa0398 100644 --- a/src/components/flight/ControlApprovalsTable.js +++ b/src/components/flight/ControlApprovalsTable.js @@ -89,6 +89,7 @@ export default function ControlApprovalsTable(props) { era: record.era, rm: record.rm, reqRadius: record.reqRadius, + reqElev: record.reqElev, ...record }); setEditingKey(record.key); @@ -114,7 +115,8 @@ export default function ControlApprovalsTable(props) { dtl: row.dtl || '', era: row.era || '', rm: row.rm || '', - reqRadius: row.reqRadius || '' + reqRadius: row.reqRadius || '', + reqElev: row.reqElev || '' } ]) ); @@ -549,7 +551,7 @@ export default function ControlApprovalsTable(props) { areaList[0].reviewedType === 'R' ? ( '검토완료' ) : areaList[0].reviewedType === 'C' ? ( - '검토요청취소' + '요청반려' ) : areaList[0].reviewedType === 'Q' ? ( '검토요청' ) : areaList[0].reviewedType === 'A' ? ( @@ -702,6 +704,7 @@ export default function ControlApprovalsTable(props) { dataIndex: 'reqElev', align: 'center', width: '80px', + editable: true, render: text => { return text ? text : <>-; } @@ -819,7 +822,7 @@ export default function ControlApprovalsTable(props) { return text === 'R' ? ( '검토완료' ) : text === 'C' ? ( - '검토요청취소' + '요청반려' ) : text === 'Q' ? ( '검토요청' ) : text === 'A' ? ( @@ -852,6 +855,7 @@ export default function ControlApprovalsTable(props) { fltElev: item.fltElev, rm: item.rm, era: item.era, + reqElev: item.reqElev, reqRadius: item.reqRadius, allowRadius: item.allowRadius, fltElevMax: item.fltElevMax, @@ -1242,7 +1246,7 @@ export default function ControlApprovalsTable(props) { const checkCondition = type === 'R' ? item => item.reviewedType !== 'Q' - : item => item.reviewedType !== 'R'; + : item => item.reviewedType !== 'Q'; // 에러 메시지 const errorMessages = { @@ -1297,6 +1301,7 @@ export default function ControlApprovalsTable(props) { 건 +
+
    diff --git a/src/components/flight/OperationApprovalsTable.js b/src/components/flight/OperationApprovalsTable.js index 47e2905d..07fd344f 100644 --- a/src/components/flight/OperationApprovalsTable.js +++ b/src/components/flight/OperationApprovalsTable.js @@ -106,6 +106,8 @@ export default function OperationApprovalsTable(props) { text = '검토대기'; } else if (type === 'Q') { text = '검토요청'; + } else if (type === 'A') { + text = '검토재요청'; } else if (type === 'C') { text = '검토취소'; } @@ -504,12 +506,21 @@ export default function OperationApprovalsTable(props) { counts.request += 1; } else if (item.reviewedType === 'W') { counts.wait += 1; + } else if (item.reviewedType === 'A') { + counts.rerequest += 1; } else if (item.reviewedType === 'C') { counts.cancel += 1; } return counts; }, - { reviewed: 0, wait: 0, cancel: 0, unapproved: 0, request: 0 } + { + reviewed: 0, + wait: 0, + cancel: 0, + unapproved: 0, + request: 0, + rerequest: 0 + } ); return ( @@ -521,6 +532,9 @@ export default function OperationApprovalsTable(props) { 검토요청: {approvalCounts.request}건
    + 검토재요청: + {approvalCounts.rerequest}건 +
    검토요청취소: {approvalCounts.cancel}건
    @@ -687,6 +701,8 @@ export default function OperationApprovalsTable(props) { dataIndex: 'reqElev', align: 'center', width: '80px', + editable: true, + render: text => { return text ? text : <>-; } @@ -775,6 +791,8 @@ export default function OperationApprovalsTable(props) { ? '검토요청취소' : text === 'Q' ? '검토요청' + : text === 'A' + ? '검토재요청' : '검토대기'; } }, @@ -954,6 +972,7 @@ export default function OperationApprovalsTable(props) { era: record.era, rm: record.rm, reqRadius: record.reqRadius, + reqElev: record.reqElev, ...record }); setEditingKey(record.key); @@ -979,7 +998,8 @@ export default function OperationApprovalsTable(props) { dtl: row.dtl || '', era: row.era || '', rm: row.rm || '', - reqRadius: row.reqRadius || '' + reqRadius: row.reqRadius || '', + reqElev: row.reqElev || '' } ]) ); @@ -1125,7 +1145,11 @@ export default function OperationApprovalsTable(props) { const rowSelection = { selectedRowKeys: checkList, getCheckboxProps: record => { + const allChildrenReviewed = record.areaList.every( + child => child.reviewedType === 'R' + ); return { + disabled: allChildrenReviewed, name: record.key }; }, @@ -1134,9 +1158,9 @@ export default function OperationApprovalsTable(props) { const key = record.key; if (key.startsWith('parent_')) { - const childKeys = record.areaList.map( - child => `child_${record.planSno}_${child.planAreaSno}` - ); + const childKeys = record.areaList + .filter(child => child.reviewedType !== 'R') + .map(child => `child_${record.planSno}_${child.planAreaSno}`); if (selected) { newCheckList.push(key, ...childKeys); @@ -1173,8 +1197,11 @@ export default function OperationApprovalsTable(props) { // 부모 키 업데이트 laancAprvList.forEach(parent => { const parentKey = `parent_${parent.planSno}`; + const selectableChildren = parent.areaList.filter( + child => child.reviewedType !== 'R' + ); - const childKeys = parent.areaList.map( + const childKeys = selectableChildren.map( child => `child_${parent.planSno}_${child.planAreaSno}` ); const allSelectableChildrenChecked = childKeys.every(key => @@ -1184,7 +1211,7 @@ export default function OperationApprovalsTable(props) { newList.includes(key) ); - if (allSelectableChildrenChecked && parent.areaList.length > 0) { + if (allSelectableChildrenChecked && selectableChildren.length > 0) { if (!newList.includes(parentKey)) { newList.push(parentKey); } @@ -1203,6 +1230,7 @@ export default function OperationApprovalsTable(props) { const childRowSelection = { selectedRowKeys: checkList.filter(key => key.startsWith('child_')), getCheckboxProps: record => ({ + disabled: record.reviewedType === 'R', name: record.key }), @@ -1241,7 +1269,7 @@ export default function OperationApprovalsTable(props) { // 검토 요청, 재 요청 조건 const checkCondition = { - A: item => item.reviewedType !== 'R', + A: item => item.reviewedType !== 'R' && item.reviewedType !== 'C', Q: item => item.reviewedType !== 'W' }; @@ -1249,7 +1277,7 @@ export default function OperationApprovalsTable(props) { const errorMessages = { A: [ '재 요청 요청 실패', - '검토결과 완료인 신청건만 재 요청이 가능합니다.' + '검토결과 완료, 검토취소인 신청건만 재 요청이 가능합니다.' ], Q: ['검토 요청 실패', '검토결과 대기인 신청건만 요청이 가능합니다.'] }; diff --git a/src/configs/constants.ts b/src/configs/constants.ts index a440d78d..c4ee3aba 100644 --- a/src/configs/constants.ts +++ b/src/configs/constants.ts @@ -239,15 +239,17 @@ export const FlightCategory = { Control: { 전체: '전체', 검토완료: '검토완료', - 검토대기: '검토대기', - 재검토: '재검토' + 검토요청: '검토요청', + 검토재요청: '검토재요청', + 요청반려: '요청반려' }, Operation: { 전체: '전체', 검토완료: '검토완료', 검토대기: '검토대기', - 재검토: '재검토', - 검토불필요: '검토불필요' + 검토재요청: '검토재요청', + 검토불필요: '검토불필요', + 검토요청취소: '검토요청취소' } }; diff --git a/src/containers/flight/ControlApprovalsContainer.js b/src/containers/flight/ControlApprovalsContainer.js index 4e22ba07..cddd4af7 100644 --- a/src/containers/flight/ControlApprovalsContainer.js +++ b/src/containers/flight/ControlApprovalsContainer.js @@ -238,12 +238,12 @@ export default function ControlApprovalsContainer({ mode }) { return 'C'; case '검토완료': return 'R'; - case '재검토': + case '검토재요청': return 'A'; - case '검토대기': - return 'W'; - case '검토불필요': - return 'U'; + case '검토요청': + return 'Q'; + case '요청반려': + return 'C'; } }; diff --git a/src/containers/flight/OperationApprovalsContainer.js b/src/containers/flight/OperationApprovalsContainer.js index bc82f5d3..cc1b1b0f 100644 --- a/src/containers/flight/OperationApprovalsContainer.js +++ b/src/containers/flight/OperationApprovalsContainer.js @@ -280,12 +280,16 @@ export default function OperationApprovalsContainer({ mode }) { return 'C'; case '검토완료': return 'R'; - case '재검토': + case '검토재요청': return 'A'; case '검토대기': return 'W'; case '검토불필요': return 'U'; + case '검토요청': + return 'Q'; + case '검토요청취소': + return 'C'; } }; const handlerSearch = (search, searchDate, filterArea) => {