IBP盘报警器逻辑修复

This commit is contained in:
yuan 2021-06-16 14:30:11 +08:00
parent c84c50efbb
commit 35cb4fcb32
5 changed files with 12 additions and 16 deletions

View File

@ -46,4 +46,14 @@ export default class alarm extends Group {
this.model.point.x+=dx;
this.model.point.y+=dy;
}
setStatus(state) {
// domid还是写在了alarm里面 待优化
const audioDom = document.querySelector('#buzzer');
if (state && state.on) {
audioDom.play()
} else if (state && !state.on) {
audioDom.pause()
}
}
}

View File

@ -76,7 +76,6 @@ export default class elevator extends Group {
}
}
setStatus(model) {
console.log('elevator--->', model);
if (model.direction=='none') {
this.elevatorArrowBottom.setStatus('off');
this.elevatorArrowTop.setStatus('off');

View File

@ -74,7 +74,6 @@ export default class elevatorArrow extends Group {
}
setStatus(data) {
console.log('elevatorArrow--->', data);
let imageBack;
switch (data) {
case 'on': {

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -86,7 +86,6 @@ export default {
'$store.state.socket.simulationIbpStatus': function (val) {
if (val && val[this.stationCode]) {
this.statusMessage(val[this.stationCode]);
this.controlAudio(val[this.stationCode].jjtcBuzzer);
}
},
'$store.state.socket.simulationTimeSync': function (time) { // 仿
@ -175,7 +174,6 @@ export default {
getIbpInitialState(this.$route.query.group, this.stationCode).then(resp => {
if (resp.data) {
this.statusMessage(resp.data);
this.controlAudio(resp.data.jjtcBuzzer);
}
}).catch((e) => {
this.$message.error('获取IBP盘初始状态异常');
@ -330,16 +328,6 @@ export default {
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
},
controlAudio(val) {
const audio = document.getElementById('buzzer');
if (audio !== null) {
if (val) {
audio.play();
} else if (val === false) {
audio.pause();
}
}
},
switchOffset() {
if (this.offsetX === 0) {
this.offsetX = 1920;