wuxiang 1 年之前
父節點
當前提交
64230a9d04
共有 1 個文件被更改,包括 47 次插入20 次删除
  1. 47 20
      src/views/map/index.vue

+ 47 - 20
src/views/map/index.vue

@@ -744,7 +744,7 @@ export default {
        if(data.redunit != null){
           this.tree.data.push({
               id: 0,
-              text: "红方作战单元",
+              text: "红方作战单元",
               icon: "el-icon-s-flag",
               opened: true,
               children: []
@@ -753,21 +753,22 @@ export default {
           for(let i = 0; i< data.redunit.length; i++){
             this.tree.data[0].children.push({
               id: 0+i,
-              text: data.redunit[i].type+"-"+data.redunit[i].name,
+              text: data.redunit[i].id+"-"+data.redunit[i].name,
               icon: "el-icon-aim",
               opened: true,
               children: []
             })
-
-          //   for(let j = 0; j< data.redunit[i].components_json.length; j++){
-          //     this.tree.data[0].children[i].children[j].push({
-          //       id: 0+i+j,
-          //       text: data.redunit[i].type+"-"+data.redunit[i].name,
-          //       icon: "el-icon-aim",
-          //       opened: true,
-          //       children: []
-          //     })
-          //  }
+        
+            for(let j = 0; j< data.redunit[i].components_json.length; j++){
+              let info = data.redunit[i].components_json[j][data.redunit[i].components_json[j].name];
+              this.tree.data[0].children[i].children.push({
+                id: 0+i+j,
+                text: info.properties.id+"-"+info.type+"-"+info.properties.method,
+                icon: "el-icon-aim",
+                opened: true,
+                children: []
+              })
+           }
           }
         }
 
@@ -782,7 +783,7 @@ export default {
           for(let i = 0; i< data.blueunit.length; i++){
               this.tree.data[1].children.push({
                 id: 1+i,
-                text: data.blueunit[i].type+"-"+data.blueunit[i].name,
+                text: data.blueunit[i].id+"-"+data.blueunit[i].name,
                 icon: "el-icon-aim",
                 opened: true,
                 children: []
@@ -799,10 +800,10 @@ export default {
               children: []
           })
           for(let i = 0; i< data.satellite.length; i++){
-              let properties = data.satellite[i][data.satellite[i].name];
+              let info = data.satellite[i][data.satellite[i].name];
               this.tree.data[2].children.push({
                 id: 20,
-                text: properties.type+"-"+ data.satellite.name,
+                text: info.properties.id+"-"+ data.satellite[i].name,
                 icon: "el-icon-aim",
                 opened: true,
                 children: []
@@ -819,17 +820,43 @@ export default {
               children: []
           })
           for(let i = 0; i< data.center.length; i++){
-              let properties = data.center[i][data.center[i].name];
+              let info = data.center[i][data.center[i].name];
               this.tree.data[3].children.push({
-                id: 30,
-                text: properties.type+"-" + data.center.name,
+                id: 3+i,
+                text: info.properties.id+"-" + data.center[i].name,
                 icon: "el-icon-aim",
                 opened: true,
                 children: []
               })
+
+              let sub = info.sub;                        
+              for(let j = 0; j< sub.sub_radar.length; j++){
+                let info = sub.sub_radar[i][sub.sub_radar[i].name];
+                this.tree.data[3].children[i].children.push({
+                  id: 3+i+j,
+                  text: "指控雷达"+"-" + info.name,
+                  icon: "el-icon-aim",
+                  opened: true,
+                  children: []
+                })
+
+               }
+              
+              for(let j = 0; j< sub.sub_satellite.length; j++){
+                let info = sub.sub_satellite[i][sub.sub_satellite[i].name];
+                this.tree.data[3].children[i].children.push({
+                  id: 3+i+j,
+                  text: "指控卫星"+"-" + info.name,
+                  icon: "el-icon-aim",
+                  opened: true,
+                  children: []
+                })
+              }
+              
            }
-      }       
-    },
+          }  
+           
+    },       
     showMissileInfo(row){
       console.log('row :>> ', row);
       this.selectMissile = row