1
This commit is contained in:
parent
b6a5253f62
commit
8436ea74d4
@ -4,10 +4,18 @@
|
|||||||
|
|
||||||
### 1. 工作流定义管理 (WorkflowDefinitionApiController)
|
### 1. 工作流定义管理 (WorkflowDefinitionApiController)
|
||||||
|
|
||||||
#### 1.1 保存工作流设计
|
#### 1.1 更新工作流定义
|
||||||
```typescript
|
```typescript
|
||||||
POST /api/v1/workflow-definitions/{id}/design
|
PUT /api/v1/workflow-definitions/{id}
|
||||||
Request: {
|
Request: {
|
||||||
|
// 基本信息
|
||||||
|
code: string; // 工作流编码
|
||||||
|
name: string; // 工作流名称
|
||||||
|
description: string; // 工作流描述
|
||||||
|
version: number; // 版本号
|
||||||
|
|
||||||
|
// 设计数据
|
||||||
|
design?: {
|
||||||
nodes: [{
|
nodes: [{
|
||||||
id: string;
|
id: string;
|
||||||
type: string;
|
type: string;
|
||||||
@ -28,27 +36,15 @@ Request: {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Response: {
|
Response: {
|
||||||
code: number;
|
code: number;
|
||||||
data: boolean;
|
data: WorkflowDefinitionDTO;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 1.2 获取工作流设计
|
#### 1.2 导入工作流定义(待实现)
|
||||||
```typescript
|
|
||||||
GET /api/v1/workflow-definitions/{id}/design
|
|
||||||
Response: {
|
|
||||||
code: number;
|
|
||||||
data: {
|
|
||||||
nodes: Node[];
|
|
||||||
edges: Edge[];
|
|
||||||
};
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 1.3 导入工作流定义
|
|
||||||
```typescript
|
```typescript
|
||||||
POST /api/v1/workflow-definitions/import
|
POST /api/v1/workflow-definitions/import
|
||||||
Request: FormData {
|
Request: FormData {
|
||||||
@ -61,7 +57,7 @@ Response: {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 1.4 导出工作流定义
|
#### 1.3 导出工作流定义(待实现)
|
||||||
```typescript
|
```typescript
|
||||||
GET /api/v1/workflow-definitions/{id}/export
|
GET /api/v1/workflow-definitions/{id}/export
|
||||||
Response: File // JSON格式的工作流定义文件
|
Response: File // JSON格式的工作流定义文件
|
||||||
|
|||||||
@ -304,6 +304,12 @@ const FlowDesigner: React.FC<FlowDesignerProps> = ({
|
|||||||
graph.on('node:moved', updateGraph);
|
graph.on('node:moved', updateGraph);
|
||||||
graph.on('edge:connected', updateGraph);
|
graph.on('edge:connected', updateGraph);
|
||||||
graph.on('cell:removed', updateGraph);
|
graph.on('cell:removed', updateGraph);
|
||||||
|
|
||||||
|
// 添加边的右键菜单删除功能
|
||||||
|
graph.on('edge:contextmenu', ({ cell, e }) => {
|
||||||
|
e.preventDefault();
|
||||||
|
cell.remove();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载流程数据
|
// 加载流程数据
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user