From c2e698079d2de8755a0f99e016d80406bbdfef36 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Fri, 27 Mar 2026 10:04:07 +0800 Subject: [PATCH] =?UTF-8?q?100j=E7=9B=B8=E5=85=B3bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 17 ++------- src/api/controlCenter/controlPanel/100J.ts | 16 ++++----- src/views/controlCenter/100J/index.vue | 41 ++++++++++------------ 3 files changed, 30 insertions(+), 44 deletions(-) diff --git a/.env.production b/.env.production index dcb9e93..860f198 100644 --- a/.env.production +++ b/.env.production @@ -2,16 +2,10 @@ VITE_APP_TITLE = 云平台管理系统 # 生产环境配置 晶全1 -VITE_APP_ENV = 'production' - -# 生产环境配置 富源晟2 -# VITE_APP_ENV = 'https://fuyuanshen.com/backend-fys' +VITE_APP_ENV = 'https://www.cnxhyc.com' # 应用访问路径 晶全1 -VITE_APP_CONTEXT_PATH = '/PC/' - -# 高德地图Key -VITE_AMAP_KEY='84a12a692ae378effdf741e16d584cd3' +VITE_APP_CONTEXT_PATH = '/jingquan/' # 应用访问路径 富源晟2 #VITE_APP_CONTEXT_PATH = '/sys/' @@ -23,12 +17,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications' VITE_APP_SNAILJOB_ADMIN = '/snail-job' # 生产环境 晶全3 代理访问 -VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq' - -# VITE_APP_BASE_API = 'http://139.224.253.23:8000' - -# 生产环境 富源晟3 -#VITE_APP_BASE_API = '/backend-fys' +VITE_APP_BASE_API = '/jq' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip diff --git a/src/api/controlCenter/controlPanel/100J.ts b/src/api/controlCenter/controlPanel/100J.ts index 54b0e12..0ee702b 100644 --- a/src/api/controlCenter/controlPanel/100J.ts +++ b/src/api/controlCenter/controlPanel/100J.ts @@ -54,7 +54,7 @@ function SosSetting (data: any) { // 语音列表 function queryAudioFileList (params: any) { return request({ - url: `/app/video/queryAudioFileList`, + url: `/api/video/queryAudioFileList`, method: 'get', params: params }); @@ -62,7 +62,7 @@ function queryAudioFileList (params: any) { // 提取文本内容 function extractText (data: any) { return request({ - url: `/app/video/extract`, + url: `/api/video/extract`, method: 'post', data: data }); @@ -70,7 +70,7 @@ function extractText (data: any) { // 上传音频文件 function uploadAudioToOss (data: any) { return request({ - url: `/app/video/uploadAudioToOss`, + url: `/api/video/uploadAudioToOss`, method: 'post', data: data }); @@ -78,7 +78,7 @@ function uploadAudioToOss (data: any) { // 文本转语音 export function videTtsToOss(data:any) { return request({ - url: `/app/video/ttsToOss`, + url: `/api/video/ttsToOss`, method: 'post', data:data }) @@ -86,7 +86,7 @@ export function videTtsToOss(data:any) { // 重命名 export function videRenameAudioFile(data:any) { return request({ - url: `/app/video/renameAudioFile`, + url: `/api/video/renameAudioFile`, method: 'post', data:data }) @@ -94,7 +94,7 @@ export function videRenameAudioFile(data:any) { // 删除语音文件列表 export function deviceDeleteAudioFile(params:any) { return request({ - url: `/app/video/deleteAudioFile`, + url: `/api/video/deleteAudioFile`, method: 'get', params:params }) @@ -103,7 +103,7 @@ export function deviceDeleteAudioFile(params:any) { // 更新语音,使用语音 export function deviceUpdateVoice(data:any) { return request({ - url: `/app/hby100j/device/updateVoice`, + url: `/api/hby100j/device/updateVoice`, method: 'post', data:data }) @@ -111,7 +111,7 @@ export function deviceUpdateVoice(data:any) { // 语音播放 export function deviceVoiceBroadcast(data:any) { return request({ - url: `/app/hby100j/device/voiceBroadcast`, + url: `/api/hby100j/device/voiceBroadcast`, method: 'post', data:data }) diff --git a/src/views/controlCenter/100J/index.vue b/src/views/controlCenter/100J/index.vue index c35d4b4..1fb4cde 100644 --- a/src/views/controlCenter/100J/index.vue +++ b/src/views/controlCenter/100J/index.vue @@ -58,16 +58,17 @@
当前语音
- + +
- + 播放 - 暂停 + 暂停
@@ -201,7 +202,7 @@
+ @dragleave.prevent="isDragOver = false" @drop.prevent="handleDrop">
@@ -762,6 +763,7 @@ const handleVoiceType = async (targetId: string) => { try { const res = await api.SosSetting(params); if (res.code === 200) proxy?.$modal.msgSuccess(res.msg); + deviceDetail.value.voiceBroadcast = 0; } catch (error) { await getList(); } @@ -937,41 +939,41 @@ const lookMap = (row: any) => { const playCurrentVoice = async () => { // 1. 报警中场景:播放/切换报警语音 if (deviceDetail.value.voiceStrobeAlarm === 1) { + const targetStatus = deviceDetail.value.voiceBroadcast === 1 ? 0 : 1; try { - const currentMode = sta_VoiceType.value.find(mode => mode.active)?.id || '0'; const data = { deviceIds: [route.params.deviceId], - voiceStrobeAlarm: 1, - mode: currentMode + voiceStrobeAlarm: deviceDetail.value.voiceBroadcast == 0 ? 1 : 0, + mode: 7 }; const res = await api.SosSetting(data); if (res.code === 200) { + deviceDetail.value.voiceBroadcast = targetStatus; proxy?.$modal.msgSuccess(res.msg); - await getList(); + } else { proxy?.$modal.msgError(res.msg); } } catch (err: any) { - // proxy?.$modal.msgError(err.msg); } } // 2. 非报警中场景:单纯播放/暂停语音 else { const targetStatus = deviceDetail.value.voiceBroadcast === 1 ? 0 : 1; + console.log(targetStatus, 'targetStatustargetStatustargetStatus'); + try { const res = await api.deviceVoiceBroadcast({ deviceId: route.params.deviceId, - voiceBroadcast: targetStatus + voiceBroadcast: deviceDetail.value.voiceBroadcast==0 ? 1 : 0 }); if (res.code === 200) { deviceDetail.value.voiceBroadcast = targetStatus; proxy?.$modal.msgSuccess(res.msg); - await getList(); } else { proxy?.$modal.msgError(res.msg); } } catch (err: any) { - // proxy?.$modal.msgError(err.msg); } } }; @@ -982,12 +984,6 @@ onMounted(async () => { }); onUnmounted(() => { - disconnect(); - if (recordTimer) clearInterval(recordTimer); - if (mediaRecorder.value && isRecording.value) mediaRecorder.value.stop(); - if (audioStream) audioStream.getTracks().forEach(track => track.stop()); - // if (ttsAudio) ttsAudio.pause(); - if (voiceAudio) voiceAudio.pause(); }); @@ -1416,12 +1412,13 @@ onUnmounted(() => { // 上传语音弹窗样式 .upload-content { .upload-area { - border: 2px dashed #dcdfe6; + // border: 2px dashed #dcdfe6; border-radius: 8px; padding: 40px 20px; text-align: center; transition: all 0.3s; cursor: pointer; + background: #EFF7FF; &.dragOver { border-color: #409eff;