|
|
|
@ -6,11 +6,12 @@ import {
|
|
|
|
|
ProTable,
|
|
|
|
|
} from '@ant-design/pro-components';
|
|
|
|
|
import {FormattedMessage, useIntl, useAccess, Access, history} from '@umijs/max';
|
|
|
|
|
import {Button, message} from 'antd';
|
|
|
|
|
import {Button, Popconfirm, message} from 'antd';
|
|
|
|
|
import React, {useRef, useState} from 'react';
|
|
|
|
|
import CreateForm from "./components/CreateForm";
|
|
|
|
|
import {ColumnDrawer} from "./components/ColumnDrawer";
|
|
|
|
|
import {getSysOperationRecordGetOperationRecordList} from "@/services/system/OperationRecord";
|
|
|
|
|
// import UpdateForm from './components/UpdateForm';
|
|
|
|
|
|
|
|
|
|
const OperationRecordList: React.FC = () => {
|
|
|
|
|
/**
|
|
|
|
@ -71,11 +72,12 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation_record.table.list.id"
|
|
|
|
|
id="system.operation.table.list.id"
|
|
|
|
|
defaultMessage="id"/>),
|
|
|
|
|
dataIndex: "id",
|
|
|
|
|
sorter: true,
|
|
|
|
|
valueType: "digit",
|
|
|
|
|
|
|
|
|
|
filters: true, onFilter: true,
|
|
|
|
|
render: (dom, entity) => {
|
|
|
|
|
return (
|
|
|
|
@ -94,30 +96,38 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
{
|
|
|
|
|
sorter: true,
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation_record.table.list.name"
|
|
|
|
|
id="system.operation.table.list.ip"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "name",
|
|
|
|
|
dataIndex: "ip",
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation_record.table.list.code"
|
|
|
|
|
id="system.operation.table.list.path"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "code",
|
|
|
|
|
dataIndex: "path",
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation_record.table.list.sort"
|
|
|
|
|
id="system.operation.table.list.method"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "sort",
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
dataIndex: "method",
|
|
|
|
|
valueEnum: {
|
|
|
|
|
'GET': intl.formatMessage({id: 'system.api.enum.GET', defaultMessage: '$$$',}),
|
|
|
|
|
'POST': intl.formatMessage({id: 'system.api.enum.POST', defaultMessage: '$$$',}),
|
|
|
|
|
'DELETE': intl.formatMessage({id: 'system.api.enum.DELETE', defaultMessage: '$$$',}),
|
|
|
|
|
'PUT': intl.formatMessage({id: 'system.api.enum.PUT', defaultMessage: '$$$',}),
|
|
|
|
|
'PATCH': intl.formatMessage({id: 'system.api.enum.PATCH', defaultMessage: '$$$',})
|
|
|
|
|
},
|
|
|
|
|
filters: true, onFilter: true,
|
|
|
|
|
// hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation_record.table.list.status"
|
|
|
|
|
id="system.operation.table.list.status"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "status",
|
|
|
|
|
valueEnum: {
|
|
|
|
@ -135,6 +145,80 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
filters: true, onFilter: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.latency"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "latency",
|
|
|
|
|
valueType: 'time',
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.agent"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "agent",
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.error_message"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "error_message",
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.body"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "body",
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.resp"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "resp",
|
|
|
|
|
tooltip: true,
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.user_id"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "user_id",
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.createTime"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "createTime",
|
|
|
|
|
valueType: 'dateTime',
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: (<FormattedMessage
|
|
|
|
|
id="system.operation.table.list.updateTime"
|
|
|
|
|
defaultMessage="$$$"/>),
|
|
|
|
|
dataIndex: "updateTime",
|
|
|
|
|
valueType: 'dateTime',
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@ -144,7 +228,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
render: (_, record) => [
|
|
|
|
|
<Access accessible={access.canUpdate(history.location.pathname)} key={`${history.location.pathname}-add`}>
|
|
|
|
|
<a
|
|
|
|
|
{/* <a
|
|
|
|
|
key="update"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setUpdateModalOpen(true);
|
|
|
|
@ -152,8 +236,25 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<FormattedMessage id="pages.searchTable.update" defaultMessage="Update"/>
|
|
|
|
|
</a>
|
|
|
|
|
<a
|
|
|
|
|
</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(() => {
|
|
|
|
@ -163,7 +264,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
id="pages.searchTable.destroy"
|
|
|
|
|
defaultMessage="Destroy"
|
|
|
|
|
/>
|
|
|
|
|
</a>
|
|
|
|
|
</a> */}
|
|
|
|
|
</Access>
|
|
|
|
|
],
|
|
|
|
|
},];
|
|
|
|
@ -178,7 +279,7 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
actionRef={actionRef}
|
|
|
|
|
rowKey="key"
|
|
|
|
|
search={{
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
labelWidth: 'auto',
|
|
|
|
|
}}
|
|
|
|
|
pagination={{
|
|
|
|
|
showSizeChanger: true,
|
|
|
|
@ -263,12 +364,12 @@ const OperationRecordList: React.FC = () => {
|
|
|
|
|
handleModal={handleCreateModal}
|
|
|
|
|
reload={actionRef.current?.reload}
|
|
|
|
|
/>
|
|
|
|
|
{/*<UpdateForm*/}
|
|
|
|
|
{/* updateModalOpen={updateModalOpen}*/}
|
|
|
|
|
{/* values={currentRow || {}}*/}
|
|
|
|
|
{/* handleModal={handleUpdateModal}*/}
|
|
|
|
|
{/* reload={actionRef.current?.reload}*/}
|
|
|
|
|
{/*/>*/}
|
|
|
|
|
{/* <UpdateForm
|
|
|
|
|
updateModalOpen={updateModalOpen}
|
|
|
|
|
values={currentRow || {}}
|
|
|
|
|
handleModal={handleUpdateModal}
|
|
|
|
|
reload={actionRef.current?.reload}
|
|
|
|
|
/> */}
|
|
|
|
|
|
|
|
|
|
<ColumnDrawer
|
|
|
|
|
handleDrawer={handleColumnDrawer}
|
|
|
|
|