|
|
|
@ -83,13 +83,14 @@
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
treeList,
|
|
|
|
|
selectDeviceByDeviceModeByMonitorUnitId,
|
|
|
|
|
selectDeviceModeFunctionByFunctionType,
|
|
|
|
|
selectDevicesByMonitorUnitId,
|
|
|
|
|
selectLatestDataByDeviceMode,
|
|
|
|
|
getMonitorById
|
|
|
|
|
} from '@/api/board/equipment'
|
|
|
|
|
|
|
|
|
|
import BoardTopNav from '@/components/BoardTopNav'
|
|
|
|
|
|
|
|
|
|
let getDeviceInterval = null
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
BoardTopNav
|
|
|
|
@ -107,6 +108,7 @@ export default {
|
|
|
|
|
acquisitionList: [],
|
|
|
|
|
MonitorInfo: {},
|
|
|
|
|
sceneId: 0,
|
|
|
|
|
deviceId: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async mounted() {
|
|
|
|
@ -150,20 +152,22 @@ export default {
|
|
|
|
|
this.getRightDevice(e.id)
|
|
|
|
|
this.setMonitorById(e)
|
|
|
|
|
this.show = true
|
|
|
|
|
if(!getDeviceInterval){
|
|
|
|
|
var getDeviceInterval = setInterval(this.getDevice, 30 * 1000)
|
|
|
|
|
if (typeof getDeviceInterval === 'number') {
|
|
|
|
|
clearInterval(getDeviceInterval)
|
|
|
|
|
getDeviceInterval = setInterval(this.getDevice, 30 * 1000)
|
|
|
|
|
}
|
|
|
|
|
getDeviceInterval = setInterval(() => {
|
|
|
|
|
this.getDevice(this.deviceId)
|
|
|
|
|
}, 30 * 1000)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getDevice(e) {
|
|
|
|
|
const {data} = await selectDeviceByDeviceModeByMonitorUnitId(this.$store.getters.sceneId, e)
|
|
|
|
|
const {data} = await selectDevicesByMonitorUnitId(this.$store.getters.sceneId, e)
|
|
|
|
|
this.deviceId = e
|
|
|
|
|
this.controlList = data.control
|
|
|
|
|
this.acquisitionList = data.acquisition
|
|
|
|
|
},
|
|
|
|
|
async getRightDevice(e) {
|
|
|
|
|
const data = await selectDeviceModeFunctionByFunctionType({
|
|
|
|
|
const data = await selectLatestDataByDeviceMode({
|
|
|
|
|
"sceneId": this.$store.getters.sceneId,
|
|
|
|
|
"deviceModeId": 1,
|
|
|
|
|
"offset": 0,
|
|
|
|
@ -177,6 +181,9 @@ export default {
|
|
|
|
|
toHistory() {
|
|
|
|
|
this.$router.push({path: "/board/senso"});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
clearInterval(getDeviceInterval)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|