pull/65/head
孙萌 2023-12-07 10:17:59 +08:00
parent d7251628c7
commit f1b90810cd
4 changed files with 22 additions and 17 deletions

View File

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

View File

@ -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;
// 416
while (hexString.length < 4) {
hexString = '0' + hexString;
}
// :
const formattedTime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
return hexString;
return formattedTime;
},
insertColonEveryTwoDigits(inputString) {
// 使
const chunks = inputString.match(/.{1,2}/g);
return chunks.join(':')
// 使join
},
dataInit() {
var store = this.$store.state

View File

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

View File

@ -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">