wuxiang há 1 ano atrás
pai
commit
a49fd0a84b
1 ficheiros alterados com 49 adições e 16 exclusões
  1. 49 16
      src/views/map/index.vue

+ 49 - 16
src/views/map/index.vue

@@ -683,23 +683,25 @@ export default {
         });
 
       for (let i = 0; i < blueunit.length; i++) {
-        this.markLocationbyJson(parseFloat(blueunit[i].pos.lat), parseFloat(blueunit[i].pos.lon), parseFloat(blueunit[i].pos.height), blueunit[i].name, "blue")
+        let component = blueunit[i].components_json[blueunit[i].components_json.name]
+        this.markLocationbyJson(parseFloat(component.lat), parseFloat(component.lon), parseFloat(component.h), component.name, "blue")
       }
       for (let i = 0; i < center.length; i++) {
         let item = center[i]
         this.markLocationbyJson(parseFloat(item[center[i].name].properties.lat), parseFloat(item[center[i].name].properties.lon), parseFloat(item[center[i].name].properties.h), item.name, "center")
       }
       for (let i = 0; i < redunit.length; i++) {
-        this.markLocationbyJson(parseFloat(redunit[i].component_movementjson.properties.launch_lat), parseFloat(redunit[i].component_movementjson.properties.launch_lon), parseFloat(redunit[i].component_movementjson.properties.launch_h), redunit[i].name, "red")
+        let component = redunit[i].component_movementjson[redunit[i].component_movementjson.name]
+        this.markLocationbyJson(parseFloat(component.properties.launch_lat), parseFloat(component.properties.launch_lon), parseFloat(component.properties.launch_h), redunit[i].component_movementjson.name, "red")
         let point1 = {
-          longitude: parseFloat(redunit[i].component_movementjson.properties.launch_lon),
-          latitude: parseFloat(redunit[i].component_movementjson.properties.launch_lat),
-          height: parseFloat(redunit[i].component_movementjson.properties.launch_h)
+          longitude: parseFloat(component.properties.launch_lon),
+          latitude: parseFloat(component.properties.launch_lat),
+          height: parseFloat(component.properties.launch_h)
         }
         let point2 = {
-          longitude: parseFloat(redunit[i].component_movementjson.properties.target_lon),
-          latitude: parseFloat(redunit[i].component_movementjson.properties.target_lat),
-          height: parseFloat(redunit[i].component_movementjson.properties.target_h)
+          longitude: parseFloat(component.properties.target_lon),
+          latitude: parseFloat(component.properties.target_lat),
+          height: parseFloat(component.properties.target_h)
         }
         this.markLine(point1, point2, "red")
       }
@@ -758,12 +760,21 @@ export default {
               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];
+            //干扰雷达
+            let info = data.redunit[i].components_json[data.redunit[i].components_json.name];
+            this.tree.data[0].children[i].children.push({
+                id: 0+i+0,
+                text: "干扰雷达-"+info.properties.id+"-"+info.type+"-"+info.properties.method,
+                icon: "el-icon-aim",
+                opened: true,
+                children: []
+              })
+            //雷达诱饵
+            for(let j = 0; j< data.redunit[i].toll_json.length; j++){
+              let info = data.redunit[i].toll_json[j][data.redunit[i].toll_json[j].name];
               this.tree.data[0].children[i].children.push({
-                id: 0+i+j,
-                text: info.properties.id+"-"+info.type+"-"+info.properties.method,
+                id: 0+i+(j+1),
+                text: "雷达诱饵-"+info.properties.id+"-"+info.type+"-"+info.properties.method,
                 icon: "el-icon-aim",
                 opened: true,
                 children: []
@@ -788,6 +799,28 @@ export default {
                 opened: true,
                 children: []
               })
+
+                //Thaad雷达
+              let info = data.blueunit[i].components_json[data.blueunit[i].components_json.name];
+              this.tree.data[1].children[i].children.push({
+                  id: 1+i+0,
+                  text: "Thaad雷达-"+info.id+"-"+info.type+"-"+info.name,
+                  icon: "el-icon-aim",
+                  opened: true,
+                  children: []
+                })
+               //拦截导弹
+               for(let j = 0; j< info.missile.length; j++){
+                let missile = info.missile[j][info.missile[i].name];
+                this.tree.data[1].children[i].children[0].children.push({
+                  id: 1+i+(j+1),
+                  text: "拦截导弹"+"-"+missile.id+"-"+missile.name,
+                  icon: "el-icon-aim",
+                  opened: true,
+                  children: []
+                })
+
+               } 
             }
         }
 
@@ -803,7 +836,7 @@ export default {
               let info = data.satellite[i][data.satellite[i].name];
               this.tree.data[2].children.push({
                 id: 20,
-                text: info.properties.id+"-"+ data.satellite[i].name,
+                text: "侦察卫星-"+info.properties.id+"-"+ data.satellite[i].name,
                 icon: "el-icon-aim",
                 opened: true,
                 children: []
@@ -845,7 +878,7 @@ export default {
               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,
+                  id: 3+i+0+j,
                   text: "指控卫星"+"-" + info.name,
                   icon: "el-icon-aim",
                   opened: true,
@@ -1237,7 +1270,7 @@ export default {
               disturb: disturb,
               src: src,
               toll_number: this.jsonData.redunit[i].toll_json.length,
-              method: this.jsonData.redunit[i].components_json.干扰器1.method,
+              method: this.jsonData.redunit[i].components_json[this.jsonData.redunit[i].components_json.name].method,
               status: '存活',
               pos:{
                 x: 0,