去分组

This commit is contained in:
joylink_zhaoerwei 2023-05-24 13:52:07 +08:00
parent 01471bba12
commit 4e2a36bcb8

View File

@ -56,58 +56,40 @@
</div>
<div class="alarm-message-All">
<el-card class="box-card">
<el-collapse v-model="activeName" accordion>
<div v-for="(item, index) in alarmDetailMessageGroup" :key="index">
<el-collapse-item>
<template slot="title">
故障汇总{{ item[0].levelNew }}
</template>
<el-table
:data="item"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
style="width: 100%"
max-height="250"
>
<el-table-column
prop="time"
label="时间"
width="100"
/>
<el-table-column
prop="levelNew"
label="级别"
width="70"
/>
<el-table-column
prop="deviceCodeNew"
label="设备"
width="105"
/>
<el-table-column
prop="typeNew"
label="类型"
width="80"
/>
<el-table-column
prop="descriptionNew"
label="信息"
/>
<!-- <el-table-column label="操作" width="90">
<template slot-scope="scope">
<el-button
size="mini"
:type="dealAlarmMessage[scope.$index] ? 'success' : 'danger'"
@click="handleAlarmMessage(scope.$index,scope.row)"
>{{ dealAlarmMessage[scope.$index] ? '已处理' : '未处理' }}</el-button>
</template>
</el-table-column> -->
</el-table>
</el-collapse-item>
</div>
</el-collapse></el-card>
</div>
<el-table
:data="alarmDetailMessageList"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
style="width: 100%"
max-height="250"
>
<el-table-column
prop="time"
label="时间"
width="100"
/>
<el-table-column
prop="levelNew"
label="级别"
width="70"
/>
<el-table-column
prop="deviceCodeNew"
label="设备"
width="105"
/>
<el-table-column
prop="typeNew"
label="类型"
width="80"
/>
<el-table-column
prop="descriptionNew"
label="信息"
/>
</el-table>
</el-card></div>
</el-dialog>
</div>
@ -138,9 +120,7 @@ export default {
]),
showDecisionMessage:{},
alarmDetailMessageList:[],
alarmDetailMessageGroup:[],
showAlarmImportantMessage:{},
dealAlarmMessage:[true, false],
alarmReasonMap:[],
oldShowAlarmMessage:{}
};
@ -157,7 +137,7 @@ export default {
alarmDetailMessage(newValue, oldValue) {
if (newValue.length > 0) {
const clone = JSON.parse(JSON.stringify(this.alarmDetailMessage));
this.alarmDetailMessageList.push(...clone);
this.alarmDetailMessageList.unshift(...clone);
this.alarmDetailMessageList.forEach((item, i)=>{
this.$set(item, 'show', true);
});
@ -211,38 +191,10 @@ export default {
} else {
this.showAlarmImportantMessage = this.oldShowAlarmMessage;
}
if (this.alarmDetailMessageGroup.length == 0) {
this.alarmDetailMessageGroup.push([newAlarmMessage]);
this.alarmReasonMap.push(newAlarmMessage.reason);
} else if (this.alarmReasonMap.includes(newAlarmMessage.reason)) {
const index = this.alarmReasonMap.indexOf(newAlarmMessage.reason);
this.alarmDetailMessageGroup[index].push(newAlarmMessage);
} else {
this.alarmReasonMap.push(newAlarmMessage.reason);
this.alarmDetailMessageGroup.push([newAlarmMessage]);
}
this.showAlarmMessageList = true;
},
goToAlarmDetail() {
}
/* handleAlarmMessage(index, row) {
this.$confirm('此操作将处理故障信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dealAlarmMessage.splice(index, 1, !this.dealAlarmMessage[index]);
this.$message({
type: 'success',
message: '处理成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消处理'
});
});
} */
}
};
</script>
@ -283,7 +235,7 @@ export default {
.alarm-message-All{
margin-top:10px;
.box-card{
padding: 0 10px;
padding:10px;
}
}
.yellow{