feat(profile): 优化设备事件日志和运行状态页面逻辑
- 在事件日志页面添加暂无事件的提示 - 解决默认查询事件日志参数为空bug - 改进设备运行状态页面的WebSocket连接逻辑,改成获取物模型后直接连接
This commit is contained in:
parent
07948ec07c
commit
44c9d04cf9
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="iot-child-device">
|
||||
<div class="event-box">
|
||||
<div v-if="eventTypeList.length > 0" class="event-box">
|
||||
<!-- 左侧事件类型列表 -->
|
||||
<div :span="4" class="event-tabs">
|
||||
<el-tabs v-model="activeEventType" style="min-height: 200px;width: 150px;height: 100%" tab-position="left" @tab-click="handleTabClick">
|
||||
|
@ -77,7 +77,10 @@
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else style="padding: 100px;text-align: center">
|
||||
<i class="el-icon-s-order" style="font-size: 50px;color: #999"></i>
|
||||
<div style="color: #909399;margin-top: 10px">暂无事件</div>
|
||||
</div>
|
||||
<el-dialog
|
||||
:visible.sync="eventContentShow"
|
||||
class="params-eldialog"
|
||||
|
@ -178,6 +181,13 @@ export default {
|
|||
getDeviceLogList() {
|
||||
this.loading = true;
|
||||
this.queryParams.deviceId = this.sourceId;
|
||||
|
||||
// 如果activeEventType为空且有事件类型列表,则使用第一个事件类型
|
||||
if (!this.activeEventType && this.eventTypeList.length > 0) {
|
||||
this.activeEventType = this.eventTypeList[0].id;
|
||||
this.activeEventObj = this.eventTypeList[0];
|
||||
}
|
||||
|
||||
this.queryParams.eventType = this.activeEventType;
|
||||
listDeviceEventLogList(this.queryParams).then(res => {
|
||||
this.eventList = res.data.records;
|
||||
|
|
|
@ -367,6 +367,9 @@ export default {
|
|||
...response.data
|
||||
];
|
||||
}
|
||||
this.connection();
|
||||
}).catch(error=>{
|
||||
this.connection();
|
||||
});
|
||||
},
|
||||
closeWebscoket() {
|
||||
|
@ -394,16 +397,16 @@ export default {
|
|||
this.closeWebscoket();
|
||||
},
|
||||
watch: {
|
||||
cmdList(val) {
|
||||
if (val) {
|
||||
// val.forEach((v, index) => {
|
||||
// this.forGetParmas(v, index);
|
||||
// });
|
||||
// setTimeout(this.connection, 3000);
|
||||
// this.connection()
|
||||
this.processAllRequests(val);
|
||||
}
|
||||
},
|
||||
// cmdList(val) {
|
||||
// if (val) {
|
||||
// // val.forEach((v, index) => {
|
||||
// // this.forGetParmas(v, index);
|
||||
// // });
|
||||
// // setTimeout(this.connection, 3000);
|
||||
// // this.connection()
|
||||
// this.processAllRequests(val);
|
||||
// }
|
||||
// },
|
||||
realTimeData: {
|
||||
handler: function() {
|
||||
this.setListData(this.realTimeData);
|
||||
|
|
Loading…
Reference in New Issue