更新数字人创作页面功能
- 修改 `ExecutionFlowItem` 接口,将 `flowId` 字段重命名为 `Id`,以提高一致性。 - 新增 `getExecutionDetail` 函数,用于获取执行详情,增强工作流管理能力。 - 更新树节点处理逻辑,使用 `workflowId` 替代 `flowId`,确保数据一致性。 - 优化模型配置页面,动态显示访问类型,提升用户体验。
This commit is contained in:
@@ -76,7 +76,7 @@ export interface ExecutionItem {
|
|||||||
|
|
||||||
export interface ExecutionFlowItem {
|
export interface ExecutionFlowItem {
|
||||||
flowName: string;
|
flowName: string;
|
||||||
flowId?: number | string;
|
Id?: number | string;
|
||||||
sessionId?: string;
|
sessionId?: string;
|
||||||
items: ExecutionItem[];
|
items: ExecutionItem[];
|
||||||
}
|
}
|
||||||
@@ -228,6 +228,15 @@ export function getWorkflowDetail(id: string, requestOptions?: RequestOptions) {
|
|||||||
}) as Promise<WorkflowDetailResponse>;
|
}) as Promise<WorkflowDetailResponse>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getExecutionDetail(id: string, requestOptions?: RequestOptions) {
|
||||||
|
return request({
|
||||||
|
url: '/ai-agent/flow/execution/get',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
requestOptions,
|
||||||
|
}) as Promise<WorkflowDetailResponse>;
|
||||||
|
}
|
||||||
|
|
||||||
export function updateWorkflow(data: { id: string; flowName: string; description: string; flowContent: any }, requestOptions?: RequestOptions) {
|
export function updateWorkflow(data: { id: string; flowName: string; description: string; flowContent: any }, requestOptions?: RequestOptions) {
|
||||||
return request({
|
return request({
|
||||||
url: '/ai-agent/flow/user/update',
|
url: '/ai-agent/flow/user/update',
|
||||||
|
|||||||
@@ -585,6 +585,7 @@ import {
|
|||||||
getNodeLibraryList,
|
getNodeLibraryList,
|
||||||
getWorkflowList,
|
getWorkflowList,
|
||||||
getWorkflowDetail,
|
getWorkflowDetail,
|
||||||
|
getExecutionDetail,
|
||||||
updateWorkflow,
|
updateWorkflow,
|
||||||
deleteWorkflow,
|
deleteWorkflow,
|
||||||
saveWorkflow,
|
saveWorkflow,
|
||||||
@@ -609,7 +610,7 @@ interface TreeNode {
|
|||||||
nodeType: NodeType;
|
nodeType: NodeType;
|
||||||
children?: TreeNode[];
|
children?: TreeNode[];
|
||||||
fileUrl?: string;
|
fileUrl?: string;
|
||||||
flowId?: number | string;
|
workflowId?: number | string;
|
||||||
sessionId?: string;
|
sessionId?: string;
|
||||||
}
|
}
|
||||||
interface SelectedState {
|
interface SelectedState {
|
||||||
@@ -880,7 +881,7 @@ const buildTreeNodes = (tree: ExecutionTreeItem[]): TreeNode[] =>
|
|||||||
id: `flow-${di}-${fi}`,
|
id: `flow-${di}-${fi}`,
|
||||||
label: f.flowName || '未命名工作流',
|
label: f.flowName || '未命名工作流',
|
||||||
nodeType: 'contentType',
|
nodeType: 'contentType',
|
||||||
flowId: f.flowId,
|
workflowId: f.Id,
|
||||||
sessionId: f.sessionId, // 添加 sessionId
|
sessionId: f.sessionId, // 添加 sessionId
|
||||||
children: (f.items || []).map((item, ii) => ({
|
children: (f.items || []).map((item, ii) => ({
|
||||||
id: `item-${di}-${fi}-${ii}`,
|
id: `item-${di}-${fi}-${ii}`,
|
||||||
@@ -1337,10 +1338,10 @@ const getFieldClass = (type: string) => {
|
|||||||
// 处理树节点点击
|
// 处理树节点点击
|
||||||
const handleTreeNodeClick = async (data: TreeNode) => {
|
const handleTreeNodeClick = async (data: TreeNode) => {
|
||||||
// 只处理工作流节点(contentType)
|
// 只处理工作流节点(contentType)
|
||||||
if (data.nodeType === 'contentType' && data.flowId) {
|
if (data.nodeType === 'contentType' && data.workflowId) {
|
||||||
try {
|
try {
|
||||||
// 调用详情接口获取工作流数据,使用 flowId
|
// 从工作空间进入,使用 execution/get 接口获取执行详情
|
||||||
const res = await getWorkflowDetail(String(data.flowId));
|
const res = await getExecutionDetail(String(data.workflowId));
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
// 设置当前会话的 sessionId(从工作空间进入)
|
// 设置当前会话的 sessionId(从工作空间进入)
|
||||||
currentSessionId.value = data.sessionId || null;
|
currentSessionId.value = data.sessionId || null;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col v-if="!props.isSuperAdmin" :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="访问类型" prop="isPrivate">
|
<el-form-item label="访问类型" prop="isPrivate">
|
||||||
<el-radio-group v-model="state.ruleForm.isPrivate" @change="onIsPrivateChange">
|
<el-radio-group v-model="state.ruleForm.isPrivate" @change="onIsPrivateChange">
|
||||||
<el-radio :label="0">本地模型</el-radio>
|
<el-radio :label="0">本地模型</el-radio>
|
||||||
@@ -609,7 +609,7 @@ const openDialog = async (type: string, row?: Record<string, unknown>) => {
|
|||||||
baseUrl: '',
|
baseUrl: '',
|
||||||
httpMethod: 'POST',
|
httpMethod: 'POST',
|
||||||
headMsg: '',
|
headMsg: '',
|
||||||
isPrivate: 0,
|
isPrivate: props.isSuperAdmin ? 1 : 0,
|
||||||
apiKey: '',
|
apiKey: '',
|
||||||
enabled: 1,
|
enabled: 1,
|
||||||
isChatModel: 0,
|
isChatModel: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user