瀏覽代碼

修改bug

wang_xy 2 年之前
父節點
當前提交
57e4895810
共有 4 個文件被更改,包括 126 次插入113 次删除
  1. 14 2
      src/api/monitor.js
  2. 3 4
      src/views/bigdata/chart-fullTimeStation.vue
  3. 1 1
      src/views/leader.vue
  4. 108 106
      src/views/monitor.vue

+ 14 - 2
src/api/monitor.js

@@ -60,16 +60,28 @@ export function getSensorListByDeptId(deptId) {
 }
 //根据部门id查询部门及部门以下的数据,没有则默认查询所有
 export function getDlblistBydeptId(deptId) {
+  let url = "";
+  if(deptId!=null){
+    url= '/center-firecontrol/VisuForestMonitorCenterController/getDlblistBydeptId?deptId=' + deptId;
+  }else{
+    url= '/center-firecontrol/VisuForestMonitorCenterController/getDlblistBydeptId';
+  }
   return request({
-    url: '/center-firecontrol/VisuForestMonitorCenterController/getDlblistBydeptId?deptId=' + deptId,
+    url: url,
     method: 'get',
   })
 }
 
 //根据部门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',
   })
 }

+ 3 - 4
src/views/bigdata/chart-fullTimeStation.vue

@@ -50,8 +50,7 @@
           var max = 0,
             len = arr.length;
           for (var i = 0; i < len; i++) {
-            var item = arr[i][key];
-            if (max < item) max = item;
+            max += arr[i][key];
           }
           return max;
         }
@@ -73,10 +72,10 @@
         //   });
         // }
 
-        var max = getMax(arr, 'amount'),
+        var max = getMax(arr, 'value'),
           angleAxisData = getValArr(arr, 'name');
         $.each(arr, function (i, e) {
-          e.value = (e.amount / max * 100).toFixed(2);
+          e.value = (e.value / max * 100).toFixed(2);
         });
         var option = {
           backgroundColor: '#222',

+ 1 - 1
src/views/leader.vue

@@ -105,7 +105,7 @@
               style="width: 100%; margin-top: 0.4rem"
             />
             <div class="this-title">
-              <span>巡任务</span>
+              <span>巡任务</span>
               <dv-decoration-3
                 style="width: 150px; height: 15px; margin-right: 1rem"
               />

+ 108 - 106
src/views/monitor.vue

@@ -50,8 +50,9 @@
                 <div
                   class="icon-con w-33 m-btm-no"
                   :class="{ on: onLa }"
-                  @click="laClick"
                 >
+                  <!--@click="laClick"-->
+                <!--&gt;-->
                   <div class="icon icon-dot"></div>
                   <div class="icon-text">
                     <h6>{{ loudspeakerNum }}</h6>
@@ -266,7 +267,7 @@ export default {
     this.getTreeselect();
     this.deptId = Cookies.get("deptId");
     this.getMonitorDeviceAndDataLists();
-    this.getDlblistBydeptIds();
+    // this.getDlblistBydeptIds();
     this.selectDeviceType(-1);
     // this.showTVWall();
   },
@@ -473,7 +474,7 @@ export default {
       } else if (that.localMark == "chuan") {
         that.getMonitorDeviceAndDataList();
       } else if (that.localMark == "la") {
-        that.getDlblistBydeptId();
+        // that.getDlblistBydeptId();
       }
     },
     sheClick() {
@@ -501,7 +502,7 @@ 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(() => {
@@ -511,116 +512,117 @@ export default {
     //传感器2
     getMonitorDeviceAndDataLists() {
       let that = this;
-      getMonitorDeviceAndDataList(this.deptId).then((res) => {
+      getMonitorDeviceAndDataList().then((res) => {
         that.sensorNum = res.data.length;
       });
     },
     // 云广播
-    getDlblistBydeptId() {
-      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: "",
-                name: "",
-                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);
-        });
-    },
-    getDlblistBydeptIds() {
-      let that = this;
-
-      getDlblistBydeptId(that.deptId)
-        .then(function (res) {
-          that.loudspeakerNum = res.data.length;
-        })
-        .catch(function (error) {
-          console.error(error);
-        });
-    },
+    // getDlblistBydeptId() {
+    //   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: "",
+    //             name: "",
+    //             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);
+    //     });
+    // },
+    // getDlblistBydeptIds() {
+    //   let that = this;
+    //
+    //   getDlblistBydeptId()
+    //     .then(function (res) {
+    //       that.loudspeakerNum = res.data.length;
+    //     })
+    //     .catch(function (error) {
+    //       console.error(error);
+    //     });
+    // },
 
     getMonitorDeviceAndDataList() {
       let list = [];
       let markersList = [];
+
       getMonitorDeviceAndDataList(this.deptId).then((res) => {
         this.visuForestCloudCameraBOListSearch = [];
         list = res.data;