feat(rohs-check): 新增 RoHS 检核工具 API 及相关功能

This commit is contained in:
hugo committed 2026-06-10 15:17:09 +08:00
1 parent 8a541211b7
commit 24551e9a9a
39 files changed
+3128 -189

No files matched your search

+23 -1
View File
@@ -13,6 +13,8 @@ export interface ScheduleTask {
dify_agent_id?: number | null;
platform_api_path?: string | null;
data_source_type?: string;
kb_sync_enabled?: boolean;
kb_group_id?: number | null;
notify_user_ids_json: number[];
notify_enabled: boolean;
enabled: boolean;
@@ -45,6 +47,12 @@ export interface ScheduleRun {
error_message?: string | null;
excel_file_name?: string | null;
excel_file_size?: number | null;
kb_sync_status?: string | null;
kb_group_id?: number | null;
kb_document_id?: number | null;
kb_document_version_id?: number | null;
kb_sync_job_id?: number | null;
kb_sync_error?: string | null;
wecom_notified: boolean;
wecom_notified_at?: string | null;
wecom_notify_error?: string | null;
@@ -77,6 +85,9 @@ async function getJson<T>(url: string): Promise<T> {
export const listAdminSchedules = () =>
getJson<ScheduleTask[]>('/api/admin/schedules');
export const getAdminSchedule = (taskId: number) =>
getJson<ScheduleTask>(`/api/admin/schedules/${taskId}`);
export const exportAdminScheduleUrl = (taskId: number) => `/api/admin/schedules/${taskId}/export`;
export const importAdminSchedules = async (payload: any) => {
@@ -127,9 +138,20 @@ export interface TestScheduleRunResult {
step_logs: StepLog[];
dify_agent_id: number | null;
dify_execution_snapshot?: DifyExecutionSnapshot | null;
kb_sync_status?: string | null;
kb_sync_error?: string | null;
kb_document_id?: number | null;
}
export const testAdminScheduleRun = (taskId: number, payload: { fetch_where_conditions?: string; fetch_order_by?: string; limit?: number }) =>
export const testAdminScheduleRun = (
taskId: number,
payload: {
fetch_where_conditions?: string;
fetch_order_by?: string;
limit?: number;
kb_sync_enabled?: boolean;
},
) =>
requestJson<TestScheduleRunResult>(`/api/admin/schedule-config/${taskId}/test-run`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...getAuthHeaders() },