xsh 3 éve
szülő
commit
7638af5c84
2 módosított fájl, 24 hozzáadás és 4 törlés
  1. 9 0
      src/utils/api.js
  2. 15 4
      src/views/Alarm/Alarm.vue

+ 9 - 0
src/utils/api.js

@@ -298,3 +298,12 @@ export function getXFarm(data) {
   })
 }
 
+/**  设备信息 **/
+export function getDevice(data) {
+  return axios({
+    url: '/admin/farm/device/getCountDeviceFailureRate',
+    method: 'get',
+    params: data
+  })
+}
+

+ 15 - 4
src/views/Alarm/Alarm.vue

@@ -207,7 +207,7 @@ import AlarmBar from "@/views/Alarm/chart/AlarmBar";
 // import ChartBar from "@/views/BioSafety/chart/ChartBar";
 import { swiper, swiperSlide } from 'vue-awesome-swiper'
 import 'swiper/css/swiper.css'
-import {getAlarmList, getWeekInfo, getPersonList, getFaceToken, getAlarmRate, getCountByDay} from "@/utils/api";
+import {getAlarmList, getWeekInfo, getPersonList, getFaceToken, getAlarmRate, getCountByDay, getDevice} from "@/utils/api";
 import img from '@/assets/Alarm/111.png';
 import {timeDate} from "@/utils";
 
@@ -274,15 +274,15 @@ export default {
       devList: [
         {
           name: '设备总数',
-          value: '100'
+          value: '0'
         },
         {
           name: '异常设备',
-          value: '20'
+          value: '0'
         },
         {
           name: '设备异常率',
-          value: '20%'
+          value: '0'
         },
       ]
     }
@@ -470,6 +470,17 @@ export default {
           this.pieLoading = false;
         }
       })
+      getDevice({bit: 2}).then(res => {
+        if(res.code === 10000) {
+          this.devList[0].value = res.data.total;
+          this.devList[1].value = res.data.num;
+          this.devList[2].value = res.data.rate;
+        } else {
+          this.devList[0].value = "0";
+          this.devList[1].value = "0";
+          this.devList[2].value = "0";
+        }
+      })
     },
     // 打开img
     open(item) {