From bf60c2e1e78681ac41974079856ee63b8a32559b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Fri, 24 Nov 2023 14:23:50 +0800 Subject: [PATCH] 1 --- src/views/page/realTime.vue | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/views/page/realTime.vue b/src/views/page/realTime.vue index 1393538..c34cdc2 100644 --- a/src/views/page/realTime.vue +++ b/src/views/page/realTime.vue @@ -249,7 +249,7 @@ export default { deviceName: 1, controlList: [], statusInterval: null,//status状态的Interval - statusTime: 3,//status状态的秒数 + statusTime: 2,//status状态的秒数 } }, watch: { @@ -551,19 +551,21 @@ export default { }); this.api.getControlRtDatastation(formData).then(res => { this.controlList = [] - res.data.data.forEach((el, index) => { - list.forEach((el1, index1) => { - if (el.formula == el1.value) { - // console.log(el1); - var num = el.environmentData + el1.unit - this.controlList.push({ - ...el, - num: num, - img: require(`../../assets/image/real-time-${el.formula}.png`) - }) - } + if (res.data.code == 200) { + res.data.data.forEach((el, index) => { + list.forEach((el1, index1) => { + if (el.formula == el1.value) { + // console.log(el1); + var num = el.environmentData + el1.unit + this.controlList.push({ + ...el, + num: num, + img: require(`../../assets/image/real-time-${el.formula}.png`) + }) + } + }) }) - }) + } // console.log(this.controlList); }) @@ -638,6 +640,11 @@ export default { }, 10); } else { + this.statusList = [] + this.fanStatus = { + name: '风机', open: 0, status: [] + } + this.$forceUpdate(); // this.$message.error(res.data.msg); } })