|
|
@ -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({ |
|
|
|