doorDetail.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import PageContent from '@/components/PageContent';
  2. import PageTitle from '@/components/PageTitle';
  3. import { queryGateOpList } from '@/services/safety';
  4. import { useParams, useRequest } from '@umijs/max';
  5. import { Table } from 'antd';
  6. const DoorDetail = () => {
  7. const { projectId } = useParams();
  8. const { data, loading } = useRequest(queryGateOpList, {
  9. defaultParams: [{ project_id: projectId }],
  10. });
  11. const columns = [
  12. {
  13. title: '时间',
  14. dataIndex: 'created_time',
  15. key: 'created_time',
  16. align: 'center',
  17. width: 160,
  18. },
  19. {
  20. title: '人员',
  21. dataIndex: 'user_name',
  22. key: 'user_name',
  23. align: 'center',
  24. width: 110,
  25. },
  26. {
  27. title: '门禁名称',
  28. dataIndex: 'gate_name',
  29. key: 'gate_name',
  30. align: 'center',
  31. width: 140,
  32. },
  33. {
  34. title: '事件',
  35. dataIndex: 'event_type',
  36. key: 'event_type',
  37. align: 'center',
  38. },
  39. {
  40. title: '验证方式',
  41. dataIndex: 'check_type',
  42. key: 'check_type',
  43. align: 'center',
  44. width: 140,
  45. },
  46. {
  47. title: '出入状态',
  48. dataIndex: 'status',
  49. key: 'status',
  50. align: 'center',
  51. width: 140,
  52. },
  53. ];
  54. return (
  55. <PageContent closeable={false}>
  56. <PageTitle children="门禁日志" returnable />
  57. <Table
  58. loading={loading}
  59. style={{ marginTop: '30px' }}
  60. dataSource={data?.list}
  61. columns={columns}
  62. pagination={false}
  63. />
  64. </PageContent>
  65. );
  66. };
  67. export default DoorDetail;