Browse Source

WMS历史轨迹-增加当车辆或保温箱温湿度无数据时隐藏标题;冷藏冷冻温度下方的警戒线提示文本移动至区域外;折线图Y轴负数展示;改变Y轴刻度;修复表头的结束时间错误。

DongZ 1 year ago
parent
commit
fc40509d26
1 changed files with 59 additions and 10 deletions
  1. 59 10
      src/views/WMS/historical-route/index.vue

+ 59 - 10
src/views/WMS/historical-route/index.vue

@@ -7,7 +7,7 @@
           <el-button class="OutCss" v-print="'#print'" type="primary">导出</el-button>
           <el-timeline>
             <!-- 数据表 -->
-            <h2>车辆温湿度列表</h2>
+            <h2 v-if="isCarData">车辆温湿度列表</h2>
             <div v-for="(item, index) in dataCar">
               <h2>
                 ============================================================================================================================
@@ -33,7 +33,7 @@
               </el-table>
               <template></template>
             </div>
-            <h2>保温箱温湿度列表</h2>
+            <h2 v-if="isBoxData">保温箱温湿度列表</h2>
             <div v-for="(item, index) in dataBox">
               <h2>
                 ============================================================================================================================
@@ -178,6 +178,8 @@
         dataCar: [],
         dataBox: [],
         dataMerge: [],
+        isCarData: false,
+        isBoxData: false,
       };
     },
     mounted() {
@@ -267,28 +269,44 @@
                       }
                     ],
                     [{
-                        name: '冷藏温度警戒线',
                         yAxis: '2'
                       },
                       {
                         yAxis: '1.9'
                       }
                     ],
+                    // -0.5这条只用来做下方的提示文本
+                    [{
+                        name: '冷藏温度警戒线',
+                        yAxis: '-0.5'
+                      },
+                      {
+                        yAxis: '-0.5'
+                      }
+                    ],
                     [{
-                        name: '冷冻温度警戒线',
                         yAxis: '-15'
                       },
                       {
+                        name: '冷冻温度警戒线',
                         yAxis: '-14.9'
                       }
                     ],
                     [{
-                        name: '冷冻温度警戒线',
                         yAxis: '-25'
                       },
                       {
                         yAxis: '-25.1'
                       }
+                    ],
+                    // -27.5这条只用来做下方的提示文本
+                    [{
+                        name: '冷冻温度警戒线',
+                        yAxis: '-27.5'
+                      },
+                      {
+                        yAxis: '-27.5'
+                      }
                     ]
                   ]
                 }
@@ -335,28 +353,44 @@
                         }
                       ],
                       [{
-                          name: '冷藏温度警戒线',
                           yAxis: '2'
                         },
                         {
                           yAxis: '1.9'
                         }
                       ],
+                      // -0.5这条只用来做下方的提示文本
+                      [{
+                          name: '冷藏温度警戒线',
+                          yAxis: '-0.5'
+                        },
+                        {
+                          yAxis: '-0.5'
+                        }
+                      ],
                       [{
-                          name: '冷冻温度警戒线',
                           yAxis: '-15'
                         },
                         {
+                          name: '冷冻温度警戒线',
                           yAxis: '-14.9'
                         }
                       ],
                       [{
-                          name: '冷冻温度警戒线',
                           yAxis: '-25'
                         },
                         {
                           yAxis: '-25.1'
                         }
+                      ],
+                      // -27.5这条只用来做下方的提示文本
+                      [{
+                          name: '冷冻温度警戒线',
+                          yAxis: '-27.5'
+                        },
+                        {
+                          yAxis: '-27.5'
+                        }
                       ]
                     ]
                   }
@@ -450,7 +484,7 @@
             }
           },
           grid: {
-            x: 22,
+            x: 30,
             y: 30,
             x2: 20,
             y2: 18,
@@ -480,8 +514,13 @@
             // Y轴最大值
             min: -30,
             splitNumber: 2,
+            // 最小刻度间隔
+            minInterval: 2,
+            // 最大刻度间隔
+            maxInterval: 5,
             // 间隔值
-            // interval: 3
+            interval: 2,
+            scale: true
           },
           //加上dataZoom可实现缩放
           dataZoom: [{
@@ -639,6 +678,7 @@
         let differenceValueCar;
         let arr2 = [];
         if (dataCar != null && dataCar != '') {
+          this.isCarData = true;
           for (let i = 0; i < dataCar.length; i++) {
             let arr3 = [];
             // 向上取整差值
@@ -683,6 +723,7 @@
         let differenceValueBox;
         let arr = [];
         if (dataBox != null && dataBox != '') {
+          this.isBoxData = true;
           for (let i = 0; i < dataBox.length; i++) {
             let arr1 = [];
             // 向上取整差值
@@ -732,18 +773,26 @@
             arr[differenceValue - 1].end = arr[j].hisDate4;
             return;
           }
+        }
+        for (let j = differenceValue - 1; j >= 0; j--) {
           if (arr[j].hisDate3 != null && arr[j].hisDate3 != '' && arr[j].hisDate3 != undefined) {
             arr[differenceValue - 1].end = arr[j].hisDate3;
             return;
           }
+        }
+        for (let j = differenceValue - 1; j >= 0; j--) {
           if (arr[j].hisDate2 != null && arr[j].hisDate2 != '' && arr[j].hisDate2 != undefined) {
             arr[differenceValue - 1].end = arr[j].hisDate2;
             return;
           }
+        }
+        for (let j = differenceValue - 1; j >= 0; j--) {
           if (arr[j].hisDate1 != null && arr[j].hisDate1 != '' && arr[j].hisDate1 != undefined) {
             arr[differenceValue - 1].end = arr[j].hisDate1;
             return;
           }
+        }
+        for (let j = differenceValue - 1; j >= 0; j--) {
           if (arr[j].hisDate != null && arr[j].hisDate != '' && arr[j].hisDate != undefined) {
             arr[differenceValue - 1].end = arr[j].hisDate;
             return;