zengh
2021-04-27 d74734fd32b892c4e71dccc0f85db7f3e9d36f18
public/map/widgets/supervisoryMap/SupervisoryMap.js
@@ -205,6 +205,7 @@
        dataType: 'JSON',
        success: function (res) {
          var datas = res.data;
          console.log(datas)
          var heatmapRenderer = null;
          that.entityData = [];
          for (var i = 0; i < datas.length; i++) {
@@ -215,7 +216,8 @@
              lttd: Number(datas[i].wd)
            })
          }
          that.flareClusterLayer(datas);
          // that.flareClusterLayer(datas);
          console.log(datas)
          that.heatmapfeatureLayer = that.heatmFeaLayers();
          that._map.addLayer(that.heatmapfeatureLayer);
          // that.checkBoxSelect();//左侧控制热力图重复
@@ -256,7 +258,7 @@
          });
        });
        that.getArea($('#policeArea'));
        that.getPoliceTableAnalysis($('.analysis-container-police').find('.tbody tbody'), time.tomorrow, time.current, '', '');
        // that.getPoliceTableAnalysis($('.analysis-container-police').find('.tbody tbody'), time.tomorrow, time.current, '', '');
        that.clickHand();
      }
@@ -267,7 +269,7 @@
      objThis._map.addLayer(objThis._siteLayer);
      var that = this;
      // console.log(mySelf.clusterLayer)
      that.getEquipmentTable($('.analysis-container-equipment').find('.tbody tbody'), '');
      that.getEquipmentTable($('.analysis-container-equipment').find('.tbody tbody'), '','once');
      // 顶部tab得切换事件
      $('.analysis-and-judgment-tab li').click(function () {
        // if (that.tabIndex == $(this).index()) return;
@@ -364,7 +366,7 @@
            break;
          }
        }
        console.log(b, id);
        // console.log(b, id);
        event.stopPropagation();
        var winSize = [+window.innerHeight / 2 - 242 + 'px', +window.innerWidth - 380 + 'px'];
