1
0
forked from dyf/dyf-vue-ui

Compare commits

...

2 Commits

Author SHA1 Message Date
c2e698079d 100j相关bug修复 2026-03-27 10:04:07 +08:00
cce863c590 提交 2026-03-20 14:58:40 +08:00
3 changed files with 42 additions and 50 deletions

View File

@ -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

View File

@ -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
})

View File

@ -38,7 +38,7 @@
<el-col :lg="9" :xs="24">
<div class="content-card1">
<h4 class="section-title">警示灯爆闪</h4>
<div class="light-mode">
<div class="light-mode1">
<!-- 使用v-for循环渲染灯光模式卡片 -->
<div class="mode-card" @click.stop="handleModeClick(mode.id)" v-for="mode in lightModes"
:key="mode.id">
@ -58,16 +58,17 @@
<div class="current-voice">
<span class="voice-label">当前语音</span>
<div class="voice-select">
<el-select v-model="currentVoiceId" placeholder="请选择语音" style="width: 100%;">
<el-input type="text" v-model="currentVoiceId" placeholder="当前语音" style="width: 100%;" :disabled="currentVoiceId"></el-input>
<!-- <el-select v-model="currentVoiceId" placeholder="请选择语音" style="width: 100%;">
<el-option v-for="item in voiceList" :key="item.id" :label="item.fileNameExt"
:value="item.id" ite>
:value="item.id" :disabled="item.id !== currentVoiceId">
</el-option>
</el-select>
</el-select> -->
</div>
<el-button type="primary" class="play-btn" @click="playCurrentVoice(1)"
v-if="deviceDetail.voiceBroadcast !== 1">
<el-button type="primary" class="play-btn" @click="playCurrentVoice"
v-if="deviceDetail.voiceBroadcast === 0">
播放</el-button>
<el-button v-else type="info" class="play-btn" @click="playCurrentVoice(0)"> 暂停
<el-button v-else type="info" class="play-btn" @click="playCurrentVoice"> 暂停
</el-button>
</div>
<div class="voice-manage-section">
@ -115,7 +116,6 @@
Number(deviceDetail.latitude).toFixed(4)
: '0.00' }} </div>
</div>
</div>
<div class="location-item1">
<div> <img src="@/assets/images/dw.png" alt="">&nbsp;&nbsp;地址</div>
@ -202,7 +202,7 @@
<el-dialog title="上传语音" v-model="uploadVoiceDialog" width="480px" class="voice-dialog" :show-close="true">
<div class="upload-content">
<div class="upload-area" :class="{ dragOver: isDragOver }" @dragover.prevent="isDragOver = true"
@dragleave.prevent="isDragOver = false" @drop.prevent="handleDrop" @click="triggerFileInput">
@dragleave.prevent="isDragOver = false" @drop.prevent="handleDrop">
<div class="upload-icon">
<el-icon>
<Document />
@ -686,14 +686,15 @@ const sta_VoiceType = ref([
{ id: '4', name: '市政', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
{ id: '5', name: '铁路', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
{ id: '6', name: '医疗', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
{ id: '7', name: '部队', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
{ id: '8', name: '水利', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
// { id: '7', name: '部队', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
// { id: '8', name: '水利', icon: sg, activeIcon: sgAc, switchStatusVioice: false, active: false },
]);
const lightModes = ref<LightMode[]>([
{ id: 'redBlueAlternate', name: '红蓝交替', icon: rb, activeIcon: rbAc, switchStatus: true, instructValue: '6', active: true },
{ id: 'redFlash', name: '红', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '0', active: false },
{ id: 'yellowFlash', name: '黄', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '2', active: false },
{ id: 'redFlash', name: '红', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '0', active: false },
{ id: 'yellowFlash', name: '黄', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '2', active: false },
{ id: 'blueFlash', name: '蓝闪', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '1', active: false },
{ id: 'redClockwise', name: '红色顺时针', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '3', active: false },
{ id: 'yellowClockwise', name: '黄色顺时针', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '4', active: false },
{ id: 'redBlueClockwise', name: '红蓝顺时针', icon: rb, activeIcon: rbAc, switchStatus: false, instructValue: '5', active: false },
@ -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();
});
</script>
@ -1076,6 +1072,12 @@ onUnmounted(() => {
gap: 15px;
}
.light-mode1 {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 15px;
}
.lacatin_gps {
height: 70px;
background: #F7F8FC;
@ -1410,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;