HistoryList.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React, { useState } from 'react';
  2. import { Row, Col, Button, Drawer, Grid, Pagination } from 'antd';
  3. import { SettingOutlined } from '@ant-design/icons';
  4. import { FormattedMessage } from 'react-intl';
  5. import WorklistTable from './components/WorklistTable';
  6. import OperationPanel from './components/OperationPanel';
  7. const { useBreakpoint } = Grid;
  8. const HistorylistPage: React.FC = () => {
  9. const screens = useBreakpoint();
  10. const [drawerVisible, setDrawerVisible] = useState(false);
  11. return (
  12. <div className="p-4">
  13. {screens.xs ? (
  14. <>
  15. <WorklistTable />
  16. <Button
  17. type="primary"
  18. shape="circle"
  19. icon={<SettingOutlined />}
  20. className="fixed bottom-6 right-6 z-50"
  21. onClick={() => setDrawerVisible(true)}
  22. />
  23. <Drawer
  24. title={
  25. <FormattedMessage
  26. id="worklist.operationPanel"
  27. defaultMessage="worklist.operationPanel"
  28. />
  29. }
  30. placement="left"
  31. onClose={() => setDrawerVisible(false)}
  32. open={drawerVisible}
  33. width={300}
  34. >
  35. <OperationPanel />
  36. </Drawer>
  37. </>
  38. ) : (
  39. <Row gutter={16}>
  40. <Col span={screens.lg ? 18 : screens.md ? 20 : 24}>
  41. <WorklistTable />
  42. <div className="flex justify-center mt-4">
  43. <Pagination defaultCurrent={1} total={50} />
  44. </div>
  45. </Col>
  46. <Col span={screens.lg ? 6 : screens.md ? 4 : 0}>
  47. <OperationPanel />
  48. </Col>
  49. </Row>
  50. )}
  51. </div>
  52. );
  53. };
  54. export default HistorylistPage;