Ver Fonte

fix: 测流结束后,界面不刷新

hum tan há 1 ano atrás
pai
commit
ab451e8e70

+ 11 - 0
ruoyi-ui/src/views/analysis/task/realtime/realtime.vue

@@ -48,6 +48,7 @@ import {
   listMeasureLine,
   listWaterLevel,
   getPointConfigByPlanid,
+  getAchievement,
 } from "@/api/analysis/achievement";
 
 export default {
@@ -127,6 +128,14 @@ export default {
       getPointConfigByPlanid(this.siteId, this.task.planid).then((res) => {
         this.positions = JSON.parse(res.data.positions || '[]');
       })
+    },
+    refreshTask() {
+      getAchievement(this.task.taskid).then((res) => {
+        if (res.data.status === 2) {
+          this.$message.success('本次测流已完成');
+          this.$emit('refresh');
+        }
+      })
     }
   },
   mounted() {
@@ -141,6 +150,7 @@ export default {
     this.timer4 = setInterval(() => this.loadSiteRealTime(), 5e3)
     this.loadWaterLevel();
     this.timer5 = setInterval(() => this.loadWaterLevel(), 5e3)
+    this.timer6 = setInterval(() => this.refreshTask(), 5e3)
   },
   beforeDestroy() {
     if (this.timer1) clearTimeout(this.timer1);
@@ -148,6 +158,7 @@ export default {
     if (this.timer3) clearTimeout(this.timer3);
     if (this.timer4) clearTimeout(this.timer4);
     if (this.timer5) clearTimeout(this.timer5);
+    if (this.timer6) clearTimeout(this.timer6);
   }
 }
 </script>

+ 29 - 0
ruoyi-ui/src/views/analysis/task/realtime/simulation.vue

@@ -165,6 +165,9 @@ export default {
           bottom: 0,
           show: false,
         },
+        tooltip: {
+          trigger: 'item',
+        },
         xAxis: {
           type: 'value',
           min: minX,
@@ -191,6 +194,9 @@ export default {
             areaStyle: {
               opacity: 1,
               color: '#ffc27f',
+            },
+            tooltip: {
+              show: false,
             }
           },
           {
@@ -204,6 +210,9 @@ export default {
             areaStyle: {
               opacity: 1,
               color: '#a5cdf7',
+            },
+            tooltip: {
+              show: false,
             }
           },
           {
@@ -215,6 +224,9 @@ export default {
               width: 2,
               color: '#54606C',
             },
+            tooltip: {
+              show: false,
+            }
           },
           {
             data: stopSeries,
@@ -251,6 +263,14 @@ export default {
                 position: 'middle',
                 formatter: '{b}',
                 color: '#FF8500',
+              },
+              tooltip: {
+                show: false
+              }
+            },
+            tooltip: {
+              formatter: (params) => {
+                return `起点距: ${params.value[0]}`;
               }
             }
           },
@@ -261,6 +281,9 @@ export default {
             z: 3,
             itemStyle: {
               color: '#A6B7C7',
+            },
+            tooltip: {
+              show: false
             }
           },
           {
@@ -273,6 +296,9 @@ export default {
             z: 3,
             itemStyle: {
               opacity: 1
+            },
+            tooltip: {
+              show: false
             }
           },
           {
@@ -286,6 +312,9 @@ export default {
             itemStyle: {
               color: '#778CB2',
               opacity: 0.5
+            },
+            tooltip: {
+              show: false
             }
           },
         ]