Browse Source

更新事件铃铛

develop
little4 2 months ago
parent
commit
4d81fe31bd
  1. 2
      ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/EarlyWarning.vue
  2. 12
      ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/WarningList.vue
  3. 14
      ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue

2
ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/EarlyWarning.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="early_warning" v-hasPermi="['home:notice:event']"> <div class="early_warning" v-hasPermi="['home:notice:event','home:notice:warningEvent','home:notice:releaseEvent','home:notice:processingEvent','home:notice:closeEvent','home:notice:disposeEvent','home:notice:deviceOffline','home:notice:processDeviceOffline']">
<div @click="onShowCtt" class="warningNum" v-if="warningNum > 0">{{ warningNum>99?'99+':warningNum }}</div> <div @click="onShowCtt" class="warningNum" v-if="warningNum > 0">{{ warningNum>99?'99+':warningNum }}</div>
<p @click="onShowCtt"> <p @click="onShowCtt">
<i class="el-icon-message-solid" v-if="isShowCtt"></i> <i class="el-icon-message-solid" v-if="isShowCtt"></i>

12
ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/WarningList.vue

@ -55,6 +55,7 @@ import { Message } from "element-ui";
import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping, warningSourceMapping, warningStateMapping } from "@screen/utils/enum.js" import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping, warningSourceMapping, warningStateMapping } from "@screen/utils/enum.js"
import { checkPermi } from "@/utils/permission.js";
import DialogWarning from './dialogWarn/DialogWarning.vue' import DialogWarning from './dialogWarn/DialogWarning.vue'
import {mokStakeWarning} from './dialogWarn/mock.js' import {mokStakeWarning} from './dialogWarn/mock.js'
export default { export default {
@ -87,6 +88,17 @@ export default {
computed: { computed: {
}, },
mounted() { mounted() {
//
//
if (checkPermi(["home:notice:event"])) {
this.activeTab = "four";
} else if(checkPermi(["home:notice:warningEvent"])){
this.activeTab = "first";
} else if(checkPermi(["home:notice:processingEvent"])){
this.activeTab = "third";
} else if(checkPermi(["home:notice:deviceOffline"])){
this.activeTab = "fifth";
}
// //
this.$root.$on('refresh-event', this.getMainData); this.$root.$on('refresh-event', this.getMainData);
this.getMainData(); this.getMainData();

14
ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue

@ -19,6 +19,7 @@ import request from "@/utils/request";
import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping, warningSourceMapping, warningStateMapping } from "@screen/utils/enum.js" import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping, warningSourceMapping, warningStateMapping } from "@screen/utils/enum.js"
import { param } from "../../../utils"; import { param } from "../../../utils";
import { checkPermi } from "@/utils/permission.js";
export default { export default {
name: "WarningNotify", name: "WarningNotify",
props: { props: {
@ -59,7 +60,7 @@ export default {
showNotify(para){ showNotify(para){
let _this = this; let _this = this;
let obj = {}; let obj = {};
if( para.subEvent == "0"){ if(checkPermi(["home:notice:warningEvent"]) && para.subEvent == "0"){
let eventType = ["trafficAccident", "vehicleBroken", "trafficControl", "trafficJam", "illegalVehicle", "barrierClear", "construction", "serviceAreaAbnormal", "equipmentTrouble", "abnormalWeather", "otherEvent"]; let eventType = ["trafficAccident", "vehicleBroken", "trafficControl", "trafficJam", "illegalVehicle", "barrierClear", "construction", "serviceAreaAbnormal", "equipmentTrouble", "abnormalWeather", "otherEvent"];
obj = { obj = {
content: para.content.content, content: para.content.content,
@ -68,7 +69,7 @@ export default {
level: "danger", level: "danger",
duration: 0 duration: 0
} }
} else if( para.subEvent == "2"){ } else if(checkPermi(["home:notice:warningEvent"]) && para.subEvent == "2"){
obj = { obj = {
content: para.content.content, content: para.content.content,
time:para.content.event.warningTime, time:para.content.event.warningTime,
@ -77,7 +78,7 @@ export default {
title:'扫码报警', title:'扫码报警',
duration: 0 duration: 0
} }
} else if(para.subEvent === '1'){ } else if(checkPermi(["home:notice:warningEvent"]) && para.subEvent === '1'){
obj = { obj = {
content: para.content.content, content: para.content.content,
time:para.content.event.warningTime, time:para.content.event.warningTime,
@ -85,7 +86,7 @@ export default {
level: "info", level: "info",
duration: 4000 duration: 4000
} }
} else if(para.subEvent === 'trafficFlowDataEarlyWarning'){ } else if(checkPermi(["home:notice:event"]) && para.subEvent === 'trafficFlowDataEarlyWarning'){ //
obj = { obj = {
content: para.content.content, content: para.content.content,
time:'', time:'',
@ -93,7 +94,7 @@ export default {
level: "warning", level: "warning",
duration: 4000 duration: 4000
} }
} else if(para.subEvent === 'deviceOfflineRecord'){ } else if(checkPermi(["home:notice:deviceOffline"]) && para.subEvent === 'deviceOfflineRecord'){
obj = { obj = {
content: para.content.deviceOfflineRecord.createTime+' '+ para.content.content, content: para.content.deviceOfflineRecord.createTime+' '+ para.content.content,
time:'', time:'',
@ -111,6 +112,9 @@ export default {
duration: 4000 duration: 4000
} }
} }
if(!obj.level){
return;
}
this.speak(obj.time + '' + para.content.content); this.speak(obj.time + '' + para.content.content);
if(Cookies.get('warning-notify') === 'off'){ if(Cookies.get('warning-notify') === 'off'){
return; return;

Loading…
Cancel
Save