删除所有console.log输出,优化评查结果的表格的显示,添加新的页码获取逻辑

This commit is contained in:
2025-06-02 18:55:00 +08:00
parent 820baa5b22
commit b02978508d
71 changed files with 862 additions and 572 deletions
+4 -1
View File
@@ -3,9 +3,11 @@ import { Sidebar } from './Sidebar';
// import { Header } from './Header';
import { Breadcrumb } from './Breadcrumb';
import { useMatches, useLocation } from '@remix-run/react';
import type { UserRole } from '~/root';
interface LayoutProps {
children: React.ReactNode;
userRole?: UserRole;
}
// 添加一个接口表示路由handle可能包含的属性
@@ -20,7 +22,7 @@ interface Match {
data: unknown;
}
export function Layout({ children }: LayoutProps) {
export function Layout({ children, userRole = 'developer' }: LayoutProps) {
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
const matches = useMatches() as Match[];
const location = useLocation();
@@ -58,6 +60,7 @@ export function Layout({ children }: LayoutProps) {
<Sidebar
collapsed={sidebarCollapsed}
onToggle={toggleSidebar}
userRole={userRole}
/>
<div className={`main-content ${sidebarCollapsed ? 'sidebar-collapsed' : ''}`}>