From f69eee62d1a4714f16420cf226a844e76233c918 Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Thu, 9 May 2024 19:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/common/menuData.js | 10 ++------ .../components/WarningNotify.vue | 24 +++++++++++++++++-- .../pages/service/boardRecord/index.vue | 7 +++++- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/src/common/menuData.js b/ruoyi-ui/src/common/menuData.js index 8d5b959f..fabf1536 100644 --- a/ruoyi-ui/src/common/menuData.js +++ b/ruoyi-ui/src/common/menuData.js @@ -151,14 +151,8 @@ export default [ { title:"收费运营", name:"fee", - children:[ - { - title: "统计分析", - name: "feeStatistic", - path: "/maintain/fee/statistic", - component: "maintenanceOperations/chargeableOperations/index.vue", - } - ] + path: "/maintain/fee", + component: "maintenanceOperations/chargeableOperations/index.vue" },{ title:"智能养护", name:"smart", diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue b/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue index 7b513421..92aac858 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue @@ -35,15 +35,16 @@ export default { showNotify(para){ let _this = this; let eventType = ["trafficAccident", "vehicleBroken", "trafficControl", "trafficJam", "illegalVehicle", "barrierClear", "construction", "serviceAreaAbnormal", "equipmentTrouble", "abnormalWeather", "otherEvent"]; + let time = para.subEvent == "0" ? para.content.event.occurrenceTime : para.content.event.warning_time; let obj = { content: para.content.content, - time: para.subEvent == "0" ? para.content.event.occurrenceTime : para.content.event.warning_time, + time, // moment().format("yyyy-MM-DD hh:mm"), type: para.subEvent == '1' ? "signal" : eventType[para.content.event.eventType*1-1], level: ["danger", "info"][para.subEvent*1], duration: para.subEvent == "0" ? 0 : 4000 } - + this.speak(time + '' + para.content.content); _this.notifications[_this.notifyIndex] = _this.$notify({ title: '', dangerouslyUseHTMLString: true, @@ -124,6 +125,25 @@ export default { ), }); _this.notifyIndex++; + }, + speak(text){ + // 创建SpeechSynthesisUtterance实例 + const utterance = new SpeechSynthesisUtterance(text); + + // 设置语音的语言 + utterance.lang = 'zh-CN'; // 中文简体 + + // 设置语音的音量(0到1之间) + utterance.volume = 10; + + // 设置语音的语速(1是正常语速) + utterance.rate = 1; + + // 设置语音的音调(可以是"default", "female", "male") + utterance.pitch = 1; + + // 使用SpeechSynthesis接口播放语音 + window.speechSynthesis.speak(utterance); } }, mounted() { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue index 7b3f477f..a15163ac 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue @@ -34,7 +34,11 @@ {{ JSON.parse(scope.row.dcDeviceId).join("、") }} - +