|
|
@ -5,7 +5,6 @@ import dayjs from 'dayjs'; |
|
|
|
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 { FaAngleDown, FaAngleUp } from 'react-icons/fa'; |
|
|
|
import { Form, Input, InputNumber, Popconfirm, Table, Typography } from 'antd'; |
|
|
|
import { Form, Input, InputNumber, Popconfirm, Table, Typography } from 'antd'; |
|
|
|
import { render } from 'react-dom'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function NewFlightApprovalsTable(props) { |
|
|
|
export default function NewFlightApprovalsTable(props) { |
|
|
|
const dispatch = useDispatch(); |
|
|
|
const dispatch = useDispatch(); |
|
|
@ -41,7 +40,6 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
form.setFieldsValue({ |
|
|
|
form.setFieldsValue({ |
|
|
|
bufferZone: '', |
|
|
|
bufferZone: '', |
|
|
|
fltElev: '', |
|
|
|
fltElev: '', |
|
|
|
|
|
|
|
|
|
|
|
...record |
|
|
|
...record |
|
|
|
}); |
|
|
|
}); |
|
|
|
setEditingKey(record.key); |
|
|
|
setEditingKey(record.key); |
|
|
@ -135,7 +133,6 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
<> |
|
|
|
<> |
|
|
|
행정 <br /> |
|
|
|
행정 <br /> |
|
|
|
구역 |
|
|
|
구역 |
|
|
|
<br /> |
|
|
|
|
|
|
|
</> |
|
|
|
</> |
|
|
|
), |
|
|
|
), |
|
|
|
dataIndex: 'areaList', |
|
|
|
dataIndex: 'areaList', |
|
|
@ -156,7 +153,6 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
dataIndex: 'areaList', |
|
|
|
dataIndex: 'areaList', |
|
|
|
width: '90px', |
|
|
|
width: '90px', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
|
|
|
|
|
|
|
|
|
render: areaList => { |
|
|
|
render: areaList => { |
|
|
|
return areaList.length <= 1 ? '강서구' : '-'; |
|
|
|
return areaList.length <= 1 ? '강서구' : '-'; |
|
|
|
} |
|
|
|
} |
|
|
@ -291,7 +287,6 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
dataIndex: 'areaList', |
|
|
|
dataIndex: 'areaList', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
|
width: '110px', |
|
|
|
width: '110px', |
|
|
|
|
|
|
|
|
|
|
|
render: areaList => { |
|
|
|
render: areaList => { |
|
|
|
const approvalCounts = areaList.reduce( |
|
|
|
const approvalCounts = areaList.reduce( |
|
|
|
(counts, item) => { |
|
|
|
(counts, item) => { |
|
|
@ -480,7 +475,6 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
dataIndex: '세부사항', |
|
|
|
dataIndex: '세부사항', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
|
editable: true, |
|
|
|
|
|
|
|
width: '110px', |
|
|
|
width: '110px', |
|
|
|
render: text => { |
|
|
|
render: text => { |
|
|
|
return <>기타</>; |
|
|
|
return <>기타</>; |
|
|
@ -512,7 +506,6 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
return <>-</>; |
|
|
|
return <>-</>; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
dataIndex: 'approvalCd', |
|
|
|
dataIndex: 'approvalCd', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
@ -578,6 +571,7 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
|
|
|
|
<Form form={form} component={false}> |
|
|
|
<Table |
|
|
|
<Table |
|
|
|
rowClassName={record => { |
|
|
|
rowClassName={record => { |
|
|
|
let className = ''; |
|
|
|
let className = ''; |
|
|
@ -593,9 +587,31 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
return className; |
|
|
|
return className; |
|
|
|
}} |
|
|
|
}} |
|
|
|
size='small' |
|
|
|
size='small' |
|
|
|
columns={childColumns} |
|
|
|
columns={childColumns.map(col => { |
|
|
|
|
|
|
|
if (!col.editable) { |
|
|
|
|
|
|
|
return col; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...col, |
|
|
|
|
|
|
|
onCell: record => ({ |
|
|
|
|
|
|
|
record, |
|
|
|
|
|
|
|
inputType: |
|
|
|
|
|
|
|
col.dataIndex === 'bufferZone' || col.dataIndex === 'fltElev' |
|
|
|
|
|
|
|
? 'number' |
|
|
|
|
|
|
|
: 'text', |
|
|
|
|
|
|
|
dataIndex: col.dataIndex, |
|
|
|
|
|
|
|
title: col.title, |
|
|
|
|
|
|
|
editing: isEditing(record) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
})} |
|
|
|
dataSource={data} |
|
|
|
dataSource={data} |
|
|
|
pagination={false} |
|
|
|
pagination={false} |
|
|
|
|
|
|
|
components={{ |
|
|
|
|
|
|
|
body: { |
|
|
|
|
|
|
|
cell: EditableCell |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}} |
|
|
|
onRow={record => ({ |
|
|
|
onRow={record => ({ |
|
|
|
onClick: event => { |
|
|
|
onClick: event => { |
|
|
|
// 이벤트 버블링을 막기 위해 클릭된 요소가 'Edit' 버튼인지 확인
|
|
|
|
// 이벤트 버블링을 막기 위해 클릭된 요소가 'Edit' 버튼인지 확인
|
|
|
@ -613,6 +629,7 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
rowHoverable={false} |
|
|
|
rowHoverable={false} |
|
|
|
bordered |
|
|
|
bordered |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
</Form> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -805,7 +822,7 @@ export default function NewFlightApprovalsTable(props) { |
|
|
|
expandable={{ |
|
|
|
expandable={{ |
|
|
|
expandedRowRender, |
|
|
|
expandedRowRender, |
|
|
|
expandedRowKeys: expandedRowKeys, |
|
|
|
expandedRowKeys: expandedRowKeys, |
|
|
|
onExpand: handleExpand, |
|
|
|
onExpand: (expanded, record) => handleExpand(record.key), |
|
|
|
rowExpandable: record => record?.areaList?.length > 1 |
|
|
|
rowExpandable: record => record?.areaList?.length > 1 |
|
|
|
}} |
|
|
|
}} |
|
|
|
scroll={{ |
|
|
|
scroll={{ |
|
|
@ -842,7 +859,8 @@ const EditableCell = ({ |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const inputNode = |
|
|
|
const inputNode = |
|
|
|
inputType === 'number' ? ( |
|
|
|
inputType === 'number' ? ( |
|
|
|
<Input |
|
|
|
<InputNumber |
|
|
|
|
|
|
|
min={0} |
|
|
|
onKeyPress={e => { |
|
|
|
onKeyPress={e => { |
|
|
|
if (!/[0-9]/.test(e.key)) { |
|
|
|
if (!/[0-9]/.test(e.key)) { |
|
|
|
e.preventDefault(); // 숫자 외의 입력을 막음
|
|
|
|
e.preventDefault(); // 숫자 외의 입력을 막음
|
|
|
|