This commit is contained in:
2023-03-01 14:55:56 +08:00
parent 00db75e767
commit 0540dc5f6a
8 changed files with 128 additions and 49 deletions

View File

@@ -1,16 +1,16 @@
<template>
<section class="container" @click="uid = ''">
<t-header index='2'></t-header>
<t-header index='3'></t-header>
<div class="content">
<div class="item_tr clearfix">
<div class="item_block fl" v-for="e in deviceDatas.slice(0, 9)" :key="e.device_uuid">
<div class="item_block fl" v-for="e in deviceDatas.slice(0, 9)" :key="e.point_id">
<div class="item_inner" @click.stop="getInfo(e)">
<div class="item_img">
<img v-if="e.device_url !== ''" :src="require('../assets/images/devmoni/' + e.device_url + '.jpg')" :alt="e.device_name">
<img v-if="e.device_url !== ''" :src="require('../assets/images/devmoni/' + e.device_url + '.jpg')" :alt="e.point_name">
</div>
<div class="device_name clearfix">
<div class="fl device_name_tag" :class="['yellow', 'green', 'orange', 'gray'][Number(e.status) - 1]"></div>
<div class="fl device_name_text">{{e.device_name}}</div>
<div class="fl device_name_tag" :class="['yellow', 'green', 'orange', 'gray'][Number(e.point_status) - 1]"></div>
<div class="fl device_name_text">{{e.point_name}}</div>
</div>
<!-- 混碾机LB0001压力机LB0004机械手LB0006 -->
<div v-if="e.deviceclass_code === 'LB0001' || e.deviceclass_code === 'LB0004' || (e.deviceclass_code === 'LB0006' && e.device_code !== 'CDJQR01' && e.device_code !== 'MDJXS01')" class="info_block clearfix">
@@ -690,6 +690,7 @@
<script>
import THeader from '@components/header.vue'
import { deviceMonitor } from '@js/getData2'
export default {
name: 'DeviceMonitor',
components: {
@@ -716,14 +717,13 @@ export default {
methods: {
refresh () {
this.timer = setInterval(() => {
// this.deviceDatas = []
// this.form = {}
// this.allrows1 = []
// this.allrows2 = []
// this.uid = ''
this.initData()
}, this.interTime)
},
async initData () {
let res = await deviceMonitor()
this.deviceDatas = [...res]
},
addPosition () {
for (let i = 0; i < this.deviceDatas.length; i++) {
if (i <= 5) {
@@ -753,26 +753,6 @@ export default {
}
}
},
initData () {
let data = {
// '_SRVNAME': 'server.jxht.screen',
'_SRVNAME': 'service.st.al.realivt',
'_SRVMETHOD': 'queryDevices',
'_DATA': JSON.stringify({
accountId: '-1'
})
}
this
.$post(data)
.then(res => {
if (res.code === '1') {
this.deviceDatas = [...res.result]
this.addPosition()
} else {
this.toast(res.desc)
}
})
},
getInfo (e) {
if (this.uid === e.device_uuid) {
this.uid = ''

View File

@@ -52,7 +52,7 @@ export default {
return {
loginname: '',
password: '',
equipment: [{id: 0, name: '首页'}, {id: 1, name: '仓储监控'}, {id: 2, name: '设备监控'}, {id: 3, name: '物流工艺'}, {id: 4, name: '生产统计'}],
equipment: [{id: 0, name: '首页'}, {id: 1, name: '生产统计'}, {id: 2, name: '仓储监控'}, {id: 3, name: '设备监控'}],
equipId: Number(this.$store.getters.equipId),
drift: 0,
baseUrl: this.$store.getters.baseUrl,
@@ -78,13 +78,11 @@ export default {
if (this.equipId === 0) {
this.$router.push('/homepage')
} else if (this.equipId === 1) {
this.$router.push('/storagemonitor')
} else if (this.equipId === 2) {
this.$router.push('/devicemonitor')
} else if (this.equipId === 3) {
this.$router.push('/logisticstech')
} else {
this.$router.push('/prodcount')
} else if (this.equipId === 2) {
this.$router.push('/storagemonitor')
} else if (this.equipId === 3) {
this.$router.push('/devicemonitor')
}
let element = document.documentElement
if (this.fullscreen) {