feat: 更新数字人创作页面以支持工作流和输入功能

- 修改工作流项接口,新增流模板名称和用户流列表支持
- 引入新的输入区域,允许用户上传文件并选择创作技能
- 实现工作流列表的Tab切换,分为“我的工作流”和“模板工作流”
- 优化界面布局和交互,提升用户体验
This commit is contained in:
2026-05-08 22:00:00 +08:00
parent 8cc5f4be64
commit a285c9d982
2 changed files with 493 additions and 76 deletions

View File

@@ -144,7 +144,8 @@ export function saveWorkflow(data: { flowName: string; description: string; flow
export interface WorkflowItem {
id: string;
flowName: string;
flowName?: string;
flowTemplateName?: string;
description: string;
flowContent: any;
nodeInputParams?: any[];
@@ -154,7 +155,15 @@ export interface WorkflowListResponse {
code: number;
message: string;
data: {
list: WorkflowItem[];
listFlowUserRes: {
list: WorkflowItem[];
total: number;
};
listFlowTemplateRes: {
list: WorkflowItem[];
total: number;
};
isAdmin?: boolean;
};
}
@@ -198,3 +207,72 @@ export function deleteWorkflow(id: string, requestOptions?: RequestOptions) {
requestOptions,
});
}
// 执行工作流相关类型定义
export interface FlowNodeFormField {
default?: any;
field?: string;
label?: string;
options?: { label?: string; value?: string }[];
required?: boolean;
type?: string;
value?: string;
}
export interface FlowNodeInputSource {
field?: string[];
nodeId?: string;
quoteOutput?: boolean;
}
export interface FlowNodeModelItem {
modelApiKey?: string;
modelForm?: FlowNodeFormField[];
modelName?: string;
}
export interface FlowNode {
config?: { [key: string]: any };
formConfig?: FlowNodeFormField[];
id?: string;
inputSource?: FlowNodeInputSource[];
modelConfig?: FlowNodeModelItem;
name?: string;
nodeCode?: string;
outputResult?: FlowNodeFormField[];
skillName?: string;
}
export interface FlowEdge {
from?: string;
id?: string;
to?: string;
}
export interface FlowInfo {
edges?: FlowEdge[];
nodes?: FlowNode[];
startNodeId?: string;
version?: string;
}
export interface ExecuteFlowParams {
desc?: string;
fileUrl?: string[];
flowContent?: FlowInfo;
flowId?: number;
nodeInputParams?: FlowNode[];
sessionId?: string;
skillName?: string;
}
export function executeFlow(data: ExecuteFlowParams | FormData, requestOptions?: RequestOptions) {
return request({
url: '/ai-agent/flow/execution/execute',
method: 'post',
data,
headers: data instanceof FormData ? { 'Content-Type': 'multipart/form-data' } : undefined,
timeout: 0,
requestOptions,
});
}