From 2daa08be12e87df4ecbef3261028bdbd23e14768 Mon Sep 17 00:00:00 2001 From: jifeng Date: Tue, 30 Apr 2024 17:12:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/node-wrapper/index.tsx | 8 ++++++-- src/lib/components/topology/index.tsx | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/components/node-wrapper/index.tsx b/src/lib/components/node-wrapper/index.tsx index c9de4752..b19abc6d 100644 --- a/src/lib/components/node-wrapper/index.tsx +++ b/src/lib/components/node-wrapper/index.tsx @@ -223,7 +223,8 @@ class NodeWrapper extends React.Component { } = this.props; const { selectedData, activeLine } = context; - const isSelected = selectedData.nodes.find(item => item.id === data.id) !== undefined; + const isSelected = + selectedData.nodes.find(item => item.id === data.id) !== undefined; return connectDragSource(
{ className="byai-topology-node-wrapper" onClick={this.handleClick} onContextMenu={this.handleRightClick} - onMouseDown={this.handleMouseDown} + onMouseDown={(e) => { + // @ts-ignore + this.handleMouseDown(e, isSelected); + }} onMouseEnter={() => { onMouseEnter(data) }} onMouseLeave={() => { onMouseLeave() }}> {connectDragPreview( diff --git a/src/lib/components/topology/index.tsx b/src/lib/components/topology/index.tsx index 0960d81d..55960c6a 100644 --- a/src/lib/components/topology/index.tsx +++ b/src/lib/components/topology/index.tsx @@ -692,7 +692,7 @@ class Topology extends React.Component { }); this.setContext( { - selectedData: selectData + selectedData: selectData, }, () => { if (mode === SelectMode.BOX_SELECTION) { @@ -2006,7 +2006,6 @@ class Topology extends React.Component { }} onClick={this.handleCanvasClick} > - {this.renderNodes()} {this.renderLines()}