fix: 1.将主页和法务助手对话设置成手机也能够正确加载的响应式布局。
2. 修改合同重新上传模板的可接受文件类型,修改对接的上传模板对应的接口。 3. 交叉评查任务列表去除任务名称的点击效果。 4. 交叉评查文件预览在点击完成评查的按钮后会返回任务列表并打开任务的文档列表。 5.修复点击完成评查按钮造成页面刷新。 6. 修复创建任务的第3步无法返回列表。
This commit is contained in:
@@ -38,21 +38,28 @@ export function Layout({ children, userRole = 'developer' as UserRole, frontendJ
|
||||
const [selectedApp, setSelectedApp] = useState<AppModule>('');
|
||||
const matches = useMatches() as Match[];
|
||||
const location = useLocation();
|
||||
|
||||
|
||||
// 检查当前路径是否应该隐藏侧边栏
|
||||
const noLayoutPaths = ['/login', '/'];
|
||||
const shouldHideSidebar = noLayoutPaths.includes(location.pathname);
|
||||
|
||||
|
||||
// 检查当前路由是否应该隐藏默认面包屑
|
||||
const shouldHideBreadcrumb = shouldHideSidebar || matches.some(match =>
|
||||
const shouldHideBreadcrumb = shouldHideSidebar || matches.some(match =>
|
||||
match.handle && match.handle.hideBreadcrumb === true
|
||||
);
|
||||
|
||||
|
||||
// 从sessionStorage中获取侧边栏状态和reviewType
|
||||
useEffect(() => {
|
||||
// 检查是否为移动端
|
||||
const isMobile = window.innerWidth <= 768;
|
||||
|
||||
// 从localStorage获取侧边栏状态
|
||||
const savedState = localStorage.getItem('sidebarCollapsed');
|
||||
if (savedState) {
|
||||
|
||||
// 移动端默认收起,桌面端使用保存的状态
|
||||
if (isMobile) {
|
||||
setSidebarCollapsed(true);
|
||||
} else if (savedState) {
|
||||
setSidebarCollapsed(savedState === 'true');
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,24 @@ export function Sidebar({ onToggle, collapsed, userRole, frontendJWT = '', selec
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true); // 添加加载状态
|
||||
const [menuItems, setMenuItems] = useState<MenuItem[]>([]); // 动态菜单项
|
||||
const [isLoadingRoutes, setIsLoadingRoutes] = useState<boolean>(true); // 路由加载状态
|
||||
const [isMobile, setIsMobile] = useState<boolean>(false); // 移动端检测
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 移动端检测
|
||||
useEffect(() => {
|
||||
const checkMobile = () => {
|
||||
const mobile = window.innerWidth <= 768; // 768px以下视为移动端
|
||||
setIsMobile(mobile);
|
||||
};
|
||||
|
||||
// 初始检测
|
||||
checkMobile();
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', checkMobile);
|
||||
return () => window.removeEventListener('resize', checkMobile);
|
||||
}, []);
|
||||
|
||||
// 获取用户路由权限
|
||||
useEffect(() => {
|
||||
const fetchUserRoutes = async () => {
|
||||
@@ -254,8 +270,26 @@ export function Sidebar({ onToggle, collapsed, userRole, frontendJWT = '', selec
|
||||
// })
|
||||
|
||||
return (
|
||||
<div className={`sidebar ${collapsed ? 'collapsed' : ''} flex flex-col`}>
|
||||
<div className="py-6 px-4 border-b border-gray-100 flex justify-between items-center">
|
||||
<>
|
||||
{/* 移动端遮罩层 */}
|
||||
{isMobile && !collapsed && (
|
||||
<div
|
||||
className="sidebar-overlay"
|
||||
onClick={onToggle}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label="关闭侧边栏"
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
onToggle();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className={`sidebar ${collapsed ? 'collapsed' : ''} ${isMobile ? 'sidebar-mobile' : ''} flex flex-col`}>
|
||||
<div className="py-6 px-4 border-b border-gray-100 flex justify-between items-center">
|
||||
<div className="flex items-center"
|
||||
onClick={() => {
|
||||
navigate('/');
|
||||
@@ -396,6 +430,7 @@ export function Sidebar({ onToggle, collapsed, userRole, frontendJWT = '', selec
|
||||
{!collapsed && <span className="text-base">操作手册</span>}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user