refactor(frontend): 重构前端第二版

This commit is contained in:
sophie committed 2026-06-11 13:47:06 +08:00
1 parent 2631f78b00
commit 4b562cfa82
205 files changed
+15399 -12015

No files matched your search

@@ -0,0 +1,30 @@
/**
* features/workspace/api/schedule.api.ts
* 工作台排程记录 HTTP API(用户可见的执行历史与 Excel 导出)。
*/
import { getAuthHeaders } from '@/shared/utils/auth';
import { requestJson } from '@/shared/api/client';
import type { ScheduleRun } from '@/shared/types/schedule.types';
async function getJson<T>(url: string): Promise<T> {
return requestJson<T>(url, { headers: getAuthHeaders() });
}
export const listWorkspaceScheduleRuns = (params?: {
status?: string;
schedule_name?: string;
started_after?: string;
started_before?: string;
}) => {
const sp = new URLSearchParams();
if (params?.status) sp.set('status', params.status);
if (params?.schedule_name) sp.set('schedule_name', params.schedule_name);
if (params?.started_after) sp.set('started_after', params.started_after);
if (params?.started_before) sp.set('started_before', params.started_before);
const qs = sp.toString();
return getJson<ScheduleRun[]>(`/api/workspace/schedule-runs${qs ? '?' + qs : ''}`);
};
export const workspaceRunExcelUrl = (runId: number) => `/api/workspace/schedule-runs/${runId}/excel`;
export type { ScheduleRun };