import React from 'react'; import { Tooltip } from 'antd'; const NODE_WIDTH = 200; const NODE_HEIGHT = 100; const STATUS_COLORS = { online: '#52c41a', offline: '#d9d9d9', fault: '#ff4d4f', warning: '#faad14' }; function RouterNode({ data }) { if (!data) { return (
无数据
); } const nodeColor = '#722ed1'; const statusColor = STATUS_COLORS[data.status] || STATUS_COLORS.offline; const isCenter = data.isCenter; const isSelected = data.selected; return (
路由器 { e.target.style.display = 'none'; }} />
{data.name?.substring(0, 14) || '路由器'}
{isCenter && ( )}
); } export default RouterNode;