|
@@ -1,5 +1,6 @@
|
|
<template>
|
|
<template>
|
|
- <div
|
|
|
|
|
|
+ <div></div>
|
|
|
|
+ <!-- <div
|
|
draggable="true"
|
|
draggable="true"
|
|
@dragstart="startDrag"
|
|
@dragstart="startDrag"
|
|
@dragend="stopDrag"
|
|
@dragend="stopDrag"
|
|
@@ -33,7 +34,7 @@
|
|
@cancleConfig="displaySetting = false"
|
|
@cancleConfig="displaySetting = false"
|
|
:alarmConfigArray="alarmConfigArray"
|
|
:alarmConfigArray="alarmConfigArray"
|
|
/>
|
|
/>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -206,80 +207,80 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
playAudioEffect() {
|
|
playAudioEffect() {
|
|
- const lv1Config = this.getConfigItem(1);
|
|
|
|
- let lv1Play = false;
|
|
|
|
- if (lv1Config.isAlarmSound) {
|
|
|
|
- lv1Play = this.dialogList.some((ele) => {
|
|
|
|
- return ele.lv === 1 && !ele.confirm;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // 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 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 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 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 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() {
|
|
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() {
|
|
getAlarmConfig() {
|
|
@@ -306,7 +307,7 @@ export default {
|
|
{
|
|
{
|
|
id: "3",
|
|
id: "3",
|
|
alarmLevel: 3,
|
|
alarmLevel: 3,
|
|
- isAlart: true,
|
|
|
|
|
|
+ isAlart: false,
|
|
isAlarmSound: false,
|
|
isAlarmSound: false,
|
|
isContinuousAlarm: false,
|
|
isContinuousAlarm: false,
|
|
},
|
|
},
|
|
@@ -597,7 +598,7 @@ export default {
|
|
let data = JSON.parse(msg.data);
|
|
let data = JSON.parse(msg.data);
|
|
// 相关处理
|
|
// 相关处理
|
|
if (data) {
|
|
if (data) {
|
|
- console.log("收到推送消息1", data);
|
|
|
|
|
|
+ // console.log("收到推送消息1", data);
|
|
this.pushALarmItem(data, "ws");
|
|
this.pushALarmItem(data, "ws");
|
|
// this.dialogList.sort((a, b) => {
|
|
// this.dialogList.sort((a, b) => {
|
|
// return b.lv - a.lv;
|
|
// return b.lv - a.lv;
|