69 lines
2.0 KiB
TypeScript
69 lines
2.0 KiB
TypeScript
import { BaseNodeDefinition, NodeType, NodeCategory } from './types';
|
|
|
|
/**
|
|
* 开始事件节点定义(纯配置)
|
|
* 使用 BaseNode 组件渲染,无需自定义渲染代码
|
|
*/
|
|
export const StartEventNodeDefinition: BaseNodeDefinition = {
|
|
nodeCode: "START_EVENT",
|
|
nodeName: "开始",
|
|
nodeType: NodeType.START_EVENT,
|
|
category: NodeCategory.EVENT,
|
|
description: "工作流的起始节点",
|
|
|
|
// 渲染配置(配置驱动)
|
|
renderConfig: {
|
|
shape: 'ellipse',
|
|
size: { width: 120, height: 50 },
|
|
icon: {
|
|
type: 'emoji',
|
|
content: '▶️',
|
|
size: 24
|
|
},
|
|
theme: {
|
|
primary: '#10b981',
|
|
secondary: '#059669',
|
|
selectedBorder: '#3b82f6',
|
|
hoverBorder: '#10b981',
|
|
gradient: ['#ffffff', '#ecfdf5']
|
|
},
|
|
handles: {
|
|
input: false, // 开始节点无输入
|
|
output: true // 有输出
|
|
},
|
|
features: {
|
|
showBadge: false, // 开始节点不显示徽章
|
|
showHoverMenu: false // 开始节点不显示菜单
|
|
}
|
|
},
|
|
|
|
configSchema: {
|
|
type: "object",
|
|
title: "基本配置",
|
|
description: "节点的基本信息",
|
|
properties: {
|
|
nodeName: {
|
|
type: "string",
|
|
title: "节点名称",
|
|
description: "节点在流程图中显示的名称",
|
|
default: "开始"
|
|
},
|
|
nodeCode: {
|
|
type: "string",
|
|
title: "节点编码",
|
|
description: "节点的唯一标识符",
|
|
default: "START_EVENT"
|
|
},
|
|
description: {
|
|
type: "string",
|
|
title: "节点描述",
|
|
description: "节点的详细说明",
|
|
default: "工作流的起始节点"
|
|
}
|
|
},
|
|
required: ["nodeName", "nodeCode"]
|
|
}
|
|
};
|
|
|
|
// ✅ 不再需要单独的渲染组件,使用 BaseNode 即可
|