Ming 4 vuotta sitten
vanhempi
commit
aa8a288fdd

+ 9 - 0
src/components/topHeader.vue

@@ -94,12 +94,21 @@ export default {
       if (e.data.search("{") != -1) {
         const redata = JSON.parse(e.data);
 
+       
+
         if (redata.CMD == "getStationInfo") {
           this.siteList = redata.RESULT;
+
           if (this.getStationId.length == 0) {
+
             console.log("created走没有的逻辑");
             // 初始化时,获取下拉列表的第一个值 放入store里
             this.StationID = this.siteList[0].StationID;
+
+            console.log('this.siteList[0].StationID');
+           console.log(this.siteList[0].StationID);
+            console.log(this.StationID)
+
             this.$store.commit("changeStationID", this.StationID); 
           } else {
             console.log("created走有的逻辑");

+ 4 - 4
src/pages/eleFireCard/eleFireCard.vue

@@ -222,10 +222,10 @@ export default {
 
           this.global.sendWs(json);
 
-          setInterval(() => {
-            // console.log("每隔30秒请求一次getDeviceDetail");
-            this.global.sendWs(json);
-          }, 30000);
+          // setInterval(() => {
+          //   // console.log("每隔30秒请求一次getDeviceDetail");
+          //   this.global.sendWs(json);
+          // }, 30000);
         }
 
         if (redata.CMD == "getDeviceDetail") {

+ 1 - 0
src/pages/gasCard/components/lineChart.vue

@@ -60,6 +60,7 @@ export default {
     draw() {
       this.myChart = this.$echarts.init(document.getElementById("myChart"));
       this.myChart.setOption({
+        // animationDuration:  30000,
         // 通过这个color修改两条线的颜色
         title: {
           // text: "一氧化碳浓度",

+ 35 - 25
src/pages/gasCard/gasCard.vue

@@ -5,7 +5,7 @@
       <div class="gas-container">
         <return-back></return-back>
         <h3>可燃气体监控实时信息</h3>
-        <p>更新时间:{{time}}</p>
+        <p>更新时间:{{ time }}</p>
 
         <div>
           <ul class="cardTabs">
@@ -15,7 +15,7 @@
           <div class="tabBox">
             <div>
               <div v-if="Inv == 1" class="lineChart gas-data">
-                <line-chart :getData="getData" ></line-chart>
+                <line-chart :getData="getData"></line-chart>
               </div>
 
               <table v-if="Inv == 0">
@@ -30,11 +30,20 @@
                   <!-- <td>位置BBBBBB</td> -->
                   <td>
                     <!-- 0.00%LEL -->
-                    {{nongDu}}
+                    {{ nongDu }}
+                  </td>
+                  <td
+                    class="normal"
+                    :class="[AlarmStatus == 0 ? 'normal' : 'error']"
+                  >
+                    {{
+                      AlarmStatus == 0
+                        ? "正常"
+                        : AlarmStatus == 1
+                        ? "告警"
+                        : "故障"
+                    }}
                   </td>
-                  <td class="normal" :class="[ AlarmStatus == 0 ? 'normal' : 'error',]">
-                    {{AlarmStatus==0?"正常":AlarmStatus==1?"告警":"故障"}}
-                    </td>
                 </tr>
               </table>
             </div>
@@ -62,11 +71,11 @@ export default {
       DeviceID: "",
       getData: {},
       StationID: "",
-      time:'',
-      AlarmStatus:'',
-      nongDu:'',
-      chartPoint:[],
-      chartDate:[]
+      time: "",
+      AlarmStatus: "",
+      nongDu: "",
+      chartPoint: [],
+      chartDate: [],
     };
   },
   watch: {
@@ -74,43 +83,44 @@ export default {
       this.messageHandle(val);
     },
   },
-  computed: {
-  },
+  computed: {},
 
   created() {
     this.DeviceID = this.$route.query.DeviceID;
     this.StationID = this.$store.state.StationID;
   },
-  
+
   methods: {
     messageHandle(e) {
       if (e.data.search("{") != -1) {
         const redata = JSON.parse(e.data);
-        this.time=redata.time;
+        this.time = redata.time;
 
         if (redata.CMD == "getStationInfo" && redata.RESULT[0].StationID) {
-
           var json = {};
           json.CMD = "getDeviceDetail";
           json.StationID = this.StationID;
           json.DeviceID = this.DeviceID;
 
           this.global.sendWs(json);
-
-          setInterval(() => {
-            // console.log("每隔30秒请求一次getDeviceDetail");
-            this.global.sendWs(json);
-          }, 30000);
-
+            setInterval(() => {
+              // console.log("每隔30秒请求一次getDeviceDetail");
+              // this.global.sendWs(json);
+            }, 30000);
+          
         }
 
         if (redata.CMD == "getDeviceDetail") {
           console.log("redata.RESULT");
           console.log(redata.RESULT.Device[0]);
-          this.getData =redata.RESULT.Device[0];
-          this.AlarmStatus=this.getData.Points[0].AlarmStatus
-          this.nongDu=this.getData.Points[1].Value
+          this.getData = redata.RESULT.Device[0];
+          this.AlarmStatus = this.getData.Points[0].AlarmStatus;
+          this.nongDu = this.getData.Points[1].Value;
+
+          if(this.$route.path== "/gasCard"&& this.DeviceID==this.getData.DeviceID){
+            // alert(this.DeviceID)
 
+          }
         }
       }
     },

+ 3 - 3
src/pages/index/index.vue

@@ -121,9 +121,9 @@ export default {
 
          
           this.homeData = redata.RESULT.LIST;
-        //    console.log('首页数据') 
-        // console.log(redata)
-        //   console.log(this.homeData);
+           console.log('首页数据') 
+        console.log(redata)
+          console.log(this.homeData);
         }
       }
     },

+ 1 - 1
src/pages/inspectRecord/inspectRecord.vue

@@ -195,7 +195,7 @@
           </table>
         </div>
 
-        <h3>可燃气体监控信息</h3>
+        <h3 >可燃气体监控信息</h3>
         <div class="gasRecord">
           <div
             class="recordItem"

+ 4 - 5
src/pages/recordTime/recordTime.vue

@@ -62,7 +62,7 @@ export default {
       // 总条数,根据接口获取数据长度(注意:这里不能为空)
       TotalCount: 1,
       // 默认每页显示的条数(可修改)
-      Count: 5,
+      Count: 35,
     };
   },
   watch: {
@@ -91,13 +91,13 @@ export default {
 
           json.CMD = "getPatrolRecord";
           json.StationID = this.StationID;
-          (json.Start = 0), (json.Limit = 5), (json.Order = "DESC");
-
+          (json.Start = 1), (json.Limit = this.Count), (json.Order = "DESC");
           this.global.sendWs(json);
 
           setInterval(() => {
             // console.log("每隔30秒请求一次getPatrolRecord");
             this.global.sendWs(json);
+            this.currentPage=1
           }, 30000);
         }
 
@@ -136,10 +136,9 @@ export default {
       console.log(val)
 
       var json = {};
-
           json.CMD = "getPatrolRecord";
           json.StationID = this.StationID;
-          (json.Start = (val-1)*5), (json.Limit = 5), (json.Order = "DESC");
+          (json.Start = (val-1)*this.Count+1), (json.Limit = this.Count), (json.Order = "DESC");
 
           this.global.sendWs(json);
 

+ 1 - 0
src/store/index.js

@@ -7,6 +7,7 @@ export default new Vuex.Store({
     state: {
         wsInfo: null,
         StationID: 'a5f41517-44be-4565-b27b-c9cc044c5061',
+        // StationID: '',
         wsTimer: 30
     },
     mutations: {