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 || [];