From 901af450e3d1fa740d183cf16b0283255dff084f Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 08 一月 2026 13:55:17 +0800
Subject: [PATCH] #tabsBar
---
rsf-admin/src/page/components/PageDrawer.jsx | 10 ++
rsf-admin/src/layout/MyMenu.jsx | 136 ++++++++++++++++++++++----------------------
rsf-admin/src/layout/index.jsx | 3
3 files changed, 78 insertions(+), 71 deletions(-)
diff --git a/rsf-admin/src/layout/MyMenu.jsx b/rsf-admin/src/layout/MyMenu.jsx
index 9e6b379..f42ce06 100644
--- a/rsf-admin/src/layout/MyMenu.jsx
+++ b/rsf-admin/src/layout/MyMenu.jsx
@@ -84,75 +84,75 @@
// 鍦� MyMenu 缁勪欢鐨� generateMenu 鍑芥暟涓紝纭繚 MenuItemLink 涔熷乏瀵归綈
const generateMenu = (permissions) => {
return permissions.map((node) => {
- if (node.children) {
- const selected = isSelected(node.component) || hasSelectedChild(node);
- return (
- <SubMenu
- key={node.id}
- handleToggle={() => handleToggle(node.route)}
- isOpen={state[node.route]}
- name={node.name}
- dense={dense}
- icon={getIcon(node.icon)}
- isSelected={selected}
- >
- {generateMenu(node.children)}
- </SubMenu>
- );
- } else {
- if (node.component) {
- const selected = isSelected(node.component);
- // 鍦� generateMenu 鍑芥暟涓殑 MenuItemLink 閮ㄥ垎
- return (
- <MenuItemLink
- key={node.id}
- to={node.component}
- state={{ _scrollToTop: true }}
- primaryText={translate(node.name)}
- leftIcon={getIcon(node.icon)}
- dense={dense}
- sx={{
- backgroundColor: selected ? 'rgba(25, 118, 210, 0.08) !important' : 'transparent',
- color: selected ? '#1976d2 !important' : 'text.secondary',
- '&:hover': {
- backgroundColor: selected ? 'rgba(25, 118, 210, 0.12) !important' : 'rgba(0, 0, 0, 0.04)',
- },
- borderLeft: 'none',
- borderRadius: '4px',
- margin: '2px 8px',
- width: 'calc(100% - 16px)',
- transition: 'all 0.2s ease-in-out',
-
- // 缂╁皬鏁翠綋闂磋窛
- padding: '6px 8px', // 鍑忓皯鍐呰竟璺�
- minHeight: '36px', // 绋嶅井鍑忓皬楂樺害
-
- '& .RaMenuItemLink-icon': {
- color: selected ? '#1976d2 !important' : 'text.secondary',
- minWidth: '32px !important', // 缂╁皬鍥炬爣鍖哄煙瀹藉害
- marginRight: '4px', // 缂╁皬鍥炬爣鍜屾枃瀛楅棿璺�
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center', // 鍥炬爣灞呬腑鏄剧ず
- },
-
- fontWeight: selected ? 600 : 400,
-
- // 纭繚鏂囧瓧鍐呭宸﹀榻�
- '& .MuiListItemText-root': {
- margin: 0,
- '& .MuiTypography-root': {
- textAlign: 'left',
- justifyContent: 'flex-start',
- fontSize: '0.875rem', // 绋嶅井鍑忓皬瀛椾綋澶у皬
- lineHeight: '1.3',
- }
- },
- }}
- />
- );
- }
+ if (node.children) {
+ const selected = isSelected(node.component) || hasSelectedChild(node);
+ return (
+ <SubMenu
+ key={node.id}
+ handleToggle={() => handleToggle(node.route)}
+ isOpen={state[node.route]}
+ name={node.name}
+ dense={dense}
+ icon={getIcon(node.icon)}
+ isSelected={selected}
+ >
+ {generateMenu(node.children)}
+ </SubMenu>
+ );
+ } else {
+ if (node.component) {
+ const selected = isSelected(node.component);
+ // 鍦� generateMenu 鍑芥暟涓殑 MenuItemLink 閮ㄥ垎
+ return (
+ <MenuItemLink
+ key={node.id}
+ to={node.component}
+ state={{ _scrollToTop: true }}
+ primaryText={translate(node.name)}
+ leftIcon={getIcon(node.icon)}
+ dense={dense}
+ sx={{
+ backgroundColor: selected ? 'rgba(25, 118, 210, 0.08) !important' : 'transparent',
+ color: selected ? '#1976d2 !important' : 'text.secondary',
+ '&:hover': {
+ backgroundColor: selected ? 'rgba(25, 118, 210, 0.12) !important' : 'rgba(0, 0, 0, 0.04)',
+ },
+ borderLeft: 'none',
+ borderRadius: '4px',
+ margin: '2px 8px',
+ width: 'calc(100% - 16px)',
+ transition: 'all 0.2s ease-in-out',
+
+ // 缂╁皬鏁翠綋闂磋窛
+ padding: '6px 8px', // 鍑忓皯鍐呰竟璺�
+ minHeight: '36px', // 绋嶅井鍑忓皬楂樺害
+
+ '& .RaMenuItemLink-icon': {
+ color: selected ? '#1976d2 !important' : 'text.secondary',
+ minWidth: '32px !important', // 缂╁皬鍥炬爣鍖哄煙瀹藉害
+ marginRight: '4px', // 缂╁皬鍥炬爣鍜屾枃瀛楅棿璺�
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center', // 鍥炬爣灞呬腑鏄剧ず
+ },
+
+ fontWeight: selected ? 600 : 400,
+
+ // 纭繚鏂囧瓧鍐呭宸﹀榻�
+ '& .MuiListItemText-root': {
+ margin: 0,
+ '& .MuiTypography-root': {
+ textAlign: 'left',
+ justifyContent: 'flex-start',
+ fontSize: '0.875rem', // 绋嶅井鍑忓皬瀛椾綋澶у皬
+ lineHeight: '1.3',
+ }
+ },
+ }}
+ />
+ );
}
+ }
});
};
diff --git a/rsf-admin/src/layout/index.jsx b/rsf-admin/src/layout/index.jsx
index 293ae54..95e8f93 100644
--- a/rsf-admin/src/layout/index.jsx
+++ b/rsf-admin/src/layout/index.jsx
@@ -31,7 +31,8 @@
<Box sx={{
position: 'fixed',
top: 48,
- left: sidebarWidth,
+ // left: 0,
+ left: sidebarWidth + 5,
right: 0,
zIndex: 1100,
transition: (theme) =>
diff --git a/rsf-admin/src/page/components/PageDrawer.jsx b/rsf-admin/src/page/components/PageDrawer.jsx
index 659e849..f582f39 100644
--- a/rsf-admin/src/page/components/PageDrawer.jsx
+++ b/rsf-admin/src/page/components/PageDrawer.jsx
@@ -29,10 +29,16 @@
open={!!drawerVal}
anchor="right"
onClose={handleClose}
- sx={{ zIndex: 100 }}
+ sx={{
+ zIndex: 100,
+ '& .MuiDrawer-paper': {
+ top: '86px', // AppBar(50px) + TabsBar(36px)
+ height: 'calc(100% - 86px)',
+ }
+ }}
>
{!!drawerVal && (
- <Box pt={5} width={{ xs: '100vW', sm: width }} height={'calc(100vh - 200px);'} mt={{ xs: 2, sm: 1 }}>
+ <Box pt={2} width={{ xs: '100vW', sm: width }} mt={{ xs: 2, sm: 1 }}>
<Stack direction="row" p={2}>
<Typography variant="h6" flex="1">
{title}
--
Gitblit v1.9.1