pull/65/head
parent
d7251628c7
commit
f1b90810cd
|
@ -50,13 +50,13 @@
|
|||
<span>秒</span>
|
||||
</div>
|
||||
<div class="input-main">
|
||||
<div>展开的输出通道</div>
|
||||
<div>打开的通道</div>
|
||||
<input @blur="blurChange('21546', $event)" v-model="inputData['21546']" @input="change('21546', $event)"
|
||||
type="text" value="60" placeholder="60" />
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main">
|
||||
<div>关闭的输出通道</div>
|
||||
<div>关闭的通道</div>
|
||||
<input @blur="blurChange('21547', $event)" v-model="inputData['21547']" @input="change('21547', $event)"
|
||||
type="text" value="60" placeholder="60" />
|
||||
<span></span>
|
||||
|
|
|
@ -228,24 +228,29 @@ export default {
|
|||
getStatus(data) {
|
||||
this.api.getControlGetState(data).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.sunrise = this.convertToTimeMinutes(res.data.data['1021'])
|
||||
this.sunset = this.convertToTimeMinutes(res.data.data['1022'])
|
||||
this.sunrise = this.insertColonEveryTwoDigits(this.convertToTimeMinutes(res.data.data['1021']))
|
||||
this.sunset = this.insertColonEveryTwoDigits(this.convertToTimeMinutes(res.data.data['1022']))
|
||||
}
|
||||
})
|
||||
},
|
||||
//16进制转为时间 16位无符号高字节是时,低字节是分
|
||||
convertToTimeMinutes(hexValue) {
|
||||
// 将 16 进制字符串转换为 16 进制数值
|
||||
const intValue = hexValue
|
||||
// 将十进制数转换为16进制字符串
|
||||
let hexString = hexValue.toString(16);
|
||||
|
||||
// 提取高字节(小时)和低字节(分钟)
|
||||
const hours = (intValue >> 8) & 0xFF;
|
||||
const minutes = intValue & 0xFF;
|
||||
// 补零,确保结果是4位16进制数
|
||||
while (hexString.length < 4) {
|
||||
hexString = '0' + hexString;
|
||||
}
|
||||
|
||||
// 格式化为时:分的字符串
|
||||
const formattedTime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
|
||||
|
||||
return formattedTime;
|
||||
return hexString;
|
||||
|
||||
},
|
||||
insertColonEveryTwoDigits(inputString) {
|
||||
// 使用正则表达式将字符串每两位切割
|
||||
const chunks = inputString.match(/.{1,2}/g);
|
||||
return chunks.join(':')
|
||||
// 使用join方法将切割后的数组元素用冒号连接起来
|
||||
},
|
||||
dataInit() {
|
||||
var store = this.$store.state
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<div class="flex-sel border-right" @click="changeOpenTrue(1)">
|
||||
<div v-if="openTrue[1] == 0" class="no-sel"></div>
|
||||
<div v-else class="sel"></div>
|
||||
大风保护
|
||||
大风保护有效
|
||||
</div>
|
||||
<div class="flex-sel border-right" @click="changeOpenTrue(2)">
|
||||
<div v-if="openTrue[2] == 0" class="no-sel"></div>
|
||||
|
@ -87,13 +87,13 @@
|
|||
<span>秒</span>
|
||||
</div>
|
||||
<div class="input-main">
|
||||
<div>展开的输出通道</div>
|
||||
<div>打开的通道</div>
|
||||
<input @blur="blurChange('21539', $event)" v-model="inputData['21539']" @input="change('21539', $event)"
|
||||
type="text" value="60" placeholder="60" />
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="input-main">
|
||||
<div>收拢的输出通道</div>
|
||||
<div>关闭的通道</div>
|
||||
<input @blur="blurChange('21540', $event)" v-model="inputData['21540']" @input="change('21540', $event)"
|
||||
type="text" value="60" placeholder="60" />
|
||||
<span></span>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<span>室内1#平均温度夜间时段高于</span>
|
||||
<input @blur="blurChangeCount('21524', $event)" v-model="inputData['21524']"
|
||||
@input="changeCountData('21524', $event)" type="text" value="60" placeholder="60" />
|
||||
<span>℃启动</span>
|
||||
<span>停止</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-view border-none">
|
||||
|
|
Loading…
Reference in New Issue