From 79edfec1f6e6789d3f6cc57db3cb0cfdffd64c32 Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期二, 24 二月 2026 15:50:32 +0800
Subject: [PATCH] 库位拣料出库数量调整

---
 rsf-admin/src/layout/index.jsx |   66 ++++++++++++++++++++++++++++----
 1 files changed, 57 insertions(+), 9 deletions(-)

diff --git a/rsf-admin/src/layout/index.jsx b/rsf-admin/src/layout/index.jsx
index 40f6657..2298066 100644
--- a/rsf-admin/src/layout/index.jsx
+++ b/rsf-admin/src/layout/index.jsx
@@ -1,13 +1,61 @@
-import { Layout as RALayout, CheckForApplicationUpdate } from "react-admin";
+import { createPortal } from 'react-dom';
+import { Layout as RALayout, CheckForApplicationUpdate, useSidebarState } from "react-admin";
 import AppBar from './AppBar';
-import { MyMenu } from './MyMenu'
+import { MyMenu } from './MyMenu';
+import TabsBar from './TabsBar';
+import { Box } from '@mui/material';
+import { TabDialogStateProvider } from '@/context/TabDialogStateContext';
+
+const LayoutContent = ({ children }) => {
+  const [sidebarIsOpen] = useSidebarState();
+  const sidebarWidth = sidebarIsOpen ? 200 : 50;
+
+  const tabsBarEl = (
+    <Box sx={{
+      position: 'fixed',
+      top: 48,
+      left: sidebarWidth + 5,
+      right: 0,
+      zIndex: 1200, // 浣庝簬 Dialog/Modal 涓� Select/Menu(1300)锛岄伩鍏嶆爣绛鹃〉閬洊涓嬪彂绐楀彛鍐呯殑涓嬫媺锛堝鍑哄簱绛栫暐锛氭晥鐜囦紭鍏�/鍏堣繘鍏堝嚭锛�
+      transition: (theme) =>
+        theme.transitions.create('left', {
+          easing: theme.transitions.easing.sharp,
+          duration: theme.transitions.duration.leavingScreen,
+        }),
+    }}>
+      <TabsBar />
+    </Box>
+  );
+
+  return (
+    <RALayout
+      appBar={AppBar}
+      menu={MyMenu}
+      sx={{
+        '& .RaLayout-content': {
+          position: 'absolute',
+          left: `${sidebarWidth}px`,
+          overflowY: 'auto',
+          width: `calc(100% - ${sidebarWidth}px)`,
+          height: 'calc(100% - 86px)', // 鍑忓幓TabsBar鐨勯珮搴� (50px AppBar + 36px TabsBar)
+          top: '86px',
+          transition: (theme) =>
+            theme.transitions.create(['left', 'width'], {
+              easing: theme.transitions.easing.sharp,
+              duration: theme.transitions.duration.leavingScreen,
+            }),
+        }
+      }}
+    >
+      {createPortal(tabsBarEl, document.body)}
+      <TabDialogStateProvider>
+        {children}
+      </TabDialogStateProvider>
+      <CheckForApplicationUpdate />
+    </RALayout>
+  );
+};
 
 export const Layout = ({ children }) => (
-  <RALayout
-    appBar={AppBar}
-    menu={MyMenu}
-  >
-    {children}
-    <CheckForApplicationUpdate />
-  </RALayout>
+  <LayoutContent>{children}</LayoutContent>
 );

--
Gitblit v1.9.1