diff --git a/app/routes/rule-groups._index.tsx b/app/routes/rule-groups._index.tsx index 4326c9b..90cb9f2 100644 --- a/app/routes/rule-groups._index.tsx +++ b/app/routes/rule-groups._index.tsx @@ -9,12 +9,12 @@ import { Table } from "~/components/ui/Table"; import { FilterPanel, FilterSelect, SearchFilter } from "~/components/ui/FilterPanel"; // import { Pagination } from "~/components/ui/Pagination"; import { - getRuleGroups, + getEvaluationPointGroups, getChildGroups, type RuleGroup, - deleteRuleGroup, - batchUpdateRuleGroupStatus, - batchDeleteRuleGroups + deleteEvaluationPointGroup, + batchUpdateEvaluationPointGroupStatus, + batchDeleteEvaluationPointGroups } from "~/api/evaluation_points/rule-groups"; import { toastService, messageService } from "~/components/ui"; @@ -43,8 +43,8 @@ export async function loader({ request }: { request: Request }) { const page = parseInt(url.searchParams.get('page') || '1'); const pageSize = parseInt(url.searchParams.get('pageSize') || '50'); - // 🆕 调用增强的 getRuleGroups API - const response = await getRuleGroups({ + // 🆕 调用 FastAPI v3 的 getEvaluationPointGroups API + const response = await getEvaluationPointGroups({ name, code, is_enabled: is_enabled ? is_enabled === 'true' : undefined, @@ -52,7 +52,7 @@ export async function loader({ request }: { request: Request }) { page, pageSize, token: frontendJWT - }); + }, frontendJWT); if (response.error) { throw new Error(response.error); @@ -239,7 +239,7 @@ export default function RuleGroupsIndex() { confirmDelay: 4, onConfirm: async () => { try { - const result = await deleteRuleGroup(groupId, frontendJWT); + const result = await deleteEvaluationPointGroup(groupId, frontendJWT); if (result.success) { // 从本地状态中移除被删除的分组 setGroups(prev => { @@ -283,7 +283,7 @@ export default function RuleGroupsIndex() { } try { - const result = await batchUpdateRuleGroupStatus(selectedIds, enable, frontendJWT); + const result = await batchUpdateEvaluationPointGroupStatus(selectedIds, enable, frontendJWT); if (result.success) { toastService.success(`成功${enable ? '启用' : '禁用'} ${result.updated_count} 个分组`); // 刷新页面以重新加载数据 @@ -313,7 +313,7 @@ export default function RuleGroupsIndex() { confirmDelay: 4, onConfirm: async () => { try { - const result = await batchDeleteRuleGroups(selectedIds, frontendJWT); + const result = await batchDeleteEvaluationPointGroups(selectedIds, frontendJWT); toastService.success(`成功删除 ${result.deleted_count} 个分组`); if (result.failed_ids.length > 0) { toastService.warning(`有 ${result.failed_ids.length} 个分组删除失败`);