qinglong/src/pages/scenario/flowgram/nodes/condition/index.tsx
copilot-swe-agent[bot] a0a70703bc Refactor workflow editor to use Flowgram.ai library
- Installed @flowgram.ai packages (free-layout-editor and plugins)
- Created node registries following Flowgram pattern
- Implemented FlowgramEditor component with proper integration
- Simplified workflowEditorModal to use Flowgram
- Added necessary translations
- All builds succeed

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
2025-11-23 06:05:24 +00:00

30 lines
643 B
TypeScript

import { nanoid } from 'nanoid';
import { WorkflowNodeType } from '../constants';
import intl from 'react-intl-universal';
import { FlowNodeRegistry } from '../http';
let conditionIndex = 0;
export const ConditionNodeRegistry: FlowNodeRegistry = {
type: WorkflowNodeType.CONDITION,
info: {
description: intl.get('条件判断'),
},
meta: {
size: {
width: 280,
height: 120,
},
},
onAdd() {
return {
id: `condition_${nanoid(5)}`,
type: WorkflowNodeType.CONDITION,
data: {
title: `${intl.get('条件判断')} ${++conditionIndex}`,
condition: '',
},
};
},
};