From eed1e5c9943696fd447574129fae507acdb257d9 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Fri, 27 Mar 2026 22:19:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E6=8E=A7=E5=88=B6=E5=99=A8=E7=95=8C=E9=9D=A2=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/other/index.vue | 27 ++++++++++++++++----------- src/home/ctr.vue | 3 ++- src/my/deviceRecharge.vue | 15 +++++++++++++-- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/components/other/index.vue b/src/components/other/index.vue index d48a612..e141e95 100644 --- a/src/components/other/index.vue +++ b/src/components/other/index.vue @@ -58,7 +58,7 @@ 正常 - {{ item.warnCodeInfo?.warnDescription }} - + {{ item.deviceName }} {{ item.errorMessage }} + 参数设置 @@ -877,11 +882,9 @@ Taro.useDidHide(() => { function startRefreshTimer() { // 先清除已有的定时器 stopRefreshTimer(); - // 每10秒刷新一次 + // 每10秒刷新一次设备状态(包括在线状态和开关状态) refreshTimer.value = setInterval(() => { - if (controlList.value.length > 0) { - getDeviceList(); - } + getDeviceList(); }, 10000); } @@ -903,9 +906,11 @@ watch( ); // 获取塘口下的设备列表 function getDeviceList() { + console.log('========== getDeviceList 被调用 =========='); emit("render", ""); const id = props.modelValue; if (!id) { + console.log('没有id,直接返回'); return; } // 查询塘口下设备列表 @@ -954,10 +959,10 @@ function getDeviceList() { item.num = num; item.status = Number(item.deviceCount) == 0 ? 0 : msg ? 2 : 1; // 判断设备是否离线,异常、断电 0 6 15 - const code0 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 0); - const code6 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 6); - const code11 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 15); - const code17 = alarmJudgeCode(item.warnCodeInfo?.warnCode, 17); + const code0 = alarmJudgeCode(item.warnCodeInfo.warnCode, 0); + const code6 = alarmJudgeCode(item.warnCodeInfo.warnCode, 6); + const code11 = alarmJudgeCode(item.warnCodeInfo.warnCode, 15); + const code17 = alarmJudgeCode(item.warnCodeInfo.warnCode, 17); item.up = true; if (code0 || code6 || code11 || code17) { item.up = false; @@ -1780,7 +1785,7 @@ function changeAllSwitch(e) { // 设置控制器 function setParamsCtr(id) { Taro.navigateTo({ - url: `/home/ctr?id=${id}&page=home`, + url: `/home/ctr?id=${id}&page=home&hideSwitch=1`, }); } function switchRes(list, index, type) { diff --git a/src/home/ctr.vue b/src/home/ctr.vue index 054496a..d4b5265 100644 --- a/src/home/ctr.vue +++ b/src/home/ctr.vue @@ -103,7 +103,7 @@ - +