From f2266317e21737ccca745f8bddba5a79bbcba8d1 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Tue, 12 May 2026 14:31:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E5=AD=97=E4=BA=BA?= =?UTF-8?q?=E5=88=9B=E4=BD=9C=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 `ExecutionFlowItem` 接口,将 `flowId` 字段重命名为 `Id`,以提高一致性。 - 新增 `getExecutionDetail` 函数,用于获取执行详情,增强工作流管理能力。 - 更新树节点处理逻辑,使用 `workflowId` 替代 `flowId`,确保数据一致性。 - 优化模型配置页面,动态显示访问类型,提升用户体验。 --- src/api/digitalHuman/creation/index.ts | 11 ++++++++++- src/views/digitalHuman/creation/index.vue | 11 ++++++----- .../modelConfig/modelModule/component/editModule.vue | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/api/digitalHuman/creation/index.ts b/src/api/digitalHuman/creation/index.ts index 295226e..7400514 100644 --- a/src/api/digitalHuman/creation/index.ts +++ b/src/api/digitalHuman/creation/index.ts @@ -76,7 +76,7 @@ export interface ExecutionItem { export interface ExecutionFlowItem { flowName: string; - flowId?: number | string; + Id?: number | string; sessionId?: string; items: ExecutionItem[]; } @@ -228,6 +228,15 @@ export function getWorkflowDetail(id: string, requestOptions?: RequestOptions) { }) as Promise; } +export function getExecutionDetail(id: string, requestOptions?: RequestOptions) { + return request({ + url: '/ai-agent/flow/execution/get', + method: 'get', + params: { id }, + requestOptions, + }) as Promise; +} + export function updateWorkflow(data: { id: string; flowName: string; description: string; flowContent: any }, requestOptions?: RequestOptions) { return request({ url: '/ai-agent/flow/user/update', diff --git a/src/views/digitalHuman/creation/index.vue b/src/views/digitalHuman/creation/index.vue index bae2ae9..a9c649f 100644 --- a/src/views/digitalHuman/creation/index.vue +++ b/src/views/digitalHuman/creation/index.vue @@ -585,6 +585,7 @@ import { getNodeLibraryList, getWorkflowList, getWorkflowDetail, + getExecutionDetail, updateWorkflow, deleteWorkflow, saveWorkflow, @@ -609,7 +610,7 @@ interface TreeNode { nodeType: NodeType; children?: TreeNode[]; fileUrl?: string; - flowId?: number | string; + workflowId?: number | string; sessionId?: string; } interface SelectedState { @@ -880,7 +881,7 @@ const buildTreeNodes = (tree: ExecutionTreeItem[]): TreeNode[] => id: `flow-${di}-${fi}`, label: f.flowName || '未命名工作流', nodeType: 'contentType', - flowId: f.flowId, + workflowId: f.Id, sessionId: f.sessionId, // 添加 sessionId children: (f.items || []).map((item, ii) => ({ id: `item-${di}-${fi}-${ii}`, @@ -1337,10 +1338,10 @@ const getFieldClass = (type: string) => { // 处理树节点点击 const handleTreeNodeClick = async (data: TreeNode) => { // 只处理工作流节点(contentType) - if (data.nodeType === 'contentType' && data.flowId) { + if (data.nodeType === 'contentType' && data.workflowId) { try { - // 调用详情接口获取工作流数据,使用 flowId - const res = await getWorkflowDetail(String(data.flowId)); + // 从工作空间进入,使用 execution/get 接口获取执行详情 + const res = await getExecutionDetail(String(data.workflowId)); if (res.data) { // 设置当前会话的 sessionId(从工作空间进入) currentSessionId.value = data.sessionId || null; diff --git a/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue b/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue index 8ad62fb..8444cde 100644 --- a/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue +++ b/src/views/digitalHuman/modelConfig/modelModule/component/editModule.vue @@ -38,7 +38,7 @@ - + 本地模型 @@ -609,7 +609,7 @@ const openDialog = async (type: string, row?: Record) => { baseUrl: '', httpMethod: 'POST', headMsg: '', - isPrivate: 0, + isPrivate: props.isSuperAdmin ? 1 : 0, apiKey: '', enabled: 1, isChatModel: 0,