Merge branch 'pc-master' of https://git.lihe-control.com/xiaomeng/wszhyWx into pc-master

pull/65/head
pangdundun 2023-12-07 10:37:51 +08:00
commit 3b38393e3b
15 changed files with 706 additions and 227 deletions

View File

@ -217,6 +217,25 @@ export default {
// 查看用户额外权限 // 查看用户额外权限
user_getjurisdiction(userId,data){ user_getjurisdiction(userId,data){
return sendGetRequest(`/user/getjurisdiction?userId=${userId}`, data) return sendGetRequest(`/user/getjurisdiction?userId=${userId}`, data)
} },
//实时数据页面状态值(查看全部设备)
getStatePermissionStatus(data){
return sendGetRequest(`/getcontrol/getStatePermissionStatus`, data)
},
//获取当前权限能看到的设备
getPermissionStatus(data){
return sendGetRequest(`/getcontrol/getPermissionStatus`, data)
},
//根据id删除status设备
delPermissionStatus(id1,id2){
return sendPostRequest(`/getcontrol/delPermissionStatus?deviceId=${id1}&permissionid=${id2}`, '')
},
//根据id添加status设备
addPermissionStatus(id1,id2){
return sendPostRequest(`/getcontrol/addStatepermission?deviceId=${id1}&Permissionid=${id2}`, '')
}
}; };

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%;
@ -1011,7 +1016,7 @@
max-height: 50px; max-height: 50px;
} }
.upload .upload-content > div > .no-sel { .upload .upload-content > div .no-sel {
margin-right: 10px; margin-right: 10px;
width: 35px; width: 35px;
height: 35px; height: 35px;
@ -1694,7 +1699,7 @@
} }
.realTime .page-content .status-view .status-view-top { .realTime .page-content .status-view .status-view-top {
padding: 0 10px 0 20px; padding: 0 10px 0 10px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@ -1707,6 +1712,7 @@
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #FFFFFF;
white-space: nowrap;
} }
.realTime .page-content .status-view .status-view-top .status-view-top-right { .realTime .page-content .status-view .status-view-top .status-view-top-right {
@ -1852,6 +1858,15 @@
flex-direction: column; flex-direction: column;
} }
.realTime .page-content .status-view .status-view-content .status-noTrue.status-add {
cursor: pointer;
}
.realTime .page-content .status-view .status-view-content .status-noTrue.status-add > img {
width: 40px;
height: 40px;
}
.realTime .page-content .status-view .status-view-content .status-noTrue > img { .realTime .page-content .status-view .status-view-content .status-noTrue > img {
width: 40px; width: 40px;
height: 35px; height: 35px;
@ -1942,6 +1957,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding-right: 10px; padding-right: 10px;
margin-right: 10px;
} }
.wufang .no-sel { .wufang .no-sel {
@ -2158,6 +2174,32 @@
margin: 0; margin: 0;
} }
.skylight .flex-sel {
display: flex;
align-items: center;
padding-right: 10px;
margin-right: 10px;
}
.skylight .no-sel {
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.5) inset;
border: 1px solid rgba(0, 204, 255, 0.7);
border-radius: 50%;
cursor: pointer;
margin-right: 9px;
}
.skylight .sel {
width: 35px;
height: 35px;
margin-right: 9px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}
.skylight .input-sel { .skylight .input-sel {
margin-right: 20px; margin-right: 20px;
} }
@ -2166,12 +2208,8 @@
border: none; border: none;
} }
.skylight .input-main { .skylight .border-bottom {
margin-right: 20px; border-bottom: 1px solid rgba(2, 148, 226, 0.5);
}
.skylight .input-main > input {
width: 260px;
} }
.fan .bold-title { .fan .bold-title {
@ -2943,3 +2981,48 @@
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
.model-title {
width: 100%;
text-align: center;
font-size: 20px;
font-weight: bold;
padding: 15px 0;
}
.model-sel {
display: flex;
flex-wrap: wrap;
align-items: center;
min-height: 200px;
max-height: 700px;
overflow: auto;
padding: 0 30px;
}
.model-sel > div {
width: 33%;
white-space: nowrap;
flex-shrink: 0;
display: flex;
align-items: center;
}
.model-sel .no-sel {
margin-right: 10px;
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.5) inset;
border: 1px solid rgba(0, 204, 255, 0.7);
border-radius: 50%;
cursor: pointer;
}
.model-sel .sel {
margin-right: 10px;
width: 35px;
height: 35px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}

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 {
@ -1057,7 +1061,7 @@ margin-top: 20px;
white-space: nowrap; white-space: nowrap;
max-height: 50px; max-height: 50px;
>.no-sel { .no-sel {
margin-right: 10px; margin-right: 10px;
width: 35px; width: 35px;
height: 35px; height: 35px;
@ -1791,7 +1795,7 @@ margin-top: 20px;
margin: 7.5px; margin: 7.5px;
.status-view-top { .status-view-top {
padding: 0 10px 0 20px; padding: 0 10px 0 10px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@ -1803,6 +1807,7 @@ margin-top: 20px;
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #FFFFFF;
white-space: nowrap;
} }
.status-view-top-right { .status-view-top-right {
@ -1951,7 +1956,13 @@ margin-top: 20px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
&.status-add{
cursor: pointer;
>img{
width: 40px;
height: 40px;
}
}
>img { >img {
width: 40px; width: 40px;
height: 35px; height: 35px;
@ -2055,6 +2066,7 @@ margin-top: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
padding-right: 10px; padding-right: 10px;
margin-right: 10px;
} }
.no-sel { .no-sel {
width: 35px; width: 35px;
@ -2288,6 +2300,30 @@ margin-top: 20px;
} }
.skylight { .skylight {
.flex-sel{
display: flex;
align-items: center;
padding-right: 10px;
margin-right: 10px;
}
.no-sel {
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.50) inset;
border: 1px solid rgba(0, 204, 255, 0.70);
border-radius: 50%;
cursor: pointer;
margin-right: 9px;
}
.sel {
width: 35px;
height: 35px;
margin-right: 9px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}
.input-sel { .input-sel {
margin-right: 20px; margin-right: 20px;
@ -2299,12 +2335,13 @@ margin-top: 20px;
.flex-view { .flex-view {
border: none; border: none;
} }
.border-bottom{
border-bottom: 1px solid rgba(2, 148, 226, 0.5);
}
.input-main { .input-main {
margin-right: 20px;
>input { >input {
width: 260px; // width: 260px;
} }
} }
} }
@ -3072,3 +3109,46 @@ color: #FFFFFF;
} }
} }
} }
.model-title{
width: 100%;
text-align: center;
font-size: 20px;
font-weight: bold;
padding: 15px 0;
}
.model-sel{
display: flex;
flex-wrap: wrap;
align-items: center;
min-height:200px ;
max-height: 700px;
overflow: auto;
padding: 0 30px;
>div{
width: 33%;
white-space: nowrap;
flex-shrink: 0;
display: flex;
align-items: center;
}
.no-sel {
margin-right: 10px;
width: 35px;
height: 35px;
box-shadow: 0 0 15px rgba(53, 187, 247, 0.50) inset;
border: 1px solid rgba(0, 204, 255, 0.70);
border-radius: 50%;
cursor: pointer;
}
.sel {
margin-right: 10px;
width: 35px;
height: 35px;
background: url(../image/radio.png) no-repeat center;
background-size: 100% 100%;
cursor: pointer;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -316,7 +316,6 @@ export function realTimeLine(id, data) {
}); });
} }
export function statusCharts(id, data) { export function statusCharts(id, data) {
console.log(id,11);
var chartDom = document.getElementById(id); var chartDom = document.getElementById(id);
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;

View File

@ -44,7 +44,7 @@ export default new Vuex.Store({
{ label: '果实直径', value: 23, countType: 0,unit:'mm' }, { label: '果实直径', value: 23, countType: 0,unit:'mm' },
{ label: '茎秆直径', value: 24, countType: 0,unit:'mm' }, { label: '茎秆直径', value: 24, countType: 0,unit:'mm' },
{ label: '流速', value: 25, countType: 2,unit:'m/s' }, { label: '流速', value: 25, countType: 2,unit:'m/s' },
{ label: '瞬时流量', value: 26, countType: 2,unit:'m3' }, { label: '瞬时流量', value: 26, countType: 2,unit:'m³/H' },
{ label: '当日流量', value: 27, countType: 2,unit:'T' }, { label: '当日流量', value: 27, countType: 2,unit:'T' },
{ label: '累计流量', value: 28, countType: 0,unit:'T' }, { label: '累计流量', value: 28, countType: 0,unit:'T' },
{ label: '无线气象站电池电压', value: 29, countType: 2,unit:'V' }, { label: '无线气象站电池电压', value: 29, countType: 2,unit:'V' },

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="formula realTime"> <div class="formula realTime">
<div class="page-content new-data" :class="deviceName == 10||deviceName == 30 ? 'control-page' : ''"> <div class="page-content new-data" :class="deviceName == 10 || deviceName == 30 ? 'control-page' : ''">
<div class="control-view" v-if="deviceName == 10||deviceName == 30"> <div class="control-view" v-if="deviceName == 10 || deviceName == 30">
<div class="title">气象站:</div> <div class="title">气象站:</div>
<vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1"> <vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1">
<div class="list-view" v-for="item, index in controlList " :key="index"> <div class="list-view" v-for="item, index in controlList " :key="index">
@ -51,7 +51,7 @@
</div> </div>
<div class="flex-list realTime-bottom"> <div class="flex-list realTime-bottom">
<div class="left-view" v-if="deviceName!=30"> <div class="left-view" v-if="deviceName != 30">
<div ref="monitor" class="monitor" id="monitor"> <div ref="monitor" class="monitor" id="monitor">
<!-- <video ref="videoPlayer" class="video-js" id="video-js"></video> --> <!-- <video ref="videoPlayer" class="video-js" id="video-js"></video> -->
<div ref="videoPlayer" class="video-js" id="video-js"></div> <div ref="videoPlayer" class="video-js" id="video-js"></div>
@ -66,102 +66,18 @@
设备运行状态 设备运行状态
</div> </div>
<div class="flex-view border-none"> <div class="flex-view border-none">
<div class="status-view">
<div class="status-view-top">
<div class="status-view-top-left">{{ fanStatus.name }}</div>
<!-- <el-popover placement="top" width="140">
<div class="set-status-blue">进入修改设定值</div>
<el-popover placement="top" width="160">
<p class="del-text"><i style="color:red" class="el-popconfirm__icon el-icon-info"></i>确认删除?
</p>
<div style="text-align: right; margin: 0">
<el-button class="el-button el-button--text el-button--mini color-blue">取消</el-button>
<el-button class="el-button el-button--text el-button--mini color-blue">确定</el-button>
</div>
<div class="set-status-red" slot="reference">删除</div>
</el-popover>
<el-popover placement="right" width="100">
<input v-model="item.index" type="text" class="status-save">
<el-button class="el-button el-button--text el-button--mini color-blue">保存</el-button>
<div class="set-status-blue" slot="reference">排序</div>
</el-popover>
<img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt="">
</el-popover> -->
<img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt="">
</div>
<div class="status-view-content">
<div v-if="fanStatus.open != 0" class="status-true">
<div class="status-true-sel">
<div class="sel">
<img v-if="fanStatus.open == 1" src="../../assets/img/status-true-sel.png" alt="">
<img v-else src="../../assets/img/status-true-nosel.png" alt="">
自动控制
</div>
<div class="sel-phone">
<img v-if="fanStatus.open != 1" src="../../assets/img/status-true-sel.png" alt="">
<img v-else src="../../assets/img/status-true-nosel.png" alt="">
手机控制
</div>
</div>
<div class="status-fan">
<div class="btn" :class="fanStatus.status[0] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="fanStatus.status[0] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt="">
<span>1#风机</span>
</div>
<div class="btn" :class="fanStatus.status[1] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="fanStatus.status[1] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>2#风机</span>
</div>
<div class="btn" :class="fanStatus.status[2] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="fanStatus.status[2] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>3#风机</span>
</div>
<div class="btn" :class="fanStatus.status[3] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="fanStatus.status[3] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>4#风机</span>
</div>
<div class="btn" :class="fanStatus.status[4] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="fanStatus.status[4] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>5#风机</span>
</div>
</div>
</div>
<div v-else class="status-noTrue">
<img src="../../assets/img/status-no.png" alt="">
<div>当前设备无效</div>
</div>
</div>
</div>
<div class="status-view" v-for="item, index in statusList" :key="index"> <div class="status-view" v-for="item, index in statusList" :key="index">
<div class="status-view-top"> <div class="status-view-top">
<div class="status-view-top-left">{{ item.name }}</div> <div class="status-view-top-left">{{ item.name }}</div>
<!-- <el-popover placement="top" width="140"> <el-popover placement="top" width="140" v-model="item.deltrue">
<div class="set-status-blue">进入修改设定值</div> <div class="set-status-red" @click="delStatus(item, index)">删除</div>
<el-popover placement="top" width="160">
<p class="del-text"><i style="color:red" class="el-popconfirm__icon el-icon-info"></i>确认删除?
</p>
<div style="text-align: right; margin: 0">
<el-button class="el-button el-button--text el-button--mini color-blue">取消</el-button>
<el-button class="el-button el-button--text el-button--mini color-blue">确定</el-button>
</div>
<div class="set-status-red" slot="reference">删除</div>
</el-popover>
<el-popover placement="right" width="100">
<input v-model="item.index" type="text" class="status-save">
<el-button class="el-button el-button--text el-button--mini color-blue">保存</el-button>
<div class="set-status-blue" slot="reference">排序</div>
</el-popover>
<img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt="">
</el-popover> --> </el-popover>
<img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> <!-- <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> -->
</div> </div>
<div class="status-view-content"> <!-- 风机 -->
<div class="status-view-content" v-if="item.type == 1">
<div v-if="item.open != 0" class="status-true"> <div v-if="item.open != 0" class="status-true">
<div class="status-true-sel"> <div class="status-true-sel">
<div class="sel"> <div class="sel">
@ -175,13 +91,67 @@
手机控制 手机控制
</div> </div>
</div> </div>
<div class="status-true-charts"> <div class="status-fan">
<div class="btn" :class="item.status[0] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="item.status[0] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt="">
<span>1#风机</span>
</div>
<div class="btn" :class="item.status[1] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="item.status[1] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>2#风机</span>
</div>
<div class="btn" :class="item.status[2] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="item.status[2] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>3#风机</span>
</div>
<div class="btn" :class="item.status[3] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="item.status[3] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>4#风机</span>
</div>
<div class="btn" :class="item.status[4] == 1 ? 'blue' : 'off'">
<img class="fan-img" v-if="item.status[4] == 1" src="../../assets/img/fan-on.png"
alt="">
<img v-else src="../../assets/img/fan-off.png" alt=""> <span>5#风机</span>
</div>
</div>
</div>
<div v-else class="status-noTrue">
<img src="../../assets/img/status-no.png" alt="">
<div>当前设备无效</div>
</div>
</div>
<!-- 顶卷膜及其他 -->
<div class="status-view-content" v-if="item.type != 1">
<div v-if="item.open != 0" class="status-true">
<div class="status-true-sel">
<div class="sel">
<img v-if="item.open == 1" src="../../assets/img/status-true-sel.png" alt="">
<img v-else src="../../assets/img/status-true-nosel.png" alt="">
自动控制
</div>
<div class="sel-phone">
<img v-if="item.open != 1" src="../../assets/img/status-true-sel.png" alt="">
<img v-else src="../../assets/img/status-true-nosel.png" alt="">
手机控制
</div>
</div>
<div class="status-true-charts" v-if="item.type == 6 || item.type == 5 || item.type == 2">
<img src="../../assets/img/status-true-charts-icon.png" alt=""> <img src="../../assets/img/status-true-charts-icon.png" alt="">
<div :id="'statusCharts' + index"></div> <div :id="'statusCharts' + index"></div>
</div>
<div class="status-true-charts" style="background: unset;height: 50px;" v-else>
</div> </div>
<div class="status-true-text"> <div class="status-true-text">
<div class="status-true-text-left">{{ getNumberStatus(item.index) }}</div> <div class="status-true-text-left">{{ getNumberStatus(item) }}</div>
<div class="status-true-text-right">{{ item.progress }}%</div> <div class="status-true-text-right"
v-if="item.type == 6 || item.type == 5 || item.type == 2">{{
item.progress }}%</div>
</div> </div>
</div> </div>
<div v-else class="status-noTrue"> <div v-else class="status-noTrue">
@ -190,8 +160,32 @@
</div> </div>
</div> </div>
</div> </div>
<div class="status-view">
<div class="status-view-top">
<div class="status-view-top-left">添加设备</div>
</div>
<div class="status-view-content">
<div class="status-noTrue status-add" @click="addModel = true">
<img src="../../assets/img/status-add.png" alt="">
<div>点击添加设备</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<el-dialog title="请选择要显示的设备" :append-to-body="true" :visible.sync="addModel" width="70%">
<div class="model-title">请选择要显示的设备</div>
<div class="model-sel scroll">
<div v-for="item, index in selDevicestatus" :key="index">
<div @click="selClick(item)" :class="item.select ? 'sel' : 'no-sel'"></div>
{{ item.statePermissions }}
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="addModel = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -234,9 +228,6 @@ export default {
return { return {
statusList: [], statusList: [],
fanStatus: {
name: '风机', open: 0, status: []
},
time: null,// time: null,//
list: [], list: [],
inputData: [], inputData: [],
@ -248,6 +239,11 @@ export default {
controlList: [], controlList: [],
statusInterval: null,//statusInterval statusInterval: null,//statusInterval
statusTime: 2,//status statusTime: 2,//status
allDevicestatus: [],//
nowDevicestatus: [],//
selDevicestatus: [],//
addModel: false,//
} }
}, },
watch: { watch: {
@ -319,18 +315,49 @@ export default {
width: divW, // 1920 px width: divW, // 1920 px
height: divH, // 1080 px height: divH, // 1080 px
}) })
console.log(this.player);
}, },
getNumberStatus(index) { getNumberStatus(item) {
if (index == 0) { var index = item.index
return '静止状态' if (item.type == 2 || item.type == 5 || item.type == 6) {
} else if (index == 1) { //
return '正向打开中' if (index == 0) {
} else if (index == 2) { return '静止状态'
return '反向关闭中' } else if (index == 1) {
} else { return '正向打开中'
return '' } else if (index == 2) {
return '反向关闭中'
} else {
return ''
}
} else if (item.type == 3) {
//
if (index == 0) {
return '加温水泵关闭'
} else if (index == 1) {
return '加温水泵打开'
} else {
return ''
}
} else if (item.type == 4) {
//
if (index == 0) {
return '地热风机关闭'
} else if (index == 1) {
return '地热风机打开'
} else {
return ''
}
} else if (item.type == 7) {
//
if (index == 0) {
return '除雪关闭'
} else if (index == 1) {
return '除雪打开'
} else {
return ''
}
} }
}, },
createVideo() { createVideo() {
@ -568,6 +595,7 @@ export default {
}) })
this.getStatus() this.getStatus()
this.getStatePermissionStatus()
clearInterval(this.statusInterval) && this.statusInterval clearInterval(this.statusInterval) && this.statusInterval
this.statusInterval = setInterval(() => { this.statusInterval = setInterval(() => {
if (this.deviceName == 10) { if (this.deviceName == 10) {
@ -615,7 +643,7 @@ export default {
var num = el.environmentData + el1.unit var num = el.environmentData + el1.unit
this.list.push({ this.list.push({
...el, ...el,
name:el.environmentDataId, name: el.environmentDataId,
num: num, num: num,
img: require(`../../assets/image/real-time-${el.formula}.png`) img: require(`../../assets/image/real-time-${el.formula}.png`)
}) })
@ -642,6 +670,90 @@ export default {
} }
}, },
//status
getStatePermissionStatus() {
this.api.getStatePermissionStatus().then(res => {
if (res.data.code == 200) {
this.allDevicestatus = res.data.data
this.getPermissionStatus()
}
})
},
//
getPermissionStatus() {
var store = this.$store.state
var TargetValue = {
deviceId: store.equipmentList[this.indexs - 1].deviceId
}
this.api.getPermissionStatus(TargetValue).then(res => {
if (res.data.code == 200) {
this.nowDevicestatus = res.data.data
var list1 = this.allDevicestatus
var list2 = this.nowDevicestatus
var resultArray = []
// list1
for (const item1 of list1) {
// list2 id
const matchingItem = list2.find(item2 => item2.id === item1.id);
// list1 select
if (matchingItem) {
item1.select = true;
} else {
// select false
item1.select = false;
}
//
resultArray.push(item1);
}
this.selDevicestatus = resultArray
}
})
},
selClick(item) {
var store = this.$store.state
var deviceId = store.equipmentList[this.indexs - 1].deviceId
var statusId = item.id
if (item.select) {
item.select = false
this.$forceUpdate();
this.api.delPermissionStatus(deviceId, statusId).then((res => {
if (res.data.code == 200) {
this.$message({
message: '修改成功',
type: "success",
});
this.getPermissionStatus()
}
}))
} else {
item.select = true
this.$forceUpdate();
this.api.addPermissionStatus(deviceId, statusId).then((res => {
if (res.data.code == 200) {
this.$message({
message: '修改成功',
type: "success",
});
this.getPermissionStatus()
}
}))
}
},
//
delStatus(item, index) {
this.statusList[index].deltrue = false
var store = this.$store.state
var deviceId = store.equipmentList[this.indexs - 1].deviceId
var statusId = item.id
this.api.delPermissionStatus(deviceId, statusId).then((res => {
if (res.data.code == 200) {
this.getPermissionStatus()
}
}))
},
//
getStatus() { getStatus() {
var store = this.$store.state var store = this.$store.state
var TargetValue = { var TargetValue = {
@ -649,24 +761,57 @@ export default {
} }
this.api.getControlGetState(TargetValue).then(res => { this.api.getControlGetState(TargetValue).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.fanStatus.open = res.data.data['1023'] const statusList = []
this.fanStatus.status = [] this.nowDevicestatus.forEach((el, index) => {
var num = res.data.data['1024'] if (el.id == 1) {
var num1 = this.padString(num.toString(2), 5) //
var openListNew = [] var fandata = {}
openListNew = num1.split("") fandata.open = res.data.data['1023']
this.fanStatus.status = openListNew.reverse() fandata.id = el.id
this.statusList = [] fandata.type = 1
for (var i = 0; i < 4; i++) { fandata.name = el.name
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))] } fandata.status = []
this.statusList.push(statusData) var num = res.data.data['1024']
var num1 = this.padString(num.toString(2), 5)
var openListNew = []
} openListNew = num1.split("")
fandata.status = openListNew.reverse()
statusList.push(fandata)
} else if (el.id == 2 || el.id == 3 || el.id == 4 || el.id == 5) {
//
var statusData = { name: el.name, type: 2, id: el.id, open: res.data.data[(1025 + ((el.id - 2) * 3))], progress: res.data.data[(1027 + ((el.id - 2) * 3))], index: res.data.data[(1026 + ((el.id - 2) * 3))] }
statusList.push(statusData)
} else if (el.id == 6) {
//
var statusData = { name: el.name, type: 3, id: el.id, open: res.data.data['1000'], progress: 0, index: res.data.data['1001'] }
statusList.push(statusData)
} else if (el.id == 7) {
//
var statusData = { name: el.name, type: 4, id: el.id, open: res.data.data['1002'], progress: 0, index: res.data.data['1003'] }
statusList.push(statusData)
} else if (el.id == 8) {
//
var statusData = { name: el.name, type: 5, id: el.id, open: res.data.data['1004'], progress: res.data.data['1006'], index: res.data.data['1005'] }
statusList.push(statusData)
} else if (el.id == 9) {
//
var statusData = { name: el.name, type: 5, id: el.id, open: res.data.data['1007'], progress: res.data.data['1009'], index: res.data.data['1008'] }
statusList.push(statusData)
} else if (el.id == 10) {
//
var statusData = { name: el.name, type: 6, id: el.id, open: res.data.data['1010'], progress: res.data.data['1012'], index: res.data.data['1011'] }
statusList.push(statusData)
} else if (el.id == 11) {
//
var statusData = { name: el.name, type: 7, id: el.id, open: res.data.data['1013'], progress: 0, index: res.data.data['1014'] }
statusList.push(statusData)
}
})
this.statusList = statusList
this.$forceUpdate(); this.$forceUpdate();
setTimeout(() => { setTimeout(() => {
this.statusList.forEach((el, index) => { this.statusList.forEach((el, index) => {
if (el.open != 0) { if (el.open != 0 && (el.type == 6 || el.type == 5 || el.type == 2)) {
statusCharts(`statusCharts${index}`, el.progress) statusCharts(`statusCharts${index}`, el.progress)
} }
}) })
@ -674,9 +819,7 @@ export default {
} else { } else {
this.statusList = [] this.statusList = []
this.fanStatus = {
name: '风机', open: 0, status: []
}
this.$forceUpdate(); this.$forceUpdate();
// this.$message.error(res.data.msg); // this.$message.error(res.data.msg);
} }

View File

@ -3,7 +3,7 @@
<div class="table-title"> <div class="table-title">
<img src="../../assets/image/skylight.png" alt=""> 顶卷膜{{ indexs }} <img src="../../assets/image/skylight.png" alt=""> 顶卷膜{{ indexs }}
</div> </div>
<div class="flex-view"> <div class="flex-view border-bottom">
<div class="input-btn"> <div class="input-btn">
<div class="btn" @click="changeOpen(1)" :class="openIndex == 1 ? 'blue' : 'green'"> <div class="btn" @click="changeOpen(1)" :class="openIndex == 1 ? 'blue' : 'green'">
<img src="../../assets/image/irrigateSet2.png" alt="" />自动运行 <img src="../../assets/image/irrigateSet2.png" alt="" />自动运行
@ -20,6 +20,43 @@
</div> </div>
</div> </div>
<div class="flex-view border-bottom">
<div class="flex-sel border-right" @click="changeOpenTrue(0)">
<div v-if="openTrue[0] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
大风保护有效
</div>
<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" @click="changeOpenTrue(2)">
<div v-if="openTrue[2] == 0" class="no-sel"></div>
<div v-else class="sel"></div>
有雨量桶检测
</div>
</div>
<div class="flex-view border-bottom">
<div class="input-main border-right">
<span>风速大于多少</span>
<input @blur="blurChange10('21662', $event)" v-model="inputData['21662']" @input="changeCount10('21662', $event)"
type="text" value="60" placeholder="60" />
<span>m/s,禁止开窗</span>
</div>
<div class="input-main border-right">
<span>大风保护时间</span>
<input @blur="blurChange('21663', $event)" v-model="inputData['21663']" @input="change('21663', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
<div class="input-main">
<span>下雨检测时间</span>
<input @blur="blurChange('21664', $event)" v-model="inputData['21664']" @input="change('21664', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
</div>
<div class="flex-view"> <div class="flex-view">
<div class="input-sel"> <div class="input-sel">
<div class="title">温度选择</div> <div class="title">温度选择</div>
@ -80,23 +117,19 @@
<div>全程运行时间</div> <div>全程运行时间</div>
<input @blur="blurChange(21621 + ((indexs - 1) * 11), $event)" v-model="inputData[21621 + ((indexs - 1) * 11)]" <input @blur="blurChange(21621 + ((indexs - 1) * 11), $event)" v-model="inputData[21621 + ((indexs - 1) * 11)]"
@input="change(21621 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0"> @input="change(21621 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0">
<span></span>
</div> </div>
</div>
<div class="flex-view padding-none">
<div class="input-main"> <div class="input-main">
<div>打开通道</div> <div>打开通道</div>
<input @blur="blurChange(21622 + ((indexs - 1) * 11), $event)" v-model="inputData[21622 + ((indexs - 1) * 11)]" <input @blur="blurChange(21622 + ((indexs - 1) * 11), $event)" v-model="inputData[21622 + ((indexs - 1) * 11)]"
@input="change(21622 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0"> @input="change(21622 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0">
<span></span>
</div> </div>
</div>
<div class="flex-view padding-none">
<div class="input-main"> <div class="input-main">
<div>关闭通道</div> <div>关闭通道</div>
<input @blur="blurChange(21623 + ((indexs - 1) * 11), $event)" v-model="inputData[21623 + ((indexs - 1) * 11)]" <input @blur="blurChange(21623 + ((indexs - 1) * 11), $event)" v-model="inputData[21623 + ((indexs - 1) * 11)]"
@input="change(21623 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0"> @input="change(21623 + ((indexs - 1) * 11), $event)" type="number" placeholder="0.0">
<span></span>
</div> </div>
</div> </div>
</div> </div>
@ -124,6 +157,8 @@ export default {
{ name: '8#空气温度', value: 10, },], { name: '8#空气温度', value: 10, },],
// //
openIndex: 0, openIndex: 0,
openTrue: [],
} }
}, },
watch: { watch: {
@ -134,7 +169,7 @@ export default {
that.getNowData(); that.getNowData();
}, 0); }, 0);
}, },
'$route.query.change'(newVal, oldVal){ '$route.query.change'(newVal, oldVal) {
this.dataInit(); this.dataInit();
}, },
}, },
@ -164,6 +199,33 @@ export default {
}; };
this.changeBtn(21613 + ((this.indexs - 1) * 11), dataNum); this.changeBtn(21613 + ((this.indexs - 1) * 11), dataNum);
}, },
//
myReverse(arr) {
return [...arr].reverse()
},
changeOpenTrue(index) {
if (this.openTrue[index] == 0) {
this.openTrue[index] = 1
} else {
this.openTrue[index] = 0
}
this.$forceUpdate();
var num = this.myReverse(this.openTrue).join("")
var dataNum = {
target: {
value: parseInt(num, 2),
},
};
this.changeBtn('21661', dataNum);
},
get21661() {
var num1 = this.inputData['21661']?this.inputData['21661']:0
var num11 = this.padString(num1.toString(2), 3)
var openList1New
openList1New = num11.split("")
this.openTrue = openList1New.reverse()
},
// //
handleCommand(index) { handleCommand(index) {
this.TypeSel = this.typeSelList[index].name this.TypeSel = this.typeSelList[index].name
@ -229,14 +291,14 @@ export default {
return 0 return 0
} }
}, },
// x/10 // x/10
countData10(data) { countData10(data) {
if (data) { if (data) {
return data / 10 return data / 10
} else { } else {
return 0 return 0
} }
}, },
dataInit() { dataInit() {
var store = this.$store.state var store = this.$store.state
var data = { var data = {
@ -247,6 +309,7 @@ export default {
if (res.data.code == 200) { if (res.data.code == 200) {
this.inputData = res.data.data; this.inputData = res.data.data;
this.getNowData() this.getNowData()
this.get21661()
this.inputData[21614] = this.countData10(this.inputData[21614]) this.inputData[21614] = this.countData10(this.inputData[21614])
this.inputData[21615] = this.countData(this.inputData[21615]) this.inputData[21615] = this.countData(this.inputData[21615])
this.inputData[21617] = this.countData(this.inputData[21617]) this.inputData[21617] = this.countData(this.inputData[21617])

View File

@ -120,7 +120,6 @@ export default {
this.actList2.push(this.actList2New.length-index-1) this.actList2.push(this.actList2New.length-index-1)
} }
}) })
console.log(this.actList2);
}, },
dataInit() { dataInit() {
this.actList1New = [] this.actList1New = []

View File

@ -50,13 +50,13 @@
<span></span> <span></span>
</div> </div>
<div class="input-main"> <div class="input-main">
<div>展开的输出通道</div> <div>打开的通道</div>
<input @blur="blurChange('21546', $event)" v-model="inputData['21546']" @input="change('21546', $event)" <input @blur="blurChange('21546', $event)" v-model="inputData['21546']" @input="change('21546', $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('21547', $event)" v-model="inputData['21547']" @input="change('21547', $event)" <input @blur="blurChange('21547', $event)" v-model="inputData['21547']" @input="change('21547', $event)"
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
<span></span> <span></span>

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,39 @@ 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.insertColonEveryTwoDigits(this.convertToTimeMinutes(res.data.data['1021']))
this.sunset = this.insertColonEveryTwoDigits(this.convertToTimeMinutes(res.data.data['1022']))
}
})
},
//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
}, },
dataInit() { dataInit() {
var store = this.$store.state var store = this.$store.state
@ -242,17 +260,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

@ -48,14 +48,29 @@
</div> </div>
</div> </div>
<div class="flex-view"> <div class="flex-view">
<div class="flex-sel border-right" @click="changeOpenTrue()"> <div class="flex-sel border-right" @click="changeOpenTrue(0)">
<div v-if="!openTrue" class="no-sel"></div> <div v-if="openTrue[0] == 0" class="no-sel"></div>
<div v-else class="sel"></div> <div v-else class="sel"></div>
计算的最大开度 计算的最大开度
</div> </div>
<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>
<div v-else class="sel"></div>
下雨保护
</div>
<div class="flex-sel border-right" @click="changeOpenTrue(3)">
<div v-if="openTrue[3] == 0" class="no-sel"></div>
<div v-else class="sel"></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">
@ -64,7 +79,7 @@
type="text" value="60" placeholder="60" /> type="text" value="60" placeholder="60" />
</div> </div>
</div> </div>
<div class="flex-view border-none"> <div class="flex-view">
<div class="input-main"> <div class="input-main">
<div>上风口的行程时间</div> <div>上风口的行程时间</div>
<input @blur="blurChange('21538', $event)" v-model="inputData['21538']" @input="change('21538', $event)" <input @blur="blurChange('21538', $event)" v-model="inputData['21538']" @input="change('21538', $event)"
@ -72,18 +87,40 @@
<span></span> <span></span>
</div> </div>
<div class="input-main"> <div class="input-main">
<div>展开的输出通道</div> <div>打开的通道</div>
<input @blur="blurChange('21539', $event)" v-model="inputData['21539']" @input="change('21539', $event)" <input @blur="blurChange('21539', $event)" v-model="inputData['21539']" @input="change('21539', $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('21540', $event)" v-model="inputData['21540']" @input="change('21540', $event)" <input @blur="blurChange('21540', $event)" v-model="inputData['21540']" @input="change('21540', $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 border-none">
<div class="input-main border-right">
<span>上风口风速大于多少</span>
<input @blur="blurChange10('21562', $event)"
v-model="inputData['21562']"
@input="changeCount10('21562', $event)"
type="text" value="60" placeholder="60" />
<span>m/s,禁止开窗</span>
</div>
<div class="input-main border-right">
<span>大风保护时间</span>
<input @blur="blurChange('21563', $event)" v-model="inputData['21563']" @input="change('21563', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
<div class="input-main">
<span>下雨检测时间</span>
<input @blur="blurChange('21564', $event)" v-model="inputData['21564']" @input="change('21564', $event)"
type="text" value="60" placeholder="60" />
<span></span>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -92,9 +129,14 @@ export default {
return { return {
openIndex: 1, openIndex: 1,
inputData: {}, inputData: {},
openTrue: false, openTrue: [],
statusNum:0,
statusInterval:null,
} }
}, },
beforeDestroy(){
clearInterval(this.statusInterval)&&this.statusInterval
},
mounted() { mounted() {
this.dataInit(); this.dataInit();
//input //input
@ -104,15 +146,33 @@ export default {
} }
}, },
methods: { methods: {
changeOpenTrue() { //
this.openTrue = !this.openTrue myReverse(arr) {
return [...arr].reverse()
},
changeOpenTrue(index) {
if (this.openTrue[index] == 0) {
this.openTrue[index] = 1
} else {
this.openTrue[index] = 0
}
this.$forceUpdate();
var num = this.myReverse(this.openTrue).join("")
var dataNum = { var dataNum = {
target: { target: {
value: this.openTrue ? 1 : 0, value: parseInt(num, 2),
}, },
}; };
this.changeBtn('21531', dataNum); this.changeBtn('21531', dataNum);
}, },
get21531() {
var num1 = this.inputData['21531']
var num11 = this.padString(num1.toString(2), 4)
var openList1New
openList1New = num11.split("")
this.openTrue = openList1New.reverse()
},
padString(str, length) { padString(str, length) {
return str.padStart(length, '0'); return str.padStart(length, '0');
}, },
@ -197,12 +257,24 @@ export default {
if(res.data.code==200){ if(res.data.code==200){
this.inputData = res.data.data this.inputData = res.data.data
this.openIndex = this.inputData['21530'] this.openIndex = this.inputData['21530']
this.openTrue = this.inputData['21531']==0?false:true this.get21531()
this.inputData['21532'] = this.countData(this.inputData['21532']) this.inputData['21532'] = this.countData(this.inputData['21532'])
this.inputData['21533'] = this.countData10(this.inputData['21533']) this.inputData['21533'] = this.countData10(this.inputData['21533'])
} }
}) })
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) {

View File

@ -41,10 +41,10 @@
</div> </div>
<div class="flex-view border-none"> <div class="flex-view border-none">
<div class="input-main"> <div class="input-main">
<span>室内1#平均温度夜间时段</span> <span>室内1#平均温度夜间时段</span>
<input @blur="blurChangeCount('21524', $event)" v-model="inputData['21524']" <input @blur="blurChangeCount('21524', $event)" v-model="inputData['21524']"
@input="changeCountData('21524', $event)" type="text" value="60" placeholder="60" /> @input="changeCountData('21524', $event)" type="text" value="60" placeholder="60" />
<span>启动</span> <span>停止</span>
</div> </div>
</div> </div>
<div class="flex-view border-none"> <div class="flex-view border-none">

View File

@ -3,3 +3,5 @@ vscode打开
先npm install 下载依赖 先npm install 下载依赖
依赖下载完成后 npm run serve 进行运行 依赖下载完成后 npm run serve 进行运行
该项目很多数据是无法循环的 故许多参数数据是写死的 如果需要添加新数据需要手动添加.