diff --git a/src/components/flight/OperationApprovalsTable.js b/src/components/flight/OperationApprovalsTable.js
index 3c7bf6bb..0a9d550c 100644
--- a/src/components/flight/OperationApprovalsTable.js
+++ b/src/components/flight/OperationApprovalsTable.js
@@ -11,6 +11,7 @@ import {
import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst';
import OperationModal from './OperationModal';
import ScrollContainer from 'react-indiana-drag-scroll';
+import OperationCheckBoxModal from './OperationCheckBoxModal';
export default function OperationApprovalsTable(props) {
const dispatch = useDispatch();
@@ -28,6 +29,9 @@ export default function OperationApprovalsTable(props) {
U: 0
});
+ // 체크박스 팝업 테이블 데이터
+ const [checkData, setCheckData] = useState([]);
+
const scrollContainerRef = useRef(null);
// 확장된 행 키
@@ -49,6 +53,9 @@ export default function OperationApprovalsTable(props) {
// 체크박스 선택
const [checkList, setCheckList] = useState([]);
+ // 체큽작스 모달
+ const [isCheckBoxModal, setIsCheckBoxModal] = useState(false);
+
// 수정 키 확인
const isEditing = record => record.key === editingKey;
@@ -502,6 +509,19 @@ export default function OperationApprovalsTable(props) {
);
}
},
+ {
+ title: (
+ <>
+ 재검토
+ 사유
+ >
+ ),
+ dataIndex: 'reviewedReason',
+ width: '70px',
+ align: 'center',
+
+ render: text => (text ? `${text}` : '-')
+ },
{
title: '비고',
dataIndex: 'areaList',
@@ -723,6 +743,12 @@ export default function OperationApprovalsTable(props) {
: '검토대기';
}
},
+ {
+ dataIndex: 'reviewedReason',
+ width: '70px',
+ align: 'center',
+ render: text => (text ? `${text}` : '-')
+ },
{
title: '비고',
dataIndex: 'planAreaSno',
@@ -739,7 +765,7 @@ export default function OperationApprovalsTable(props) {
const data = [];
record.areaList.map((item, index) => {
data.push({
- key: `${item.planAreaSno}-${index}`,
+ key: `${item.planSno}`,
applyNo: item.applyNo,
applyDt: item.applyDt,
zoneNo: item.zoneNo,
@@ -764,6 +790,7 @@ export default function OperationApprovalsTable(props) {
addr1: item.addr1,
addr2: item.addr2,
addr3: item.addr3,
+ reviewedReason: item.reviewedReason,
limitZoneNm: item?.limitZoneNm ? item?.limitZoneNm : '-'
});
});
@@ -814,7 +841,10 @@ export default function OperationApprovalsTable(props) {
key.startsWith(`child_${record.planSno}_`)
)
}}
- dataSource={data}
+ dataSource={record.areaList.map((item, index) => ({
+ ...item,
+ key: `child_${record.planSno}_${item.planAreaSno}`
+ }))}
pagination={false}
components={{
body: {
@@ -1070,7 +1100,7 @@ export default function OperationApprovalsTable(props) {
if (key.startsWith('parent_')) {
const childKeys = record.areaList
- .filter(child => child.reviewedType !== 'R')
+ .filter(child => child.reviewedType === 'R')
.map(child => `child_${record.planSno}_${child.planAreaSno}`);
if (selected) {
@@ -1089,7 +1119,7 @@ export default function OperationApprovalsTable(props) {
? laancAprvList.flatMap(parent => {
const parentKey = `parent_${parent.planSno}`;
const selectableChildren = parent.areaList.filter(
- child => child.reviewedType !== 'R'
+ child => child.reviewedType === 'R'
);
const childKeys = selectableChildren.map(
child => `child_${parent.planSno}_${child.planAreaSno}`
@@ -1113,7 +1143,7 @@ export default function OperationApprovalsTable(props) {
laancAprvList.forEach(parent => {
const parentKey = `parent_${parent.planSno}`;
const selectableChildren = parent.areaList.filter(
- child => child.reviewedType !== 'R'
+ child => child.reviewedType === 'R'
);
const childKeys = selectableChildren.map(
child => `child_${parent.planSno}_${child.planAreaSno}`
@@ -1170,6 +1200,24 @@ export default function OperationApprovalsTable(props) {
false
);
}
+
+ const planAreaSnoList = [
+ ...new Set(
+ checkList
+ .filter(item => item.startsWith('child_')) // 'child_'로 시작하는 항목 필터링
+ .map(item => item.split('_').pop()) // 마지막 언더바 이후의 숫자 추출
+ )
+ ];
+
+ // res에서 planAreaSnoList에 해당하는 데이터만 추출 2차원 배열 말고 1차원 배열로 추출
+ const res = laancAprvList.flatMap(item =>
+ item.areaList.filter(area =>
+ planAreaSnoList.includes(area.planAreaSno.toString())
+ )
+ );
+
+ setCheckData(res);
+ setIsCheckBoxModal(true);
// try {
// const planAreaSnoList = [
// ...new Set(
@@ -1212,6 +1260,14 @@ export default function OperationApprovalsTable(props) {
data={validData}
/>
)}
+ {isCheckBoxModal && (
+