From ba517d7b9c8544b8d0c3141d85f660ee14f092bf Mon Sep 17 00:00:00 2001 From: yorn <1057707203@qq.com> Date: Wed, 10 Dec 2025 09:10:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=A4=E5=8F=89=E8=AF=84=E6=9F=A5=E4=B8=8E?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E8=AF=84=E6=9F=A5=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?ai=E5=BB=BA=E8=AE=AE=E7=9A=84=E6=9B=BF=E6=8D=A2=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E4=B8=8D=E4=B8=80=E8=87=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/auth/user-routes.ts | 72 ++++++++++++++++- .../cross-checking/ReviewPointsList.tsx | 57 ++++++++++++-- app/components/reviews/ReviewPointsList.tsx | 8 +- app/root.tsx | 78 +++++++++++++++++-- 4 files changed, 196 insertions(+), 19 deletions(-) diff --git a/app/api/auth/user-routes.ts b/app/api/auth/user-routes.ts index 82bc063..852f43b 100644 --- a/app/api/auth/user-routes.ts +++ b/app/api/auth/user-routes.ts @@ -199,7 +199,23 @@ const FALLBACK_MENU_DATA: Record = { title: '交叉评查', path: '/cross-checking', icon: 'ri-color-filter-line', - order: 7 + order: 7, + children: [ + { + id: 'cross-checking-upload', + title: '创建任务', + path: '/cross-checking/upload', + icon: 'ri-upload-cloud-line', + order: 1 + }, + { + id: 'cross-checking-result', + title: '评查结果', + path: '/cross-checking/result', + icon: 'ri-file-list-3-line', + order: 2 + } + ] } ], 'common': [ @@ -291,7 +307,23 @@ const FALLBACK_MENU_DATA: Record = { title: '交叉评查', path: '/cross-checking', icon: 'ri-color-filter-line', - order: 7 + order: 7, + children: [ + { + id: 'cross-checking-upload', + title: '创建任务', + path: '/cross-checking/upload', + icon: 'ri-upload-cloud-line', + order: 1 + }, + { + id: 'cross-checking-result', + title: '评查结果', + path: '/cross-checking/result', + icon: 'ri-file-list-3-line', + order: 2 + } + ] } ], 'deptLeader': [ @@ -390,7 +422,23 @@ const FALLBACK_MENU_DATA: Record = { title: '交叉评查', path: '/cross-checking', icon: 'ri-color-filter-line', - order: 7 + order: 7, + children: [ + { + id: 'cross-checking-upload', + title: '创建任务', + path: '/cross-checking/upload', + icon: 'ri-upload-cloud-line', + order: 1 + }, + { + id: 'cross-checking-result', + title: '评查结果', + path: '/cross-checking/result', + icon: 'ri-file-list-3-line', + order: 2 + } + ] } ], 'groupLeader': [ @@ -482,7 +530,23 @@ const FALLBACK_MENU_DATA: Record = { title: '交叉评查', path: '/cross-checking', icon: 'ri-color-filter-line', - order: 7 + order: 7, + children: [ + { + id: 'cross-checking-upload', + title: '创建任务', + path: '/cross-checking/upload', + icon: 'ri-upload-cloud-line', + order: 1 + }, + { + id: 'cross-checking-result', + title: '评查结果', + path: '/cross-checking/result', + icon: 'ri-file-list-3-line', + order: 2 + } + ] } ] }; diff --git a/app/components/cross-checking/ReviewPointsList.tsx b/app/components/cross-checking/ReviewPointsList.tsx index 48ecdb5..a14143e 100644 --- a/app/components/cross-checking/ReviewPointsList.tsx +++ b/app/components/cross-checking/ReviewPointsList.tsx @@ -449,7 +449,9 @@ export function ReviewPointsList({ scoringProposals = [], jwtToken, userInfo, - onOpinionSubmitted + onOpinionSubmitted, + fileFormat, + onAiSuggestionReplace }: ReviewPointsListProps) { // 状态管理 const [searchText, setSearchText] = useState(''); // 搜索文本 @@ -1971,10 +1973,15 @@ export function ReviewPointsList({ // 渲染AI建议(ai_suggestion) if (config.ai_suggestion?.suggestions && Object.keys(config.ai_suggestion.suggestions).length > 0) { + // 判断是否为PDF文档(禁用替换按钮) + fileFormat = fileFormat?.replace(/\./g,'') + const isPDF = fileFormat?.toUpperCase() === 'PDF'; + // 遍历suggestions对象的key-value对 Object.entries(config.ai_suggestion.suggestions).forEach(([key, suggestionValue], index) => { // 检查建议值是否存在(null 或有值都要渲染) const hasSuggestedValue = suggestionValue.suggested_value !== null && suggestionValue.suggested_value.trim() !== ''; + const isReplaceDisabled = !hasSuggestedValue || isPDF; fieldElements.push(
@@ -1986,7 +1993,7 @@ export function ReviewPointsList({ {/* 原因说明 */}
-
+
{suggestionValue.reason} @@ -1999,14 +2006,14 @@ export function ReviewPointsList({
- {/* 建议内容显示 */} + {/* 建议内容和替换按钮 */}
{/* 文本输入框 */}