From a3fd2c7fed4b6b1418b954dcc16e7adbac73fc5e Mon Sep 17 00:00:00 2001 From: yorn <1057707203@qq.com> Date: Tue, 21 Apr 2026 15:08:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E8=AF=84=E6=9F=A5=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?work=E6=96=87=E6=A1=A3=E5=92=8Cpdf=E6=96=87=E6=A1=A3=E7=9A=84?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=9A=84=E9=A1=B5=E9=9D=A2=E4=B8=89=E6=A0=8F?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=9A=84=E9=87=8D=E6=9E=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/evaluation_points/reviews.ts | 15 +- app/components/layout/Layout.tsx | 28 +- app/components/reviews/ReviewPointsList.tsx | 5 + app/components/reviews/index.ts | 8 +- .../reviews/leftColumn/RulesDirectory.tsx | 302 +++++++++ .../previewComponents/DocxPreviewTest.tsx | 224 +++++++ .../previewComponents/PdfPreviewTest.tsx | 32 +- .../reviews/rightColumn/DetailPanel.tsx | 222 +++++++ .../reviews/rightColumn/FileInfoPanel.tsx | 71 ++ .../rightColumn/ReviewPointDetailCard.tsx | 577 +++++++++++++++++ app/root.tsx | 15 +- app/routes/documents.list.tsx | 1 + app/routes/reviewsTest.tsx | 613 +++++++++--------- 13 files changed, 1781 insertions(+), 332 deletions(-) create mode 100644 app/components/reviews/leftColumn/RulesDirectory.tsx create mode 100644 app/components/reviews/previewComponents/DocxPreviewTest.tsx create mode 100644 app/components/reviews/rightColumn/DetailPanel.tsx create mode 100644 app/components/reviews/rightColumn/FileInfoPanel.tsx create mode 100644 app/components/reviews/rightColumn/ReviewPointDetailCard.tsx 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格式的文件,上传后将替换当前的比对模板。
+