From 8cca1cd70b215ea733eee61d9eba8e07f6726409 Mon Sep 17 00:00:00 2001 From: zmt Date: Sat, 22 Jan 2022 11:45:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8E=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=AB=AF=E5=90=8C=E6=AD=A5=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84?= =?UTF-8?q?tcp=E7=8A=B6=E6=80=81=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/subpackage/device/pages/timing/timing_list.vue | 22 ++++++++++++++++++++-- .../device/pages/timing/timing_setting.vue | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/subpackage/device/pages/timing/timing_list.vue b/src/subpackage/device/pages/timing/timing_list.vue index f3a484d..e4335e4 100644 --- a/src/subpackage/device/pages/timing/timing_list.vue +++ b/src/subpackage/device/pages/timing/timing_list.vue @@ -188,10 +188,28 @@ timeText += ` 当天${row.times_on_day[0].substring(0, 5)}` } if (!row.expand_value.main) rs('历史错误结构数据'); - let _status = row.expand_value.main.value.status||row.expand_value.main.data.value.status;//兼容旧数据中的一种情况 + // let _status = row.expand_value.main.value.status||row.expand_value.main.data.value.status;//兼容旧数据中的一种情况 + let _status = getStatus(row) rs(` ${timeText} 执行 ${_status === 'high' ? '[关闭]' : '[开启]'} 操作`) }) - + //2022-01-22 与后端同步添加新的tcp状态解析 + function getStatus(row) { + if (row["expand_value"] && row["expand_value"]["main"]) { + let name = row["expand_value"]["main"]["name"] + if (!row["expand_value"]["main"]["value"]) return "unknown" + switch (name) { + case "zzio404d-gpio-tcp": + return row["expand_value"]["main"]["value"]["o"] + case "zzio404d-gpio": + return row["expand_value"]["main"]["value"]["o"] + case "set-rpio": + return row["expand_value"]["main"]["value"]["status"] + case "set-rpio-lock": + return row["expand_value"]["main"]["value"]["status"] + } + } + return "unknown" + } }, goBack() { uni.navigateBack({ diff --git a/src/subpackage/device/pages/timing/timing_setting.vue b/src/subpackage/device/pages/timing/timing_setting.vue index 9f5b25d..8fba768 100644 --- a/src/subpackage/device/pages/timing/timing_setting.vue +++ b/src/subpackage/device/pages/timing/timing_setting.vue @@ -304,6 +304,7 @@ tapSwitch(){ //开关切换 this.on = !this.on this.switchData.data.value.status = this.on? "low":"high"; + this.switchData.data.value.o = this.on? "low":"high"; }, clickWeekTab(index) { if(this.weekArrSelect[index]) {