生产管理系统前端 1.修复系统导航过长的问题 2.利用旧菜单交互 开发菜单与导航

This commit is contained in:
2025-10-22 15:18:36 +08:00
parent 9afc680833
commit 7a21043dd8
25 changed files with 1843 additions and 109 deletions

View File

@@ -21,7 +21,7 @@ import {
SidebarMenuItem,
SidebarRail,
} from "@/components/ui/sidebar"
import { useLayoutStore } from '@/stores/useLayoutStore';
// Define the interface for menu data
interface MenuItem {
title: string
@@ -110,17 +110,10 @@ export interface AppSidebarProps extends React.ComponentProps<typeof Sidebar> {
export function AppSidebar({ data, ...props }: AppSidebarProps) {
// Use external data if provided, otherwise use default data
const sidebarData = data || defaultData
const { navigatorHeight } = useLayoutStore();
return (
<Sidebar {...props}>
<SidebarHeader>
<VersionSwitcher
versions={sidebarData.versions || defaultData.versions}
defaultVersion={sidebarData.versions?.[0] || defaultData.versions[0]}
/>
<SearchForm />
</SidebarHeader>
<SidebarContent className="gap-0">
<Sidebar {...props} style = {{top: navigatorHeight + 'px'}}>
<SidebarContent className="gap-0" >
{/* We create a collapsible SidebarGroup for each parent. */}
{sidebarData.navMain.map((item) => (
<Collapsible