yf_zd 4 rokov pred
rodič
commit
9b62d83ed9

+ 1 - 1
src/pages/plantGuard/disasterWarn/disasterWarn.vue

@@ -71,7 +71,7 @@
               <div class="wranInfo" v-for="item in scrollWranList" v-bind:key="item.id">
                 <div>{{item.device_id}}</div>
                 <div class="wranmsg">{{item.warning_info}}</div>
-                <div>{{item.warning_time | formatTime}}</div>
+                <div>{{item.warning_time*1000 | formatTime}}</div>
               </div>
             </div>
           </div>

+ 17 - 6
src/pages/plantGuard/disasterWarn/disasterWarnSet.vue

@@ -172,7 +172,12 @@ export default {
             let arr = new Array();
             let conf = res.data.data.device_conf;
             let dat = res.data.data.dat;
-            let deploy = JSON.parse(res.data.data.alarm_conf);
+
+            if(Object.keys(res.data.data.alarm_conf).length){
+              var deploy = JSON.parse(res.data.data.alarm_conf);
+            }else{
+              var deploy = {}
+            }
             
             for (let i1 in conf) {
               if (conf[i1]) {
@@ -181,11 +186,17 @@ export default {
                 obj.e = "e" + i1.slice(1);
                 obj.name = arr2[0];
                 obj.unit = arr2[1];
-                
-                obj.max = deploy[i1][0];
-                obj.maxtxt = deploy[i1][1];
-                obj.min = deploy[i1][2];
-                obj.mintxt = deploy[i1][3];
+                if(Object.keys(deploy).length){
+                  obj.max = deploy[i1][0];
+                  obj.maxtxt = deploy[i1][1];
+                  obj.min = deploy[i1][2];
+                  obj.mintxt = deploy[i1][3];
+                }else{
+                  obj.max = '';
+                  obj.maxtxt = '';
+                  obj.min = '';
+                  obj.mintxt = '';
+                }
 
                 for (let i2 in dat) {
                   if (i1 == i2) {

+ 12 - 2
src/pages/plantGuard/disasterWarn/windowPopUp.vue

@@ -23,7 +23,9 @@
               <span>操作:</span>{{item.action}}
             </div>
           </div>
-            
+          <div class="notDate" v-if="!msgList.length">
+            <img src="../../../../static/images/disasterWarn/notData.png" alt="">
+          </div>
         </div>
     </div>
     <div class="amap-info-sharp">
@@ -67,12 +69,16 @@ export default {
       this.visible = e.visible;
       this.currEquip = e.currEquip;
       this.infoWindow = e.infoWindow;
+      var end_time = parseInt(new Date().getTime()/1000);
+      var start_time = end_time - (24 * 60 * 60)
       this.$axios({
         method: "post",
         url: "/api/api_gateway?method=weather.weather.warning_info", //forecast.forecast_system.equip_photo
         data: this.qs.stringify({
           device_id: this.$store.state.qxz_wran_id,
           page_size: 3,
+          start_time:  start_time, //开始时间(时间戳)
+          end_time: end_time, //结束时间(时间戳)
         }),
       })
       .then((res) => {
@@ -165,8 +171,12 @@ export default {
                 color:#fff;
               }
             }
+            
+        }
+        .notDate{
+          margin-top: 10px;
+          text-align: center;
         }
-
     }
 }
 .amap-info-sharp{

BIN
static/images/disasterWarn/notData.png