Bladeren bron

工地监护、应急调度、车辆监控、巡检等模块调整

liangluogis 3 jaren geleden
bovenliggende
commit
ba57291c52

+ 0 - 1
src/configure.ts

@@ -804,7 +804,6 @@ var AppX = {
                     }
                 ]
             },
-
             {
                 "id": "guanwangfenxi",
                 "label": "管网分析",

+ 1 - 1
src/widgets/MaintenanceManagerReport/Widget.html

@@ -22,7 +22,7 @@
         </div>
         <div class="form-group">
             <button id="btn_add" type="button" class="btn btn-sm btn-default btn-success btn_location">
-                            <span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span>派工
+                            <span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span>上报
                     </button>
         </div>
     </div>

+ 1 - 1
src/widgets/MaintenanceManagerReport/Widget.ts

@@ -117,7 +117,7 @@ class MaintenanceManagerReport extends BaseWidget {
      */
     initPage(dataInfo?) {
         this.popup.setSize(1000, 730);
-        this.title = dataInfo ? "查看" : "抢维修上报";
+        this.title = dataInfo ? "查看" : "应急上报";
         let actionInfo = dataInfo ? action.update : action.add;
         var Obj = this.popup.Show(this.title, this.template.split('$$')[1], undefined, this.colsePop.bind(this));
         let getHtml = this.AppX.runtimeConfig.maintenancePageInfo;

+ 1 - 1
src/widgets/MaintenancePersonSearch/Widget.ts

@@ -142,7 +142,7 @@ class MaintenancePersonSearch extends BaseWidget {
         if(data.isMaintenance=="1"&&data.mdispatchingUserId){
             dataState.push(getHtml.state.maintenanceConduct);
         }
-        if(data.maintenanceNotes||data.maintenanceFile){
+        if(data.maintenanceNotes || data.maintenanceFile||data.maintenanceFile.length>0){
             dataState.push(getHtml.state.maintenanceAudit);
         }
         getHtml.getLinkHtml(this, Obj.conObj.find('.widget-MaintenancePersonSearch-pop'), dataState,undefined, data);

+ 1 - 1
src/widgets/MaintenanceSearch/Widget.ts

@@ -141,7 +141,7 @@ class MaintenanceSearch extends BaseWidget {
         if(data.isMaintenance=="1"&&data.mdispatchingUserId){
             dataState.push(getHtml.state.maintenanceConduct);
         }
-        if(data.maintenanceNotes||data.maintenanceFile){
+        if(data.maintenanceNotes||data.maintenanceFile||data.maintenanceFile.length>0){
             dataState.push(getHtml.state.maintenanceAudit);
         }
         getHtml.getLinkHtml(this, Obj.conObj.find('.widget-MaintenanceSearch-pop'), dataState,undefined, data);

+ 5 - 1
src/widgets/MissionSchedule/Widget.ts

@@ -1200,7 +1200,11 @@ class MissionSchedule extends BaseWidget {
                 this.plan_addptype_layer.add(p);
             })
             var geometry = geometryEngine.union(geometrys);
-            this.map.setExtent(geometry.getExtent());
+            if(geometry.type&&geometry.type=="point"){
+                this.map.centerAt(geometry)
+            }else{
+                this.map.setExtent(geometry.getExtent());
+            }
         }
     }
 

+ 5 - 1
src/widgets/PlanSearch/Widget.ts

@@ -869,7 +869,11 @@ class PlanSearch extends BaseWidget {
                 this.plan_ptype_layer.add(p);
             })
             var geometry = geometryEngine.union(geometrys);
-            this.map.setExtent(geometry.getExtent());
+            if(geometry.type&&geometry.type=="point"){
+                this.map.centerAt(geometry)
+            }else{
+                this.map.setExtent(geometry.getExtent());
+            }
         }
     }
 

+ 2 - 2
src/widgets/SiteDispatchSearch/Widget.ts

@@ -100,8 +100,8 @@ class SiteDispatchSearch extends BaseWidget {
             startTime: startTime!=""?(startTime+ timeStr):"",
             endTime:endTime!=""?(endTime+timeStr):"",
             "orders[0].asc":false,
-            "orders[0].column":"create_time"
-        }
+            "orders[0].column":"creat_time"
+        } 
     }
 
     /**

+ 1 - 1
src/widgets/SiteSupervisionAllSearch/Widget.ts

@@ -114,7 +114,7 @@ class SiteSupervisionAllSearch extends BaseWidget {
             siteType: siteType ? siteType : "",
             siteName: siteName ? siteName : "",
             "orders[0].asc":false,
-            "orders[0].column":"create_time"
+            "orders[0].column":"creat_time"
         }
     }
 

+ 243 - 53
src/widgets/VehicleHistoryMonitor/Widget.ts

@@ -1,5 +1,6 @@
 import BaseWidget = require('core/BaseWidget.class');
-
+import geometryEngine = require("esri/geometry/geometryEngine");
+import SpatialReference = require("esri/SpatialReference");
 import Map = require("esri/map");
 import Point = require('esri/geometry/Point');
 import GraphicsLayer = require("esri/layers/GraphicsLayer");
@@ -260,57 +261,125 @@ class VehicleHistoryMonitor extends BaseWidget {
         }.bind(this));
     }
 
-    //设置偏移角度
-    setAngelSymbol(linePath) {
-        for (let i = 0; i < linePath.length - 2; i++) {
-            let point1 = { x: linePath[i][0], y: linePath[i][1] };
-            let point2 = { x: linePath[i + 1][0], y: linePath[i + 1][1] };
-            let num = 100000000
-            let a = 0;
-            let angle=0;
-            let draw=true;
-            if (point1.x < point2.x && point1.y < point2.y) {
-                a = (point2.y * num - point1.y * num) / (point2.x * num - point1.x * num);
-                angle = 360 - Math.atan(a) / (2 * Math.PI / 360);
-            } else if (point1.x > point2.x && point1.y < point2.y) {
-                a = (point2.y * num - point1.y * num) / (point1.x * num - point2.x * num);
-                angle = Math.atan(a) / (2 * Math.PI / 360);
-                angle = 180+angle;
-            } else if (point1.x > point2.x && point1.y > point2.y) {
-                a = (point1.y * num - point2.y * num) / (point1.x * num - point2.x * num);
-                angle = Math.atan(a) / (2 * Math.PI / 360);
-                angle = 180-angle;
-            } else if (point1.x < point2.x && point1.y > point2.y) {
-                a =  (point1.y * num - point2.y * num) / (point2.x * num - point1.x * num);
-                angle = Math.atan(a) / (2 * Math.PI / 360);
-                angle = angle;
-            }else if(point1.x==point2.x){
-                if(point1.y<point2.y){
-                    angle=270
-                }else if(point1.y>point2.y){
-                    angle=90
-                }else{
-                    draw=false;
-                }
-            }else if(point1.y==point2.y){
-                if(point1.x<point2.x){
-                    angle=0
-                }else if(point1.x>point2.x){
-                    angle=180
-                }else{
-                    draw=false;
+        //设置偏移角度
+        setAngelSymbol(Paths) {
+            Paths.forEach(linePath => {
+                let previousPoint = null;
+                for (let i = 0; i < linePath.length - 2; i++) {
+                    let point1 = { x: linePath[i][0], y: linePath[i][1] };
+                    let point2 = { x: linePath[i + 1][0], y: linePath[i + 1][1] };
+
+                    let num = 100000000
+                    let a = 0;
+                    let angle = 0;
+                    let draw = true;
+                    if (point1.x < point2.x && point1.y < point2.y) {
+                        a = (point2.y * num - point1.y * num) / (point2.x * num - point1.x * num);
+                        angle = 360 - Math.atan(a) / (2 * Math.PI / 360);
+                    } else if (point1.x > point2.x && point1.y < point2.y) {
+                        a = (point2.y * num - point1.y * num) / (point1.x * num - point2.x * num);
+                        angle = Math.atan(a) / (2 * Math.PI / 360);
+                        angle = 180 + angle;
+                    } else if (point1.x > point2.x && point1.y > point2.y) {
+                        a = (point1.y * num - point2.y * num) / (point1.x * num - point2.x * num);
+                        angle = Math.atan(a) / (2 * Math.PI / 360);
+                        angle = 180 - angle;
+                    } else if (point1.x < point2.x && point1.y > point2.y) {
+                        a = (point1.y * num - point2.y * num) / (point2.x * num - point1.x * num);
+                        angle = Math.atan(a) / (2 * Math.PI / 360);
+                        angle = angle;
+                    } else if (point1.x == point2.x) {
+                        if (point1.y < point2.y) {
+                            angle = 270
+                        } else if (point1.y > point2.y) {
+                            angle = 90
+                        } else {
+                            draw = false;
+                        }
+                    } else if (point1.y == point2.y) {
+                        if (point1.x < point2.x) {
+                            angle = 0
+                        } else if (point1.x > point2.x) {
+                            angle = 180
+                        } else {
+                            draw = false;
+                        }
+                    }
+                    if (draw) {
+                        let symbol = new PictureMarkerSymbol(this.root + "/" + this.config.anglePicture, 20, 20);
+                        symbol.setAngle(angle);
+                        let graphic = new Graphic(new Point(point1), symbol);
+                        if (!previousPoint) {
+                            previousPoint = point1;
+                            this.angleGraphic.add(graphic);
+                        } else {
+                            let measure_p = new Polyline({
+                                "paths": [[[previousPoint.x, previousPoint.y], [point1.x, point1.y]]],
+                                "spatialReference": this.AppX.runtimeConfig.map.spatialReference
+                            });
+                            measure_p.spatialReference = new SpatialReference(4326);
+                            let length = geometryEngine.geodesicLength(measure_p, 'meters');
+                            if (length > this.config.distance) {
+                                this.angleGraphic.add(graphic);
+                                previousPoint = point1;
+                            }
+                        }
+                    }
                 }
-            }
+            })
+        }
 
+    // //设置偏移角度
+    // setAngelSymbol(linePath) {
+    //     for (let i = 0; i < linePath.length - 2; i++) {
+    //         let point1 = { x: linePath[i][0], y: linePath[i][1] };
+    //         let point2 = { x: linePath[i + 1][0], y: linePath[i + 1][1] };
+    //         let num = 100000000
+    //         let a = 0;
+    //         let angle=0;
+    //         let draw=true;
+    //         if (point1.x < point2.x && point1.y < point2.y) {
+    //             a = (point2.y * num - point1.y * num) / (point2.x * num - point1.x * num);
+    //             angle = 360 - Math.atan(a) / (2 * Math.PI / 360);
+    //         } else if (point1.x > point2.x && point1.y < point2.y) {
+    //             a = (point2.y * num - point1.y * num) / (point1.x * num - point2.x * num);
+    //             angle = Math.atan(a) / (2 * Math.PI / 360);
+    //             angle = 180+angle;
+    //         } else if (point1.x > point2.x && point1.y > point2.y) {
+    //             a = (point1.y * num - point2.y * num) / (point1.x * num - point2.x * num);
+    //             angle = Math.atan(a) / (2 * Math.PI / 360);
+    //             angle = 180-angle;
+    //         } else if (point1.x < point2.x && point1.y > point2.y) {
+    //             a =  (point1.y * num - point2.y * num) / (point2.x * num - point1.x * num);
+    //             angle = Math.atan(a) / (2 * Math.PI / 360);
+    //             angle = angle;
+    //         }else if(point1.x==point2.x){
+    //             if(point1.y<point2.y){
+    //                 angle=270
+    //             }else if(point1.y>point2.y){
+    //                 angle=90
+    //             }else{
+    //                 draw=false;
+    //             }
+    //         }else if(point1.y==point2.y){
+    //             if(point1.x<point2.x){
+    //                 angle=0
+    //             }else if(point1.x>point2.x){
+    //                 angle=180
+    //             }else{
+    //                 draw=false;
+    //             }
+    //         }
 
-            if(draw){
-                let symbol = new PictureMarkerSymbol(this.root + "/" + this.config.anglePicture, 20, 20);
-                symbol.setAngle(angle);
-                let graphic = new Graphic(new Point(point1), symbol);
-                this.angleGraphic.add(graphic);
-            }
-        }
-    }
+
+    //         if(draw){
+    //             let symbol = new PictureMarkerSymbol(this.root + "/" + this.config.anglePicture, 20, 20);
+    //             symbol.setAngle(angle);
+    //             let graphic = new Graphic(new Point(point1), symbol);
+    //             this.angleGraphic.add(graphic);
+    //         }
+    //     }
+    // }
 
     //设置车辆点等的样式
     setSymbol() {
@@ -784,21 +853,38 @@ class VehicleHistoryMonitor extends BaseWidget {
     }
 
     addWorkerAllPathToMap(result) {
-        // result = this.config.result;
         var config = this.config.addWorkerAllPathToMap;
+        // var allPathGraphicLayer = <GraphicsLayer>this.map.getLayer(this.preLayerId + "car_allPathGraphicLayer");
         var allPathGraphicLayer = <GraphicsLayer>this.map.getLayer(this.preLayerId + "car_his_allPathGraphicLayer");
         var path = result.result.records;
-        var linePath: Array<any> = [];
         //展示方向图标的点
         var arrowLinePoint: Array<any> = [];
         //方向图标在屏幕上显示距离,单位米
         var screenSpace = 1.00000;
         var map = this.AppX.runtimeConfig.map;
         var space = screenSpace * map.getScale();
+        let paths = [];
+        let pathSingle = [];
+        var linePath: Array<any> = [];
         for (var i = 0, length = path.length; i < length; i++) {
             var pathPoint = [];
             pathPoint.push(path[i].locationLongitude);
             pathPoint.push(path[i].locationLatitude);
+            if (pathSingle.length == 0) {
+                pathSingle.push(pathPoint);
+            } else {
+                var beginDate = new Date(path[i - 1].gpstime);
+                var endDate = new Date(path[i].gpstime);
+                var diff = endDate.getTime() - beginDate.getTime();
+                var sec = diff / 1000;
+                if (sec < 50) {
+                    pathSingle.push(pathPoint);
+                } else {
+                    paths.push(pathSingle.slice());
+                    pathSingle = [];
+                    pathSingle.push(pathPoint);
+                }
+            }
             linePath.push(pathPoint);
             //对轨迹点进行筛选
             if (i != 0 && i % 15 == 0) {
@@ -849,9 +935,9 @@ class VehicleHistoryMonitor extends BaseWidget {
             }
         }
         this.addArrowToMap_New(allPathGraphicLayer, arrowLinePoint);
-        this.setAngelSymbol(linePath);
+        this.setAngelSymbol(paths);
         var polyline = new Polyline({
-            "paths": [linePath],
+            "paths": paths,
             "spatialReference": this.map.spatialReference
         });
         var lineSymbol = new SimpleLineSymbol({
@@ -887,6 +973,110 @@ class VehicleHistoryMonitor extends BaseWidget {
         })
     }
 
+    // addWorkerAllPathToMap(result) {
+    //     // result = this.config.result;
+    //     var config = this.config.addWorkerAllPathToMap;
+    //     var allPathGraphicLayer = <GraphicsLayer>this.map.getLayer(this.preLayerId + "car_his_allPathGraphicLayer");
+    //     var path = result.result.records;
+    //     var linePath: Array<any> = [];
+    //     //展示方向图标的点
+    //     var arrowLinePoint: Array<any> = [];
+    //     //方向图标在屏幕上显示距离,单位米
+    //     var screenSpace = 1.00000;
+    //     var map = this.AppX.runtimeConfig.map;
+    //     var space = screenSpace * map.getScale();
+    //     for (var i = 0, length = path.length; i < length; i++) {
+    //         var pathPoint = [];
+    //         pathPoint.push(path[i].locationLongitude);
+    //         pathPoint.push(path[i].locationLatitude);
+    //         linePath.push(pathPoint);
+    //         //对轨迹点进行筛选
+    //         if (i != 0 && i % 15 == 0) {
+    //             //当前两点间距
+    //             var distance = Math.sqrt(Math.pow((path[i].locationLongitude - path[i - 1].locationLongitude), 2) + Math.pow((path[i].locationLatitude - path[i - 1].locationLatitude), 2));
+    //             if (distance < 1) {
+    //                 continue;
+    //             }
+    //             //相对于x轴正方向偏转cos值
+    //             var x_cos_value = 5 * (path[i].locationLongitude - path[i - 1].locationLongitude) / (distance * 5);
+    //             //方向偏转角度
+    //             var angle = Math.acos(x_cos_value);
+    //             angle = angle / (2 * Math.PI / 360);
+    //             //判断偏转方向是否为顺时针
+    //             if (path[i].locationLatitude - path[i - 1].locationLatitude > 0) {
+    //                 angle = 360 - angle;
+    //             }
+    //             //偏转sin值
+    //             var sin_value = (path[i].locationLatitude - path[i - 1].locationLatitude) / distance;
+    //             //偏转cos值
+    //             var cos_value = (path[i].locationLongitude - path[i - 1].locationLongitude) / distance;
+    //             //修正后的间隔距离
+    //             var respace = null;
+    //             //标识点的个数
+    //             var num = 0;
+    //             if (distance < space) {
+    //                 if (distance > space / 3) {
+    //                     num = 1;
+    //                     respace = distance / 2;
+    //                 }
+    //             }
+    //             else {
+    //                 if (distance % space > (space / 2)) {
+    //                     num = distance / space;
+    //                     respace = distance / (num + 1);
+    //                 }
+    //                 else {
+    //                     num = (distance / space) - 1;
+    //                     respace = distance / (num + 1);
+    //                 }
+    //             }
+    //             var changex = respace * cos_value;
+    //             var changey = respace * sin_value;
+    //             for (var index2 = 0; index2 < num + 1; index2++) {
+    //                 var markpoint = { "x": path[i - 1].locationLongitude + changex * index2, "y": path[i - 1].locationLatitude + changey * index2, "angle": angle };
+    //                 arrowLinePoint.push(markpoint);
+    //             }
+    //         }
+    //     }
+    //     this.addArrowToMap_New(allPathGraphicLayer, arrowLinePoint);
+    //     this.setAngelSymbol(linePath);
+    //     var polyline = new Polyline({
+    //         "paths": [linePath],
+    //         "spatialReference": this.map.spatialReference
+    //     });
+    //     var lineSymbol = new SimpleLineSymbol({
+    //         color: new Color(this.watchingSetting._carPathColor),
+    //         style: SimpleLineSymbol.STYLE_DASHDOT,   //线的样式 dash|dash-dot|solid等
+    //         width: this.watchingSetting.pathLineWith
+    //     });
+    //     lineSymbol.setStyle(SimpleLineSymbol.STYLE_SHORTDASH);
+    //     var lineGraphic = new Graphic(polyline, lineSymbol);
+    //     allPathGraphicLayer.add(lineGraphic);
+    //     //起点添加
+    //     if (!linePath || linePath.length == 0) {
+    //         return;
+    //     }
+    //     var startx = linePath[0][0];
+    //     var starty = linePath[0][1];
+    //     var startPoint = new Point(startx, starty, this.map.spatialReference);
+    //     var startPointSymbol = new PictureMarkerSymbol(this.root + config.IMG_startpoint, 23, 23);
+    //     var startPointGraphic = new Graphic(startPoint, startPointSymbol);
+    //     allPathGraphicLayer.add(startPointGraphic);
+    //     //终点添加
+    //     var endx = linePath[linePath.length - 1][0];
+    //     var endy = linePath[linePath.length - 1][1];
+    //     var endPoint = new Point(endx, endy, this.map.spatialReference);
+    //     var endPointSymbol = new PictureMarkerSymbol(this.root + config.IMG_endpoint, 23, 23);
+    //     var endPointGraphic = new Graphic(endPoint, endPointSymbol);
+    //     allPathGraphicLayer.add(endPointGraphic);
+    //     //定位到轨迹范围
+    //     this.centerAtExtent(startPoint);
+    //     allPathGraphicLayer.on("load", function (event) {
+    //         if (event) {
+    //         }
+    //     })
+    // }
+
     addArrowToMap_New(graphicLayer, arrowPoint) {
         var picUrl = this.root + this.config.arrow_new;
         for (var mark of arrowPoint) {

+ 1 - 0
src/widgets/VehicleHistoryMonitor/config.json

@@ -6,6 +6,7 @@
     "requestWatchingSetting": {
         "URL_request": "/zmrq/tfsyssetting/getSysSetting"
     },
+    "distance":210,
     "requestAllCarInfo": {
         "_comment": "//获取监控车辆信息的接口",
         "URL_Query": "/zmrqcar/car/listCarWatch",

+ 1 - 1
src/widgets/VehicleMonitoring/config.json

@@ -3,7 +3,7 @@
     "tmplateUrl": "widgets/VehicleMonitoring/Widget.html",
     "styleUrl": "widgets/VehicleMonitoring/css/style.css",
     "anglePicture":"widgets/VehicleMonitoring/css/img/directrow.png",
-    "distance":70,
+    "distance":210,
     "requestWatchingSetting": {
         "URL_request": "/zmrq/tfsyssetting/getSysSetting"
     },