From b9a995d3f37c99d4a5cc1397692201db97be2326 Mon Sep 17 00:00:00 2001 From: basstal <330475004@qq.com> Date: Fri, 16 Sep 2022 23:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=20fix:=20=E7=BC=96=E8=BE=91=E6=97=B6=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=8F=82=E6=95=B0=E6=97=B6=EF=BC=8C=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E6=8C=89=E4=B8=8B=E5=B9=B6=E9=80=89=E4=B8=AD=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=A6=82=E6=9E=9C=E9=BC=A0=E6=A0=87=E5=BC=B9?= =?UTF-8?q?=E8=B5=B7=E6=97=B6=E4=BD=8D=E4=BA=8EG6=E6=A0=91=E7=8A=B6?= =?UTF-8?q?=E5=9B=BE=E5=8C=BA=E5=9F=9F=EF=BC=8C=E8=8A=82=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E4=BC=9A=E8=A2=AB=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- render-process/Editor/index.tsx | 38 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/render-process/Editor/index.tsx b/render-process/Editor/index.tsx index 1da4045..3004e56 100644 --- a/render-process/Editor/index.tsx +++ b/render-process/Editor/index.tsx @@ -24,6 +24,7 @@ export interface EditorProps { interface EditorState { curNodeId?: string; + blockNodeSelectChange?: boolean; } export default class Editor extends React.Component { @@ -113,7 +114,7 @@ export default class Editor extends React.Component { }, }, }); - + graph.on("contextmenu", (e: G6GraphEvent) => { require("@electron/remote").Menu.getApplicationMenu().popup(); }); @@ -135,6 +136,11 @@ export default class Editor extends React.Component { }); graph.on("nodeselectchange", (e: G6GraphEvent) => { + if (this.state.blockNodeSelectChange) { + // ** 重置选中效果 + this.onSelectNode(this.state.curNodeId) + return; + } if (e.target) { this.onSelectNode(e.target.getID()); } else { @@ -481,8 +487,12 @@ export default class Editor extends React.Component { return (
- - + { + this.state.blockNodeSelectChange = false; + }} /> + { + this.state.blockNodeSelectChange = true; + }}> {curNode ? ( { }} /> ) : ( - { + { - }} - onRemoveTree={() => { + }} + onRemoveTree={() => { - }} - onChangeTreeDesc={(desc) => { - this.changeTreeDesc(desc); - }} - /> - )} + }} + onChangeTreeDesc={(desc) => { + this.changeTreeDesc(desc); + }} + /> + )}