From 8f3062cd6729850839b02b4dc0a4a76c4322f1c4 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 23 Apr 2021 17:32:41 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/jfpt-Vue

---
 public/map/widgets/supervisoryMap/SupervisoryMap.js |  152 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 104 insertions(+), 48 deletions(-)

diff --git a/public/map/widgets/supervisoryMap/SupervisoryMap.js b/public/map/widgets/supervisoryMap/SupervisoryMap.js
index ce39baa..6d5fb1f 100644
--- a/public/map/widgets/supervisoryMap/SupervisoryMap.js
+++ b/public/map/widgets/supervisoryMap/SupervisoryMap.js
@@ -260,6 +260,7 @@
       var mySelf = this;
       objThis._map.addLayer(objThis._siteLayer);
       var that = this;
+      // console.log(mySelf.clusterLayer)
       that.getEquipmentTable($('.analysis-container-equipment').find('.tbody tbody'), '');
       // 顶部tab得切换事件
       $('.analysis-and-judgment-tab li').click(function () {
@@ -462,13 +463,13 @@
 
         // console.log(that.clusterLayer, that._map, 6)
         // console.log(id, 'id');
-        // console.log(that.clusterLayer.indexs);
+        // console.log(that.clusterLayer);
         var Tattributes = null
           , ds = that.clusterLayer.allData;
         for (var key in ds) {
-          if (ds[key].id == id){
+          if (ds[key].id == id) {
             Tattributes = ds[key];
-          } 
+          }
         }
         if (mySelf.onceTimeMethod == null) {//防抖.限制时间内点击次数,否则会造成不能正确销毁前一个弹窗
           var evtdata = {};
@@ -491,47 +492,47 @@
       // $('.analysis-container-equipment .analysis-table-content .tbody').off('click', '.location').on('click', '.location', function (event) {
       //   event.stopPropagation();
       // })
-      $('.analysis-container-equipment .analysis-table-content .tbody').off('click', '.location input').on('click', '.location input', function (event) {
-        event.stopPropagation();
-        var lgtd = Number($(this).attr('lgtd'));
-        var lttd = Number($(this).attr('lttd'));
-        var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
-        that._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
+      // $('.analysis-container-equipment .analysis-table-content .tbody').off('click', '.location input').on('click', '.location input', function (event) {
+      //   event.stopPropagation();
+      //   var lgtd = Number($(this).attr('lgtd'));
+      //   var lttd = Number($(this).attr('lttd'));
+      //   var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
+      //   that._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
 
-        var y = +window.innerHeight / 2 + 200;
-        var x = (+window.innerWidth - 360) / 2 + 360 + 70;
-        // document.elementFromPoint(x, y).click();
-        // console.log(x, y)
+      //   var y = +window.innerHeight / 2 + 200;
+      //   var x = (+window.innerWidth - 360) / 2 + 360 + 70;
+      //   // document.elementFromPoint(x, y).click();
+      //   // console.log(x, y)
 
-        // var a = document.elementFromPoint(21, 122);
-        // console.log(a);
+      //   // var a = document.elementFromPoint(21, 122);
+      //   // console.log(a);
 
-        // console.log(that.clusterLayer, that._map, 6)
-        // console.log(id, 'id');
-        // console.log(that.clusterLayer.indexs);
-        var Tattributes = null
-          , ds = that.clusterLayer.allData;
-        for (var key in ds) {
-          if (ds[key].id == id){
-            Tattributes = ds[key];
-          } 
-        }
-        if (mySelf.onceTimeMethod == null) {//防抖.限制时间内点击次数,否则会造成不能正确销毁前一个弹窗
-          var evtdata = {};
-          evtdata = {
-            graphic: {
-              attributes: Tattributes,
-            },
-            screenX: x,
-            screenY: y,
-          }
-          that.clusterLayer._clickOpenOnclick(evtdata, '控制端', that.clusterLayer.indexs);
-          mySelf.onceTimeMethod = setTimeout(() => {
-            mySelf.onceTimeMethod = null;
-          }, mySelf.onceTime);
-        } else {
-        };
-      })
+      //   // console.log(that.clusterLayer, that._map, 6)
+      //   // console.log(id, 'id');
+      //   // console.log(that.clusterLayer.indexs);
+      //   var Tattributes = null
+      //     , ds = that.clusterLayer.allData;
+      //   for (var key in ds) {
+      //     if (ds[key].id == id) {
+      //       Tattributes = ds[key];
+      //     }
+      //   }
+      //   if (mySelf.onceTimeMethod == null) {//防抖.限制时间内点击次数,否则会造成不能正确销毁前一个弹窗
+      //     var evtdata = {};
+      //     evtdata = {
+      //       graphic: {
+      //         attributes: Tattributes,
+      //       },
+      //       screenX: x,
+      //       screenY: y,
+      //     }
+      //     that.clusterLayer._clickOpenOnclick(evtdata, '控制端', that.clusterLayer.indexs);
+      //     mySelf.onceTimeMethod = setTimeout(() => {
+      //       mySelf.onceTimeMethod = null;
+      //     }, mySelf.onceTime);
+      //   } else {
+      //   };
+      // })
       // 警情列表中得热力图是否选中事件
       $('#policeHeatMap').click(function () {
         that.checkBoxSelect(this);
@@ -797,6 +798,7 @@
     getEquipmentTable: function (dom, deviceType) {
       dom.empty();
       var that = this;
+      // console.log(that.clusterLayer)
       // console.log(dom, deviceType);
       // dom.append(deviceType);
       // var str = "<td class='locationb'> <input type='button' value='定位'" + ' lgtd=' + 114.9285 + ' lttd=' + 25.850693 + "></td>"
@@ -810,35 +812,89 @@
       // dom.append(str)
 
       $.ajax({
-        url: '/api/blade-jfpts/equipment/equipment/selectList?deviceType=' + deviceType,
+        url: '/api/blade-jfpts/equipment/equipment/listAll?deviceType=' + deviceType,
         type: 'GET',
         dataType: 'JSON',
         success: function (data) {
-          var result = data.data;
-          // console.log(data)
+          var oldData = data.data
+          var result = [];
+          // console.log(result)
           var str = '';
           that.entitysData = [];
           that.analysisAddEntitys.clear();
+
+
+          if(deviceType == ''){
+            result = oldData;
+          }else if(deviceType == '在线'){
+            for (var key in oldData){
+              // console.log(oldData[key]);
+              if(oldData[key].state == '' && oldData[key].jtype != 1 && oldData[key].onlineStatus == 1){
+                result.push(oldData[key]);
+              }
+            }
+          }else if(deviceType == '离线'){
+            for (var key in oldData){
+              // console.log(oldData[key]);
+              if(oldData[key].state == '' && oldData[key].jtype != 1 && oldData[key].onlineStatus != 1){
+                result.push(oldData[key]);
+              }
+            }
+          }else if(deviceType == '警报'){
+            for (var key in oldData){
+              // console.log(oldData[key]);
+              if(oldData[key].state == '' && oldData[key].jtype == 1){
+                result.push(oldData[key]);
+              }
+            }
+          }else if(deviceType == '故障'){
+            for (var key in oldData){
+              // console.log(oldData[key]);
+              if(oldData[key].state != ''){
+                result.push(oldData[key]);
+              }
+            }
+          }
+
+
           for (var a, i = 0; i < result.length; i++) {
             that.createEntitysAnalysis(that.analysisAddEntitys, that.entitysData, '设备信息', {
               lgtd: result[i].jd,
               lttd: result[i].wd,
               id: result[i].id
             }, result[i].jd, result[i].wd, './images/ceshi.png');
+            var stares = '';
 
             a = Number(i) + 1;
             str += "<tr term-listid=" + result[i].id + ">";
             str += '<td>' + a + '</td>';
             str += '<td title=' + result[i].deviceName + '>' + result[i].deviceName + '</td>';
-            str += '<td title=' + result[i].deviceType + '>' + result[i].deviceType + '</td>';
+            // str += '<td title=' + result[i].deviceType + '>' + result[i].deviceType + '</td>';
             str += '<td>' + result[i].deviceNumber + '</td>';
-            str += "<td class='location'> <input type='button' value='定位'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+            // console.log(result[i].state);
+
+            
+            if (result[i].state != '') {
+              stares = '故障';
+              str += "<td class='location'> <input style='background-image:linear-gradient(to right, #F49966 , #F49966' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+            } else {
+              if (result[i].jtype != 1) {
+                if (result[i].onlineStatus == 1) {//el-tabs__active-bar
+                  stares = '在线';
+                  str += "<td class='location'> <input style='background-image:linear-gradient(to right, #32C1A2 , #32C1A2' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+                } else {
+                  stares = '离线';
+                  str += "<td class='location'> <input style='background-image:linear-gradient(to right, #CDCDCD , #CDCDCD' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+                }
+              } else {
+                stares = '警报';
+                str += "<td class='location'> <input style='background-image:linear-gradient(to right, #F35B5B , #F35B5B' type='button' value=" + stares + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
+              }
+            }
             str += '</tr>';
             dom.append(str);
             str = '';
           }
-
-
         }
       })
     },

--
Gitblit v1.9.3