|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="centerImg"></div>
|
|
|
|
|
<BoardTopNav nowMenu="3" @sceneIdChange="sceneIdChange"></BoardTopNav>
|
|
|
|
|
<BoardTopNav ref="boardTopNav" nowMenu="3" @sceneIdChange="sceneIdChange"></BoardTopNav>
|
|
|
|
|
<div class="title">物联网平台</div>
|
|
|
|
|
<div class="tree">
|
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@
|
|
|
|
|
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitTypeId }}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="img" v-if="show"></div>
|
|
|
|
|
<div v-if="show" class="img"></div>
|
|
|
|
|
<div class="terminal">
|
|
|
|
|
<el-form :model="form" class="demo-form-inline">
|
|
|
|
|
<el-form-item label="传感器名称:">
|
|
|
|
@ -110,7 +110,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
|
setInterval(this.getDevice, 30 * 1000)
|
|
|
|
|
this.sceneId = this.$store.getters.sceneId
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
sceneIdChange(e) {
|
|
|
|
@ -139,33 +140,40 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async getTree() {
|
|
|
|
|
const {data} = await treeList(this.sceneId)
|
|
|
|
|
const {data} = await treeList(this.$store.getters.sceneId)
|
|
|
|
|
this.treeData = data
|
|
|
|
|
},
|
|
|
|
|
treeClick(e) {
|
|
|
|
|
if (e.child.length === 0) {
|
|
|
|
|
this.monitorUnitId = e.monitorUnitId
|
|
|
|
|
this.getDevice(e.monitorUnitId)
|
|
|
|
|
this.getRightDevice(e.monitorUnitId)
|
|
|
|
|
if (!e.children?.length > 0) {
|
|
|
|
|
this.monitorUnitId = e.id
|
|
|
|
|
this.getDevice(e.id)
|
|
|
|
|
this.getRightDevice(e.id)
|
|
|
|
|
this.setMonitorById()
|
|
|
|
|
this.show = true
|
|
|
|
|
if(!getDeviceInterval){
|
|
|
|
|
var getDeviceInterval = setInterval(this.getDevice, 30 * 1000)
|
|
|
|
|
clearInterval(getDeviceInterval)
|
|
|
|
|
getDeviceInterval = setInterval(this.getDevice, 30 * 1000)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getDevice(e) {
|
|
|
|
|
const {data} = await selectDeviceByDeviceModeByMonitorUnitId(this.sceneId, e)
|
|
|
|
|
console.log('getDevice')
|
|
|
|
|
const {data} = await selectDeviceByDeviceModeByMonitorUnitId(this.$store.getters.sceneId, e)
|
|
|
|
|
this.controlList = data.control
|
|
|
|
|
this.acquisitionList = data.acquisition
|
|
|
|
|
console.log(data)
|
|
|
|
|
},
|
|
|
|
|
async getRightDevice(e) {
|
|
|
|
|
const data = await selectDeviceModeFunctionByFunctionType({
|
|
|
|
|
"sceneId": this.sceneId,
|
|
|
|
|
"sceneId": this.$store.getters.sceneId,
|
|
|
|
|
"deviceModeId": 1,
|
|
|
|
|
"offset": 0,
|
|
|
|
|
"limit": 1
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async setMonitorById() {
|
|
|
|
|
const {data} = await getMonitorById(this.sceneId)
|
|
|
|
|
const {data} = await getMonitorById(this.$store.getters.sceneId)
|
|
|
|
|
this.MonitorInfo = data
|
|
|
|
|
},
|
|
|
|
|
toHistory() {
|
|
|
|
|