You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.9 KiB

  1. import { ActionSheet, InfiniteScroll, List, NavBar, Popup } from 'antd-mobile';
  2. import { useNavigate } from 'react-router-dom';
  3. import { MoreOutline } from 'antd-mobile-icons';
  4. import { useState } from 'react';
  5. import { dataListFlat } from '../utils/constant';
  6. import MeasureGroups from '../components/MeasureGroups';
  7. import MeasureItem from '../components/MeasureItem';
  8. export default function UploadList() {
  9. const navigate = useNavigate();
  10. const [showMenu, setShowMenu] = useState(false);
  11. const actions = [
  12. { text: '重试失败任务', key: 'retry' },
  13. { text: '清空列表', key: 'clear' },
  14. { text: '清空已完成任务', key: 'clearCompleted' },
  15. ]
  16. const back = () => navigate(-1);
  17. const right = (
  18. <div
  19. onClick={() => setShowMenu(!showMenu)}
  20. className="flex justify-end gap-x-2"
  21. style={{ fontSize: 24 }}
  22. >
  23. <MoreOutline />
  24. </div>
  25. );
  26. return (
  27. <div>
  28. <NavBar className="bg-white" onBack={back} right={right}>
  29. </NavBar>
  30. <div className="main-page-content">
  31. <header className="h-8 bg-[#EEE] flex items-center px-4">
  32. <span>10</span>
  33. <i className="border-l border-[#999] h-3 mx-2" />
  34. <span>0</span>
  35. <p className="ml-auto text-primary"></p>
  36. </header>
  37. <main className=" overflow-x-hidden overflow-y-auto">
  38. <List>
  39. {dataListFlat.map((item) => (
  40. <List.Item key={item.id}>
  41. <MeasureItem item={item} onDetail={() => navigate(`/measure/record/${item.id}`)} />
  42. </List.Item>
  43. ))}
  44. {/* <InfiniteScroll loadMore={loadMore} hasMore={hasMore} /> */}
  45. </List>
  46. </main>
  47. </div>
  48. <ActionSheet
  49. visible={showMenu}
  50. actions={actions}
  51. onClose={() => setShowMenu(false)}
  52. />
  53. </div>
  54. );
  55. }