JX.LI 2 年之前
父节点
当前提交
8a648092d1
共有 2 个文件被更改,包括 108 次插入96 次删除
  1. 14 2
      src/api/monitor.js
  2. 94 94
      src/views/monitor.vue

+ 14 - 2
src/api/monitor.js

@@ -75,8 +75,14 @@ export function getSensorListByDeptId(deptId) {
 }
 //根据部门id查询部门及部门以下的数据,没有则默认查询所有
 export function getDlblistBydeptId(deptId) {
+   let url = "";
+    if(deptId!=null){
+      url= '/center-fire/VisuForestMonitorCenterController/getDlblistBydeptId?deptId=' + deptId;
+    }else{
+      url= '/center-fire/VisuForestMonitorCenterController/getDlblistBydeptId';
+    }
   return request({
-    url: '/center-fire/VisuForestMonitorCenterController/getDlblistBydeptId?deptId=' + deptId,
+    url: url,
     method: 'get',
   })
 }
@@ -84,8 +90,14 @@ export function getDlblistBydeptId(deptId) {
 
 //根据部门id查询部门及部门以下的数据,没有则默认查询所有
 export function getMonitorDeviceAndDataList(deptId) {
+    let url = "";
+    if(deptId!=null){
+      url= '/center-monitor/device/getMonitorDeviceAndDataList?deptId=' + deptId;
+    }else{
+      url= '/center-monitor/device/getMonitorDeviceAndDataList';
+    }
   return request({
-    url: '/center-monitor/device/getMonitorDeviceAndDataList?deptId=' + deptId,
+    url: url,
     method: 'get',
   })
 }

+ 94 - 94
src/views/monitor.vue

@@ -50,8 +50,8 @@
                 <div
                   class="icon-con w-33 m-btm-no"
                   :class="{ on: onLa }"
-                  @click="laClick"
                 >
+                <!-- @click="laClick" -->
                   <div class="icon icon-dot"></div>
                   <div class="icon-text">
                     <h6>{{ loudspeakerNum }}</h6>
@@ -270,7 +270,7 @@ export default {
     // this.cgqTimer = setInterval(() => {
     //   this.getMonitorDeviceAndDataList()
     // }, 5 * 60 * 1000)
-    this.getDlblistBydeptIds(-1);
+    // this.getDlblistBydeptIds(-1);
     this.selectDeviceType(-1);
   },
   beforeDestroy() {
@@ -397,7 +397,7 @@ export default {
     //传感器2
     getMonitorDeviceAndDataLists() {
       let that = this;
-      getMonitorDeviceAndDataList(this.deptId).then((res) => {
+      getMonitorDeviceAndDataList().then((res) => {
         that.sensorNum = res.data.length;
       });
     },
@@ -479,7 +479,7 @@ export default {
       } else if (that.localMark == "chuan") {
         that.getMonitorDeviceAndDataList();
       } else if (that.localMark == "la") {
-        that.getDlblistBydeptId();
+        // that.getDlblistBydeptId();
       }
     },
     sheClick() {
@@ -507,103 +507,103 @@ export default {
       this.onChuan = true;
       this.localMark = "chuan";
       this.placeholderMsg = "请输入传感器名称";
-      this.deptId = Cookies.get("deptId");
+      this.deptId = null;
       this.getMonitorDeviceAndDataList();
       clearInterval(this.cgqTimer);
       this.cgqTimer = setInterval(() => {
         this.getMonitorDeviceAndDataList();
       }, 20 * 1000);
     },
-    // 云广播
-    getDlblistBydeptId(index) {
-      let that = this;
-      let markersList = [];
-      getDlblistBydeptId(that.deptId)
-        .then(function (res) {
-          that.loudspeakerNum = res.data.length;
-          that.visuForestCloudCameraBOListSearch = [];
-          if (res.data != null && res.data.length > 0) {
-            for (let j = 0; j < res.data.length; j++) {
-              let dat = {
-                cameraName: res.data[j].name,
-                longitude: res.data[j].longitude,
-                latitude: res.data[j].latitude,
-              };
-              that.visuForestCloudCameraBOListSearch.push(dat);
-            }
-            for (let i = 0; i < res.data.length; i++) {
-              let markersMap = {
-                lng: 124.59,
-                lat: 43.02,
-                icon: "marker",
-                bindPopupHtml:
-                  '<div class="map-tip">' +
-                  "<span>" +
-                  '                  <div class="d-l-con">' +
-                  '                  <div class="d-l-l-text">' +
-                  "                  <h4>名称:" +
-                  (res.data[i].name ? res.data[i].name : "") +
-                  "</h4>" +
-                  "                </div>" +
-                  "                </div>" +
-                  "                </span>" +
-                  "<span>" +
-                  '                  <div class="d-l-con">' +
-                  '                  <div class="d-l-l-text">' +
-                  "                  <h4>位置:" +
-                  (res.data[i].position ? res.data[i].position : "") +
-                  "</h4>" +
-                  "                </div>" +
-                  "                </div>" +
-                  "                </span>" +
-                  "<span>" +
-                  '                  <div class="d-l-con">' +
-                  '                  <div class="d-l-l-text">' +
-                  "                  <h4>备注:" +
-                  (res.data[i].remark ? res.data[i].remark : "") +
-                  "</h4>" +
-                  "                </div>" +
-                  "                </div>" +
-                  "                </span>" +
-                  "<span>" +
-                  '                  <div class="d-l-con">' +
-                  '                  <div class="d-l-l-text">' +
-                  "                  <h4>经纬度:" +
-                  res.data[i].longitude +
-                  "," +
-                  res.data[i].latitude +
-                  "</h4>" +
-                  "                </div>" +
-                  "                </div>" +
-                  "                </span>" +
-                  "</div>",
-                click: "jump",
-                parameter: "",
-                keepBindPopup: false,
-                isAggregation: false,
-              };
-              markersMap.icon = "big-horn";
+    // // 云广播
+    // getDlblistBydeptId(index) {
+    //   let that = this;
+    //   let markersList = [];
+    //   getDlblistBydeptId(that.deptId)
+    //     .then(function (res) {
+    //       that.loudspeakerNum = res.data.length;
+    //       that.visuForestCloudCameraBOListSearch = [];
+    //       if (res.data != null && res.data.length > 0) {
+    //         for (let j = 0; j < res.data.length; j++) {
+    //           let dat = {
+    //             cameraName: res.data[j].name,
+    //             longitude: res.data[j].longitude,
+    //             latitude: res.data[j].latitude,
+    //           };
+    //           that.visuForestCloudCameraBOListSearch.push(dat);
+    //         }
+    //         for (let i = 0; i < res.data.length; i++) {
+    //           let markersMap = {
+    //             lng: 124.59,
+    //             lat: 43.02,
+    //             icon: "marker",
+    //             bindPopupHtml:
+    //               '<div class="map-tip">' +
+    //               "<span>" +
+    //               '                  <div class="d-l-con">' +
+    //               '                  <div class="d-l-l-text">' +
+    //               "                  <h4>名称:" +
+    //               (res.data[i].name ? res.data[i].name : "") +
+    //               "</h4>" +
+    //               "                </div>" +
+    //               "                </div>" +
+    //               "                </span>" +
+    //               "<span>" +
+    //               '                  <div class="d-l-con">' +
+    //               '                  <div class="d-l-l-text">' +
+    //               "                  <h4>位置:" +
+    //               (res.data[i].position ? res.data[i].position : "") +
+    //               "</h4>" +
+    //               "                </div>" +
+    //               "                </div>" +
+    //               "                </span>" +
+    //               "<span>" +
+    //               '                  <div class="d-l-con">' +
+    //               '                  <div class="d-l-l-text">' +
+    //               "                  <h4>备注:" +
+    //               (res.data[i].remark ? res.data[i].remark : "") +
+    //               "</h4>" +
+    //               "                </div>" +
+    //               "                </div>" +
+    //               "                </span>" +
+    //               "<span>" +
+    //               '                  <div class="d-l-con">' +
+    //               '                  <div class="d-l-l-text">' +
+    //               "                  <h4>经纬度:" +
+    //               res.data[i].longitude +
+    //               "," +
+    //               res.data[i].latitude +
+    //               "</h4>" +
+    //               "                </div>" +
+    //               "                </div>" +
+    //               "                </span>" +
+    //               "</div>",
+    //             click: "jump",
+    //             parameter: "",
+    //             keepBindPopup: false,
+    //             isAggregation: false,
+    //           };
+    //           markersMap.icon = "big-horn";
 
-              markersMap.lng = res.data[i].longitude;
-              markersMap.lat = res.data[i].latitude;
-              markersList.push(markersMap);
-            }
-            setTimeout(() => {
-              that.$refs.supermap.clearM();
-              that.$refs.supermap.clearMRadius();
-              that.$refs.supermap.setMarkers(markersList);
-            }, 2000);
-          } else {
-            setTimeout(() => {
-              that.$refs.supermap.clearM();
-              that.$refs.supermap.clearMRadius();
-            }, 2000);
-          }
-        })
-        .catch(function (error) {
-          console.error(error);
-        });
-    },
+    //           markersMap.lng = res.data[i].longitude;
+    //           markersMap.lat = res.data[i].latitude;
+    //           markersList.push(markersMap);
+    //         }
+    //         setTimeout(() => {
+    //           that.$refs.supermap.clearM();
+    //           that.$refs.supermap.clearMRadius();
+    //           that.$refs.supermap.setMarkers(markersList);
+    //         }, 2000);
+    //       } else {
+    //         setTimeout(() => {
+    //           that.$refs.supermap.clearM();
+    //           that.$refs.supermap.clearMRadius();
+    //         }, 2000);
+    //       }
+    //     })
+    //     .catch(function (error) {
+    //       console.error(error);
+    //     });
+    // },
     jump() {
       // 跳转云广播页面
       window.open("https://sts.sty1818.com");