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