Skip to content

Commit 62f3c0d

Browse files
committed
修改监控
1 parent 24b2e3b commit 62f3c0d

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
> * 用户模块:用户列表(带分页)、新增、删除、编辑、头像上传等
2121
> * 个人资料编辑设置
2222
> * 设备模块:设备列表(带分页)、新增、删除、编辑等
23+
> * 设备实时参数图表展现
2324
2425
TODO
2526

26-
> * 设备实时监控模块、设备参数告警、参数管理等
27+
> * 设备参数告警、参数管理等
2728
> * OAuth2授权管理模块
2829
> * 消息管理模块
2930

src/mq/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const startSub = () => {
1616
}).on('error', err => {
1717
console.log("链接mqtt报错", err)
1818
client.end()
19-
client.reconnect()
19+
client.reconnect()
2020
}).on("message", (topic, message) => {
2121
console.log('topic', topic);
2222
// message is Buffer

src/store/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export default new Vuex.Store({
1010
user,
1111
devArgsMsg
1212
}
13-
})
13+
})

src/views/device/Monitor.vue

+2-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<el-row type="flex" justify="space-around">
4141
<el-col :span="11">
4242
<el-row type="flex" class="grid-content bg-purple-light" style="justify-content:center; align-items: center;">
43-
<chart :options="monitorArgs" v-if="monitorArgsVisible"></chart>
43+
<chart :options="monitorArgs" v-if="device.id && device.argId"></chart>
4444
<span v-else>请先选择要查看的设备,并选中要查看的参数(确保该参数有上传数值?)</span>
4545
<!-- <span v-else>该参数暂未收到统计数值</span> -->
4646
</el-row>
@@ -72,7 +72,6 @@ export default {
7272
argName: "", // 当前选中的参数名称
7373
pic: "", // 当前选中设备的pic原理图
7474
},
75-
monitorArgsVisible: false, // monitorArgs图标可见性
7675
devArgs: [], // table中的所有设备参数
7776
currentPage: 1, // table分页
7877
pageSize: 5, // table分页
@@ -124,13 +123,7 @@ export default {
124123
data: this.doneMsg.filter(
125124
item => {
126125
// 仅显示当前选择的设备下的选中的参数的历史值
127-
const ret = item.value[2] === this.device.argName && (item.value[3] + '' === this.device.id + '');
128-
if (ret) {
129-
this.monitorArgsVisible = true;
130-
} else {
131-
this.monitorArgsVisible = false;
132-
}
133-
return ret
126+
return item.value[2] === this.device.argName && (item.value[3] + '' === this.device.id + '');
134127
}
135128
)
136129
}

0 commit comments

Comments
 (0)