#
luxiaotao1123
2024-09-29 551aa6e5c2f92d57cdcc67c579b6259e88ff2b27
zy-acs-flow/src/page/mission/MissionList.jsx
@@ -33,7 +33,7 @@
    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";
@@ -41,6 +41,7 @@
import * as Common from '@/utils/common';
// import { MissionEmpty } from "./MissionEmpty";
import MissionShow from "./MissionShow";
import { MissionListContent } from "./MissionListContent";
const MissionList = () => {
@@ -58,18 +59,22 @@
}
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);
    const hasFilters = filterValues && Object.keys(filterValues).length > 0;
    if (!data?.length) {
    if (isPending) return <LinearProgress />;
    if (!data?.length && !hasFilters) {
        return (
            <>
                {/* <MissionEmpty> */}
@@ -86,14 +91,11 @@
            <ListToolbar filters={filters} actions={(
                <TopToolbar>
                    <FilterButton />
                    <SelectColumnsButton preferenceKey='locSts' />
                </TopToolbar>
            )} />
            <Card>
                {/* <DealListContent /> */}
                <MissionListContent />
            </Card>
            {/* <DealArchivedList /> */}
            <MissionShow open={!!matchShow} id={matchShow?.params.id} />
        </Stack>
    );