From 02658b77b233d5a5530ec63ff4c0a4ca9ca21c55 Mon Sep 17 00:00:00 2001 From: Wenyan Date: Tue, 25 Nov 2025 20:24:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(document-types):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=94=99=E8=AF=AF=20-=20=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=20FastAPI=20v3=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: - document-types.new.tsx 仍在使用已重命名的 getAllRuleGroups 函数 - 导致构建失败:"getAllRuleGroups" is not exported 修复: - getAllRuleGroups → getAllEvaluationPointGroups - 传递正确的参数:includeDisabled=false, withRuleCount=true 影响范围: - app/routes/document-types.new.tsx (文档类型创建/编辑页面) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/routes/document-types.new.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/routes/document-types.new.tsx b/app/routes/document-types.new.tsx index f0bb5f9..e189b46 100644 --- a/app/routes/document-types.new.tsx +++ b/app/routes/document-types.new.tsx @@ -4,7 +4,7 @@ import { redirect, type MetaFunction, type ActionFunctionArgs, type LoaderFuncti import { Card } from "~/components/ui/Card"; import { Button } from "~/components/ui/Button"; import documentTypesNewStyles from "~/styles/pages/document-types_new.css?url"; -import { getAllRuleGroups, type RuleGroup } from "~/api/evaluation_points/rule-groups"; +import { getAllEvaluationPointGroups, type RuleGroup } from "~/api/evaluation_points/rule-groups"; import { getDocumentType, createDocumentType, updateDocumentType, getEntryModules } from "~/api/document-types/document-types"; import { getPromptTemplates, type PromptTemplateUI } from "~/api/prompts/prompts"; import { toastService } from "~/components/ui/Toast"; @@ -70,14 +70,14 @@ export async function loader({ request }: LoaderFunctionArgs) { const id = url.searchParams.get("id"); const isEdit = id ? true : false; - // 1. 获取评查点分组 - 使用getAllRuleGroups获取所有分组 - const ruleGroupsResponse = await getAllRuleGroups(frontendJWT); + // 1. 获取评查点分组 - 使用 FastAPI v3 的 getAllEvaluationPointGroups 获取所有分组 + const ruleGroupsResponse = await getAllEvaluationPointGroups(false, true, frontendJWT); if (ruleGroupsResponse.error) { console.error("获取评查点分组失败:", ruleGroupsResponse.error); // throw new Error(ruleGroupsResponse.error); } - - // ruleGroupsResponse.data已经是树形结构数据,getAllRuleGroups内部已处理好parent-children关系 + + // ruleGroupsResponse.data已经是树形结构数据,getAllEvaluationPointGroups内部已处理好parent-children关系 const groupsTree = ruleGroupsResponse.error ? [] : ruleGroupsResponse.data || [];