From a7d9ddda70f0e593a394ece016e1458e87b65bd2 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 08 十月 2024 14:04:30 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/mission/MissionList.jsx | 54 +++++++++++++++---------------------------------------
1 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/zy-acs-flow/src/page/mission/MissionList.jsx b/zy-acs-flow/src/page/mission/MissionList.jsx
index 3135d7c..b0b3eca 100644
--- a/zy-acs-flow/src/page/mission/MissionList.jsx
+++ b/zy-acs-flow/src/page/mission/MissionList.jsx
@@ -2,46 +2,23 @@
import { useNavigate } from 'react-router-dom';
import {
ListBase,
- DatagridConfigurable,
- SearchInput,
TopToolbar,
- SelectColumnsButton,
- EditButton,
FilterButton,
- CreateButton,
- ExportButton,
- BulkDeleteButton,
- WrapperField,
- useRecordContext,
- useTranslate,
useListContext,
- useCreatePath,
- TextField,
- NumberField,
- DateField,
- BooleanField,
- ReferenceField,
TextInput,
- DateTimeInput,
- DateInput,
- SelectInput,
- NumberInput,
ReferenceInput,
- 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";
+import MissionResend from "./MissionResend";
const MissionList = () => {
@@ -59,26 +36,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 matchResend = matchPath('/mission/:id/resend', location.pathname);
const { data, isPending, filterValues } = useListContext();
- if (isPending) return null;
- console.log(data);
+ const hasFilters = filterValues && Object.keys(filterValues).length > 0;
- if (!data?.length) {
+ if (isPending) return <LinearProgress />;
+ if (!data?.length && !hasFilters) {
return (
<>
- {/* <MissionEmpty> */}
- <MissionShow open={!!matchShow} id={matchShow?.params.id} />
- {/* <DealArchivedList /> */}
- {/* </MissionEmpty> */}
+ <EmptyDataLoader>
+ <MissionShow open={!!matchShow} groupNo={matchShow?.params.id} />
+ </EmptyDataLoader>
</>
);
}
@@ -89,15 +67,13 @@
<ListToolbar filters={filters} actions={(
<TopToolbar>
<FilterButton />
- <SelectColumnsButton preferenceKey='locSts' />
</TopToolbar>
)} />
<Card>
<MissionListContent />
</Card>
- {/* <DealArchivedList /> */}
-
<MissionShow open={!!matchShow} id={matchShow?.params.id} />
+ <MissionResend open={!!matchResend} id={matchResend?.params.id} />
</Stack>
);
}
--
Gitblit v1.9.1