Browse Source

绘制内容结算0116

zhiyuan-007 2 months ago
parent
commit
c0a00fa025

BIN
src/assets/基本信息框-红.png


BIN
src/assets/基本信息框.png


BIN
src/assets/预警.png


+ 66 - 20
src/components/mapJK.vue

@@ -59,6 +59,7 @@ import {
 import FeaturePointsPlottingEvent from "../units/map/FeaturePointsPlottingEvent.js";
 import FeaturePolygonPlottingEvent from "../units/map/FeaturePolygonPlottingEvent.js";
 import HeatMap from "../units/map/HeatMap.js";
+import AddGraphicsEvent from "../units/map/AddGraphicsEvent.js";
 export default {
   name: "mapJK",
   setup(){
@@ -91,6 +92,7 @@ export default {
     let draw_GeometryMeshPrismEffectEvent = null;
     let symbolPathPipeEvent = null;
     let symbolPointCubeEvent = null;
+    let addGraphicsEvent = null;
     let featurePointsPlottingEvent = null;
     let currentShowGridId = null;
     onMounted(() =>{
@@ -1447,6 +1449,10 @@ export default {
               })
               messages.forEach(message => {
                 if(message.overall == "SAFE"){
+                  addGraphics({
+                    "id": message.uavid+'_conflict',
+                    "status": "hide"
+                  });
                   pathPipe({
                     "id": message.uavid+'_conflict',
                     "status": "hide"
@@ -1455,8 +1461,8 @@ export default {
                     id:message.id,
                     uavid:message.uavid,
                     status:message.routeInfoVO.status == 3?"hide":"show",
-                    duration:message.time + 1000,
-                    //duration:3000,
+                    //duration:message.time + 100,
+                    duration:2100,
                     point:message.position_cj,
                     uavInfo: {
                       type:"safe",
@@ -1469,23 +1475,36 @@ export default {
                       id:message.id,
                       uavid:message.uavid,
                       status:message.routeInfoVO.status == 3?"hide":"show",
-                      duration:message.time + 1000,
-                      //duration:3000,
+                      //duration:message.time + 100,
+                      duration:2100,
                       point:message.position_cj,
                       uavInfo: {
                         type:"conflict",
                         data:message.nearestAircraft
                       }
                     });
+                    debugger
+                    addGraphics({
+                      id: message.uavid+'_conflict',
+                      status: "show",
+                      data: {
+                          "geometry": { "type": "point", "x": message.nearestAircraft.conflictPoint[0],   "y":  message.nearestAircraft.conflictPoint[1], "z": message.nearestAircraft.conflictPoint[2] },
+                          "attributes": { "name": "碰撞点位" }
+                        }
+                    });
                     pathPipe({
                       "id": message.uavid+'_conflict',
                       "status": "show",
                       "paths":[message.nearestAircraft.conflictPath],
                       "color": "#FF0000",
                       "intensity": 1.5,
-                      "pipeRadius": 6
+                      "pipeRadius": 10
                     });
                   }else{
+                    addGraphics({
+                      "id": message.uavid+'_conflict',
+                      "status": "hide"
+                    });
                     pathPipe({
                       "id": message.uavid+'_conflict',
                       "status": "hide"
@@ -1497,8 +1516,8 @@ export default {
                         id:message.id,
                         uavid:message.uavid,
                         status:message.routeInfoVO.status == 3?"hide":"show",
-                        duration:message.time + 1000,
-                        //duration:3000,
+                        //duration:message.time + 100,
+                        duration:2100,
                         point:message.position_cj,
                         uavInfo: {
                           type:"noFlyZone",
@@ -1511,8 +1530,8 @@ export default {
                         id:message.id,
                         uavid:message.uavid,
                         status:message.routeInfoVO.status == 3?"hide":"show",
-                        duration:message.time + 1000,
-                        //duration:3000,
+                        //duration:message.time + 100,
+                        duration:2100,
                         point:message.position_cj,
                         uavInfo: {
                           type:"routeDeviate",
@@ -1525,8 +1544,8 @@ export default {
                         id:message.id,
                         uavid:message.uavid,
                         status:message.routeInfoVO.status == 3?"hide":"show",
-                        duration:message.time + 1000,
-                        //duration:3000,
+                        //duration:message.time + 100,
+                        duration:2100,
                         point:message.position_cj,
                         uavInfo: {
                           type:"electricityWarning",
@@ -1539,8 +1558,8 @@ export default {
                         id:message.id,
                         uavid:message.uavid,
                         status:message.routeInfoVO.status == 3?"hide":"show",
-                        duration:message.time + 1000,
-                        //duration:3000,
+                        //duration:message.time + 100,
+                        duration:2100,
                         point:message.position_cj,
                         uavInfo: {
                           type:"collision",
@@ -1553,8 +1572,8 @@ export default {
                         id:message.id,
                         uavid:message.uavid,
                         status:message.routeInfoVO.status == 3?"hide":"show",
-                        duration:message.time + 1000,
-                        //duration:3000,
+                        //duration:message.time + 100,
+                        duration:2100,
                         point:message.position_cj,
                         uavInfo: {
                           type:"clearZone",
@@ -1566,8 +1585,8 @@ export default {
                       id:message.id,
                       uavid:message.uavid,
                       status:message.routeInfoVO.status == 3?"hide":"show",
-                      duration:message.time + 1000,
-                      //duration:3000,
+                      //duration:message.time + 100,
+                      duration:2100,
                       point:message.position_cj,
                       uavInfo: {
                         type:"safe",
@@ -1844,13 +1863,13 @@ export default {
           status: params.status,
           data:routeList.points
         });
-        routeList.uavList.forEach((item) =>{
+        routeList.conflictList.forEach((item) =>{
           item.status = params.status =="show"?1:3
         })
         //先加载所有的无人机和航线
         getRealFlyPoint({
           status: params.status,
-          flyList:params.status=="show"?routeList.uavList:routeList.uavList
+          flyList:params.status=="show"?routeList.conflictList:routeList.conflictList
         })
 
       }
@@ -1944,6 +1963,32 @@ export default {
         })
         m_map.add(symbolPointCubeEvent.graphicsLayer);
       }
+
+      function addGraphics(params){
+        let status = params.status;
+        let id = params.id;
+        if(status == "hide"){
+          let idGraphic = m_view.graphics.find(item => item.id === id);
+          if(idGraphic){
+            m_view.graphics.remove(idGraphic);
+          }
+          return
+        }
+        let idGraphic = m_view.graphics.find(item => item.id === id);
+        if(idGraphic && JSON.stringify(params.data.geometry) == JSON.stringify(idGraphic.geometry)){
+         return
+        }else{
+          m_view.graphics.remove(idGraphic);
+          addGraphicsEvent = new AddGraphicsEvent({
+            id,
+            view:m_view,
+            data:params.data,
+            imgType:params.imgType
+          })
+        }
+      }
+
+
       function featurePointsPlotting(params){
         let status = params.status;
         let f_layer = m_map.layers.find(item => item.id === "featurePointsPlottingEvent");
@@ -1956,7 +2001,8 @@ export default {
         //params.data = Path.paths_point;
         featurePointsPlottingEvent = new FeaturePointsPlottingEvent({
           view:m_view,
-          data:params.data
+          data:params.data,
+          imgType:params.imgType
         })
         m_map.add(featurePointsPlottingEvent.featureLayer);
       }

File diff suppressed because it is too large
+ 407 - 943
src/config/routeList.json


+ 11 - 2
src/service/http.js

@@ -35,8 +35,17 @@ export function getPowerPoint(params){
                 //  "G001133223-031112-303001.1|000000000000000000000001"
             ],
             "fields":["gridCode","x","y","z","element","boxSize"],
-            //"elementFields":["demographics","green","river","road","collision_buffer","no_fly_zone_buffer"],
-            "elementFields":params.fields,
+            "elementFields":[   "demographics",
+                "green",
+                "river",
+                "road",
+                "collision",
+                "no_fly_zone",
+                "clear_zone",
+                "collision_buffer",
+                "no_fly_zone_buffer",
+                "clear_zone_buffer"],
+            //"elementFields":params.fields,
             //"elementFields":["road"],
             "scrollPage": {
                 "pageIndex": 1,

+ 46 - 0
src/units/map/AddGraphicsEvent.js

@@ -0,0 +1,46 @@
+import Graphic from "@arcgis/core/Graphic.js";
+import dangerIcon from "../../assets/预警.png";
+import Point from "@arcgis/core/geometry/Point.js";
+
+
+class AddGraphicsEvent {
+    constructor(options) {
+        this.id = options.id;
+        this.view = options.view;
+        this.data = options.data;
+        this.add();
+    }
+    add(){
+        let point = new Point({
+            type: "point", // autocasts as new Point()
+            x: this.data.geometry.x,
+            y: this.data.geometry.y,
+            z: this.data.geometry.z,
+            spatialReference: this.view.spatialReference
+        })
+        let graphic = new Graphic({
+            id: this.id,
+            geometry: point,
+            attributes: this.data.attributes,
+            symbol:{
+                type: "point-3d",
+                symbolLayers: [
+                    {
+                        type: "icon",
+                        resource: {
+                            href: dangerIcon
+                        },
+                        size: 50,
+                        outline: {
+                            color: "white",
+                            size: 2
+                        }
+                    }
+                ]
+            },
+        });
+        this.view.graphics.add(graphic)
+    }
+}
+
+export default AddGraphicsEvent;

+ 21 - 6
src/units/map/FeaturePointsPlottingEvent.js

@@ -1,6 +1,7 @@
 import FeatureLayer from "@arcgis/core/layers/FeatureLayer.js";
 import Graphic from "@arcgis/core/Graphic.js";
 import levelFrIcon from "../../assets/三维_点.png";
+import dangerIcon from "../../assets/预警.png";
 import Point from "@arcgis/core/geometry/Point.js";
 
 class FeaturePointsPlottingEvent {
@@ -8,6 +9,7 @@ class FeaturePointsPlottingEvent {
         this.view = options.view;
         this.data = options.data;
         this.featureLayer = null;
+        this.imgType =options.imgType
         this.add();
     }
     add(){
@@ -26,6 +28,23 @@ class FeaturePointsPlottingEvent {
             });
             resultPointGraphics.push(graphic);
         })
+        let resource;
+        let material;
+        if(this.imgType == "danger"){
+            resource = {
+                href: dangerIcon
+            }
+            material = {
+                color: [255, 0, 0, 1]
+            }
+        }else{
+            resource = {
+                href: levelFrIcon
+            }
+            material = {
+                color: [35, 250, 250, 1]
+            }
+        }
         this.featureLayer = new FeatureLayer({
             id: "featurePointsPlottingEvent",
             title: "点位标绘",
@@ -42,9 +61,7 @@ class FeaturePointsPlottingEvent {
                     symbolLayers: [
                         {
                             type: "icon",
-                            resource: {
-                                href: levelFrIcon
-                            },
+                            resource: resource,
                             size: 50,
                             outline: {
                                 color: "white",
@@ -65,9 +82,7 @@ class FeaturePointsPlottingEvent {
                     symbolLayers: [
                         {
                             type: "text", // autocasts as new TextSymbol3DLayer()
-                            material: {
-                                color: [35, 250, 250, 1] // [0, 240, 255,1]
-                            },
+                            material: material,
                             font: {  // autocasts as new Font()
                                 size: 12,
                                 weight: "bold"

+ 1 - 1
src/units/threejs/flyGLTF.js

@@ -240,7 +240,7 @@ export const FlyGLTFClass = {
                         const textInfo = [
                             { text: '暂停飞行原地等待:' + this.panelInfo.data.waitTime +'秒', color: '#fff', font: 'bold 16px Arial', offsetX:50, offsetY: 20 },
                             { text: '距预测撞点前方: ', color: '#fff', font: '20px Verdana', offsetX:70, offsetY: 90 },
-                            { text: Math.floor(this.panelInfo.data.waitLength * 1) + '米', color: '#ff0000', font: 'bold 22px Courier New', offsetX:120, offsetY: 120  }
+                            { text: Math.floor(this.panelInfo.data.danger_path_distance * 1) + '米', color: '#ff0000', font: 'bold 22px Courier New', offsetX:120, offsetY: 120  }
                         ];
                         // 绘制文字
                         textInfo.forEach((line) => {