This commit is contained in:
戚辰先生 2024-12-05 14:54:35 +08:00
parent b6a5253f62
commit 8436ea74d4
2 changed files with 39 additions and 37 deletions

View File

@ -4,10 +4,18 @@
### 1. 工作流定义管理 (WorkflowDefinitionApiController)
#### 1.1 保存工作流设计
#### 1.1 更新工作流定义
```typescript
POST /api/v1/workflow-definitions/{id}/design
PUT /api/v1/workflow-definitions/{id}
Request: {
// 基本信息
code: string; // 工作流编码
name: string; // 工作流名称
description: string; // 工作流描述
version: number; // 版本号
// 设计数据
design?: {
nodes: [{
id: string;
type: string;
@ -27,28 +35,16 @@ Request: {
condition?: string;
}
}]
}
}
Response: {
code: number;
data: boolean;
data: WorkflowDefinitionDTO;
message: string;
}
```
#### 1.2 获取工作流设计
```typescript
GET /api/v1/workflow-definitions/{id}/design
Response: {
code: number;
data: {
nodes: Node[];
edges: Edge[];
};
message: string;
}
```
#### 1.3 导入工作流定义
#### 1.2 导入工作流定义(待实现)
```typescript
POST /api/v1/workflow-definitions/import
Request: FormData {
@ -61,7 +57,7 @@ Response: {
}
```
#### 1.4 导出工作流定义
#### 1.3 导出工作流定义(待实现)
```typescript
GET /api/v1/workflow-definitions/{id}/export
Response: File // JSON格式的工作流定义文件

View File

@ -304,6 +304,12 @@ const FlowDesigner: React.FC<FlowDesignerProps> = ({
graph.on('node:moved', updateGraph);
graph.on('edge:connected', updateGraph);
graph.on('cell:removed', updateGraph);
// 添加边的右键菜单删除功能
graph.on('edge:contextmenu', ({ cell, e }) => {
e.preventDefault();
cell.remove();
});
}
// 加载流程数据