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 |   81 +++++++++++++++++++---------------------
 1 files changed, 38 insertions(+), 43 deletions(-)

diff --git a/web/src/views/modules/taskReliability/RBD-edit-img.vue b/web/src/views/modules/taskReliability/RBD-edit-img.vue
index b3fe5d6..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,
               })
             },
@@ -496,28 +503,28 @@
             console.log(node.getData().imgWidth, node.getData().imgHeight, 'node.size()')
             return node.clone().size(width, height)
           },
-        // 杩斿洖涓�涓柊鐨勮妭鐐逛綔涓哄疄闄呮斁缃埌鐢诲竷涓婄殑鑺傜偣
           title: '',
           target: this.graph,
-          stencilGraphWidth: 230,
-          stencilGraphHeight: 300,
-          collapsable: false,
+            stencilGraphWidth: 200,
+            stencilGraphHeight: 280,
+            collapsable: true,
           groups: [
             {
               title: '杩愮畻绗﹀彿',
               name: 'group1',
-              collapsable: false
             },
             {
               title: '璁惧鑺傜偣',
               name: 'group2',
-              collapsable: false
+                graphHeight: '',
+                layoutOptions: {
+                    rowHeight: 90,
+                },
             }
           ],
           layoutOptions: {
             columns: 2,
-            columnWidth: 110,
-            // rowHeight: 75,
+            columnWidth: 105,
           },
         })
         document.getElementById('stencilImg').appendChild(stencil.container)
@@ -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']
           )
         })
 
@@ -1055,10 +1045,15 @@
     position: relative;
     height: 100%;
   }
-
+#stencilImg .x6-graph-svg-viewport{
+    height: 100%;
+}
   .x6-widget-stencil-content {
     position: relative;
-    height: 100%;
+  height: calc(100% - 32px);
+}
+#stencilImg .x6-widget-stencil.collapsable > .x6-widget-stencil-content{
+    top:0
   }
 
 </style>

--
Gitblit v1.9.1