告警红点标志

This commit is contained in:
白菜
2025-10-13 17:01:13 +08:00
parent 679f8f2a07
commit fef1704cbd
5 changed files with 47 additions and 19 deletions

View File

@ -1,5 +1,7 @@
import {getAlarmDetailList} from'@/api/ems/dzjk'
const ems = {
state: {
dzjkAlarmLighting:false,//单站监控 告警统计红点标志
zdList:[],
workStatusOptions:{'0':'正常','1':'异常','2':'停止'},//工作状态
deviceStatusOptions:{'0':'在线','1':'离线','2':'维修中'},//设备状态
@ -19,8 +21,20 @@ const ems = {
mutations: {
SET_ZD_LIST(state, list) {
state.zdList = list || []
}
},
SET_DZJK_ALARM_LIGHTING(state, status) {
state.dzjkAlarmLighting = status
},
},
actions: {
//查询站点的所有待处理0的告警 存在展示红点标志
getSiteAlarmNum({state,commit},siteId){
console.log('页面进入单站监控或切换站点ID或在告警统计页面调用了告警list接口',siteId)
getAlarmDetailList({status:0,siteId,pageSize:10,pageNum:1,deviceId:'',alarmLevel:'',alarmStartTime:'',alarmEndTime:''}).then(response=>{
commit('SET_DZJK_ALARM_LIGHTING',!!response?.total || false)
})
}
}
}
export default ems

View File

@ -179,7 +179,6 @@ export default {
// 搜索
onSearch(){
this.pageNum =1//每次搜索从1开始搜索
const [alarmStartTime='',alarmEndTime='']=(this.dateRange || [])
this.getData()
},
// 重置
@ -199,6 +198,7 @@ export default {
},
// 获取数据
getData(){
this.$store.dispatch('getSiteAlarmNum',this.siteId)
this.loading=true
const {deviceId,alarmLevel} = this.search
const {siteId,pageNum,pageSize,activeBtn} =this

View File

@ -11,10 +11,10 @@
active-text-color="#ffffff"
mode="horizontal"
>
<el-menu-item :index="item.name" v-for="(item,index) in childrenRoute" :key="index+'dzjkChildrenRoute'">
<router-link style="height: 100%;width: 100%;display: block;padding:0 20px;" :to="{path:item.path,query:$route.query}">
{{item.meta.title}}
</router-link>
<el-menu-item :index="item.name" v-for="(item,index) in childrenRoute" :key="index+'dzjkChildrenRoute'" :class="{'lighting':item.path.indexOf('gzgj')>-1 && dzjkAlarmLighting}">
<router-link style="height: 100%;width: 100%;display: block;padding:0 20px;" :to="{path:item.path,query:$route.query}">
{{item.meta.title}}
</router-link>
</el-menu-item>
</el-menu>
<div class="ems-content-container ems-content-container-padding dzjk-ems-content-container">
@ -30,6 +30,7 @@ import { dzjk } from '@/router/ems'
const childrenRoute = dzjk[0].children[0].children//获取到单站监控下面的字路由
console.log('childrenRoute',childrenRoute)
import ZdSelect from '@/components/Ems/ZdSelect/index.vue'
import {mapState} from "vuex";
export default {
components:{ZdSelect},
data(){
@ -38,14 +39,21 @@ export default {
activeMenu:''
}
},
computed:{
...mapState({
dzjkAlarmLighting:state=>state.ems.dzjkAlarmLighting
})
},
methods:{
submitSite(id){
if(id != this.$route.query.siteId){
console.log('单站监控选择了其他的站点id=',id,'并更新页面地址参数')
if(id !== this.$route.query.siteId){
// console.log('单站监控选择了其他的站点id=',id,'并更新页面地址参数')
this.$router.push({query:{...this.$route.query,siteId:id}})
}else{
console.log('单站监控选择了相同的其他的站点id=',id,'页面地址不发生改变')
// console.log('单站监控选择了相同的其他的站点id=',id,'页面地址不发生改变')
}
//获取告警列表数据
this.$store.dispatch('getSiteAlarmNum',id)
}
},
beforeRouteLeave(to,from, next){
@ -54,10 +62,6 @@ export default {
this.$store.commit('SET_ZD_LIST',[])
next()
},
mounted() {
console.log('单站监控一级页面路由',this.$route)
}
}
</script>
@ -65,4 +69,19 @@ export default {
.dzjk-ems-content-container{
margin-top:0;
}
.lighting{
position: relative;
z-index: 1;
&::after{
content:"";
display: block;
background-color: red;
height: 10px;
width: 10px;
border-radius: 100%;
position: absolute;
right: -2px;
top: -2px;
}
}
</style>

View File

@ -25,7 +25,6 @@
<script>
import { dzjk } from '@/router/ems'
const childrenRoute = dzjk[0].children[0].children.find(item=> item.name==='DzjkSbjk').children//获取到单站监控-设备监控下面的字路由
console.log('设备监控子路由',childrenRoute)
export default {
name:'DzjkSbjk',
data(){
@ -34,10 +33,6 @@ export default {
activeMenu:''
}
},
mounted() {
console.log('当前设备监控页面路由',this.$route)
}
}
</script>

View File

@ -72,7 +72,7 @@ export default {
return {
loading:false,
pageNum:1,
pageSize:10,
pageSize:40,
searchLoading:false,
siteId:'',
siteList:[],