From afac377f99fd8d2cd24c2ac73555a9f20426ef1d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 07 十月 2024 08:19:06 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/agv/GridList.jsx |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/zy-acs-flow/src/page/agv/GridList.jsx b/zy-acs-flow/src/page/agv/GridList.jsx
index be1e4b1..3e91a71 100644
--- a/zy-acs-flow/src/page/agv/GridList.jsx
+++ b/zy-acs-flow/src/page/agv/GridList.jsx
@@ -1,8 +1,8 @@
 import * as React from 'react';
 import { Box, Paper, Typography } from '@mui/material';
-import { RecordContextProvider, useListContext } from 'react-admin';
+import { RecordContextProvider, useListContext, useTranslate } from 'react-admin';
 
-// import { CompanyCard } from './CompanyCard';
+import { AgvCard } from './AgvCard';
 
 const times = (nbChildren, fn) => Array.from({ length: nbChildren }, (_, key) => fn(key));
 
@@ -23,33 +23,33 @@
     </Box>
 );
 
-// const LoadedGridList = () => {
-//     const { data, error, isPending } = useListContext();
+const LoadedGridList = () => {
+    const { data, error, isPending } = useListContext();
+    const translate = useTranslate();
 
-//     if (isPending || error) return null;
+    if (isPending || error) return null;
 
-//     return (
-//         <Box
-//             width="100%"
-//             gap={1}
-//             display="grid"
-//             gridTemplateColumns="repeat(auto-fill, minmax(180px, 1fr))"
-//         >
-//             {data.map(record => (
-//                 <RecordContextProvider key={record.id} value={record}>
-//                     <CompanyCard />
-//                 </RecordContextProvider>
-//             ))}
+    return (
+        <Box
+            width="100%"
+            gap={1}
+            display="grid"
+            gridTemplateColumns="repeat(auto-fill, minmax(180px, 1fr))"
+        >
+            {data.map(record => (
+                <RecordContextProvider key={record.id} value={record}>
+                    <AgvCard />
+                </RecordContextProvider>
+            ))}
 
-//             {data.length === 0 && (
-//                 <Typography p={2}>No companies found</Typography>
-//             )}
-//         </Box>
-//     );
-// };
+            {data.length === 0 && (
+                <Typography p={2}>No data found</Typography>
+            )}
+        </Box>
+    );
+};
 
 export const ImageList = () => {
     const { isPending } = useListContext();
-    // return isPending ? <LoadingGridList /> : <LoadedGridList />;
-    return <LoadingGridList />;
+    return isPending ? <LoadingGridList /> : <LoadedGridList />;
 };

--
Gitblit v1.9.1