Browse Source

fix(id 问题)

liujing 8 months ago
parent
commit
dff4da2cee
1 changed files with 12 additions and 12 deletions
  1. 12 12
      src/views/business-analysis/analysisDetail/components/Topo.vue

+ 12 - 12
src/views/business-analysis/analysisDetail/components/Topo.vue

@@ -82,18 +82,18 @@ export default {
       this.isFull = screenfull.isFullscreen // 更新全屏状态
     },
     initGraph(data, id) {
-      function replaceIds(obj) {
-        if (typeof obj === 'object' && obj!== null) {
-          if (obj.hasOwnProperty('id') && obj.hasOwnProperty('unique_id')) {
-            obj.id = obj.unique_id;
-          }
-          if (obj.hasOwnProperty('children')) {
-            obj.children && obj.children.forEach(child => replaceIds(child));
-          }
-        }
-        return obj
-      }
-      data = replaceIds(data)
+      // function replaceIds(obj) {
+      //   if (typeof obj === 'object' && obj!== null) {
+      //     if (obj.hasOwnProperty('id') && obj.hasOwnProperty('unique_id')) {
+      //       obj.id = obj.unique_id;
+      //     }
+      //     if (obj.hasOwnProperty('children')) {
+      //       obj.children && obj.children.forEach(child => replaceIds(child));
+      //     }
+      //   }
+      //   return obj
+      // }
+      // data = replaceIds(data)
       let graph = null
       const container = document.getElementById(id)
       const width = container.scrollWidth