feat: 添加节点库功能和动态表单支持
- 新增节点库相关接口和类型定义,支持获取节点库列表 - 更新界面,添加节点库展示和动态表单功能,允许用户根据节点类型动态生成表单项 - 修改按钮事件名称以提高代码可读性
This commit is contained in:
@@ -6,6 +6,34 @@ export interface CreationListParams {
|
||||
keyword?: string;
|
||||
}
|
||||
|
||||
export interface NodeLibraryFormItem {
|
||||
field: string;
|
||||
label: string;
|
||||
type: 'input' | 'number' | 'textarea' | 'switch' | string;
|
||||
required: boolean;
|
||||
default?: string | number | boolean;
|
||||
}
|
||||
|
||||
export interface NodeLibraryItem {
|
||||
nodeCode: string;
|
||||
nodeName: string;
|
||||
form: NodeLibraryFormItem[];
|
||||
}
|
||||
|
||||
export interface NodeLibraryGroup {
|
||||
group: string;
|
||||
label: string;
|
||||
items: NodeLibraryItem[];
|
||||
}
|
||||
|
||||
export interface NodeLibraryListResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
groups: NodeLibraryGroup[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface CreationImageItem {
|
||||
name: string;
|
||||
url: string;
|
||||
@@ -71,6 +99,14 @@ export function getCreationList(params: CreationListParams, requestOptions?: Req
|
||||
}) as Promise<CreationListResponse>;
|
||||
}
|
||||
|
||||
export function getNodeLibraryList(requestOptions?: RequestOptions) {
|
||||
return request({
|
||||
url: '/black-deacon/node/library/list',
|
||||
method: 'get',
|
||||
requestOptions,
|
||||
}) as Promise<NodeLibraryListResponse>;
|
||||
}
|
||||
|
||||
export function createCreation(data: CreationSubmitParams, requestOptions?: RequestOptions) {
|
||||
return request({
|
||||
url: '/black-deacon/creation/info/creation',
|
||||
|
||||
Reference in New Issue
Block a user