|
|
|
@ -1,5 +1,12 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="event-box">
|
|
|
|
|
<div class="event-box" v-if="errorInfo && isTrue">
|
|
|
|
|
<div class="event-background-two"></div>
|
|
|
|
|
<div class="event-right">
|
|
|
|
|
<div class="msgType">算法运行异常</div>
|
|
|
|
|
<div class="msgContent">请及时联系运维人员进行处理</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="event-box" v-else-if="eventInfoTrue && !isTrue">
|
|
|
|
|
<div class="event-background"></div>
|
|
|
|
|
<div class="event-right">
|
|
|
|
|
<div class="msgType">{{ eventInfo.msgTypeName }}</div>
|
|
|
|
@ -8,25 +15,69 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { limitOneMsg } from "@/api/eventPage/index"
|
|
|
|
|
import { limitOneMsg, getErrorMsg } from "@/api/eventPage/index"
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
eventInfo:{},
|
|
|
|
|
isTrue:true,
|
|
|
|
|
ErrorMsgTime:'',
|
|
|
|
|
errorInfo:true,
|
|
|
|
|
eventInfoTrue:true,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
this.getLimitOneMsg();
|
|
|
|
|
// 一分钟
|
|
|
|
|
setInterval(()=>{
|
|
|
|
|
this.getLimitOneMsg();
|
|
|
|
|
},60000)
|
|
|
|
|
watch:{
|
|
|
|
|
$route:{
|
|
|
|
|
handler(route){
|
|
|
|
|
let timeOne;
|
|
|
|
|
let timeTwo;
|
|
|
|
|
if(route.meta.title == '算法运行监测') {
|
|
|
|
|
this.isTrue = true;
|
|
|
|
|
this.getGetErrorMsg();
|
|
|
|
|
// 一分钟
|
|
|
|
|
timeOne = setInterval(()=>{
|
|
|
|
|
this.getGetErrorMsg();
|
|
|
|
|
},3600000)
|
|
|
|
|
clearInterval(timeTwo)
|
|
|
|
|
} else {
|
|
|
|
|
this.isTrue = false;
|
|
|
|
|
timeTwo = this.getLimitOneMsg();
|
|
|
|
|
// 一分钟
|
|
|
|
|
setInterval(()=>{
|
|
|
|
|
this.getLimitOneMsg();
|
|
|
|
|
},60000)
|
|
|
|
|
clearInterval(timeOne)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
immediate:true,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
|
|
|
|
// 预警钟
|
|
|
|
|
getLimitOneMsg(){
|
|
|
|
|
limitOneMsg().then(res=>{
|
|
|
|
|
this.eventInfo = res.data
|
|
|
|
|
if(res.data) {
|
|
|
|
|
this.eventInfo = res.data;
|
|
|
|
|
this.eventInfoTrue = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.eventInfoTrue = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 算法异常
|
|
|
|
|
getGetErrorMsg(){
|
|
|
|
|
getErrorMsg().then(res=>{
|
|
|
|
|
if(res.data) {
|
|
|
|
|
this.$store.dispatch("debug/changeDebugTime", res.data)
|
|
|
|
|
// this.$store.commit("debug/CHANGE_TIME",res.data)
|
|
|
|
|
this.ErrorMsgTime = res.data;
|
|
|
|
|
this.errorInfo = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.$store.dispatch("debug/changeDebugTime", '')
|
|
|
|
|
// this.$store.commit("debug/CHANGE_TIME",res.data)
|
|
|
|
|
this.errorInfo = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
@ -49,6 +100,16 @@ export default {
|
|
|
|
|
height: 30px;
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
}
|
|
|
|
|
.event-background-two {
|
|
|
|
|
background: url("../../assets/images/debugTwo.png");
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
padding: 5px;
|
|
|
|
|
background-size: 95% 95%;
|
|
|
|
|
background-repeat: no-repeat; /* 不平铺 */
|
|
|
|
|
width: 30px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
}
|
|
|
|
|
.event-right {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|