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