From 54ca3ab0d24289f35ee29cc9bdd328c90022e3e6 Mon Sep 17 00:00:00 2001 From: kerwincui <164770707@qq.com> Date: Tue, 14 Jun 2022 16:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BC=96=E8=BE=91=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/src/views/iot/device/running-status.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vue/src/views/iot/device/running-status.vue b/vue/src/views/iot/device/running-status.vue index 1c4531a6..52566480 100644 --- a/vue/src/views/iot/device/running-status.vue +++ b/vue/src/views/iot/device/running-status.vue @@ -155,7 +155,7 @@ - + @@ -192,10 +192,10 @@ export default { watch: { // 获取到父组件传递的device后,刷新列表 device: function (newVal, oldVal) { - this.deviceInfo = newVal; - if (this.deviceInfo && this.deviceInfo.deviceId != 0) { - getDeviceRunningStatus(this.deviceInfo.deviceId).then(response => { + if (newVal && newVal.deviceId != 0) { + getDeviceRunningStatus(newVal.deviceId).then(response => { this.deviceInfo = response.data; + console.log(this.deviceInfo); this.updateDeviceStatus(this.deviceInfo); this.$nextTick(function () { this.MonitorChart(); @@ -231,7 +231,7 @@ export default { integerList: [], decimalList: [], arrayList: [], - readonlyList: [] + readOnlyList: [] }, } }, @@ -241,7 +241,7 @@ export default { methods: { /** 发布物模型 类型(1=属性,2=功能) */ publishThingsModel(device, model) { - // TODO 创建的时候过去一次即可。 获取缓存的Json物模型 + // TODO 创建的时候获取一次即可。 获取缓存的Json物模型 cacheJsonThingsModel(device.productId).then(response => { let thingsModel = JSON.parse(response.data); let type = 0; @@ -349,8 +349,9 @@ export default { model.name = "设备升级" this.mqttPublish(3, this.deviceInfo, model); }, - /**监测图表*/ + /**监测图表统计*/ MonitorChart() { + console.log(this.deviceInfo.readOnlyList.length); for (let i = 0; i < this.deviceInfo.readOnlyList.length; i++) { var myChart = echarts.init(this.$refs.map[i]); var option;