mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-13 07:25:05 +08:00
- 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>
30 lines
643 B
TypeScript
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: '',
|
|
},
|
|
};
|
|
},
|
|
};
|