({
+ ...item,
+ key: `parent_${item.planSno}`
+ }))}
+ 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';
}
- 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 요소를 감지
+ record.areaList.length <= 1 &&
+ record.areaList[0].planAreaSno === props.selected
) {
- handleRowClick(record);
+ className += ' flight-approval-row-click';
+ }
+ if (expandedRowKeys.includes(record.key)) {
+ className += ' expanded-row';
}
- }
- })}
- loading={laancAprvLoading}
- expandable={{
- expandedRowRender,
- expandedRowKeys: expandedRowKeys,
- onExpand: (expanded, record) =>
- handleExpand(record.key),
- rowExpandable: record => record?.areaList?.length > 1
- }}
- scroll={{
- x: 1700
- }}
- rowHoverable={false}
- expandIconColumnIndex={-1}
- />
+ if (record.areaList.length > 1) {
+ className += 'expanded-tr';
+ }
+ return className;
+ }}
+ rowSelection={{
+ ...rowSelection
+ }}
+ 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);
+ }
+ }
+ })}
+ loading={laancAprvLoading}
+ expandable={{
+ expandedRowRender,
+ expandedRowKeys: expandedRowKeys,
+ onExpand: (expanded, record) =>
+ handleExpand(record.key),
+ rowExpandable: record => record?.areaList?.length > 1
+ }}
+ scroll={{
+ x: 1700
+ }}
+ rowHoverable={false}
+ expandIconColumnIndex={-1}
+ />
+
@@ -1394,18 +1397,7 @@ const EditableCell = ({
return (
{editing ? (
-
+
{inputNode}
) : (
diff --git a/src/components/flight/OperationApprovalsTable.js b/src/components/flight/OperationApprovalsTable.js
index a61c3600..513ee6bd 100644
--- a/src/components/flight/OperationApprovalsTable.js
+++ b/src/components/flight/OperationApprovalsTable.js
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Button, Card } from '@component/ui';
import { openModal } from '@src/redux/features/comn/message/messageSlice';
@@ -52,7 +52,6 @@ export default function OperationApprovalsTable(props) {
// 유효성 기체 데이터
const [validData, setValidData] = useState();
- console.log('>>', laancAprvList);
useEffect(() => {
let approvalCdValue = { S: 0, F: 0, C: 0, U: 0 };
@@ -271,7 +270,6 @@ export default function OperationApprovalsTable(props) {
dataIndex: 'allowRadius',
align: 'center',
width: '80px',
- editable: true,
render: (text, record) => {
return text ? text : '-';
}
@@ -620,7 +618,6 @@ export default function OperationApprovalsTable(props) {
{
dataIndex: 'allowRadius',
align: 'center',
- editable: true,
width: '80px',
render: text => {
return text ? text : <>->;
@@ -874,7 +871,7 @@ export default function OperationApprovalsTable(props) {
const edit = record => {
form.setFieldsValue({
planAreaSno: record.planAreaSno,
- bufferZone: record.bufferZone,
+ reqRadius: record.reqRadius,
fltElev: record.fltElev,
dtl: record.dtl,
era: record.era,
@@ -899,8 +896,8 @@ export default function OperationApprovalsTable(props) {
updateLaancAprv([
{
planAreaSno: selectedRowKey,
- bufferZone: row.bufferZone,
- fltElev: row.fltElev,
+ reqRadius: row.reqRadius || '',
+ fltElev: row.fltElev || '',
dtl: row.dtl || '',
era: row.era || '',
rm: row.rm || ''
@@ -1099,82 +1096,87 @@ export default function OperationApprovalsTable(props) {
vertical={true}
horizontal={true}
activationDistance={10}
+ ignoreElements='.editable-input' // 이 클래스의 요소는 드래그 이벤트에서 제외
>
- ({
- ...item,
- key:
- item.areaList.length >= 1
- ? `${item.planAreaSno}-${index}`
- : `${item.planAreaSno}`
- }))}
- 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';
- }
+ |