diff --git a/src/components/flight/NewFlightApprovalsTable.js b/src/components/flight/NewFlightApprovalsTable.js
index e1c294fd..2a948795 100644
--- a/src/components/flight/NewFlightApprovalsTable.js
+++ b/src/components/flight/NewFlightApprovalsTable.js
@@ -5,6 +5,13 @@ import dayjs from 'dayjs';
import { openModal } from '@src/redux/features/comn/message/messageSlice';
import { FaAngleDown, FaAngleUp } from 'react-icons/fa';
import { Form, Input, InputNumber, Popconfirm, Table, Typography } from 'antd';
+import { HOST } from '../../configs/constants';
+import { pdfjs } from 'react-pdf';
+import { getLaancAprvExcel } from '../../redux/features/laanc/laancThunk';
+import axios from 'axios';
+import { getAccessToken } from '../../utility/authService/jwtTokenUtil';
+
+pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
export default function NewFlightApprovalsTable(props) {
const dispatch = useDispatch();
@@ -27,6 +34,15 @@ export default function NewFlightApprovalsTable(props) {
const [form] = Form.useForm();
+ const [updateRowData, setRowData] = useState({
+ planAreaSno: 0,
+ bufferZone: 0,
+ fltElev: 0,
+ dtl: '',
+ era: '',
+ rm: ''
+ });
+
// 수정 키 확인
const isEditing = record => record.key === editingKey;
@@ -62,10 +78,12 @@ export default function NewFlightApprovalsTable(props) {
newData.splice(index, 1, { ...item, ...row });
setData(newData);
setEditingKey('');
+ setRowData(row); // 입력한 값을 setRowData에 저장
} else {
newData.push(row);
setData(newData);
setEditingKey('');
+ setRowData(row); // 입력한 값을 setRowData에 저장
}
} catch (errInfo) {
console.log('Validate Failed:', errInfo);
@@ -92,10 +110,10 @@ export default function NewFlightApprovalsTable(props) {
신청
월
>
),
- dataIndex: 'applyDt',
+ dataIndex: 'applyDtMonth',
width: '80px',
align: 'center',
- render: text => dayjs(text).format(' M월')
+ render: text => dayjs(text).format('M월')
},
{
title: (
@@ -103,7 +121,7 @@ export default function NewFlightApprovalsTable(props) {
신청
일
>
),
- dataIndex: 'applyDt',
+ dataIndex: 'applyDtDay',
width: '80px',
align: 'center',
render: text => dayjs(text).format('DD일')
@@ -394,13 +412,13 @@ export default function NewFlightApprovalsTable(props) {
align: 'center'
},
{
- dataIndex: '6월',
+ dataIndex: 'applyDtMonth',
width: '80px',
align: 'center',
render: text => dayjs(text).format('M월')
},
{
- dataIndex: '21일',
+ dataIndex: 'applyDtDay',
width: '80px',
align: 'center',
render: text => dayjs(text).format('DD일')
@@ -473,7 +491,7 @@ export default function NewFlightApprovalsTable(props) {
width: '70px'
},
{
- dataIndex: '세부사항',
+ dataIndex: 'dtl',
align: 'center',
editable: true,
width: '110px',
@@ -490,7 +508,7 @@ export default function NewFlightApprovalsTable(props) {
}
},
{
- dataIndex: '긴급구조기관',
+ dataIndex: 'era',
align: 'center',
editable: true,
width: '110px',
@@ -499,7 +517,7 @@ export default function NewFlightApprovalsTable(props) {
}
},
{
- dataIndex: '비고',
+ dataIndex: 'rm',
align: 'center',
editable: true,
width: '110px',
@@ -571,6 +589,16 @@ export default function NewFlightApprovalsTable(props) {
});
});
+ // PDF 다운로드
+ const handlerPdfDownload = pdf => {
+ if (pdf) {
+ let alink = document.createElement('a');
+ alink.href = `${HOST}${pdf?.substring(1)}`;
+ alink.download = 'SamplePDF.pdf';
+ alink.click();
+ }
+ };
+
return (