diff --git a/app/api/evaluation_points/reviews.ts b/app/api/evaluation_points/reviews.ts index f791517..8935a8e 100644 --- a/app/api/evaluation_points/reviews.ts +++ b/app/api/evaluation_points/reviews.ts @@ -1149,13 +1149,16 @@ export async function getReviewPoints_fromApi(fileId: string, request: Request) // 成功响应 if (response.data) { + // console.log('✅ [getReviewPoints_fromApi] API调用成功,返回数据结构:', JSON.stringify(response.data, null, 2)) + // console.log('✅ [getReviewPoints_fromApi] API调用成功,返回数据结构:', JSON.stringify(response.data)) // console.log('✅ [getReviewPoints_fromApi] API调用成功,返回数据结构:', JSON.stringify({ - // 评查点数量: response.data.data?.length || 0, - // // 统计信息: response.data.stats, - // // 评查信息: response.data.reviewInfo, - // 有文档数据: response.data.document, - // // 有比对数据: !!response.data.comparison_document, - // // 评分提案数量: response.data.scoring_proposals?.length || 0 + // 评查点数量: response.data.data?.length || 0, + // 评查点数量: response.data.data + // 统计信息: response.data.stats, + // 评查信息: response.data.reviewInfo, + // 有文档数据: response.data.document, + // 有比对数据: !!response.data.comparison_document, + // 评分提案数量: response.data.scoring_proposals?.length || 0 // })); // 返回数据格式与原方法完全一致 diff --git a/app/components/layout/Layout.tsx b/app/components/layout/Layout.tsx index 250ee89..20ab35b 100644 --- a/app/components/layout/Layout.tsx +++ b/app/components/layout/Layout.tsx @@ -15,6 +15,8 @@ interface LayoutProps { // 添加一个接口表示路由handle可能包含的属性 interface RouteHandle { hideBreadcrumb?: boolean; + collapseSidebar?: boolean; + noPadding?: boolean; [key: string]: unknown; } @@ -42,6 +44,11 @@ export function Layout({ children, userRole = 'developer' as UserRole, frontendJ match.handle && match.handle.hideBreadcrumb === true ); + // 检查当前路由是否要求无 padding + const shouldNoPadding = matches.some(match => + match.handle && match.handle.noPadding === true + ); + // 从 localStorage 读取用户信息和 JWT 作为备用方案 useEffect(() => { if (typeof window === 'undefined') return; @@ -80,16 +87,23 @@ export function Layout({ children, userRole = 'developer' as UserRole, frontendJ // 检查是否为移动端 const isMobile = window.innerWidth <= 768; - // 从localStorage获取侧边栏状态 - const savedState = localStorage.getItem('sidebarCollapsed'); + // 检查当前路由是否要求收缩侧边栏 + const shouldCollapse = matches.some(match => + match.handle && match.handle.collapseSidebar === true + ); - // 移动端默认收起,桌面端使用保存的状态 if (isMobile) { setSidebarCollapsed(true); - } else if (savedState) { - setSidebarCollapsed(savedState === 'true'); + } else if (shouldCollapse) { + setSidebarCollapsed(true); + } else { + // 从localStorage获取侧边栏状态 + const savedState = localStorage.getItem('sidebarCollapsed'); + if (savedState) { + setSidebarCollapsed(savedState === 'true'); + } } - }, []); + }, [location.pathname]); const toggleSidebar = () => { const newState = !sidebarCollapsed; @@ -135,7 +149,7 @@ export function Layout({ children, userRole = 'developer' as UserRole, frontendJ ))} */} -
| {cell} | )} +
| {cell} | )} +
| {cell} | )} +
{msg}
+请选择新的模板文件用于结构比对。
+注意:支持PDF和Word格式的文件,上传后将替换当前的比对模板。
+