From cdf86bb4d627156e1a32b5381e3e52f9cf477e82 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 24 四月 2024 16:05:08 +0800
Subject: [PATCH] 2024-04-24

---
 src/tabviews/custom/components/chart/antv-X6/index.jsx            |   14 +++++++++++++-
 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx |   24 ++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx
index 03c7b22..08990ce 100644
--- a/src/tabviews/custom/components/chart/antv-X6/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx
@@ -998,6 +998,18 @@
 
       graph.clearTransformWidgets()
     })
+
+    graph.on('node:dblclick', () => {
+      setTimeout(() => {
+        MKEmitter.emit('mk-x6-dbclick')
+      }, 100)
+    })
+    graph.on('edge:dblclick', () => {
+      setTimeout(() => {
+        MKEmitter.emit('mk-x6-dbclick')
+      }, 100)
+    })
+
     graph.on('blank:click', () => {
       this.selectNode = null
       
@@ -2303,7 +2315,7 @@
             <Tooltip title="娓呯┖">
               <ClearOutlined onClick={this.clearNode}/>
             </Tooltip>
-            <Tooltip overlayStyle={{maxWidth: 260}} title="蹇嵎閿細澶嶅埗锛坈trl+c锛夈�佸壀鍒囷紙ctrl+x锛夈�佺矘璐达紙ctrl+v锛夈�佸悗閫�锛坈trl+z锛夈�佸墠杩涳紙ctrl+shift+z锛夈�佸垹闄わ紙backspace 鎴� delete锛�">
+            <Tooltip overlayStyle={{maxWidth: 310}} title="蹇嵎閿細澶嶅埗锛坈trl+c锛夈�佸壀鍒囷紙ctrl+x锛夈�佺矘璐达紙ctrl+v锛夈�佸悗閫�锛坈trl+z锛夈�佸墠杩涳紙ctrl+shift+z锛夈�佸垹闄わ紙backspace 鎴� delete锛夛紱鍙屽嚮鑺傜偣鎴栬繛绾垮彲缂栬緫鑷畾涔変俊鎭��">
               <QuestionCircleOutlined />
             </Tooltip>
           </div>
diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
index e125341..91c6cee 100644
--- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
@@ -6,6 +6,7 @@
 
 import ColorSketch from '@/tabviews/zshare/mutilform/mkColor'
 import NodeForm from './nodeform'
+import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
 const { TextArea } = Input
@@ -30,6 +31,10 @@
     })
   }
 
+  componentDidMount () {
+    MKEmitter.addListener('mk-x6-dbclick', this.trigger)
+  }
+
   UNSAFE_componentWillReceiveProps(nextProps) {
     if (!is(fromJS(this.props.node), fromJS(nextProps.node))) {
       this.setState({
@@ -44,6 +49,25 @@
     }
   }
 
+  /**
+   * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆
+   */
+  componentWillUnmount () {
+    this.setState = () => {
+      return
+    }
+
+    MKEmitter.removeListener('mk-x6-dbclick', this.trigger)
+  }
+
+  trigger = () => {
+    const { formlist } = this.state
+
+    if (!formlist || formlist.findIndex(item => item.type === 'other') === -1) return
+
+    this.setState({visible: true})
+  }
+
   getFormList = (node) => {
     let roleList = sessionStorage.getItem('sysRoles')
     if (roleList) {

--
Gitblit v1.8.0