更新报警声

This commit is contained in:
朱文强 2023-08-14 13:20:23 +08:00
parent 5a537dd66e
commit 3d2e1d95e5
2 changed files with 10 additions and 1 deletions

BIN
src/views/modules/alarm.mp3 Normal file

Binary file not shown.

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-01-04 10:29:40 * @Date: 2023-01-04 10:29:40
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-08-09 09:54:14 * @LastEditTime: 2023-08-14 09:20:13
* @Description: * @Description:
--> -->
<template> <template>
@ -10,6 +10,9 @@
<div id="alertOverlay" :class="{ alertOverlay: showAlarm }"> <div id="alertOverlay" :class="{ alertOverlay: showAlarm }">
<div></div> <div></div>
</div> </div>
<audio controls hidden ref="audio" loop>
<source src="./alarm.mp3" />
</audio>
<div class="title"> <div class="title">
<img style="height: 52px;float:left;margin:12px 24px" src="~@/assets/img/横版logo.png" /> <img style="height: 52px;float:left;margin:12px 24px" src="~@/assets/img/横版logo.png" />
<img <img
@ -185,9 +188,15 @@ export default {
this.tableData = JSON.parse(JSON.stringify(dataJson)).alarm; this.tableData = JSON.parse(JSON.stringify(dataJson)).alarm;
if (this.tableData.length > 0 && this.tableData.find((i) => i.type !== "RGV1提示")) { if (this.tableData.length > 0 && this.tableData.find((i) => i.type !== "RGV1提示")) {
this.showAlarm = true; this.showAlarm = true;
this.$nextTick(() => {
this.$refs.audio.play(); //
});
this.setAlertState(true); this.setAlertState(true);
} else { } else {
this.showAlarm = false; this.showAlarm = false;
this.$nextTick(() => {
this.$refs.audio.pause(); //
});
this.setAlertState(false); this.setAlertState(false);
} }
} }