FlowchartNodePanel.js 913 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { FlowchartNodePanel } from '@antv/xflow';
  2. /** 配置Dnd组件面板 */
  3. import CustomCircle from './react-node/CustomCircle';
  4. import CustomRect from './react-node/CustomRect';
  5. function NodePanel() {
  6. return (
  7. <FlowchartNodePanel
  8. registerNode={{
  9. title: '自定义节点',
  10. key: '1',
  11. nodes: [
  12. {
  13. component: CustomRect,
  14. popover: () => <div>业务节点</div>,
  15. name: 'custom-rect',
  16. width: 120,
  17. height: 50,
  18. label: '业务节点',
  19. },
  20. {
  21. component: CustomCircle,
  22. popover: () => <div>审批节点</div>,
  23. name: 'custom-circle',
  24. width: 90,
  25. height: 90,
  26. label: '审批节点',
  27. },
  28. ],
  29. }}
  30. position={{ width: 162, top: 40, bottom: 0, left: 0 }}
  31. />
  32. );
  33. }
  34. export default NodePanel;