pull/37/head
pangdundun 2023-11-16 15:07:31 +08:00
parent 7fc50fd211
commit 79f70fd075
2 changed files with 54 additions and 22 deletions

View File

@ -150,41 +150,48 @@
</div>
<div class="device_content scroll">
<div class="content_item" v-for="(content_item, index) in 6" :key="index">
<div class="content_item">
<div class="i_title">
<img src="../../assets/img/i_title_img.png" alt="">
<span>卷膜天窗</span>
<span>风机</span>
<span class="line"></span>
<span>打开</span>
<span>{{ fanStatus.open == 1 ? '自动控制' : '手动控制' }}</span>
<span class="line"></span>
<span>位置50%</span>
<span @click="i_contentHandler(index)"></span>
<span></span>
</div>
<div class="i_content" v-if="menu_current == true && content_item_current == index">
<div class="i_content">
<div class="i_content_item">
<span>1#风机</span>
<span>开启</span>
<span>{{ fanStatus.status[0] == 1 ? '打开' : '关闭' }}</span>
<span class="line"></span>
<span>2#风机</span>
<span>开启</span>
<span>{{ fanStatus.status[1] == 1 ? '打开' : '关闭' }}</span>
</div>
<div class="line1"></div>
<div class="i_content_item">
<span>3#风机</span>
<span>开启</span>
<span>{{ fanStatus.status[2] == 1 ? '打开' : '关闭' }}</span>
<span class="line"></span>
<span>4#风机</span>
<span>开启</span>
<span>{{ fanStatus.status[3] == 1 ? '打开' : '关闭' }}</span>
</div>
<div class="line1"></div>
<div class="i_content_item">
<span>5#风机</span>
<span>开启</span>
<span>{{ fanStatus.status[4] == 1 ? '打开' : '关闭' }}</span>
<span class="line"></span>
<span>6#风机</span>
<span>开启</span>
</div>
</div>
<div class="i_title" style="margin-top: 0.2rem;" v-for="(item, index) in statusList" :key="index">
<img src="../../assets/img/i_title_img.png" alt="">
<span>{{ item.name }}</span>
<span class="line"></span>
<span>{{ item.open == 1 ? '自动控制' : '手动控制' }}</span>
<span class="line"></span>
<span>位置{{ item.progress }}%</span>
<span>菜单</span>
</div>
</div>
</div>
</div>
@ -262,7 +269,12 @@ export default {
// Copy
getVideoDataList: [],
url: ''
url: '',
fanStatus: {
name: '风机', open: 0, status: []
},
statusList: [],
}
},
mounted() {
@ -285,9 +297,9 @@ export default {
this.drag_boxHandler()
// this.timer_ = setTimeout(() => {
// this.$router.push({ path: '/largeScreen1' })
// }, 6000);
this.timer_ = setTimeout(() => {
this.$router.push({ path: '/largeScreen1' })
}, 6000);
this.login()
@ -420,10 +432,30 @@ export default {
})
},
padString(str, length) {
return str.padStart(length, '0');
},
// Copy
get_readControl_getState(deviceId) {
this.api.readControl_getState(deviceId).then(res => {
console.log('控制器状态值获取 Copy', res);
if (res.data.code == 200) {
this.fanStatus.open = res.data.data['1023']
this.fanStatus.status = []
var num = res.data.data['1024']
var num1 = this.padString(num.toString(2), 5)
var openListNew = []
openListNew = num1.split("")
this.fanStatus.status = openListNew.reverse()
this.statusList = []
for (var i = 0; i < 4; i++) {
var statusData = { name: `顶卷膜${i + 1}`, open: res.data.data[(1025 + (i * 3))], progress: res.data.data[(1027 + (i * 3))], index: res.data.data[(1026 + (i * 3))] }
this.statusList.push(statusData)
}
console.log(this.statusList);
}
})
},

View File

@ -191,15 +191,15 @@ export default {
mounted() {
this.drag_boxHandler()
// this.timer1 = setTimeout(() => {
// this.$router.push({ path: '/largeScreen' })
// }, 20000);
this.timer1 = setTimeout(() => {
this.$router.push({ path: '/largeScreen' })
}, 20000);
// this.timer = setInterval(() => {
// this.dialogVisible = !this.dialogVisible
// }, 3000);
this.timer = setInterval(() => {
this.dialogVisible = !this.dialogVisible
}, 3000);
this.login()