| | |
| | | <div class="dialog-footer"> |
| | | <el-button @click="centerDialogVisible = false">取消</el-button> |
| | | <el-button @click="test">测试播报</el-button> |
| | | <el-button @click="playAlarm">测试报警</el-button> |
| | | <el-button type="primary" @click="saveSet"> 确认 </el-button> |
| | | <el-button type="success" @click="shuaxin"> 刷新 </el-button> |
| | | </div> |
| | |
| | | import cljd from "../img/cljd.png"; |
| | | import tizhong from "../img/tizhong.png"; |
| | | import { EventSourcePolyfill } from "event-source-polyfill"; |
| | | import alertbaojin from '../assets/alert.wav' |
| | | |
| | | import { |
| | | computed, |
| | | getCurrentInstance, |
| | |
| | | import * as echarts from "echarts"; |
| | | import { jgTime4 } from "../utils/formatTime"; |
| | | import { setTimeoutAlert } from "../utils/httpApi"; |
| | | // 创建 Audio 对象,指向 public 目录下的音频文件 |
| | | const alarmSound = new Audio(alertbaojin) |
| | | |
| | | // 播放报警声的方法 |
| | | const playAlarm = () => { |
| | | alarmSound.currentTime = 0 // 重置到开头,以便可以重复播放 |
| | | alarmSound.play().catch((err) => { |
| | | console.error('播放失败:', err) |
| | | }) |
| | | } |
| | | // 语音播报 |
| | | import Speech from "speak-tts"; |
| | | const speech = ref(null); |