zhangsijie 1 год назад
Родитель
Сommit
b17b3785f0

+ 11 - 4
minggao/src/page/home/newHome/deviceHome.vue

@@ -3,11 +3,11 @@
  * @Autor: lin
  * @Date: 2024-04-09 14:26:43
  * @LastEditors: lin
- * @LastEditTime: 2024-04-20 09:37:36
+ * @LastEditTime: 2024-04-20 09:45:41
 -->
 <template>
-  <div class="bigBg">
-    <el-carousel indicator-position="outside" :autoplay="false" trigger="click" class="deviceBox" :interval="10000"
+  <div class="bigBg" v-loading="loading">
+    <el-carousel indicator-position="outside" trigger="click" class="deviceBox" :interval="10000"
       @change="changeSlider">
       <el-carousel-item v-for="(item, index) in deviceList" :key="item.id">
           <div class="flexBox topBox">
@@ -173,6 +173,7 @@ export default {
   },
   data() {
     return {
+      loading: true,
       deviceList: [],
       pestTypeList: [], // 害虫类别数组 3D 用
       pestTypeBar: [], // 害虫类别数组 柱状图用
@@ -181,7 +182,8 @@ export default {
       pestImgList: [], //设备图片
       videoList: [], //监控列表 跳出页面要停止
       pestLineCheck: [],
-      activeIndex: 0
+      activeIndex: 0,
+      timmer:null
     };
   },
   computed: {
@@ -197,6 +199,7 @@ export default {
     this.videoList.forEach(item => {
       item.stop()
     })
+    clearInterval(this.timmer);
   },
   methods: {
     changeSlider(index) {
@@ -242,6 +245,7 @@ export default {
         })
         this.setLineOption(pestDateChar, [pestDateCharInfo.day.pestName[0]], xData, [yData], [['#0066ff59', '#0066ff00']], ['#1588F2'], true)
       }
+      this.loading = false;
     },
     /**
      * @description: 虫害折线图 切换年月日 由于虫子不一样 所以会默认展示第一种
@@ -330,6 +334,9 @@ export default {
           // 默认渲染第一页
           this.initCharByIndex(0, 'tem');
         })
+        this.timmer = setInterval(() => {
+          this.$router.push('/newHome/home');
+        }, this.deviceList.length * 10000)
       })
     },
     // 折线图带渐变配置

+ 22 - 6
minggao/src/page/home/newHome/newHome.vue

@@ -3,7 +3,7 @@
  * @Autor: lin
  * @Date: 2024-04-09 14:26:07
  * @LastEditors: lin
- * @LastEditTime: 2024-04-17 15:36:56
+ * @LastEditTime: 2024-04-20 10:28:00
 -->
 <template>
   <div class="box">
@@ -63,11 +63,11 @@
         </div>
         <div class="tipsBox">
           <div>
-            <span>77</span>
+            <span>{{ warningTaskInfo.month_warning_count }}</span>
             <span>本月预警数量</span>
           </div>
           <div>
-            <span>48664</span>
+            <span>{{ warningTaskInfo.year_warning_count }}</span>
             <span>全年预警数量</span>
           </div>
         </div>
@@ -108,11 +108,11 @@
         </div>
         <div class="tipsBox rightTips">
           <div>
-            <span>77</span>
+            <span>{{ warningTaskInfo.task }}</span>
             <span>今日监督任务</span>
           </div>
           <div>
-            <span>48664</span>
+            <span>{{ warningTaskInfo.kong }}</span>
             <span>今日监测任务</span>
           </div>
         </div>
@@ -372,6 +372,7 @@ export default {
         month_count: 0,
         year_count: 0
       }, // 告警详情
+      warningTaskInfo:{}
     };
   },
   computed: {
@@ -394,6 +395,7 @@ export default {
     this.getTaskInfo(this.taskYear);
     this.getWatchInfo();
     this.getWarningList();
+    this.getTaskWarningInfo();
   },
   watch: {
 
@@ -418,6 +420,20 @@ export default {
         })
       }
     },
+    // 获取告警个数任务监督个数表
+    getTaskWarningInfo() {
+      this.$axios({
+        method: 'POST',
+        url: '/api/api_gateway?method=data_report.screen.Warning_statistics',
+        data: this.qs.stringify({})
+      }).then(res => {
+        if (!res.data.data) {
+          this.$message.error('网络连接出错或服务报错,请刷新页面重试');
+          return
+        }
+        this.warningTaskInfo = res.data.data;
+      })
+    },
     // 获取告警列表
     getWarningList() {
       this.$axios({
@@ -900,7 +916,7 @@ export default {
       }
 
       // 启动水波纹动画
-      // addRippleAnimation();
+      addRippleAnimation();
     },
     initMap() {
       let _this = this;