|
@@ -207,80 +207,76 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
playAudioEffect() {
|
|
|
- // const lv1Config = this.getConfigItem(1);
|
|
|
- // let lv1Play = false;
|
|
|
- // if (lv1Config.isAlarmSound) {
|
|
|
- // lv1Play = this.dialogList.some((ele) => {
|
|
|
- // return ele.lv === 1 && !ele.confirm;
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // const lv2Config = this.getConfigItem(2);
|
|
|
- // let lv2Play = false;
|
|
|
- // if (lv2Config.isAlarmSound) {
|
|
|
- // lv2Play = this.dialogList.some((ele) => {
|
|
|
- // return ele.lv === 2 && !ele.confirm;
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // const lv3Config = this.getConfigItem(3);
|
|
|
- // let lv3Play = false;
|
|
|
- // if (lv3Config.isAlarmSound) {
|
|
|
- // lv3Play = this.dialogList.some((ele) => {
|
|
|
- // return ele.lv === 3 && !ele.confirm;
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // const lv4Config = this.getConfigItem(4);
|
|
|
- // let lv4Play = false;
|
|
|
- // if (lv4Config.isAlarmSound) {
|
|
|
- // lv4Play = this.dialogList.some((ele) => {
|
|
|
- // return ele.lv === 4 && !ele.confirm;
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // const lv5Config = this.getConfigItem(5);
|
|
|
- // let lv5Play = false;
|
|
|
- // if (lv5Config.isAlarmSound) {
|
|
|
- // lv5Play = this.dialogList.some((ele) => {
|
|
|
- // return ele.lv === 5 && !ele.confirm;
|
|
|
- // });
|
|
|
- // }
|
|
|
- // // console.log(lv1Play, lv2Play, lv3Play, lv4Play, lv5Play);
|
|
|
- // if (lv5Play && !this.seriousWarning) {
|
|
|
- // this.seriousWarning = true;
|
|
|
- // this.audioElement = new Audio();
|
|
|
- // this.audioElement.src = "./static/sound/lv5.mp3";
|
|
|
- // this.audioElement.loop = true;
|
|
|
- // this.audioElement?.play();
|
|
|
- // } else if (
|
|
|
- // (lv1Play || lv2Play || lv3Play || lv4Play) &&
|
|
|
- // !this.seriousWarning
|
|
|
- // ) {
|
|
|
- // this.audioElement = new Audio();
|
|
|
- // this.audioElement.src = "./static/sound/lv4.mp3";
|
|
|
- // this.audioElement.addEventListener("ended", () => {
|
|
|
- // this.audioElement?.removeEventListener(
|
|
|
- // "ended",
|
|
|
- // this.stopPlayAudioEffect
|
|
|
- // );
|
|
|
- // });
|
|
|
- // this.audioElement?.play();
|
|
|
- // } else {
|
|
|
- // if (!this.seriousWarning) {
|
|
|
- // this.stopPlayAudioEffect();
|
|
|
- // }
|
|
|
- // }
|
|
|
+ // const lv1Config = this.getConfigItem(1);
|
|
|
+ // let lv1Play = false;
|
|
|
+ // if (lv1Config.isAlarmSound) {
|
|
|
+ // lv1Play = this.dialogList.some((ele) => {
|
|
|
+ // return ele.lv === 1 && !ele.confirm;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // const lv2Config = this.getConfigItem(2);
|
|
|
+ // let lv2Play = false;
|
|
|
+ // if (lv2Config.isAlarmSound) {
|
|
|
+ // lv2Play = this.dialogList.some((ele) => {
|
|
|
+ // return ele.lv === 2 && !ele.confirm;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // const lv3Config = this.getConfigItem(3);
|
|
|
+ // let lv3Play = false;
|
|
|
+ // if (lv3Config.isAlarmSound) {
|
|
|
+ // lv3Play = this.dialogList.some((ele) => {
|
|
|
+ // return ele.lv === 3 && !ele.confirm;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // const lv4Config = this.getConfigItem(4);
|
|
|
+ // let lv4Play = false;
|
|
|
+ // if (lv4Config.isAlarmSound) {
|
|
|
+ // lv4Play = this.dialogList.some((ele) => {
|
|
|
+ // return ele.lv === 4 && !ele.confirm;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // const lv5Config = this.getConfigItem(5);
|
|
|
+ // let lv5Play = false;
|
|
|
+ // if (lv5Config.isAlarmSound) {
|
|
|
+ // lv5Play = this.dialogList.some((ele) => {
|
|
|
+ // return ele.lv === 5 && !ele.confirm;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // // console.log(lv1Play, lv2Play, lv3Play, lv4Play, lv5Play);
|
|
|
+ // if (lv5Play && !this.seriousWarning) {
|
|
|
+ // this.seriousWarning = true;
|
|
|
+ // this.audioElement = new Audio();
|
|
|
+ // this.audioElement.src = "./static/sound/lv5.mp3";
|
|
|
+ // this.audioElement.loop = true;
|
|
|
+ // this.audioElement?.play();
|
|
|
+ // } else if (
|
|
|
+ // (lv1Play || lv2Play || lv3Play || lv4Play) &&
|
|
|
+ // !this.seriousWarning
|
|
|
+ // ) {
|
|
|
+ // this.audioElement = new Audio();
|
|
|
+ // this.audioElement.src = "./static/sound/lv4.mp3";
|
|
|
+ // this.audioElement.addEventListener("ended", () => {
|
|
|
+ // this.audioElement?.removeEventListener(
|
|
|
+ // "ended",
|
|
|
+ // this.stopPlayAudioEffect
|
|
|
+ // );
|
|
|
+ // });
|
|
|
+ // this.audioElement?.play();
|
|
|
+ // } else {
|
|
|
+ // if (!this.seriousWarning) {
|
|
|
+ // this.stopPlayAudioEffect();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
stopPlayAudioEffect() {
|
|
|
- // this.seriousWarning = false;
|
|
|
- // if (this.audioElement) {
|
|
|
- // this.audioElement.pause();
|
|
|
- // this.audioElement.currentTime = 0;
|
|
|
- // this.audioElement.loop = false;
|
|
|
- // }
|
|
|
- // this.audioElement = null;
|
|
|
+ // this.seriousWarning = false;
|
|
|
+ // if (this.audioElement) {
|
|
|
+ // this.audioElement.pause();
|
|
|
+ // this.audioElement.currentTime = 0;
|
|
|
+ // this.audioElement.loop = false;
|
|
|
+ // }
|
|
|
+ // this.audioElement = null;
|
|
|
},
|
|
|
//获取报警配置
|
|
|
getAlarmConfig() {
|
|
@@ -393,6 +389,7 @@ export default {
|
|
|
lv: alarmItem.rank,
|
|
|
lvName: this.getLvName(alarmItem),
|
|
|
rank: alarmItem.rank,
|
|
|
+ confirmed: alarmItem.confirmed,
|
|
|
class: `animate__bounceInRight lv${alarmItem.rank}`,
|
|
|
deviceId: alarmItem.deviceId,
|
|
|
faultCause: alarmItem.faultCause,
|
|
@@ -436,8 +433,8 @@ export default {
|
|
|
: new Date(alarmItem.updateTime).formatDate("yyyy-MM-dd hh:mm:ss"),
|
|
|
};
|
|
|
if (
|
|
|
- alarmItem.alarmType == "booststation" &&
|
|
|
- alarmItem.deviceType != "custom"
|
|
|
+ alarmOption.alarmType == "booststation" &&
|
|
|
+ alarmOption.deviceType != "custom"
|
|
|
) {
|
|
|
if (
|
|
|
configItem.isAlarmSound ||
|
|
@@ -445,7 +442,8 @@ export default {
|
|
|
configItem.isContinuousAlarm
|
|
|
) {
|
|
|
let a = {};
|
|
|
- a[`${alarmItem.stationId}`] = alarmItem.closeTime ? false : true;
|
|
|
+ a[`${alarmOption.stationId}`] =
|
|
|
+ alarmOption.closeTime || alarmOption.confirmed ? false : true;
|
|
|
this.alarmList.push(a);
|
|
|
this.alarmList = [
|
|
|
...new Set(this.alarmList.map((t) => JSON.stringify(t))),
|
|
@@ -456,7 +454,7 @@ export default {
|
|
|
(configItem.isAlarmSound ||
|
|
|
configItem.isAlart ||
|
|
|
configItem.isContinuousAlarm) &&
|
|
|
- alarmItem.deviceType != "custom"
|
|
|
+ alarmOption.deviceType != "custom"
|
|
|
) {
|
|
|
if (type && type == "ws") {
|
|
|
this.dialogList.unshift(alarmOption);
|
|
@@ -598,7 +596,7 @@ export default {
|
|
|
let data = JSON.parse(msg.data);
|
|
|
// 相关处理
|
|
|
if (data) {
|
|
|
- // console.log("收到推送消息1", data);
|
|
|
+ // console.log("收到推送消息1", data);
|
|
|
this.pushALarmItem(data, "ws");
|
|
|
// this.dialogList.sort((a, b) => {
|
|
|
// return b.lv - a.lv;
|