|
@@ -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)
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|