From f01613f2d65ce199c6595de9e29ba96e7e6ac4f9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 15 十月 2024 14:19:51 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/mission/MissionList.jsx | 72 +++++++++++++++++++++++++++++++++++
1 files changed, 71 insertions(+), 1 deletions(-)
diff --git a/zy-acs-flow/src/page/mission/MissionList.jsx b/zy-acs-flow/src/page/mission/MissionList.jsx
index d33cd3b..b0b3eca 100644
--- a/zy-acs-flow/src/page/mission/MissionList.jsx
+++ b/zy-acs-flow/src/page/mission/MissionList.jsx
@@ -1,11 +1,81 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+import { useNavigate } from 'react-router-dom';
+import {
+ ListBase,
+ TopToolbar,
+ FilterButton,
+ useListContext,
+ TextInput,
+ ReferenceInput,
+ AutocompleteInput,
+ ListToolbar,
+ Title,
+} from 'react-admin';
+import { matchPath, useLocation } from 'react-router';
+import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material';
+import { styled } from '@mui/material/styles';
+import * as Common from '@/utils/common';
+import MissionShow from "./MissionShow";
+import { MissionListContent } from "./MissionListContent";
+import EmptyDataLoader from "../components/EmptyDataLoader";
+import MissionResend from "./MissionResend";
const MissionList = () => {
return (
<>
- <h1>Fuck</h1>
+ <ListBase
+ perPage={100}
+ filter={{
+ }}
+ >
+ <MissionLayout />
+ </ListBase>
</>
)
}
+const filters = [
+ <ReferenceInput source="agvId" label="table.field.segment.agvId" reference="agv" alwaysOn>
+ <AutocompleteInput label="table.field.segment.agvId" optionText="uuid" filterToQuery={(val) => ({ uuid: val })} />
+ </ReferenceInput>,
+ <TextInput source="groupNo" label="table.field.segment.groupId" />,
+];
+
+const MissionLayout = () => {
+ const location = useLocation();
+ const matchShow = matchPath('/mission/:id/show', location.pathname);
+ const matchResend = matchPath('/mission/:id/resend', location.pathname);
+
+ const { data, isPending, filterValues } = useListContext();
+ const hasFilters = filterValues && Object.keys(filterValues).length > 0;
+
+ if (isPending) return <LinearProgress />;
+ if (!data?.length && !hasFilters) {
+ return (
+ <>
+ <EmptyDataLoader>
+ <MissionShow open={!!matchShow} groupNo={matchShow?.params.id} />
+ </EmptyDataLoader>
+ </>
+ );
+ }
+
+ return (
+ <Stack component="div" sx={{ width: '100%' }}>
+ <Title title={'menu.mission'} />
+ <ListToolbar filters={filters} actions={(
+ <TopToolbar>
+ <FilterButton />
+ </TopToolbar>
+ )} />
+ <Card>
+ <MissionListContent />
+ </Card>
+ <MissionShow open={!!matchShow} id={matchShow?.params.id} />
+ <MissionResend open={!!matchResend} id={matchResend?.params.id} />
+ </Stack>
+ );
+}
+
export default MissionList;
\ No newline at end of file
--
Gitblit v1.9.1