lxh 4 months ago
parent
commit
395ff12a21

+ 10 - 10
src/views/vent/home/clique/components/wind-road.vue

@@ -341,16 +341,16 @@ watch(
       roadDatas.value = newR.totallength;
       maxY.value = roadDatas.value.indexOf('.') == -1 ? roadDatas.value : roadDatas.value.substring(0, roadDatas.value.indexOf('.'))
       if (maxY.value.length < 2) {
-        maxY.value = 10
-      } else if (maxY.value.length < 3) {
-        maxY.value = Number(maxY.value[0]) * 10
-      } else if (maxY.value.length < 4) {
-        maxY.value = Number(maxY.value[0]) * 100
-      } else if (maxY.value.length < 5) {
-        maxY.value = Number(maxY.value[0]) * 1000
-      } else if (maxY.value.length < 6) {
-        maxY.value = Number(maxY.value[0]) * 10000
-      }
+          maxY.value = 10
+        } else if (maxY.value.length < 3) {
+          maxY.value = (Number(maxY.value[0])+1) * 10
+        } else if (maxY.value.length < 4) {
+          maxY.value = (Number(maxY.value[0])+1) * 100
+        } else if (maxY.value.length < 5) {
+          maxY.value = (Number(maxY.value[0])+1) * 1000
+        } else if (maxY.value.length < 6) {
+          maxY.value = (Number(maxY.value[0])+1) * 10000
+        }
       xData.value = newR.data1;
       yData.value = newR.data;
       yData.value.forEach((el) => {

+ 13 - 6
src/views/vent/home/colliery/components/wind-monitor.vue

@@ -19,7 +19,7 @@ let props = defineProps({
 //获取dom节点
 let windBar = ref<any>();
 //坐标轴最大值
-let maxY = ref(0);
+let maxY = ref<any>(0);
 //echart数据
 let echartData = reactive<any>({ ydata: [], xdata: [] });
 //跳转详情
@@ -258,11 +258,18 @@ watch(
     maxY.value = echartData.ydata.reduce((acr, cur) => {
       return parseFloat(acr) > parseFloat(cur) ? parseFloat(acr) : parseFloat(cur);
     });
-    if (maxY.value.toString().length == 2 && maxY.value.toString().indexOf('.') == -1) {
-      maxY.value = maxY.value + 20
-    } else if (maxY.value.toString().length == 3 && maxY.value.toString().indexOf('.') == -1) {
-      maxY.value = maxY.value + 100
-    }
+    maxY.value = maxY.value.toString().indexOf('.') == -1 ? maxY.value.toString() : maxY.value.toString().substring(0, maxY.value.toString().indexOf('.'))
+        if (maxY.value.length < 2) {
+          maxY.value = 10
+        } else if (maxY.value.length < 3) {
+          maxY.value = (Number(maxY.value[0])+1) * 10
+        } else if (maxY.value.length < 4) {
+          maxY.value = (Number(maxY.value[0])+1) * 100
+        } else if (maxY.value.length < 5) {
+          maxY.value = (Number(maxY.value[0])+1) * 1000
+        } else if (maxY.value.length < 6) {
+          maxY.value = (Number(maxY.value[0])+1) * 10000
+        }
     getOption();
   },
   {

+ 15 - 15
src/views/vent/monitorManager/alarmMonitor/warn/dustWarn.vue

@@ -236,13 +236,13 @@ function getSysWarnList(id, type) {
         if (maxY.value.length < 2) {
           maxY.value = 10
         } else if (maxY.value.length < 3) {
-          maxY.value = Number(maxY.value[0]) * 10
+          maxY.value = (Number(maxY.value[0])+1) * 10
         } else if (maxY.value.length < 4) {
-          maxY.value = Number(maxY.value[0]) * 100
+          maxY.value = (Number(maxY.value[0])+1) * 100
         } else if (maxY.value.length < 5) {
-          maxY.value = Number(maxY.value[0]) * 1000
+          maxY.value = (Number(maxY.value[0])+1) * 1000
         } else if (maxY.value.length < 6) {
-          maxY.value = Number(maxY.value[0]) * 10000
+          maxY.value = (Number(maxY.value[0])+1) * 10000
         }
       } else {
         activeIndex.value = 0;
@@ -275,17 +275,17 @@ function getSysWarnList(id, type) {
           return acr > cur ? acr : cur;
         });
         maxY.value = maxY.value.toString().indexOf('.') == -1 ? maxY.value.toString() : maxY.value.toString().substring(0, maxY.value.toString().indexOf('.'))
-      if (maxY.value.length < 2) {
-        maxY.value = 10
-      } else if (maxY.value.length < 3) {
-        maxY.value = Number(maxY.value[0]) * 10
-      } else if (maxY.value.length < 4) {
-        maxY.value = Number(maxY.value[0]) * 100
-      } else if (maxY.value.length < 5) {
-        maxY.value = Number(maxY.value[0]) * 1000
-      } else if (maxY.value.length < 6) {
-        maxY.value = Number(maxY.value[0]) * 10000
-      }
+        if (maxY.value.length < 2) {
+          maxY.value = 10
+        } else if (maxY.value.length < 3) {
+          maxY.value = (Number(maxY.value[0])+1) * 10
+        } else if (maxY.value.length < 4) {
+          maxY.value = (Number(maxY.value[0])+1) * 100
+        } else if (maxY.value.length < 5) {
+          maxY.value = (Number(maxY.value[0])+1) * 1000
+        } else if (maxY.value.length < 6) {
+          maxY.value = (Number(maxY.value[0])+1) * 10000
+        }
       }
     }
   });

+ 12 - 11
src/views/vent/monitorManager/alarmMonitor/warn/ventilateWarn.vue

@@ -186,17 +186,18 @@ function getSysWarnList(id, type) {
       maxY.value = max1 >= max2 ? max1 : max2;
       console.log(maxY.value,'000')
       maxY.value = maxY.value.toString().indexOf('.') == -1 ? maxY.value.toString() : maxY.value.toString().substring(0, maxY.value.toString().indexOf('.'))
-      if (maxY.value.length < 2) {
-        maxY.value = 10
-      } else if (maxY.value.length < 3) {
-        maxY.value = Number(maxY.value[0]) * 10
-      } else if (maxY.value.length < 4) {
-        maxY.value = Number(maxY.value[0]) * 100
-      } else if (maxY.value.length < 5) {
-        maxY.value = Number(maxY.value[0]) * 1000
-      } else if (maxY.value.length < 6) {
-        maxY.value = Number(maxY.value[0]) * 10000
-      }
+      maxY.value = maxY.value.toString().indexOf('.') == -1 ? maxY.value.toString() : maxY.value.toString().substring(0, maxY.value.toString().indexOf('.'))
+        if (maxY.value.length < 2) {
+          maxY.value = 10
+        } else if (maxY.value.length < 3) {
+          maxY.value = (Number(maxY.value[0])+1) * 10
+        } else if (maxY.value.length < 4) {
+          maxY.value = (Number(maxY.value[0])+1) * 100
+        } else if (maxY.value.length < 5) {
+          maxY.value = (Number(maxY.value[0])+1) * 1000
+        } else if (maxY.value.length < 6) {
+          maxY.value = (Number(maxY.value[0])+1) * 10000
+        }
     }
   });
 }