光带修改

This commit is contained in:
joylink_zhaoerwei 2023-08-17 18:19:05 +08:00
parent b35b8892f6
commit 0c8163e7b5
4 changed files with 14 additions and 23 deletions

View File

@ -141,14 +141,6 @@ onMounted(() => {
case '道岔失表':
faultTypeOptions = ['道岔均失表', '道岔定位失表', '道岔反位失表'];
break;
case '光带':
faultTypeOptions = [
'计轴红光带',
'计轴大面积红光带',
'计轴橙光带',
'计轴大面积橙光带',
];
break;
default:
faultTypeOptions = [alarmInfo.value.alertType];
faultType.value = alarmInfo.value.alertType;

View File

@ -10,7 +10,8 @@ export enum showAlertTypeData {
'道岔均失表',
'道岔定位失表',
'道岔反位失表',
'光带',
'红光带',
'橙光带',
'计轴红光带',
'计轴大面积红光带',
'计轴橙光带',
@ -34,7 +35,6 @@ export enum showAlertTypeData {
SWITCH_All_LOST = '道岔均失表',
SWITCH_DW_LOST = '道岔定位失表',
SWITCH_FW_LOST = '道岔反位失表',
AXLE_LED = '光带',
AXLE_LED_RED = '计轴红光带',
AXLE_LED_RED_MOST = '计轴大面积红光带',
AXLE_LED_ORANGE = '计轴橙光带',
@ -57,7 +57,6 @@ export enum saveAlertTypeData {
= 'SWITCH_All_LOST',
= 'SWITCH_DW_LOST',
= 'SWITCH_FW_LOST',
= 'AXLE_LED',
= 'AXLE_LED_RED',
= 'AXLE_LED_RED_MOST',
= 'AXLE_LED_ORANGE',

View File

@ -1,6 +1,6 @@
<template>
<div>
<audio ref="audio" >
<audio ref="audio">
<source :src="audioSrc" type="audio/mpeg" />
</audio>
</div>
@ -25,6 +25,7 @@ const watchInteract = () => {
document.removeEventListener('click', watchInteract);
document.removeEventListener('keydown', watchInteract);
};
const redOption = ['计轴红光带', '计轴大面积红光带'];
watch(
() => lineNetStore.alarmInfo,
@ -40,16 +41,12 @@ watch(
function playAlarmMusic(type: number) {
if (playAble.value && audio.value.paused) {
const alarmType = (showAlertTypeData as never)[type + ''];
switch (alarmType) {
case '道岔失表':
audioSrc.value = 'src/assets/lost.mp3';
break;
case '光带':
audioSrc.value = 'src/assets/red.mp3';
break;
default:
audioSrc.value = 'src/assets/buzzer.mp3';
break;
if (alarmType == '道岔失表') {
audioSrc.value = 'src/assets/lost.mp3';
} else if (redOption.includes(alarmType)) {
audioSrc.value = 'src/assets/red.mp3';
} else {
audioSrc.value = 'src/assets/buzzer.mp3';
}
audio.value.src = audioSrc.value;
audio.value.play();

View File

@ -194,7 +194,10 @@ const optionsAlertType = [
'整侧站台门无法打开',
'整侧站台门无法关闭',
'道岔失表',
'光带',
'计轴红光带',
'计轴大面积红光带',
'计轴橙光带',
'计轴大面积橙光带',
];
async function alarmMockSet() {