pull/63/head
孙萌 2023-12-05 11:44:18 +08:00
parent 5edfe5088c
commit 542d2b79d4
5 changed files with 86 additions and 46 deletions

View File

@ -225,6 +225,11 @@
color: #00FFBA; color: #00FFBA;
} }
.table-title .title-text {
font-size: 16px;
margin-left: 15px;
}
.index { .index {
width: 100%; width: 100%;
height: 100%; height: 100%;

File diff suppressed because one or more lines are too long

View File

@ -245,6 +245,10 @@
font-weight: 400; font-weight: 400;
color: #00FFBA; color: #00FFBA;
} }
.title-text{
font-size: 16px;
margin-left: 15px;
}
} }
.index { .index {

View File

@ -2,6 +2,9 @@
<div class="waterPump wufang"> <div class="waterPump wufang">
<div class="table-title"> <div class="table-title">
<img src="../../assets/img/rollByRoll.png" alt=""> 卷被 <img src="../../assets/img/rollByRoll.png" alt=""> 卷被
<div class="title-text">日出:{{ sunrise }}</div>
<div class="title-text">日落:{{ sunset }}</div>
</div> </div>
<div class="title-tips">卷被有效性设置</div> <div class="title-tips">卷被有效性设置</div>
<div class="flex-view"> <div class="flex-view">
@ -24,56 +27,48 @@
<div class="flex-view"> <div class="flex-view">
<div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(0)"> <div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(0)">
<div v-if="openTrue[0]==0" class="no-sel margin-none"></div> <div v-if="openTrue[0] == 0" class="no-sel margin-none"></div>
<div v-else class="sel margin-none"></div> <div v-else class="sel margin-none"></div>
</div> </div>
<div class="input-main"> <div class="input-main">
<span>①室外光照大于</span> <span>①室外光照大于</span>
<input @blur="blurChange10('21550', $event)" <input @blur="blurChange10('21550', $event)" v-model="inputData['21550']"
v-model="inputData['21550']" @input="changeCount10('21550', $event)" type="text" value="60" placeholder="60" />
@input="changeCount10('21550', $event)"
type="text" value="60" placeholder="60" />
<span>klx收拢卷被</span> <span>klx收拢卷被</span>
</div> </div>
</div> </div>
<div class="flex-view"> <div class="flex-view">
<div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(1)"> <div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(1)">
<div v-if="openTrue[1]==0" class="no-sel margin-none"></div> <div v-if="openTrue[1] == 0" class="no-sel margin-none"></div>
<div v-else class="sel margin-none"></div> <div v-else class="sel margin-none"></div>
</div> </div>
<div class="input-main"> <div class="input-main">
<span>②日出</span> <span>②日出</span>
<input @blur="blurChange('21551', $event)" <input @blur="blurChange('21551', $event)" v-model="inputData['21551']" @input="change('21551', $event)"
v-model="inputData['21551']"
@input="change('21551', $event)"
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
<span>分钟收拢卷被</span> <span>分钟收拢卷被</span>
</div> </div>
</div> </div>
<div class="flex-view"> <div class="flex-view">
<div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(2)"> <div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(2)">
<div v-if="openTrue[2]==0" class="no-sel margin-none"></div> <div v-if="openTrue[2] == 0" class="no-sel margin-none"></div>
<div v-else class="sel margin-none"></div> <div v-else class="sel margin-none"></div>
</div> </div>
<div class="input-main"> <div class="input-main">
<span>③室内1#平均温度低于</span> <span>③室内1#平均温度低于</span>
<input @blur="blurChangeCount('21552', $event)" <input @blur="blurChangeCount('21552', $event)" v-model="inputData['21552']"
v-model="inputData['21552']" @input="changeCountData('21552', $event)" type="text" value="60" placeholder="60" />
@input="changeCountData('21552', $event)"
type="text" value="60" placeholder="60" />
<span>展开卷被</span> <span>展开卷被</span>
</div> </div>
</div> </div>
<div class="flex-view"> <div class="flex-view">
<div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(3)"> <div class="flex-sel padding-none" v-if="openTrue.length" @click="changeOpenTrue(3)">
<div v-if="openTrue[3]==0" class="no-sel margin-none"></div> <div v-if="openTrue[3] == 0" class="no-sel margin-none"></div>
<div v-else class="sel margin-none"></div> <div v-else class="sel margin-none"></div>
</div> </div>
<div class="input-main"> <div class="input-main">
<span>④日落前</span> <span>④日落前</span>
<input @blur="blurChange('21553', $event)" <input @blur="blurChange('21553', $event)" v-model="inputData['21553']" @input="change('21553', $event)"
v-model="inputData['21553']"
@input="change('21553', $event)"
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
<span>分钟展开卷被</span> <span>分钟展开卷被</span>
</div> </div>
@ -81,25 +76,19 @@
<div class="flex-view border-none"> <div class="flex-view border-none">
<div class="input-main"> <div class="input-main">
<div>卷被的行程时间</div> <div>卷被的行程时间</div>
<input @blur="blurChange('21554', $event)" <input @blur="blurChange('21554', $event)" v-model="inputData['21554']" @input="change('21554', $event)"
v-model="inputData['21554']"
@input="change('21554', $event)"
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
<span></span> <span></span>
</div> </div>
<div class="input-main"> <div class="input-main">
<div>卷被开窗的行程时间</div> <div>卷被开窗的行程时间</div>
<input @blur="blurChange('21555', $event)" <input @blur="blurChange('21555', $event)" v-model="inputData['21555']" @input="change('21555', $event)"
v-model="inputData['21555']"
@input="change('21555', $event)"
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
<span></span> <span></span>
</div> </div>
<div class="input-main"> <div class="input-main">
<div>展开的输出通道</div> <div>展开的输出通道</div>
<input @blur="blurChange('21556', $event)" <input @blur="blurChange('21556', $event)" v-model="inputData['21556']" @input="change('21556', $event)"
v-model="inputData['21556']"
@input="change('21556', $event)"
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
<span></span> <span></span>
</div> </div>
@ -119,6 +108,8 @@ export default {
openIndex: 1, openIndex: 1,
inputData: {}, inputData: {},
openTrue: [], openTrue: [],
sunrise: '00:00',
sunset: '00:00'
} }
}, },
mounted() { mounted() {
@ -130,21 +121,21 @@ export default {
} }
}, },
methods: { methods: {
// //
myReverse(arr) { myReverse(arr) {
return [...arr].reverse() return [...arr].reverse()
}, },
padString(str, length) { padString(str, length) {
return str.padStart(length, '0'); return str.padStart(length, '0');
}, },
changeOpenTrue(index) { changeOpenTrue(index) {
if( this.openTrue[index]==0){ if (this.openTrue[index] == 0) {
this.openTrue[index]=1 this.openTrue[index] = 1
}else{ } else {
this.openTrue[index]=0 this.openTrue[index] = 0
} }
this.$forceUpdate(); this.$forceUpdate();
var num=this.myReverse(this.openTrue).join("") var num = this.myReverse(this.openTrue).join("")
var dataNum = { var dataNum = {
target: { target: {
@ -227,12 +218,34 @@ export default {
return 0 return 0
} }
}, },
get21549(){ get21549() {
var num1 = this.inputData['21549'] var num1 = this.inputData['21549']
var num11 = this.padString(num1.toString(2), 4) var num11 = this.padString(num1.toString(2), 4)
var openList1New var openList1New
openList1New = num11.split("") openList1New = num11.split("")
this.openTrue= openList1New.reverse() this.openTrue = openList1New.reverse()
},
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'])
}
})
},
//16 16
convertToTimeMinutes(hexValue) {
// 16 16
const intValue = hexValue
//
const hours = (intValue >> 8) & 0xFF;
const minutes = intValue & 0xFF;
// :
const formattedTime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
return formattedTime;
}, },
dataInit() { dataInit() {
var store = this.$store.state var store = this.$store.state
@ -242,17 +255,18 @@ export default {
}; };
this.api.readControl_fiveControl(data).then(res => { this.api.readControl_fiveControl(data).then(res => {
console.log(res, 111); console.log(res, 111);
if(res.data.code==200){ if (res.data.code == 200) {
this.inputData = res.data.data this.inputData = res.data.data
this.openIndex = this.inputData['21548'] this.openIndex = this.inputData['21548']
this.get21549() this.get21549()
this.inputData['21552'] = this.countData(this.inputData['21552']) this.inputData['21552'] = this.countData(this.inputData['21552'])
this.inputData['21550'] = this.countData10(this.inputData['21550']) this.inputData['21550'] = this.countData10(this.inputData['21550'])
} }
}) })
this.getStatus(data)
}, },
// //
selectValue(e) { selectValue(e) {

View File

@ -55,7 +55,7 @@
</div> </div>
<div class="input-main border-right"> <div class="input-main border-right">
<span>最大开度</span> <span>最大开度</span>
<span>{{ inputData['21535'] }}</span> <span>{{ statusNum }}</span>
<span>%</span> <span>%</span>
</div> </div>
<div class="input-main"> <div class="input-main">
@ -93,8 +93,13 @@ export default {
openIndex: 1, openIndex: 1,
inputData: {}, inputData: {},
openTrue: false, openTrue: false,
statusNum:0,
statusInterval:null,
} }
}, },
beforeDestroy(){
clearInterval(this.statusInterval)&&this.statusInterval
},
mounted() { mounted() {
this.dataInit(); this.dataInit();
//input //input
@ -203,6 +208,18 @@ export default {
} }
}) })
this.getStatus(data)
clearInterval(this.statusInterval)&&this.statusInterval
this.statusInterval=setInterval(() => {
this.getStatus(data)
}, 3000);
},
getStatus(data){
this.api.getControlGetState(data).then(res=>{
if(res.data.code==200){
this.statusNum=res.data.data['1015']
}
})
}, },
// //
selectValue(e) { selectValue(e) {