Browse Source

수정 버튼 분기 추가

master
sanguu516 2 months ago
parent
commit
1a060de565
  1. 46
      src/components/flight/ControlApprovalsTable.js
  2. 1
      src/redux/features/laanc/laancThunk.ts

46
src/components/flight/ControlApprovalsTable.js

@ -123,10 +123,10 @@ export default function ControlApprovalsTable(props) {
})
);
} else {
handlerErrorModal(ERROR_TITLE, ERROR_MESSAGE);
handlerErrorModal(ERROR_TITLE, ERROR_MESSAGE, true);
}
} catch (errInfo) {
handlerErrorModal(ERROR_TITLE, ERROR_MESSAGE);
handlerErrorModal(ERROR_TITLE, ERROR_MESSAGE, true);
}
};
@ -286,7 +286,6 @@ export default function ControlApprovalsTable(props) {
dataIndex: 'bufferZone',
align: 'center',
width: '80px',
editable: true,
render: (text, record) => {
return text ? text : '-';
}
@ -518,7 +517,15 @@ export default function ControlApprovalsTable(props) {
<Button color='flat-dark'>
<Typography.Link
disabled={editingKey !== ''}
onClick={() => edit(record)}
onClick={() => {
record.reviewedType === 'R'
? handlerErrorModal(
'수정 불가',
'검토가 완료된 구역은 수정할 수 없습니다.',
false
)
: edit(record);
}}
>
수정
</Typography.Link>
@ -638,7 +645,6 @@ export default function ControlApprovalsTable(props) {
{
dataIndex: 'bufferZone',
align: 'center',
editable: true,
width: '80px',
render: text => {
return text ? text : <>-</>;
@ -760,7 +766,16 @@ export default function ControlApprovalsTable(props) {
<Button color='flat-dark'>
<Typography.Link
disabled={editingKey !== ''}
onClick={() => edit(record)}
onClick={() => {
console.log('record>>', record);
record.reviewedType === 'R'
? handlerErrorModal(
'수정 불가',
'검토가 완료된 구역은 수정할 수 없습니다.',
false
)
: edit(record);
}}
>
수정
</Typography.Link>
@ -912,13 +927,13 @@ export default function ControlApprovalsTable(props) {
});
// 단순 메시지 표출 모달
const handlerErrorModal = (header, body) => {
const handlerErrorModal = (header, body, isRefresh) => {
dispatch(
openModal({
header: header,
body: body,
isHistoryBack: false,
isRefresh: true
isRefresh: isRefresh
})
);
};
@ -1175,6 +1190,13 @@ export default function ControlApprovalsTable(props) {
// 체크박스 업데이트 함수
const handleCheckbox = async () => {
if (checkList.length === 0) {
return handlerErrorModal(
'검토 실패',
'검토할 항목을 선택해주세요.',
false
);
}
try {
const planAreaSnoList = [
...new Set(
@ -1193,7 +1215,13 @@ export default function ControlApprovalsTable(props) {
searchEndDt: props.endDate
})
);
} catch (error) {}
} catch (error) {
return handlerErrorModal(
'검토 실패',
'검토를 실패하였습니다. 다시 시도해주세요.',
false
);
}
};
return (

1
src/redux/features/laanc/laancThunk.ts

@ -289,6 +289,7 @@ export const getLaancAprvList = createAsyncThunk(
dtl: item.areaList[0].dtl,
planAreaSno: item.areaList[0].planAreaSno,
reqRadius: item.areaList[0].reqRadius,
reviewedType: item.areaList[0].reviewedType,
allowRadius: item.areaList[0].allowRadius,
fltElevMax:
!item.areaList[0].fltElevMax &&

Loading…
Cancel
Save