算法异常获取

Lvtianfang
吕天方 4 months ago
parent 23170d465c
commit b9eefe7993

@ -6,7 +6,7 @@ ENV = 'development'
# 若依管理系统/开发环境
# VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://192.168.0.114:9102/api'
VUE_APP_BASE_API = 'http://192.168.0.107:9102/api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -83,4 +83,12 @@ export function limitOneMsg(){
url: '/earlyWarningAudit/massEvents/limitOneMsg',
method: 'get',
})
}
// 获取日志错误信息
export function getErrorMsg(){
return request({
url: '/earlyWarningAudit/massEvents/getErrorMsg',
method: 'get',
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -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;

@ -15,5 +15,6 @@ const getters = {
topbarRouters:state => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters,
debugTime:state => state.debug.debugTime
}
export default getters

@ -7,6 +7,7 @@ import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import getters from './getters'
import debug from './modules/debug'
Vue.use(Vuex)
@ -17,7 +18,8 @@ const store = new Vuex.Store({
user,
tagsView,
permission,
settings
settings,
debug
},
getters
})

@ -0,0 +1,22 @@
const state = {
debugTime:"",
}
const mutations = {
CHANGE_TIME: (state, debugTime) => {
state.debugTime = debugTime
},
}
const actions = {
changeDebugTime({ commit },debugTime) {
commit('CHANGE_TIME',debugTime)
},
}
export default {
namespaced: true,
state,
mutations,
actions
}

@ -4,7 +4,8 @@
<div class="headerText">
<div class="searchP">
算法运行监测
<span>算法运行正常数据获取正常数据推送上一次时间 <span v-if="tableData.length > 0">{{ tableData[0].runningTime }}</span></span>
<span v-if="!debugTime"> <span v-if="tableData.length > 0">{{ tableData[0].runningTime }}</span></span>
<span v-else> <span>{{ debugTime }}</span></span>
</div>
</div>
<div class="arithmetic-query">
@ -61,6 +62,7 @@
<script>
// import tabContent from "./components/algorithmTime"
import { getEventLogs } from "@/api/platform/index"
import { mapState, mapGetters } from 'vuex'
export default {
// components:{
// tabContent
@ -83,6 +85,9 @@ export default {
}
};
},
computed: {
...mapGetters(['debugTime']),
},
mounted() {
this.getList();
this.cancalDebounce();

Loading…
Cancel
Save