From 812d77e3db062d63bc35304ac527f14efd1a454d Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期一, 18 三月 2024 11:12:18 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/taskReliability/RBD-edit-img.vue |   56 +++++++++++++++++++++++---------------------------------
 1 files changed, 23 insertions(+), 33 deletions(-)

diff --git a/web/src/views/modules/taskReliability/RBD-edit-img.vue b/web/src/views/modules/taskReliability/RBD-edit-img.vue
index b9acbcf..5b240b8 100644
--- a/web/src/views/modules/taskReliability/RBD-edit-img.vue
+++ b/web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -184,7 +184,7 @@
         id: '',
         graph: null,
         globalGridAttr: {
-          voteSum: '',
+          voteNum: '',
           repairMttcr: '',
           repairMttcrOther: '',
           repairDistribType: '',
@@ -372,15 +372,16 @@
           grid: {
             visible: true,
           },
-          onToolItemCreated({tool}) {
-            const handle = tool
-            const options = handle.options
-            if (options && options.index % 2 === 1) {
-              tool.setAttrs({fill: 'red'})
-            }
-          },
           autoResize: true,
-          history: true,
+            history: {
+                enabled: true,
+                beforeAddCommand(event, args) {
+                    if (args.key==='tools') {
+                        console.log(args.key,'event, args')
+                        return false
+                    }
+                },
+            },
           // panning: {
           //   enabled: true,
           // },
@@ -450,6 +451,12 @@
                     }
                   }
                 }],
+                tools: {
+                  name: 'vertices',
+                  args: {
+                    attrs: { fill: '#666' },
+                  },
+                },
                 zIndex: 0,
               })
             },
@@ -532,7 +539,8 @@
             data: {
               dataId: '',
               nodeType: item.nodeType,
-              nodeTypeExt: ''
+              nodeTypeExt: '',
+              voteNum:''
             },
             attrs: {
               text: {
@@ -564,7 +572,7 @@
             width: 60,
             height: 60,
             data: {
-              isRepair: false,
+              isRepair: item.isRepair,
               dataId: item.dataId,
               nodeType: item.nodeType,
               nodeTypeExt: item.nodeTypeExt,
@@ -576,9 +584,9 @@
               repairMttcrOther: item.repairMttcrOther,
               taskMtbcf: item.taskMtbcf,
               taskMtbcfOther: item.taskMtbcfOther,
-              voteSum: '',
               imgHeight: item.imgHeight,
-              imgWidth: item.imgWidth
+              imgWidth: item.imgWidth,
+              voteNum:'',
             },
             attrs: {
               text: {
@@ -799,28 +807,10 @@
           this.showPorts(ports, false)
         })
 
-        this.graph.on('edge:mouseenter', ({cell, view}) => {
+        this.graph.on('edge:mouseenter', ({cell}) => {
           // alert(123)
-          cell.addTools([
-            {
-              name: 'source-arrowhead',
-            },
-            {
-              name: 'target-arrowhead',
-              args: {
-                attrs: {
-                  fill: 'red',
-                },
-              },
-            },
-          ])
           cell.addTools(
-            [
-              {
-                name: 'segments',
-                args: {snapRadius: 20, attrs: {fill: '#444'}}
-              }
-            ]
+              ['vertices', 'segments']
           )
         })
 

--
Gitblit v1.9.1