From 0cd6dfd544b900ff66682881fe4d6df0b90e386d Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 14 八月 2025 11:21:02 +0800
Subject: [PATCH] no message

---
 rsf-admin/src/page/dashboard/index.jsx |   60 +++++++++++++-----------------------------------------------
 1 files changed, 13 insertions(+), 47 deletions(-)

diff --git a/rsf-admin/src/page/dashboard/index.jsx b/rsf-admin/src/page/dashboard/index.jsx
index b832f8d..c2f7fd8 100644
--- a/rsf-admin/src/page/dashboard/index.jsx
+++ b/rsf-admin/src/page/dashboard/index.jsx
@@ -13,6 +13,8 @@
 import NbChart from "./NbChart";
 import NbList from "./NbList";
 import NbCard from "./NbCard";
+import { orderBy } from 'lodash';
+import NbPie from './NbPie';
 
 const styles = {
     flex: { display: 'flex' },
@@ -72,6 +74,7 @@
     const notify = useNotify();
     const [statistic, setStatistic] = useState({});
     const [stock, setStock] = useState([]);
+    const [deadStock, setDeadStock] = useState([]);
 
     useEffect(() => {
         getDashBoardHeader()
@@ -94,10 +97,10 @@
     }
 
     const getRecentStocks = async () => {
-        await request.post('/asnOrder/dashbord/header').then(res => {
-            const { code, msg, data } = res.data?.data;
+        await request.post('/locItem/page', { current: 1, pageSize: 10, orderBy: 'create_time asc' }).then(res => {
+            const { code, msg, data } = res?.data;
             if (code === 200) {
-                setStatistic(data);
+                setDeadStock(data?.records);
             } else {
                 notify(msg, { type: 'error', messageArgs: { _: msg } });
             }
@@ -105,7 +108,6 @@
             notify(error.message, { type: 'error', messageArgs: { _: error.message } });
         })
     }
-
 
     /**
      * 鑾峰彇搴撹繎涓�涓湀鍑哄叆搴撲俊鎭�
@@ -123,47 +125,9 @@
         })
     }
 
-    const recentOrders = [
-        {
-            id: 1,
-            name: 'a',
-            date: "2025-08-10T12:23:56.959Z",
-            total: 138.94,
-            inTotal: 254,
-        },
-        {
-            id: 2,
-            name: 'b',
-            date: "2025-08-03T07:45:00.304Z",
-            total: 214.66,
-            inTotal: 258,
-        },
-        {
-            id: 3,
-            name: 'c',
-            date: "2025-07-28T00:20:10.968Z",
-            total: 68.19,
-            inTotal: 154,
-        },
-        {
-            id: 4,
-            name: 'd',
-            date: "2025-07-22T20:39:00.293Z",
-            total: 36.56,
-            inTotal: 124,
-        },
-        {
-            id: 5,
-            name: 'e',
-            date: "2025-07-16T17:40:24.791Z",
-            total: 100.82,
-            inTotal: 354,
-        },
-    ]
-
     return (
         <>
-            <Grid container md={12}>
+            <Grid container md={12} item>
                 <Grid item md={8}>
                     <Box sx={{ display: "flex" }}>
                         <CardWithIcon
@@ -180,7 +144,6 @@
                             title={`${statistic?.membersTotalQua}`}
                             type={"out"}
                             statistic={statistic}
-
                         />
                     </Box>
                     <Spacer />
@@ -188,9 +151,12 @@
                         <NbChart orders={stock} />
                     </Box>
                     <Spacer />
-                    <Box>
-                        <NbList orders={recentOrders} />
+                    <Box sx={{ display: 'flex' }}>
+                        <NbList deadStock={deadStock} />
+                        <NbPie />
                     </Box>
+                    <Spacer />
+
                 </Grid>
                 <Grid item md={4}>
                     <Box sx={{ display: 'flex' }}>
@@ -205,7 +171,7 @@
                                     filter: JSON.stringify({ status: 1 }),
                                 }),
                             }}
-                            list={recentOrders}
+                            list={deadStock}
                         />
                     </Box>
                 </Grid>

--
Gitblit v1.9.1