feat: prolist in /admin/report

This commit is contained in:
Dawn1Ocean
2024-04-02 15:53:26 +08:00
parent e71abc0c0b
commit 54f7fe53a5
7 changed files with 87 additions and 4 deletions
+66
View File
@@ -0,0 +1,66 @@
import { PageContainer, ProList } from '@ant-design/pro-components';
import { Card, Space, Tag } from 'antd';
import moment from 'moment';
import request from 'umi-request';
import { ReportItem } from './reportItem';
const Logs: React.FC = () => {
return (
<PageContainer>
<Card>
<ProList<ReportItem>
search={{
filterType: 'light',
}}
rowKey="name"
headerTitle="反馈列表"
request={async (params = {} as Record<string, any>) =>
request<{
data: ReportItem[];
}>('/admin/reportlist', {
params,
})
}
pagination={{
pageSize: 10,
}}
metas={{
title: {
dataIndex: 'name',
title: '用户',
},
avatar: {
dataIndex: 'avatar',
search: false,
},
subTitle: {
dataIndex: 'phone',
render: (_, row) => {
return (
<Space size={0}>
<Tag color="blue" key={row.name}>
{row.phone}
</Tag>
</Space>
);
},
title: '联系方式',
},
description: {
dataIndex: 'text',
search: false,
},
extra: {
dataIndex: 'time',
render: (_, row) => {
return <div>{moment(row.time).format('YYYY-M-D HH:mm:ss')}</div>;
},
search: false,
},
}}
/>
</Card>
</PageContainer>
);
};
export default Logs;