Browse Source

与后台管理端同步添加新的tcp状态解析

organize
zmt 3 years ago
parent
commit
8cca1cd70b
  1. 22
      src/subpackage/device/pages/timing/timing_list.vue
  2. 1
      src/subpackage/device/pages/timing/timing_setting.vue

22
src/subpackage/device/pages/timing/timing_list.vue

@ -188,10 +188,28 @@
timeText += ` 当天<strong>${row.times_on_day[0].substring(0, 5)}</strong>`
}
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' ? '<strong style="color:gray;">[关闭]</strong>' : '<strong style="color:#009874;">[开启]</strong>'} 操作`)
})
//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({

1
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]) {

Loading…
Cancel
Save