报警状态调整

This commit is contained in:
fan 2020-10-30 14:15:00 +08:00
parent 3341f5475c
commit 7425506054
2 changed files with 80 additions and 26 deletions

View File

@ -36,9 +36,9 @@
<el-col :span="10">
<div class="nav-border">
<el-row>
<el-col :span="6"><el-button style="width: 80px;" :style="{background:levelList.includes('A')?'#F00':'#FFF' }" plain :class="{'headerBox' :levelList.includes('A')}" @click="showLowAlarm('A')">A级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" :style="{background:levelList.includes('B')?'#F00':'#FFF' }" plain :class="{'headerBox' :levelList.includes('B')}" @click="showLowAlarm('B')">B级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" :style="{background:levelList.includes('C')?'#F00':'#FFF' }" plain :class="{'headerBox' :levelList.includes('C')}" @click="showLowAlarm('C')">C级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" :style="{background:isNoRecoverLevelA || isNoConfirmLevelA?'#F00':'#FFF' }" plain :class="{'headerBox' :isNoConfirmLevelA}" @click="showLowAlarm('A')">A级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" :style="{background:isNoRecoverLevelB || isNoConfirmLevelB?'#F00':'#FFF' }" plain :class="{'headerBox' :isNoConfirmLevelB}" @click="showLowAlarm('B')">B级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" :style="{background:isNoRecoverLevelC?'#F00':'#FFF' }" plain>C级警报</el-button></el-col>
<el-col :span="6"><el-button style="width: 80px;" plain @click="undeveloped">记录</el-button></el-col>
</el-row>
<el-row>
@ -107,9 +107,9 @@
<el-col :span="4">
<div style="width: calc(100% - 10px);border: 2px solid #DDD9CA;border-radius: 5px;">
<el-row style="height: 68px;display: flex; justify-content: space-between;align-items: center;">
<div style="width: 40px;" class="div-simulate-button" :class="{'headerBox' :levelList.includes('A')}" @click="showHimAlarm('A')">A</div>
<div style="width: 40px;" class="div-simulate-button" :class="{'headerBox' :levelList.includes('B')}" @click="showHimAlarm('B')">B</div>
<div style="width: 40px;" class="div-simulate-button" :class="{'headerBox' :levelList.includes('C')}" @click="showHimAlarm('C')">C</div>
<div style="width: 40px;" class="div-simulate-button" :style="{background:isNoRecoverLevelA || isNoConfirmLevelA?'#F00':'#FFF' }" :class="{'headerBox' :isNoConfirmLevelA}" @click="showHimAlarm('A')">A</div>
<div style="width: 40px;" class="div-simulate-button" :style="{background:isNoRecoverLevelB || isNoConfirmLevelB?'#F00':'#FFF' }" :class="{'headerBox' :isNoConfirmLevelB}" @click="showHimAlarm('B')">B</div>
<div style="width: 40px;" class="div-simulate-button" :style="{background:isNoRecoverLevelC?'#F00':'#FFF' }" @click="showHimAlarm('C')">C</div>
<img :src="voiceIcon" style="width: 40px;height: 40px;" @click="controlAudio(false)">
</el-row>
<el-row class="button-row">
@ -187,9 +187,18 @@ export default {
version: '',
centralizedMap: {},
tipContent: [],
levelList: [],
sound: false,
buzzerAudio: BuzzerAudio
buzzerAudio: BuzzerAudio,
noConfirmMapA: {},
noConfirmMapB: {},
confirmNoRecoverMapA: {},
confirmNoRecoverMapB: {},
confirmNoRecoverMapC: {},
noConfirmMapAString: '{}',
noConfirmMapBString: '{}',
confirmNoRecoverMapAString: '{}',
confirmNoRecoverMapBString: '{}',
confirmNoRecoverMapCString: '{}'
};
},
computed: {
@ -208,6 +217,21 @@ export default {
},
voiceIcon() {
return this.sound ? voiceOpen : voiceClose;
},
isNoConfirmLevelA() {
return this.noConfirmMapAString !== '{}';
},
isNoConfirmLevelB() {
return this.noConfirmMapBString !== '{}';
},
isNoRecoverLevelA() {
return this.confirmNoRecoverMapAString !== '{}';
},
isNoRecoverLevelB() {
return this.confirmNoRecoverMapBString !== '{}';
},
isNoRecoverLevelC() {
return this.confirmNoRecoverMapCString !== '{}';
}
},
watch: {
@ -243,13 +267,52 @@ export default {
}
},
'$store.state.socket.simulationAlarmInfo': function(val) {
if (val) {
this.tipContent.push(val);
this.handleAlarm(val);
(val || []).forEach(item => {
if (!item.confirmed) {
this.tipContent.push(item);
this.handleAlarm(item);
if (this.tipContent.length > 3) {
this.tipContent.shift();
}
if (item.level === 'A') {
this.noConfirmMapA[item.code] = item;
this.noConfirmMapAString = JSON.stringify(this.noConfirmMapA);
} else if (item.level === 'B') {
this.noConfirmMapB[item.code] = item;
this.noConfirmMapBString = JSON.stringify(this.noConfirmMapB);
}
} else if (!item.recovered) {
if (item.level === 'A') {
delete this.noConfirmMapA[item.code];
this.confirmNoRecoverMapA[item.code] = item;
this.noConfirmMapAString = JSON.stringify(this.noConfirmMapA);
this.confirmNoRecoverMapAString = JSON.stringify(this.confirmNoRecoverMapA);
} else if (item.level === 'B') {
delete this.noConfirmMapB[item.code];
this.confirmNoRecoverMapB[item.code] = item;
this.noConfirmMapBString = JSON.stringify(this.noConfirmMapB);
this.confirmNoRecoverMapBString = JSON.stringify(this.confirmNoRecoverMapB);
} else if (item.level === 'C') {
this.confirmNoRecoverMapC[item.code] = item;
this.confirmNoRecoverMapCString = JSON.stringify(this.confirmNoRecoverMapC);
}
} else {
if (item.level === 'A') {
delete this.noConfirmMapA[item.code];
delete this.confirmNoRecoverMapA[item.code];
this.noConfirmMapAString = JSON.stringify(this.noConfirmMapA);
this.confirmNoRecoverMapAString = JSON.stringify(this.confirmNoRecoverMapA);
} else if (item.level === 'B') {
delete this.noConfirmMapB[item.code];
delete this.confirmNoRecoverMapB[item.code];
this.noConfirmMapBString = JSON.stringify(this.noConfirmMapB);
this.confirmNoRecoverMapBString = JSON.stringify(this.confirmNoRecoverMapB);
} else if (item.level === 'C') {
delete this.confirmNoRecoverMapC[item.code];
this.confirmNoRecoverMapCString = JSON.stringify(this.confirmNoRecoverMapC);
}
}
});
}
},
mounted() {
@ -262,10 +325,9 @@ export default {
},
methods: {
handleAlarm(val) {
if (!this.levelList.includes(val.level)) {
this.levelList.push(val.level);
}
if (val.level === 'A' || val.level === 'B') {
this.controlAudio(true);
}
},
initMenu() {
//
@ -351,17 +413,9 @@ export default {
});
},
showHimAlarm(level) {
const index = this.levelList.indexOf(level);
if (index > -1) {
this.levelList.splice(index, 1);
}
this.$refs.alarmTableHmi.doShow(level);
},
showLowAlarm(level) {
const index = this.levelList.indexOf(level);
if (index > -1) {
this.levelList.splice(index, 1);
}
this.$refs.alarmTableLow.doShow(level);
},
controlAudio(val) {

View File

@ -276,7 +276,7 @@ const socket = {
simulationTimeSync: '', // 仿真时间
simulationIbpStatus: null,
competitionPracticeFinish:0, // 竞赛场景结束标识
simulationAlarmInfo: {} // 仿真报警信息
simulationAlarmInfo: []// 仿真报警信息
},
getters: {
},