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 }}
-
@@ -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 @@
-
+