refactor(node): 移除任务节点组件
- 删除了 DraggableNode 组件的实现文件 - 从 nodeTypes、nodeTypeMap 和 nodeTypeNameMap 中移除了任务节点的相关定义 - 从侧边栏配置中移除了任务节点的数据master
parent
88f6b9f4eb
commit
3bd9bea680
@ -1,25 +0,0 @@
|
||||
import React from 'react';
|
||||
import { useStore } from '@xyflow/react';
|
||||
import styles from '@/pages/flowEditor/node/style/base.module.less';
|
||||
import NodeContent from '@/pages/flowEditor/components/nodeContent';
|
||||
|
||||
const DraggableNode = ({ data, id }: { data: any; id: string }) => {
|
||||
const title = data.title || '任务节点';
|
||||
|
||||
// 获取节点选中状态 - 适配React Flow v12 API
|
||||
const isSelected = useStore((state) =>
|
||||
state.nodeLookup.get(id)?.selected || false
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={`${styles['node-container']} ${isSelected ? styles.selected : ''}`}>
|
||||
<div className={styles['node-header']} style={{ backgroundColor: '#1890ff' }}>
|
||||
{title}
|
||||
</div>
|
||||
|
||||
<NodeContent data={data} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DraggableNode;
|
||||
Loading…
Reference in New Issue