ibp盘多个报警器处理
This commit is contained in:
parent
ecea32ad9c
commit
dbfbbc9034
@ -49,11 +49,13 @@ export default class alarm extends Group {
|
||||
|
||||
setStatus(state) {
|
||||
// domid还是写在了alarm里面 待优化
|
||||
const audioDom = document.querySelector('#buzzer');
|
||||
if (state && state.on) {
|
||||
audioDom.play().catch(e=>{throw e})
|
||||
} else if (state && !state.on) {
|
||||
audioDom.pause()
|
||||
const audioDom = document.querySelector(`#buzzer_${this.model.code}`);
|
||||
if (audioDom) {
|
||||
if (state && state.on) {
|
||||
audioDom.play().catch(e=>{throw e})
|
||||
} else if (state && !state.on) {
|
||||
audioDom.pause()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,11 @@
|
||||
<el-button v-if="$route.query.noPreLogout" type="primary" @click="quit">退出</el-button>
|
||||
</el-button-group>
|
||||
|
||||
<audio id="buzzer" controls loop="loop">
|
||||
<template v-for="alarm in alarmList" >
|
||||
<audio :key="alarm.code" :id="`buzzer_${alarm.code}`" controls loop="loop">
|
||||
<source :src="buzzerAudio" type="audio/mpeg">
|
||||
</audio>
|
||||
</audio>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -64,7 +66,8 @@ export default {
|
||||
stationCode: '',
|
||||
banUpOpenScreenDoor: false,
|
||||
banDownOpenScreenDoor: false,
|
||||
buzzerAudio:BuzzerAudio
|
||||
buzzerAudio:BuzzerAudio,
|
||||
alarmList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -193,7 +196,8 @@ export default {
|
||||
this.setIbp(data, ibpDatas);
|
||||
this.$store.dispatch('ibp/setIbpData', ibpDatas);
|
||||
this.handleBanOpenScreenDoorStatus();
|
||||
this.preResetBtn = this.$ibp.$painter.ibpInstanceLevel.SquareButton.children().find(e=>e.model.mean === IbpOperation.PRERESET_Z.event);
|
||||
this.preResetBtn = this.$ibp.$painter.ibpInstanceLevel.SquareButton.children().find(e=>e.model.mean === IbpOperation.PRERESET_Z.event); //计轴预复零按钮
|
||||
this.alarmList = this.$ibp.$painter.ibpInstanceLevel.Alarm.children().map(e=>e.model);
|
||||
} else {
|
||||
// 无数据
|
||||
this.loading = false;
|
||||
|
Loading…
Reference in New Issue
Block a user