@@ -374,8 +376,10 @@
        } else {
          // console.log('有地图经纬度')
          b.haveJW = '有地图经纬度';
          var lgtd = Number($(this).find('input').attr('lgtd'));
          var lttd = Number($(this).find('input').attr('lttd'));
          // var lgtd = Number($(this).find('input').attr('lgtd'));
          // var lttd = Number($(this).find('input').attr('lttd'));
          var lgtd = Number(b.jd);
          var lttd = Number(b.wd);
          // console.log($(this).find('input').attr('lttd'));
          var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
          that._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
@@ -392,7 +396,7 @@
              extend: 'myskin/FlareClusterLayer.css'
            });
            that.layuiLayer.close(that.layuiLayer.index);
            that.layuiLayer.open({
            that.layuiLayer.open({
              title: '',
              type: 2,
              shadeClose: true,
@@ -447,6 +451,23 @@
            break;
          }
        }
        event.stopPropagation();
        if (b.jd == '' || b.wd == '') {
          // console.log('无地图经纬度');
          b.haveJW = '无地图经纬度';
        } else {
          // console.log('有地图经纬度')
          b.haveJW = '有地图经纬度';
          var lgtd = Number(b.jd);
          var lttd = Number(b.wd);
          // console.log($(this).find('input').attr('lttd'));
          var position = new esri.geometry.Point(lgtd, lttd, new esri.SpatialReference({ wkid: 4326 }));//根据输入坐标信息找地图上的点
          that._map.centerAndZoom(position, 18);//缩放,10是缩放级别,可以自定义,数值越大缩放越大
        }
        console.log(b, id);
        var winSize = [+window.innerHeight / 2 - 242 + 'px', +window.innerWidth - 380 + 'px'];
        var as = b;
@@ -459,7 +480,7 @@
              extend: 'myskin/FlareClusterLayer.css'
            });
            that.layuiLayer.close(that.layuiLayer.index);
            that.layuiLayer.open({
            that.layuiLayer.open({
              title: '',
              type: 2,
              shadeClose: true,
@@ -513,19 +534,6 @@
        //   });
        // })
        event.stopPropagation();
        if (b.jd == '' || b.wd == '') {
          // console.log('无地图经纬度');
          b.haveJW = '无地图经纬度';
        } else {
          // console.log('有地图经纬度')
          b.haveJW = '有地图经纬度';
          var lgtd = Number($(this).find('input').attr('lgtd'));
          var lttd = Number($(this).find('input').attr('lttd'));
          // console.log($(this).find('input').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;
@@ -844,6 +852,7 @@
          var oldData = data.data.records
          var result = oldData;
          that.Pdata = oldData;
          console.log(that.Pdata);//警情筛选
          var str = '';
          that.entitysData = [];
          that.analysisAddEntitys.clear();
@@ -871,7 +880,7 @@
            str += '<td title=' + result[i].waringType + '>' + result[i].waringType + '</td>';
            str += '<td title=' + result[i].alarmPeople + '>' + result[i].alarmPeople + '</td>';
            str += "<td><a href='javascript:;' title=" + time + ">" + y + ' ' + h + "</a></td>";
            str += "<td class='location' style='display: none'> <input type='button' value='定位'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
            // str += "<td class='location' style='display: none'> <input type='button' value='定位'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
            if (result[i].jtype == 0) {
              str += "<td class='location'> <input style='color:#000000;background-color:#ffffff;background-image:linear-gradient(to right, #fffff , #fffff' type='button' value='未处理'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
            } else {
@@ -935,17 +944,31 @@
      dom.empty();
      var that = this;
      $.ajax({
        url: '/api/blade-jfpts/suser/suser/selectList?type=' + type + '&dj=' + dj,
        type: 'GET',
        // url: '/api/blade-system/tenant/page',
        // type: 'GET',
        url: '/api/blade-system/tenant/selectListTe',
        type: 'POST',
        dataType: 'JSON',
        success: function (data) {
          // var result = data.data;
          var oldData = data.data
          var oldData = data.data;
          // console.log(oldData)
          var result = oldData;
          that.Ydata = oldData;
          var str = '';
          that.entitysData = [];
          that.analysisAddEntitys.clear();
          var createD = (id, a, name, dj, type) => {
            str += "<tr term-list=" + id + ">";
            str += '<td>' + a + '</td>';
            str += '<td>' + name + '</td>';
            str += '<td>' + dj + '</td>';
            str += '<td>' + type + '</td>';
            // str += "<td class='location' style='display: none'> <input type='button' value='定位'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
            str += '</tr>';
            dom.append(str);
            str = '';
          }
          for (var a, i = 0; i < result.length; i++) {
            that.createEntitysAnalysis(that.analysisAddEntitys, that.entitysData, '业主信息', {
@@ -953,24 +976,27 @@
              lttd: result[i].wd,
              id: result[i].id
            }, result[i].jd, result[i].wd, './images/owner.png');
            a = Number(i) + 1;
            str += "<tr term-list=" + result[i].id + ">";
            str += '<td>' + a + '</td>';
            str += '<td>' + result[i].type + '</td>';
            str += '<td>' + result[i].dj + '</td>';
            str += '<td>' + result[i].yname + '</td>';
            str += "<td class='location' style='display: none'> <input type='button' value='定位'" + ' lgtd=' + result[i].jd + ' lttd=' + result[i].wd + "></td>";
            str += '</tr>';
            dom.append(str);
            str = '';
            if (result[i].type === "0") {
              createD(result[i].id, a, result[i].tenant_name, result[i].dj, '医院')
            } else if (result[i].type === "1") {
              createD(result[i].id, a, result[i].tenant_name, result[i].nature, '学校')
            } else if (result[i].type === "2") {
              createD(result[i].id, a, result[i].tenant_name, result[i].housetype, '小区')
            } else {
              createD(result[i].id, a, result[i].tenant_name, result[i].dj, '其他')
            }
          }
          console.log(that.Ydata);//业主筛选
        }
      })
    },
    // 获取设备信息列表
    getEquipmentTable: function (dom, deviceType) {
    getEquipmentTable: function (dom, deviceType,once) {
      dom.empty();
      var that = this;
      // console.log(that.clusterLayer)
@@ -994,7 +1020,7 @@
          var oldData = data.data;
          var result = [];
          that.Sdata = oldData;
          // console.log(result)
          var str = '';
          that.entitysData = [];
          that.analysisAddEntitys.clear();
@@ -1031,7 +1057,18 @@
              }
            }
          }
          if(once != 'once'){
            for (var i = 0; i < result.length; i++) {
              result[i].x = Number(result[i].jd);
              result[i].y = Number(result[i].wd);
              that.entityData.push({
                lgtd: Number(result[i].jd),
                lttd: Number(result[i].wd)
              })
            }
            console.log(result);//设备筛选
          that.flareClusterLayer(result);
          }
          for (var a, i = 0; i < result.length; i++) {
            that.createEntitysAnalysis(that.analysisAddEntitys, that.entitysData, '设备信息', {