Bläddra i källkod

修复双击失效bug

yanglzh 11 månader sedan
förälder
incheckning
60ffbc5f71
2 ändrade filer med 10 tillägg och 9 borttagningar
  1. 6 5
      src/views/home/AllLink.vue
  2. 4 4
      src/views/home/g6.js

+ 6 - 5
src/views/home/AllLink.vue

@@ -4,7 +4,9 @@
       <div class="flex">
         <el-input size="small" v-model="form.start" style="width: 200px;margin-right: 6px;" placeholder="Search"></el-input>
         <!-- <el-input size="small" v-model="form.end" style="width: 120px;margin-right: 6px;" placeholder="末节点"></el-input> -->
-        <button class="el-button el-button--primary el-button--small" icon="Search" @click="search"><el-icon><Search></Search></el-icon></button>
+        <button class="el-button el-button--primary el-button--small" icon="Search" @click="search()"><el-icon>
+            <Search></Search>
+          </el-icon></button>
 
       </div>
       <!-- <button class="el-button el-button--primary el-button--small" @click="search">返回上一级</button> -->
@@ -60,11 +62,10 @@ function getTableData() {
   }).finally(() => loading.value = false)
 }
 
-function search() {
-  if (form.start) {
+function search(dblclick = false) {
+  if (form.start || dblclick) {
     num++
     graph.clear();
-    // graph.destroy();
     graph.data(getRandomData(num));
     graph.render();
     loadingTableData()
@@ -118,7 +119,7 @@ function nodeClick2(e) {
 }
 
 function rowDblclick(row) {
-  search()
+  search(true)
 }
 
 </script>

+ 4 - 4
src/views/home/g6.js

@@ -454,12 +454,12 @@ const nodeTree = [
               {
                 id: '18',
                 label: 'VM\nVM01',
-                img: '/imgs/vm.svg'
+                img: '/imgs/VM.svg'
               },
               {
                 id: '19',
                 label: 'VM\nVM02',
-                img: '/imgs/vm.svg',
+                img: '/imgs/VM.svg',
                 type: 'background-animate',
                 info: '网络异常',
                 color: '#f00',
@@ -520,7 +520,7 @@ const nodeTree2 = [
               {
                 id: '19',
                 label: 'VM\nVM02',
-                img: '/imgs/vm.svg',
+                img: '/imgs/VM.svg',
                 type: 'background-animate',
                 info: '网络异常',
                 color: '#f00',
@@ -558,7 +558,7 @@ const nodeTree2 = [
               {
                 id: '18',
                 label: 'VM\nVM01',
-                img: '/imgs/vm.svg'
+                img: '/imgs/VM.svg'
               }
             ]
           }