diff --git a/src/api/digitalHuman/creation/index.ts b/src/api/digitalHuman/creation/index.ts index e22a6aa..c6bfb94 100644 --- a/src/api/digitalHuman/creation/index.ts +++ b/src/api/digitalHuman/creation/index.ts @@ -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, + }); +} diff --git a/src/views/digitalHuman/creation/index.vue b/src/views/digitalHuman/creation/index.vue index 974979b..bb118d3 100644 --- a/src/views/digitalHuman/creation/index.vue +++ b/src/views/digitalHuman/creation/index.vue @@ -296,8 +296,45 @@ -
- 开始创作 + + +
+ +
+ + {{ file.name }} + +
+ + +
+ +
+ + + + +
+ + + + + + +
+ + +
+ 技能: {{ selectedCreationSkill.name }} +
@@ -343,41 +380,80 @@
-
-
我的工作流
- 刷新 -
-
- -
-
-
-
{{ workflow.flowName }}
-
{{ workflow.description || '暂无描述' }}
-
-
- 编辑 - 删除 + + + +
+ 新建 + 刷新 +
+
+ +
+
+
+
{{ workflow.flowName }}
+
{{ workflow.description || '暂无描述' }}
+
+
+ 编辑 + 删除 +
+
-
-
- -
- -
+ +
+ +
+ + + + +
+ 新建 + 刷新 +
+
+ +
+
+
+
{{ workflow.flowName || workflow.flowTemplateName }}
+
{{ workflow.description || '暂无描述' }}
+
+
+ 编辑 + 使用 + 删除 +
+
+
+
+ +
+ +
+
+
@@ -403,13 +479,16 @@ + + +