From 4aa60d9e08ed3e9bcd787d17cc771e50f8555a8a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 29 九月 2024 10:41:25 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/mission/MissionList.jsx |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/zy-acs-flow/src/page/mission/MissionList.jsx b/zy-acs-flow/src/page/mission/MissionList.jsx
index 712cc13..0273f92 100644
--- a/zy-acs-flow/src/page/mission/MissionList.jsx
+++ b/zy-acs-flow/src/page/mission/MissionList.jsx
@@ -30,16 +30,18 @@
     ReferenceArrayInput,
     AutocompleteInput,
     ListToolbar,
+    Title,
 } from 'react-admin';
 import { matchPath, useLocation } from 'react-router';
-import { Box, Typography, Card, Stack } from '@mui/material';
+import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material';
 import { styled } from '@mui/material/styles';
 import EmptyData from "../components/EmptyData";
 import PageDrawer from "../components/PageDrawer";
 import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
 import * as Common from '@/utils/common';
-// import { MissionEmpty } from "./MissionEmpty";
 import MissionShow from "./MissionShow";
+import { MissionListContent } from "./MissionListContent";
+import EmptyDataLoader from "../components/EmptyDataLoader";
 
 const MissionList = () => {
 
@@ -57,24 +59,27 @@
 }
 
 const filters = [
-    <SearchInput source="q" alwaysOn />,
+    <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);
+    console.log(matchShow);
 
     const { data, isPending, filterValues } = useListContext();
-    if (isPending) return null;
-    console.log(data);
-    
-    if (!data?.length) {
+    const hasFilters = filterValues && Object.keys(filterValues).length > 0;
+
+    if (isPending) return <LinearProgress />;
+    if (!data?.length && !hasFilters) {
         return (
             <>
-                {/* <MissionEmpty> */}
+                <EmptyDataLoader>
                     <MissionShow open={!!matchShow} id={matchShow?.params.id} />
-                    {/* <DealArchivedList /> */}
-                {/* </MissionEmpty> */}
+                </EmptyDataLoader>
             </>
         );
     }
@@ -85,14 +90,11 @@
             <ListToolbar filters={filters} actions={(
                 <TopToolbar>
                     <FilterButton />
-                    <SelectColumnsButton preferenceKey='locSts' />
                 </TopToolbar>
             )} />
             <Card>
-                {/* <DealListContent /> */}
+                <MissionListContent />
             </Card>
-            {/* <DealArchivedList /> */}
-
             <MissionShow open={!!matchShow} id={matchShow?.params.id} />
         </Stack>
     );

--
Gitblit v1.9.1