新版本流程编辑器
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
import { FormRenderProps, FormMeta } from '@flowgram.ai/free-layout-editor';
|
||||
import { Avatar } from '@douyinfe/semi-ui';
|
||||
|
||||
import { FlowNodeJSON } from '../../typings';
|
||||
import iconEnd from '../../assets/icon-end.jpg';
|
||||
|
||||
export const renderForm = ({ form }: FormRenderProps<FlowNodeJSON>) => (
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
width: 60,
|
||||
height: 60,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Avatar
|
||||
shape="circle"
|
||||
style={{
|
||||
width: 40,
|
||||
height: 40,
|
||||
borderRadius: '50%',
|
||||
cursor: 'move',
|
||||
}}
|
||||
alt="Icon"
|
||||
src={iconEnd}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
export const formMeta: FormMeta<FlowNodeJSON> = {
|
||||
render: renderForm,
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
import { FlowNodeRegistry } from '../../typings';
|
||||
import iconStart from '../../assets/icon-start.jpg';
|
||||
import { formMeta } from './form-meta';
|
||||
import { WorkflowNodeType } from '../constants';
|
||||
|
||||
export const BlockEndNodeRegistry: FlowNodeRegistry = {
|
||||
type: WorkflowNodeType.BlockEnd,
|
||||
meta: {
|
||||
isNodeEnd: true,
|
||||
deleteDisable: true,
|
||||
copyDisable: true,
|
||||
sidebarDisabled: true,
|
||||
nodePanelVisible: false,
|
||||
defaultPorts: [{ type: 'input' }],
|
||||
size: {
|
||||
width: 100,
|
||||
height: 100,
|
||||
},
|
||||
wrapperStyle: {
|
||||
minWidth: 'unset',
|
||||
width: '100%',
|
||||
borderWidth: 2,
|
||||
borderRadius: 12,
|
||||
cursor: 'move',
|
||||
},
|
||||
},
|
||||
info: {
|
||||
icon: iconStart,
|
||||
description: 'The final node of the block.',
|
||||
},
|
||||
/**
|
||||
* Render node via formMeta
|
||||
*/
|
||||
formMeta,
|
||||
/**
|
||||
* Start Node cannot be added
|
||||
*/
|
||||
canAdd() {
|
||||
return false;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user