feat: 添加工作流管理功能和动态表单支持
- 新增工作流相关接口和类型定义,包括创建、更新、删除和获取工作流列表的功能 - 更新界面,支持工作流的展示和操作,允许用户保存和管理工作流 - 优化动态表单,支持根据工作流节点动态生成表单项 - 修改按钮事件名称以提高代码可读性
This commit is contained in:
@@ -14,10 +14,16 @@ export interface NodeLibraryFormItem {
|
|||||||
default?: string | number | boolean;
|
default?: string | number | boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface NodeLibraryModelConfig {
|
||||||
|
modelName: string;
|
||||||
|
modelForm: NodeLibraryFormItem[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface NodeLibraryItem {
|
export interface NodeLibraryItem {
|
||||||
nodeCode: string;
|
nodeCode: string;
|
||||||
nodeName: string;
|
nodeName: string;
|
||||||
form: NodeLibraryFormItem[];
|
formConfig: NodeLibraryFormItem[];
|
||||||
|
modelConfig: NodeLibraryModelConfig[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NodeLibraryGroup {
|
export interface NodeLibraryGroup {
|
||||||
@@ -89,7 +95,6 @@ export interface DownloadToFileParams {
|
|||||||
fileURL: string;
|
fileURL: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// requestOptions 用来声明“这个接口的错误提示由谁负责”。
|
|
||||||
export function getCreationList(params: CreationListParams, requestOptions?: RequestOptions) {
|
export function getCreationList(params: CreationListParams, requestOptions?: RequestOptions) {
|
||||||
return request({
|
return request({
|
||||||
url: '/black-deacon/creation/info/list',
|
url: '/black-deacon/creation/info/list',
|
||||||
@@ -126,3 +131,69 @@ export function downloadToFile(data: DownloadToFileParams, requestOptions?: Requ
|
|||||||
requestOptions,
|
requestOptions,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function saveWorkflow(data: { flowName: string; description: string; flowContent: any }, requestOptions?: RequestOptions) {
|
||||||
|
return request({
|
||||||
|
url: '/black-deacon/flow/user/create',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
requestOptions,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowItem {
|
||||||
|
id: string;
|
||||||
|
flowName: string;
|
||||||
|
description: string;
|
||||||
|
flowContent: any;
|
||||||
|
nodeInputParams?: any[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowListResponse {
|
||||||
|
code: number;
|
||||||
|
message: string;
|
||||||
|
data: {
|
||||||
|
list: WorkflowItem[];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkflowList(requestOptions?: RequestOptions) {
|
||||||
|
return request({
|
||||||
|
url: '/black-deacon/flow/user/list',
|
||||||
|
method: 'get',
|
||||||
|
requestOptions,
|
||||||
|
}) as Promise<WorkflowListResponse>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowDetailResponse {
|
||||||
|
code: number;
|
||||||
|
message: string;
|
||||||
|
data: WorkflowItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkflowDetail(id: string, requestOptions?: RequestOptions) {
|
||||||
|
return request({
|
||||||
|
url: '/black-deacon/flow/user/get',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
requestOptions,
|
||||||
|
}) as Promise<WorkflowDetailResponse>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateWorkflow(data: { id: string; flowName: string; description: string; flowContent: any }, requestOptions?: RequestOptions) {
|
||||||
|
return request({
|
||||||
|
url: '/black-deacon/flow/user/update',
|
||||||
|
method: 'put',
|
||||||
|
data,
|
||||||
|
requestOptions,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteWorkflow(id: string, requestOptions?: RequestOptions) {
|
||||||
|
return request({
|
||||||
|
url: '/black-deacon/flow/user/delete',
|
||||||
|
method: 'delete',
|
||||||
|
params: { id },
|
||||||
|
requestOptions,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user