|
|
|
@ -12,6 +12,12 @@ import CreateForm from "./components/CreateForm";
|
|
|
|
|
import {ColumnDrawer} from "./components/ColumnDrawer";
|
|
|
|
|
import {getSysOperationRecordGetOperationRecordList} from "@/services/system/OperationRecord";
|
|
|
|
|
// import UpdateForm from './components/UpdateForm';
|
|
|
|
|
// 列表操作栏组件
|
|
|
|
|
import TableActionCard from '@/components/TableActionCard';
|
|
|
|
|
import IsDelete from '@/components/TableActionCard/isDelete';
|
|
|
|
|
// 批量删除
|
|
|
|
|
import IsBatchDelete from '@/components/BatchOperation/isBatchDelete';
|
|
|
|
|
import { proTableCommonOptions } from '../../../../config/defaultTable';
|
|
|
|
|
|
|
|
|
|
const OperationRecordList: React.FC = () => {
|
|
|
|
|
/**
|
|
|
|
@ -75,13 +81,16 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="system.operation.table.list.id"
|
|
|
|
|
defaultMessage="id"/>),
|
|
|
|
|
dataIndex: "id",
|
|
|
|
|
key:"ID",
|
|
|
|
|
sorter: true,
|
|
|
|
|
valueType: "digit",
|
|
|
|
|
|
|
|
|
|
// valueType: "digit",
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
width: 80,
|
|
|
|
|
filters: true, onFilter: true,
|
|
|
|
|
render: (dom, entity) => {
|
|
|
|
|
return (
|
|
|
|
|
<a
|
|
|
|
|
style={{color: '#155BD4'}}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setCurrentRow(entity);
|
|
|
|
|
setShowDetail(true);
|
|
|
|
@ -99,6 +108,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="system.operation.table.list.ip"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "ip",
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -108,6 +118,9 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="system.operation.table.list.path"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "path",
|
|
|
|
|
width: 120,
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -115,6 +128,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="system.operation.table.list.method"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "method",
|
|
|
|
|
width: 120,
|
|
|
|
|
valueEnum: {
|
|
|
|
|
'GET': intl.formatMessage({id: 'system.api.enum.GET', defaultMessage: '$$$',}),
|
|
|
|
|
'POST': intl.formatMessage({id: 'system.api.enum.POST', defaultMessage: '$$$',}),
|
|
|
|
@ -144,6 +158,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
status: 'Error'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
width: 120,
|
|
|
|
|
filters: true, onFilter: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
@ -154,6 +169,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "latency",
|
|
|
|
|
valueType: 'time',
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -164,6 +180,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
dataIndex: "agent",
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -172,6 +189,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="system.operation.table.list.error_message"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "error_message",
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -182,6 +200,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
dataIndex: "body",
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -192,6 +211,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
dataIndex: "resp",
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -200,6 +220,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="system.operation.table.list.user_id"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "user_id",
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -209,6 +230,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "createTime",
|
|
|
|
|
valueType: 'dateTime',
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -218,6 +240,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "updateTime",
|
|
|
|
|
valueType: 'dateTime',
|
|
|
|
|
width: 120,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -225,47 +248,52 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating"/>,
|
|
|
|
|
dataIndex: 'option',
|
|
|
|
|
valueType: 'option',
|
|
|
|
|
width: 120,
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
render: (_, record) => [
|
|
|
|
|
<Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}>
|
|
|
|
|
{/* <a
|
|
|
|
|
key="update"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setUpdateModalOpen(true);
|
|
|
|
|
setCurrentRow(record);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<FormattedMessage id="pages.searchTable.update" defaultMessage="Update"/>
|
|
|
|
|
</a> */}
|
|
|
|
|
<Popconfirm
|
|
|
|
|
placement="topLeft"
|
|
|
|
|
title={intl.formatMessage({ id: 'common.tip.title', defaultMessage: '$$$' })}
|
|
|
|
|
description={intl.formatMessage({
|
|
|
|
|
id: 'common.modal.table.delete.content',
|
|
|
|
|
defaultMessage: '$$$',
|
|
|
|
|
})}
|
|
|
|
|
okText={intl.formatMessage({ id: 'common.yes', defaultMessage: '$$$' })}
|
|
|
|
|
cancelText={intl.formatMessage({ id: 'common.no', defaultMessage: '$$$' })}
|
|
|
|
|
onConfirm={() => {
|
|
|
|
|
handleDestroy(record).then(() => {});
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Button key="destroy" type="link" size="small" danger>
|
|
|
|
|
<FormattedMessage id="pages.searchTable.destroy" defaultMessage="Destroy" />
|
|
|
|
|
</Button>
|
|
|
|
|
</Popconfirm>
|
|
|
|
|
{/* <a
|
|
|
|
|
key="destroy"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
handleDestroy(record).then(() => {
|
|
|
|
|
})
|
|
|
|
|
}}>
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
id="pages.searchTable.destroy"
|
|
|
|
|
defaultMessage="Destroy"
|
|
|
|
|
/>
|
|
|
|
|
</a> */}
|
|
|
|
|
</Access>
|
|
|
|
|
<TableActionCard
|
|
|
|
|
key="TableActionCardRef"
|
|
|
|
|
renderActions={[
|
|
|
|
|
{
|
|
|
|
|
key: 'destroy',
|
|
|
|
|
renderDom: (
|
|
|
|
|
<IsDelete
|
|
|
|
|
deleteApi={() => {
|
|
|
|
|
handleDestroy(record).then(() => {});
|
|
|
|
|
}}
|
|
|
|
|
></IsDelete>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
></TableActionCard>
|
|
|
|
|
// <Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}>
|
|
|
|
|
// <a
|
|
|
|
|
// key="update"
|
|
|
|
|
// onClick={() => {
|
|
|
|
|
// setUpdateModalOpen(true);
|
|
|
|
|
// setCurrentRow(record);
|
|
|
|
|
// }}
|
|
|
|
|
// >
|
|
|
|
|
// <FormattedMessage id="pages.searchTable.update" defaultMessage="Update"/>
|
|
|
|
|
// </a>
|
|
|
|
|
// <Popconfirm
|
|
|
|
|
// placement="topLeft"
|
|
|
|
|
// title={intl.formatMessage({ id: 'common.tip.title', defaultMessage: '$$$' })}
|
|
|
|
|
// description={intl.formatMessage({
|
|
|
|
|
// id: 'common.modal.table.delete.content',
|
|
|
|
|
// defaultMessage: '$$$',
|
|
|
|
|
// })}
|
|
|
|
|
// okText={intl.formatMessage({ id: 'common.yes', defaultMessage: '$$$' })}
|
|
|
|
|
// cancelText={intl.formatMessage({ id: 'common.no', defaultMessage: '$$$' })}
|
|
|
|
|
// onConfirm={() => {
|
|
|
|
|
// handleDestroy(record).then(() => {});
|
|
|
|
|
// }}
|
|
|
|
|
// >
|
|
|
|
|
// <Button key="destroy" type="link" size="small" danger>
|
|
|
|
|
// <FormattedMessage id="pages.searchTable.destroy" defaultMessage="Destroy" />
|
|
|
|
|
// </Button>
|
|
|
|
|
// </Popconfirm>
|
|
|
|
|
// </Access>
|
|
|
|
|
],
|
|
|
|
|
},];
|
|
|
|
|
return (
|
|
|
|
@ -275,6 +303,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id: 'pages.searchTable.title',
|
|
|
|
|
defaultMessage: '$$$',
|
|
|
|
|
})}
|
|
|
|
|
scroll={{ x: proTableCommonOptions.commscrollX}}
|
|
|
|
|
options={{fullScreen: true, setting: true, density: true, reload: true}}
|
|
|
|
|
actionRef={actionRef}
|
|
|
|
|
rowKey="key"
|
|
|
|
@ -330,8 +359,26 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
setSelectedRows(selectedRows);
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
tableAlertOptionRender={() => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{selectedRowsState?.length > 0 && (
|
|
|
|
|
<IsBatchDelete
|
|
|
|
|
deleteApi={() => {
|
|
|
|
|
const ids = selectedRowsState.map((v: API.OperationRecord) => {
|
|
|
|
|
return v.id
|
|
|
|
|
})
|
|
|
|
|
// deleteOperationRecordDeleteOperationRecordsByIds({ids: ids as number[]}).then(() => {
|
|
|
|
|
// actionRef.current?.reloadAndRest?.();
|
|
|
|
|
// })
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
{selectedRowsState?.length > 0 && (
|
|
|
|
|
{/* {selectedRowsState?.length > 0 && (
|
|
|
|
|
<FooterToolbar
|
|
|
|
|
extra={
|
|
|
|
|
<div>
|
|
|
|
@ -357,7 +404,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
/>
|
|
|
|
|
</Button>
|
|
|
|
|
</FooterToolbar>
|
|
|
|
|
)}
|
|
|
|
|
)} */}
|
|
|
|
|
<CreateForm
|
|
|
|
|
createModalOpen={createModalOpen}
|
|
|
|
|
values={currentRow || {}}
|
|
|
|
|