1
This commit is contained in:
parent
463cc3b16f
commit
efdaa5ec80
@ -217,6 +217,15 @@ export default {
|
||||
// 查看用户额外权限
|
||||
user_getjurisdiction(userId,data){
|
||||
return sendGetRequest(`/user/getjurisdiction?userId=${userId}`, data)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//实时数据页面状态值(查看全部设备)
|
||||
getStatePermissionStatus(data){
|
||||
return sendGetRequest(`/getcontrol/getStatePermissionStatus`, data)
|
||||
},
|
||||
getPermissionStatus(data){
|
||||
return sendGetRequest(`/getcontrol/getPermissionStatus`, data)
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -1699,7 +1699,7 @@
|
||||
}
|
||||
|
||||
.realTime .page-content .status-view .status-view-top {
|
||||
padding: 0 10px 0 20px;
|
||||
padding: 0 10px 0 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@ -1712,6 +1712,7 @@
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.realTime .page-content .status-view .status-view-top .status-view-top-right {
|
||||
|
2
src/assets/css/main.min.css
vendored
2
src/assets/css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1795,7 +1795,7 @@ margin-top: 20px;
|
||||
margin: 7.5px;
|
||||
|
||||
.status-view-top {
|
||||
padding: 0 10px 0 20px;
|
||||
padding: 0 10px 0 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@ -1807,6 +1807,7 @@ margin-top: 20px;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.status-view-top-right {
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<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>
|
||||
<vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1">
|
||||
<div class="list-view" v-for="item, index in controlList " :key="index">
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
</div>
|
||||
<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">
|
||||
<!-- <video ref="videoPlayer" class="video-js" id="video-js"></video> -->
|
||||
<div ref="videoPlayer" class="video-js" id="video-js"></div>
|
||||
@ -66,83 +66,11 @@
|
||||
设备运行状态
|
||||
</div>
|
||||
<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-top">
|
||||
<div class="status-view-top-left">{{ item.name }}</div>
|
||||
<!-- <el-popover placement="top" width="140">
|
||||
<div class="set-status-blue">进入修改设定值</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>
|
||||
@ -152,16 +80,12 @@
|
||||
</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="">
|
||||
</el-popover>
|
||||
<!-- <img class="status-view-top-right" slot="reference" src="../../assets/img/more.png" alt=""> -->
|
||||
</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 class="status-true-sel">
|
||||
<div class="sel">
|
||||
@ -175,13 +99,66 @@
|
||||
手机控制
|
||||
</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="">
|
||||
<div :id="'statusCharts' + index"></div>
|
||||
</div>
|
||||
<div class="status-true-charts" style="background: unset;height: 50px;" v-else>
|
||||
|
||||
</div>
|
||||
<div class="status-true-text">
|
||||
<div class="status-true-text-left">{{ getNumberStatus(item.index) }}</div>
|
||||
<div class="status-true-text-right">{{ item.progress }}%</div>
|
||||
<div class="status-true-text-left">{{ getNumberStatus(item) }}</div>
|
||||
<div class="status-true-text-right" v-if="item.type == 6 || item.type == 5 || item.type == 2">{{
|
||||
item.progress }}%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="status-noTrue">
|
||||
@ -234,9 +211,6 @@ export default {
|
||||
return {
|
||||
statusList: [],
|
||||
|
||||
fanStatus: {
|
||||
name: '风机', open: 0, status: []
|
||||
},
|
||||
time: null,//右上角时间
|
||||
list: [],
|
||||
inputData: [],
|
||||
@ -248,6 +222,9 @@ export default {
|
||||
controlList: [],
|
||||
statusInterval: null,//status状态的Interval
|
||||
statusTime: 2,//status状态的秒数
|
||||
|
||||
allDevicestatus: [],//所有权限
|
||||
nowDevicestatus: [],//当前设备权限
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -321,16 +298,48 @@ export default {
|
||||
})
|
||||
console.log(this.player);
|
||||
},
|
||||
getNumberStatus(index) {
|
||||
if (index == 0) {
|
||||
return '静止状态'
|
||||
} else if (index == 1) {
|
||||
return '正向打开中'
|
||||
} else if (index == 2) {
|
||||
return '反向关闭中'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
getNumberStatus(item) {
|
||||
var index = item.index
|
||||
if (item.type == 2||item.type == 5||item.type == 6) {
|
||||
//顶卷膜
|
||||
if (index == 0) {
|
||||
return '静止状态'
|
||||
} else if (index == 1) {
|
||||
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() {
|
||||
|
||||
@ -566,8 +575,9 @@ export default {
|
||||
}
|
||||
// console.log(this.controlList);
|
||||
})
|
||||
|
||||
this.getPermissionStatus()
|
||||
this.getStatus()
|
||||
this.getStatePermissionStatus()
|
||||
clearInterval(this.statusInterval) && this.statusInterval
|
||||
this.statusInterval = setInterval(() => {
|
||||
if (this.deviceName == 10) {
|
||||
@ -615,7 +625,7 @@ export default {
|
||||
var num = el.environmentData + el1.unit
|
||||
this.list.push({
|
||||
...el,
|
||||
name:el.environmentDataId,
|
||||
name: el.environmentDataId,
|
||||
num: num,
|
||||
img: require(`../../assets/image/real-time-${el.formula}.png`)
|
||||
})
|
||||
@ -642,6 +652,26 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
//获取全部status数据
|
||||
getStatePermissionStatus() {
|
||||
this.api.getStatePermissionStatus().then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.allDevicestatus = res.data.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取当前设备的权限
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
getStatus() {
|
||||
var store = this.$store.state
|
||||
var TargetValue = {
|
||||
@ -649,24 +679,57 @@ export default {
|
||||
}
|
||||
this.api.getControlGetState(TargetValue).then(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)
|
||||
this.nowDevicestatus.forEach((el, index) => {
|
||||
if (el.id == 1) {
|
||||
//风机
|
||||
var fandata = {}
|
||||
fandata.open = res.data.data['1023']
|
||||
fandata.id = el.id
|
||||
fandata.type = 1
|
||||
fandata.name = el.name
|
||||
fandata.status = []
|
||||
var num = res.data.data['1024']
|
||||
var num1 = this.padString(num.toString(2), 5)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
fandata.status = openListNew.reverse()
|
||||
this.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))] }
|
||||
this.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'] }
|
||||
this.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'] }
|
||||
this.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'] }
|
||||
this.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'] }
|
||||
this.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'] }
|
||||
this.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'] }
|
||||
this.statusList.push(statusData)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
this.$forceUpdate();
|
||||
setTimeout(() => {
|
||||
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)
|
||||
}
|
||||
})
|
||||
@ -674,9 +737,7 @@ export default {
|
||||
|
||||
} else {
|
||||
this.statusList = []
|
||||
this.fanStatus = {
|
||||
name: '风机', open: 0, status: []
|
||||
}
|
||||
|
||||
this.$forceUpdate();
|
||||
// this.$message.error(res.data.msg);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user