|
|
@ -162,7 +162,6 @@ export class HomeComponent implements OnInit { |
|
|
|
this.router.events |
|
|
|
this.router.events |
|
|
|
.pipe(filter((event) => event instanceof NavigationEnd)) |
|
|
|
.pipe(filter((event) => event instanceof NavigationEnd)) |
|
|
|
.subscribe((event: any) => { |
|
|
|
.subscribe((event: any) => { |
|
|
|
console.log('走这里Elma44',event) |
|
|
|
|
|
|
|
//管理者进入油站页面
|
|
|
|
//管理者进入油站页面
|
|
|
|
if (event.url.indexOf("petrolStation") != -1 && !this.isGasStation) { |
|
|
|
if (event.url.indexOf("petrolStation") != -1 && !this.isGasStation) { |
|
|
|
//控制返回按钮显示
|
|
|
|
//控制返回按钮显示
|
|
|
@ -286,7 +285,6 @@ export class HomeComponent implements OnInit { |
|
|
|
abp.event.on("abp.notifications.received", this.reloadPage); |
|
|
|
abp.event.on("abp.notifications.received", this.reloadPage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reloadPage = (userNotification) => { |
|
|
|
reloadPage = (userNotification) => { |
|
|
|
console.log("abp.notifications.received收到通知", userNotification); |
|
|
|
console.log("abp.notifications.received收到通知", userNotification); |
|
|
|
if ( |
|
|
|
if ( |
|
|
@ -306,18 +304,7 @@ export class HomeComponent implements OnInit { |
|
|
|
messageId = []; |
|
|
|
messageId = []; |
|
|
|
receiptOfNotification(userNotification) { |
|
|
|
receiptOfNotification(userNotification) { |
|
|
|
if (this.isWarningVoice) { |
|
|
|
if (this.isWarningVoice) { |
|
|
|
// if (!window.speechSynthesis) {
|
|
|
|
this.Sound(userNotification); |
|
|
|
// this.message.create("warning", `该游览器不支持语音播报`);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// let speakMsg = new SpeechSynthesisUtterance(
|
|
|
|
|
|
|
|
// "请注意,收到一条新的预警信息,请及时处理!"
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// speakMsg.lang = "zh-CN";
|
|
|
|
|
|
|
|
// speakMsg.rate = 1;
|
|
|
|
|
|
|
|
// speakMsg.pitch = 1.5;
|
|
|
|
|
|
|
|
// window.speechSynthesis.speak(speakMsg);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
this.Sound(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (this.isWarningWindow) { |
|
|
|
if (this.isWarningWindow) { |
|
|
|
let obj = { |
|
|
|
let obj = { |
|
|
@ -332,9 +319,30 @@ export class HomeComponent implements OnInit { |
|
|
|
this.messageId.push(obj); |
|
|
|
this.messageId.push(obj); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Sound() { |
|
|
|
Sound(userNotification) { |
|
|
|
var mp3Url = "../../../assets/sound/warning.mp3"; |
|
|
|
let violationName = |
|
|
|
var player = new Audio(mp3Url); |
|
|
|
userNotification.notification.data.properties.ViolationName; |
|
|
|
|
|
|
|
const soundMap = { |
|
|
|
|
|
|
|
油罐区非工作人员闯入: "../../../assets/sound/chuangru.mp3", |
|
|
|
|
|
|
|
进出口长时间停放车辆: "../../../assets/sound/jinchukou.mp3", |
|
|
|
|
|
|
|
前庭有顾客疑似抽烟: "../../../assets/sound/chouyan.mp3", |
|
|
|
|
|
|
|
前庭有顾客接打电话: "../../../assets/sound/dadianhua.mp3", |
|
|
|
|
|
|
|
卸油前未按规定设置隔离: "../../../assets/sound/xygeli.mp3", |
|
|
|
|
|
|
|
卸油后未按规定拆除卸油管: "../../../assets/sound/xychaichuxyguan.mp3", |
|
|
|
|
|
|
|
卸油前未按规定连接静电接地: "../../../assets/sound/xyjiedi.mp3", |
|
|
|
|
|
|
|
卸油前未按规定放置灭火器: "../../../assets/sound/xymiehuoqi.mp3", |
|
|
|
|
|
|
|
卸油后长时间未清理现场: "../../../assets/sound/xyxianchang.mp3", |
|
|
|
|
|
|
|
油罐车长时间无人卸油: "../../../assets/sound/xywuren.mp3", |
|
|
|
|
|
|
|
卸油前未按规定连接卸油管: "../../../assets/sound/xyxieyouguan.mp3", |
|
|
|
|
|
|
|
卸油中未按规定全程监卸: "../../../assets/sound/xyjianxie.mp3", |
|
|
|
|
|
|
|
疑似烟雾: "../../../assets/sound/yanwu.mp3", |
|
|
|
|
|
|
|
疑似明火: "../../../assets/sound/minghuo.mp3", |
|
|
|
|
|
|
|
"收银员未穿工装/非工作人员闯入收银区": |
|
|
|
|
|
|
|
"../../../assets/sound/gongzhuang.mp3", |
|
|
|
|
|
|
|
default: "../../../assets/sound/warning.mp3", |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
const audioUrl = soundMap[violationName] || soundMap.default; |
|
|
|
|
|
|
|
var player = new Audio(audioUrl); |
|
|
|
player.play(); //播放 mp3这个音频对象
|
|
|
|
player.play(); //播放 mp3这个音频对象
|
|
|
|
} |
|
|
|
} |
|
|
|
modalData; |
|
|
|
modalData; |
|
|
|