From 247662f1eb58937036de298324ff77ec930c7cc0 Mon Sep 17 00:00:00 2001 From: sanguu516 Date: Wed, 24 Jul 2024 17:00:43 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8E=B8=EC=A7=91=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/ControlApprovalsTable.js | 160 ++++++++--------- .../flight/OperationApprovalsTable.js | 167 +++++++++--------- src/router/hoc/ResolveRoutes.tsx | 1 - 3 files changed, 155 insertions(+), 173 deletions(-) diff --git a/src/components/flight/ControlApprovalsTable.js b/src/components/flight/ControlApprovalsTable.js index 44603c80..a2b5e2af 100644 --- a/src/components/flight/ControlApprovalsTable.js +++ b/src/components/flight/ControlApprovalsTable.js @@ -82,7 +82,7 @@ export default function ControlApprovalsTable(props) { const edit = record => { form.setFieldsValue({ planAreaSno: record.planAreaSno, - bufferZone: record.bufferZone, + reqRadius: record.reqRadius, fltElev: record.fltElev, dtl: record.dtl, era: record.era, @@ -103,12 +103,13 @@ export default function ControlApprovalsTable(props) { const row = await form.validateFields(); const index = { ...row, planAreaSno: selectedRowKey }; + console.log('recordrecord>>', row); const updateRes = await dispatch( updateLaancAprv([ { planAreaSno: selectedRowKey, - bufferZone: row.bufferZone, - fltElev: row.fltElev, + reqRadius: row.reqRadius || '', + fltElev: row.fltElev || '', dtl: row.dtl || '', era: row.era || '', rm: row.rm || '' @@ -321,7 +322,6 @@ export default function ControlApprovalsTable(props) { dataIndex: 'allowRadius', align: 'center', width: '80px', - editable: true, render: (text, record) => { return text ? text : '-'; } @@ -664,7 +664,6 @@ export default function ControlApprovalsTable(props) { { dataIndex: 'allowRadius', align: 'center', - editable: true, width: '80px', render: text => { return text ? text : <>-; @@ -1289,79 +1288,83 @@ export default function ControlApprovalsTable(props) { vertical={true} horizontal={true} activationDistance={10} + ignoreElements='.editable-input' // 이 클래스의 요소는 드래그 이벤트에서 제외 >
- ({ - ...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'; - } - if ( - record.areaList.length <= 1 && - record.areaList[0].planAreaSno === props.selected - ) { - className += ' flight-approval-row-click'; - } - if (expandedRowKeys.includes(record.key)) { - className += ' expanded-row'; - } - if (record.areaList.length > 1) { - className += 'expanded-tr'; - } - return className; - }} - rowSelection={{ - ...rowSelection - }} - onRow={record => ({ - onClick: event => { - if (editingKey !== '') { - return; // edit 상태면 이벤트 실행 안 함 + +
({ + ...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'; - } + +
({ + ...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'; + } - if (props.selected?.length > 0) { - if ( - record.areaList.length <= 1 && - record.areaList[0].planAreaSno === props.selected[0] - ) { - className += ' flight-approval-row-click'; + if (props.selected?.length > 0) { + if ( + record.areaList.length <= 1 && + record.areaList[0].planAreaSno === + props.selected[0] + ) { + className += ' flight-approval-row-click'; + } } - } - if (expandedRowKeys.includes(record.key)) { - className += ' expanded-row'; - } - if (record.areaList.length > 1) { - className += 'expanded-tr'; - } - return className; - }} - onRow={record => ({ - onClick: event => { - if (editingKey !== '') { - return; // edit 상태면 이벤트 실행 안 함 + if (expandedRowKeys.includes(record.key)) { + className += ' expanded-row'; + } + if (record.areaList.length > 1) { + className += 'expanded-tr'; } - 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); + return className; + }} + 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), - rowExpandable: record => record?.areaList?.length > 1 - }} - scroll={{ - x: 1700 - }} - rowHoverable={false} - expandIconColumnIndex={-1} - /> + })} + loading={laancAprvLoading} + expandable={{ + expandedRowRender, + expandedRowKeys: expandedRowKeys, + onExpand: (expanded, record) => handleExpand(record), + rowExpandable: record => record?.areaList?.length > 1 + }} + scroll={{ + x: 1700 + }} + rowHoverable={false} + expandIconColumnIndex={-1} + /> + @@ -1207,18 +1209,7 @@ const EditableCell = ({ return (
{editing ? ( - + {inputNode} ) : ( diff --git a/src/router/hoc/ResolveRoutes.tsx b/src/router/hoc/ResolveRoutes.tsx index a31af69c..a320463d 100644 --- a/src/router/hoc/ResolveRoutes.tsx +++ b/src/router/hoc/ResolveRoutes.tsx @@ -35,7 +35,6 @@ export default function ResolveRoutes() { let Router = [...Routes]; let decodeToken = getDecodeToken(); - console.log(decodeToken, '??????'); if (decodeToken) { if (decodeToken.userId === 'palnet') { Router = [...Routes, ...GimpoControlRoutes];