feat(schedule): 新增平台任务参数契约与动态选项支持
This commit is contained in:
1 parent
2ce1aca023
commit
8b5b0b49bf
76 files changed
+7103
-1203
No files matched your search
@@ -44,6 +44,49 @@ export interface PlatformJobOption {
|
||||
export const listAdminPlatformJobs = () =>
|
||||
getJson<PlatformJobOption[]>('/api/admin/schedule/platform-jobs');
|
||||
|
||||
/** 平台任务参数 schema 字段(DynamicTaskParamsForm 按 type 通用渲染) */
|
||||
export interface PlatformTaskParamField {
|
||||
key: string;
|
||||
type:
|
||||
| 'text' | 'textarea' | 'number' | 'boolean'
|
||||
| 'select' | 'multi_select'
|
||||
| 'date' | 'datetime' | 'cron' | 'json' | 'info';
|
||||
label: string;
|
||||
label_key?: string | null;
|
||||
required?: boolean;
|
||||
default?: any;
|
||||
options_source?: string | null;
|
||||
placeholder?: string;
|
||||
placeholder_key?: string | null;
|
||||
help?: string;
|
||||
help_key?: string | null;
|
||||
}
|
||||
|
||||
/** 平台任务完整契约(注册表下发:展示信息 + params_schema + defaults) */
|
||||
export interface PlatformTaskDefinition {
|
||||
task_type: string;
|
||||
label: string;
|
||||
label_key?: string | null;
|
||||
description?: string;
|
||||
description_key?: string | null;
|
||||
category?: string;
|
||||
params_schema: PlatformTaskParamField[];
|
||||
defaults: Record<string, any>;
|
||||
}
|
||||
|
||||
/** options_source 动态选项统一结构 */
|
||||
export interface PlatformTaskOption {
|
||||
label: string;
|
||||
value: string | number;
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
export const listAdminPlatformTaskDefinitions = () =>
|
||||
getJson<PlatformTaskDefinition[]>('/api/admin/platform-tasks/definitions');
|
||||
|
||||
export const listAdminPlatformTaskOptions = (source: string) =>
|
||||
getJson<PlatformTaskOption[]>(`/api/admin/platform-tasks/options?source=${encodeURIComponent(source)}`);
|
||||
|
||||
export const getAdminScheduleTaskConfig = (taskId: number) =>
|
||||
getJson<{ data_source_type: string; config: Record<string, any> | null }>(`/api/admin/schedule-config/${taskId}`);
|
||||
|
||||
|
||||
Reference in new issue
Block a user