feat: 为审批记录增加翻页 (#115)

This commit is contained in:
RuoJi6 authored and GitHub committed 2026-09-15 00:52:48 +08:00
1 parent 5db71f7c53
commit 71fa919599
5 files changed
+179 -14

No files matched your search

+14
View File
@@ -1063,8 +1063,22 @@ export const api = {
post<{ ok: boolean }>(`/intercept/pending/${id}/decide`, { decision }),
interceptDetail: (id: number) => get<InterceptDetail>(`/intercept/history/${id}`),
interceptHistory: () => get<{ items: InterceptApprovalRow[] }>("/intercept/history").then((r) => arr(r.items)),
interceptHistoryPage: (page = 1, size = 20) =>
get<{ items: InterceptApprovalRow[]; total?: number }>(`/intercept/history?page=${page}&size=${size}`).then(
(r) => ({
items: arr(r.items),
total: r.total ?? r.items?.length ?? 0,
}),
),
interceptTask: (taskId: string) =>
get<{ items: InterceptApprovalRow[] }>(`/intercept/task/${taskId}`).then((r) => arr(r.items)),
interceptTaskPage: (taskId: string, page = 1, size = 20) =>
get<{ items: InterceptApprovalRow[]; total?: number }>(
`/intercept/task/${encodeURIComponent(taskId)}?page=${page}&size=${size}`,
).then((r) => ({
items: arr(r.items),
total: r.total ?? r.items?.length ?? 0,
})),
// ---- intercept tool-config (全局工具拦截范围) ----
interceptGetToolConfig: async (): Promise<{ enabled_tools: string[] }> => {