|
|
|
@ -33,7 +33,9 @@
|
|
|
|
|
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitTypeName }}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="show" class="img"></div>
|
|
|
|
|
<div v-if="show"
|
|
|
|
|
:style="'background-image: url('+(MonitorInfo.monitorPic ? MonitorInfo.monitorPic :defaultImg)+');'"
|
|
|
|
|
class="img"></div>
|
|
|
|
|
<div class="terminal">
|
|
|
|
|
<!--el-form :model="form" class="demo-form-inline">
|
|
|
|
|
<el-form-item label="传感器名称:">
|
|
|
|
@ -42,19 +44,22 @@
|
|
|
|
|
</el-form-->
|
|
|
|
|
<div class="terminalList">
|
|
|
|
|
<div v-for="(i,k) in controlList" class="item">
|
|
|
|
|
<div class="icon"></div>
|
|
|
|
|
<div :style="'background-image: url('+(i.devicePic ? i.devicePic :defaultImg1)+');'" class="icon"></div>
|
|
|
|
|
<div class="title">{{ i.deviceName + ' - ' + i.deviceModeFunction.functionName }}</div>
|
|
|
|
|
<div class="switch">
|
|
|
|
|
<el-button
|
|
|
|
|
@click="switchChange(i.deviceModeFunction.functionIdentifier,i.deviceId,i.deviceCode,i.deviceModeFunction.modeFunctionId)" type="primary" size="mini">执行
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="switchChange(i.deviceModeFunction.functionIdentifier,i.deviceId,i.deviceCode,i.deviceModeFunction.modeFunctionId)">
|
|
|
|
|
执行
|
|
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- <el-switch-->
|
|
|
|
|
<!-- v-model="i.deviceType==='1'"-->
|
|
|
|
|
<!-- active-color="#1165a1"-->
|
|
|
|
|
<!-- inactive-color="#1facf4"-->
|
|
|
|
|
<!-- @change="switchChange(i.deviceModeFunction.functionIdentifier,i.deviceId,i.deviceCode,i.deviceModeFunction.modeFunctionId)">-->
|
|
|
|
|
<!-- </el-switch>-->
|
|
|
|
|
<!-- <el-switch-->
|
|
|
|
|
<!-- v-model="i.deviceType==='1'"-->
|
|
|
|
|
<!-- active-color="#1165a1"-->
|
|
|
|
|
<!-- inactive-color="#1facf4"-->
|
|
|
|
|
<!-- @change="switchChange(i.deviceModeFunction.functionIdentifier,i.deviceId,i.deviceCode,i.deviceModeFunction.modeFunctionId)">-->
|
|
|
|
|
<!-- </el-switch>-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -63,14 +68,14 @@
|
|
|
|
|
<div v-for="i in acquisitionList" class="item">
|
|
|
|
|
<div class="iconBg"></div>
|
|
|
|
|
<div
|
|
|
|
|
:style="'background-image: url('+i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]+')'"
|
|
|
|
|
:style="'background-image: url('+i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))] ? i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]:''+')'"
|
|
|
|
|
class="icon"></div>
|
|
|
|
|
<div class="rightBg">
|
|
|
|
|
<div class="title">{{ i.deviceName }}</div>
|
|
|
|
|
<div style="position: absolute;left: 24%;top: 0px;width: 55%;height: 100%;">
|
|
|
|
|
<div
|
|
|
|
|
v-for="val in Object.keys(i.deviceDataMap).slice(0,6).filter(e=> !(i.deviceDataMap[e].toString().includes('http')))"
|
|
|
|
|
class="infoItem" :style="'height:'+(Object.keys(i.deviceDataMap).length<4 ? '100%':'50%')">
|
|
|
|
|
:style="'height:'+(Object.keys(i.deviceDataMap).length<4 ? '100%':'50%')" class="infoItem">
|
|
|
|
|
<div class="span">{{ val }}:</div>
|
|
|
|
|
<div class="spanBg"></div>
|
|
|
|
|
<div class="num">{{ i.deviceDataMap[val] }}</div>
|
|
|
|
@ -95,6 +100,8 @@ import {
|
|
|
|
|
getMonitorById,
|
|
|
|
|
publishControlCommand
|
|
|
|
|
} from '@/api/board/equipment'
|
|
|
|
|
import defaultImg from '@/assets/board/equipment/icon.png'
|
|
|
|
|
import defaultImg1 from '@/assets/board/equipment/icon2.png'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let getDeviceInterval = null
|
|
|
|
@ -102,6 +109,8 @@ export default {
|
|
|
|
|
components: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
defaultImg,
|
|
|
|
|
defaultImg1,
|
|
|
|
|
show: false,
|
|
|
|
|
monitorUnitId: '',
|
|
|
|
|
data1: true,
|
|
|
|
@ -128,7 +137,7 @@ export default {
|
|
|
|
|
async getData() {
|
|
|
|
|
await this.getTree()
|
|
|
|
|
},
|
|
|
|
|
switchChange(functionIdentifier, deviceId, deviceCode,modeFunctionId) {
|
|
|
|
|
switchChange(functionIdentifier, deviceId, deviceCode, modeFunctionId) {
|
|
|
|
|
console.log(this.controlList)
|
|
|
|
|
console.log(this.controlList)
|
|
|
|
|
this.$confirm('确定执行么?', '提示', {
|
|
|
|
@ -137,10 +146,10 @@ export default {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
publishControlCommand({
|
|
|
|
|
deviceId:deviceId,
|
|
|
|
|
modeFunctionId:modeFunctionId,
|
|
|
|
|
deviceCode:deviceCode,
|
|
|
|
|
type:functionIdentifier,
|
|
|
|
|
deviceId: deviceId,
|
|
|
|
|
modeFunctionId: modeFunctionId,
|
|
|
|
|
deviceCode: deviceCode,
|
|
|
|
|
type: functionIdentifier,
|
|
|
|
|
}).then(e => {
|
|
|
|
|
if (e.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
@ -148,7 +157,7 @@ export default {
|
|
|
|
|
message: '成功!'
|
|
|
|
|
});
|
|
|
|
|
this.controlList.find(e => e.deviceId === deviceId).deviceType === '1' ? this.controlList.find(e => e.deviceId === deviceId).deviceType = '0' : this.controlList.find(e => e.deviceId === deviceId).deviceType = '1'
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '网络错误'
|
|
|
|
@ -163,7 +172,7 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async getTree() {
|
|
|
|
|
if(this.$store.getters.sceneId){
|
|
|
|
|
if (this.$store.getters.sceneId) {
|
|
|
|
|
const {data} = await treeList(this.$store.getters.sceneId)
|
|
|
|
|
this.treeData = data
|
|
|
|
|
}
|
|
|
|
@ -192,9 +201,9 @@ export default {
|
|
|
|
|
const {data} = await getMonitorById(e.id)
|
|
|
|
|
this.MonitorInfo = data
|
|
|
|
|
},
|
|
|
|
|
toHistory(e,i) {
|
|
|
|
|
toHistory(e, i) {
|
|
|
|
|
console.log(i)
|
|
|
|
|
this.$router.push({path: "/board/senso",query:{id:e,deviceModeId:i}});
|
|
|
|
|
this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
@ -276,7 +285,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.img {
|
|
|
|
|
background-image: url("~@/assets/board/equipment/icon.png");
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
position: absolute;
|
|
|
|
@ -334,10 +342,11 @@ export default {
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 13%;
|
|
|
|
|
left: 3.3%;
|
|
|
|
|
width: 19.5%;
|
|
|
|
|
height: 73%;
|
|
|
|
|
|
|
|
|
|
top: 21%;
|
|
|
|
|
left: 5.8%;
|
|
|
|
|
width: 14.5%;
|
|
|
|
|
height: 57%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|