From 6953f79ce7da9f584102c298097b0ca26cdd4fb8 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 27 九月 2024 10:24:55 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/mission/MissionList.jsx |   92 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 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..712cc13 100644
--- a/zy-acs-flow/src/page/mission/MissionList.jsx
+++ b/zy-acs-flow/src/page/mission/MissionList.jsx
@@ -1,11 +1,101 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+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,
+} from 'react-admin';
+import { matchPath, useLocation } from 'react-router';
+import { Box, Typography, Card, Stack } 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";
 
 const MissionList = () => {
 
     return (
         <>
-            <h1>Fuck</h1>
+            <ListBase
+                perPage={100}
+                filter={{
+                }}
+            >
+                <MissionLayout />
+            </ListBase>
         </>
     )
 }
 
+const filters = [
+    <SearchInput source="q" alwaysOn />,
+];
+
+const MissionLayout = () => {
+    const location = useLocation();
+    const matchShow = matchPath('/mission/:id/show', location.pathname);
+
+    const { data, isPending, filterValues } = useListContext();
+    if (isPending) return null;
+    console.log(data);
+    
+    if (!data?.length) {
+        return (
+            <>
+                {/* <MissionEmpty> */}
+                    <MissionShow open={!!matchShow} id={matchShow?.params.id} />
+                    {/* <DealArchivedList /> */}
+                {/* </MissionEmpty> */}
+            </>
+        );
+    }
+
+    return (
+        <Stack component="div" sx={{ width: '100%' }}>
+            <Title title={'menu.mission'} />
+            <ListToolbar filters={filters} actions={(
+                <TopToolbar>
+                    <FilterButton />
+                    <SelectColumnsButton preferenceKey='locSts' />
+                </TopToolbar>
+            )} />
+            <Card>
+                {/* <DealListContent /> */}
+            </Card>
+            {/* <DealArchivedList /> */}
+
+            <MissionShow open={!!matchShow} id={matchShow?.params.id} />
+        </Stack>
+    );
+}
+
 export default MissionList;
\ No newline at end of file

--
Gitblit v1.9.1