Browse Source

편집 파라미터 데이터 수정

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

30
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,15 +1288,17 @@ export default function ControlApprovalsTable(props) {
vertical={true}
horizontal={true}
activationDistance={10}
ignoreElements='.editable-input' // 이 클래스의 요소는 드래그 이벤트에서 제외
>
<div style={{ width: '2000px' }}>
<Form form={form} component={false}>
<Table
components={{
body: {
cell: EditableCell
}
}}
dataSource={laancAprvList.map((item, index) => ({
dataSource={laancAprvList.map(item => ({
...item,
key: `parent_${item.planSno}`
}))}
@ -1308,7 +1309,8 @@ export default function ControlApprovalsTable(props) {
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';
className +=
'flight-not-approval-row editable-row';
} else if (record.areaList[0].approvalCd === 'C') {
className +=
'flight-condition-approval-row editable-row';
@ -1362,6 +1364,7 @@ export default function ControlApprovalsTable(props) {
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>
) : (

33
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,8 +1096,10 @@ export default function OperationApprovalsTable(props) {
vertical={true}
horizontal={true}
activationDistance={10}
ignoreElements='.editable-input' // 이 클래스의 요소는 드래그 이벤트에서 제외
>
<div style={{ width: '2000px' }}>
<Form form={form} component={false}>
<Table
components={{
body: {
@ -1121,7 +1120,8 @@ export default function OperationApprovalsTable(props) {
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';
className +=
'flight-not-approval-row editable-row';
} else if (record.areaList[0].approvalCd === 'C') {
className +=
'flight-condition-approval-row editable-row';
@ -1131,7 +1131,8 @@ export default function OperationApprovalsTable(props) {
if (props.selected?.length > 0) {
if (
record.areaList.length <= 1 &&
record.areaList[0].planAreaSno === props.selected[0]
record.areaList[0].planAreaSno ===
props.selected[0]
) {
className += ' flight-approval-row-click';
}
@ -1175,6 +1176,7 @@ export default function OperationApprovalsTable(props) {
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