1 #102

Merged
xiaomeng merged 1 commits from pc-master into portal 2024-01-24 08:45:43 +00:00
1 changed files with 30 additions and 1 deletions

View File

@ -92,6 +92,8 @@
<div class="table-title">
<img src="../../assets/image/status.png" alt="" />
设备运行状态
<div class="title-text">日出:{{ sunrise }}</div>
<div class="title-text">日落:{{ sunset }}</div>
</div>
<div class="flex-view border-none">
<div class="status-view" v-for="item, index in statusList" :key="index">
@ -428,6 +430,8 @@ export default {
},
data() {
return {
sunrise: "00:00",
sunset: "00:00",
statusList: [],
time: null,//
@ -759,6 +763,25 @@ export default {
}
return num
},
//16 16
convertToTimeMinutes(hexValue) {
// 16
let hexString = hexValue.toString(16);
// 416
while (hexString.length < 4) {
hexString = "0" + hexString;
}
return hexString;
},
insertColonEveryTwoDigits(inputString) {
// 使
const chunks = inputString.match(/.{1,2}/g);
return chunks.join(":");
// 使join
},
//countType
//0
//1-400
@ -1175,6 +1198,12 @@ export default {
}
this.api.getControlGetState(TargetValue).then(res => {
if (res.data.code == 200) {
this.sunrise = this.insertColonEveryTwoDigits(
this.convertToTimeMinutes(res.data.data["1119"])
);
this.sunset = this.insertColonEveryTwoDigits(
this.convertToTimeMinutes(res.data.data["1120"])
);
const statusList = []
this.nowDevicestatus.forEach((el, index) => {
if (el.id == 1) {
@ -1273,7 +1302,7 @@ export default {
statusList.push(statusData)
} else if (el.id == 26 || el.id == 27 || el.id == 28 || el.id == 29) {
//
var statusData = { name: el.name, type: 15, id: el.id, open: res.data.data[(1102 + ((el.id - 26) * 2))], progress: res.data.data[(1104 + ((el.id - 26) * 2))], index: res.data.data[(1103 + ((el.id - 26) * 2))] }
var statusData = { name: el.name, type: 15, id: el.id, open: res.data.data[(1102 + ((el.id - 26) * 3))], progress: res.data.data[(1104 + ((el.id - 26) * 3))], index: res.data.data[(1103 + ((el.id - 26) * 3))] }
statusList.push(statusData)
}