From 9140aee230de0ef41de9682a9353fbd372e2bcaa Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期二, 03 三月 2026 13:43:22 +0800
Subject: [PATCH] 云仓WMS接口
---
rsf-admin/src/layout/index.jsx | 80 +++++++++++++++++++++++++++++++++++----
1 files changed, 71 insertions(+), 9 deletions(-)
diff --git a/rsf-admin/src/layout/index.jsx b/rsf-admin/src/layout/index.jsx
index 40f6657..e095920 100644
--- a/rsf-admin/src/layout/index.jsx
+++ b/rsf-admin/src/layout/index.jsx
@@ -1,13 +1,75 @@
-import { Layout as RALayout, CheckForApplicationUpdate } from "react-admin";
+import { createPortal } from 'react-dom';
+import { useLocation } from 'react-router-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';
+
+/** RCS娴嬭瘯鐙珛椤佃矾鐢憋細涓嶆樉绀轰晶杈规爮鍜屾爣绛炬爮锛屾暣椤靛彧鏄剧ずRCS娴嬭瘯鍐呭 */
+const RCS_TEST_STANDALONE_PATH = '/rcsTest-page';
+
+const LayoutContent = ({ children }) => {
+ const location = useLocation();
+ const [sidebarIsOpen] = useSidebarState();
+ const sidebarWidth = sidebarIsOpen ? 200 : 50;
+
+ if (location.pathname === RCS_TEST_STANDALONE_PATH) {
+ return (
+ <Box sx={{ width: '100%', height: '100vh', overflow: 'hidden' }}>
+ {children}
+ <CheckForApplicationUpdate />
+ </Box>
+ );
+ }
+
+ 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