Browse Source

편집 파라미터 데이터 수정

master
sanguu516 2 months ago
parent
commit
247662f1eb
  1. 160
      src/components/flight/ControlApprovalsTable.js
  2. 167
      src/components/flight/OperationApprovalsTable.js
  3. 1
      src/router/hoc/ResolveRoutes.tsx

160
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' // 이 클래스의 요소는 드래그 이벤트에서 제외
>
<div style={{ width: '2000px' }}>
<Table
components={{
body: {
cell: EditableCell
}
}}
dataSource={laancAprvList.map((item, index) => ({
...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 상태면 이벤트 실행 안 함
<Form form={form} component={false}>
<Table
components={{
body: {
cell: EditableCell
}
}}
dataSource={laancAprvList.map(item => ({
...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}
/>
</Form>
</div>
</ScrollContainer>
</Form>
@ -1394,18 +1397,7 @@ const EditableCell = ({
return (
<td {...restProps}>
{editing ? (
<Form.Item
name={dataIndex}
style={{
margin: 0
}}
// rules={[
// {
// required: true,
// message: `값을 입력해 주세요`
// }
// ]}
>
<Form.Item name={dataIndex} className='editable-input'>
{inputNode}
</Form.Item>
) : (

167
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' // 이 클래스의 요소는 드래그 이벤트에서 제외
>
<div style={{ width: '2000px' }}>
<Table
components={{
body: {
cell: EditableCell
}
}}
dataSource={laancAprvList.map((item, index) => ({
...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';
}
<Form form={form} component={false}>
<Table
components={{
body: {
cell: EditableCell
}
}}
dataSource={laancAprvList.map((item, index) => ({
...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}
/>
</Form>
</div>
</ScrollContainer>
</Form>
@ -1207,18 +1209,7 @@ const EditableCell = ({
return (
<td {...restProps}>
{editing ? (
<Form.Item
name={dataIndex}
style={{
margin: 0
}}
// rules={[
// {
// required: true,
// message: `값을 입력해 주세요`
// }
// ]}
>
<Form.Item name={dataIndex} className='editable-input'>
{inputNode}
</Form.Item>
) : (

1
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];

Loading…
Cancel
Save