告警功能增加
This commit is contained in:
parent
daff010eb7
commit
2d898be6c4
|
|
@ -201,16 +201,14 @@ export default {
|
||||||
// 处理告警信息并显示弹窗
|
// 处理告警信息并显示弹窗
|
||||||
handleWarning(warning) {
|
handleWarning(warning) {
|
||||||
console.log(warning)
|
console.log(warning)
|
||||||
const formattedTime = new Date(warning.warningTime).toLocaleString();
|
// const formattedTime = new Date(warning.warningTime).toLocaleString();
|
||||||
|
|
||||||
// 弹出告警信息
|
// 弹出告警信息
|
||||||
MessageBox.alert(
|
MessageBox.alert(
|
||||||
`
|
`
|
||||||
|
<p><strong>操作人:</strong>${warning.operaUserName}</p>
|
||||||
<p><strong>事件:</strong>${warning.warningEvent}</p>
|
<p><strong>事件:</strong>${warning.warningEvent}</p>
|
||||||
<p><strong>内容:</strong>${warning.warningContent}</p>
|
|
||||||
<p><strong>等级:</strong>${warning.warningGrade}</p>
|
|
||||||
<p><strong>IP:</strong>${warning.warningIp}</p>
|
<p><strong>IP:</strong>${warning.warningIp}</p>
|
||||||
<p><strong>时间:</strong>${formattedTime}</p>
|
<p><strong>时间:</strong>${warning.warningTime}</p>
|
||||||
`,
|
`,
|
||||||
'告警通知',
|
'告警通知',
|
||||||
{
|
{
|
||||||
|
|
@ -228,9 +226,8 @@ export default {
|
||||||
if (this.socket && this.socket.readyState === WebSocket.OPEN) {
|
if (this.socket && this.socket.readyState === WebSocket.OPEN) {
|
||||||
const message = {
|
const message = {
|
||||||
warningId,
|
warningId,
|
||||||
status: '1' // 1 表示已处理
|
|
||||||
};
|
};
|
||||||
this.socket.send(JSON.stringify(message));
|
this.socket.send(warningId);
|
||||||
console.log(`已通知后端处理告警: ${warningId}`);
|
console.log(`已通知后端处理告警: ${warningId}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope" v-if="scope.row.userId !== 1">
|
<template slot-scope="scope" v-if="scope.row.userId !== 1 ">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="confirmPassword(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="confirmPassword(scope.row)"
|
||||||
v-hasPermi="['system:user:edit']"
|
v-hasPermi="['system:user:edit']"
|
||||||
>修改
|
>修改
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue