|
|
|
@ -265,7 +265,7 @@ |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- AGV状态表格 --> |
|
|
|
<el-table :data="agvList" border style="width: 100%;" max-height="400"> |
|
|
|
<el-table :data="agvList" border style="width: 100%;" max-height="400" class="zxClass"> |
|
|
|
<el-table-column prop="id" label="AGV编号" width="100" align="center"></el-table-column> |
|
|
|
<el-table-column prop="soc" label="电量" width="120" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
@ -355,46 +355,49 @@ |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 告警列表 --> |
|
|
|
<el-table |
|
|
|
<el-table class="zxClass" |
|
|
|
:data="alarmList" |
|
|
|
border |
|
|
|
v-loading="alarmLoading" |
|
|
|
style="width: 100%;" |
|
|
|
max-height="400"> |
|
|
|
<el-table-column prop="alarmId" label="告警ID" width="100" align="center"></el-table-column> |
|
|
|
<el-table-column prop="deviceId" label="设备ID" width="120" align="center"></el-table-column> |
|
|
|
<el-table-column prop="alarmType" label="告警类型" width="100" align="center"> |
|
|
|
<el-table-column prop="deviceName" label="设备名称" width="120" align="center"></el-table-column> |
|
|
|
<el-table-column prop="tuskServiceName" label="服务名称" width="120" align="center"></el-table-column> |
|
|
|
<el-table-column prop="taskId" label="任务ID" width="120" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag :type="getAlarmTypeColor(scope.row.alarmType)"> |
|
|
|
{{ getAlarmTypeText(scope.row.alarmType) }} |
|
|
|
</el-tag> |
|
|
|
{{ scope.row.taskId || '-' }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="alarmLevel" label="告警级别" width="100" align="center"> |
|
|
|
<el-table-column prop="lev" label="告警级别" width="100" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag :type="getAlarmLevelColor(scope.row.alarmLevel)"> |
|
|
|
{{ getAlarmLevelText(scope.row.alarmLevel) }} |
|
|
|
<el-tag :type="getAlarmLevelColor(scope.row.lev)"> |
|
|
|
{{ getAlarmLevelText(scope.row.lev) }} |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="alarmCode" label="告警代码" width="120" align="center"></el-table-column> |
|
|
|
<el-table-column prop="alarmMessage" label="告警信息" min-width="200"> |
|
|
|
<el-table-column prop="code" label="告警代码" width="120" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span style="font-weight: bold; color: #409EFF;">{{ scope.row.code }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="告警描述" min-width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{color: getAlarmMessageColor(scope.row.alarmLevel)}"> |
|
|
|
{{ scope.row.alarmMessage }} |
|
|
|
<span :style="{color: getAlarmMessageColor(scope.row.lev)}"> |
|
|
|
{{ getAlarmCodeDescription(scope.row.code) }} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="alarmTime" label="告警时间" width="160" align="center"> |
|
|
|
<el-table-column prop="alarm" label="详细信息" min-width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.alarmTime | dateFormat }} |
|
|
|
<span v-if="scope.row.alarm" :style="{color: getAlarmMessageColor(scope.row.lev)}"> |
|
|
|
{{ scope.row.alarm }} |
|
|
|
</span> |
|
|
|
<span v-else style="color: #C0C4CC;">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="status" label="状态" width="100" align="center"> |
|
|
|
<el-table-column prop="time" label="告警时间" width="160" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag :type="scope.row.status === 'ACTIVE' ? 'danger' : 'success'"> |
|
|
|
{{ scope.row.status === 'ACTIVE' ? '活跃' : '已清除' }} |
|
|
|
</el-tag> |
|
|
|
{{ formatTimestamp(scope.row.time) }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -879,9 +882,9 @@ export default { |
|
|
|
calculateAlarmStats() { |
|
|
|
this.alarmStats = { |
|
|
|
total: this.alarmList.length, |
|
|
|
warning: this.alarmList.filter(alarm => alarm.alarmLevel === 'WARNING').length, |
|
|
|
error: this.alarmList.filter(alarm => alarm.alarmLevel === 'ERROR' || alarm.alarmLevel === 'CRITICAL').length, |
|
|
|
info: this.alarmList.filter(alarm => alarm.alarmLevel === 'INFO').length |
|
|
|
warning: this.alarmList.filter(alarm => alarm.lev === 2).length, |
|
|
|
error: this.alarmList.filter(alarm => alarm.lev === 3 || alarm.lev === 4).length, |
|
|
|
info: this.alarmList.filter(alarm => alarm.lev === 1).length |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -914,21 +917,21 @@ export default { |
|
|
|
// 获取告警级别文本 |
|
|
|
getAlarmLevelText(level) { |
|
|
|
const levelMap = { |
|
|
|
'INFO': '信息', |
|
|
|
'WARNING': '警告', |
|
|
|
'ERROR': '错误', |
|
|
|
'CRITICAL': '严重' |
|
|
|
1: '信息', |
|
|
|
2: '警告', |
|
|
|
3: '错误', |
|
|
|
4: '严重' |
|
|
|
}; |
|
|
|
return levelMap[level] || level; |
|
|
|
return levelMap[level] || `级别${level}`; |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取告警级别颜色 |
|
|
|
getAlarmLevelColor(level) { |
|
|
|
const colorMap = { |
|
|
|
'INFO': 'info', |
|
|
|
'WARNING': 'warning', |
|
|
|
'ERROR': 'danger', |
|
|
|
'CRITICAL': 'danger' |
|
|
|
1: 'info', |
|
|
|
2: 'warning', |
|
|
|
3: 'danger', |
|
|
|
4: 'danger' |
|
|
|
}; |
|
|
|
return colorMap[level] || 'info'; |
|
|
|
}, |
|
|
|
@ -936,19 +939,65 @@ export default { |
|
|
|
// 获取告警信息颜色 |
|
|
|
getAlarmMessageColor(level) { |
|
|
|
const colorMap = { |
|
|
|
'INFO': '#909399', |
|
|
|
'WARNING': '#e6a23c', |
|
|
|
'ERROR': '#f56c6c', |
|
|
|
'CRITICAL': '#f56c6c' |
|
|
|
1: '#909399', |
|
|
|
2: '#e6a23c', |
|
|
|
3: '#f56c6c', |
|
|
|
4: '#f56c6c' |
|
|
|
}; |
|
|
|
return colorMap[level] || '#606266'; |
|
|
|
}, |
|
|
|
|
|
|
|
// 格式化时间戳 |
|
|
|
formatTimestamp(timestamp) { |
|
|
|
if (!timestamp) return '-'; |
|
|
|
const date = new Date(timestamp); |
|
|
|
return date.toLocaleString('zh-CN', { |
|
|
|
year: 'numeric', |
|
|
|
month: '2-digit', |
|
|
|
day: '2-digit', |
|
|
|
hour: '2-digit', |
|
|
|
minute: '2-digit', |
|
|
|
second: '2-digit' |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取告警代码描述 |
|
|
|
getAlarmCodeDescription(code) { |
|
|
|
const codeMap = { |
|
|
|
'PM0003': 'AGV偏离拓扑点', |
|
|
|
'PM0060': '电池电量低', |
|
|
|
'PM0001': '急停按钮触发', |
|
|
|
'PM0002': '碰撞检测触发', |
|
|
|
'PM0004': '导航异常', |
|
|
|
'PM0005': '通信异常', |
|
|
|
'PM0006': '传感器故障', |
|
|
|
'PM0007': '电机故障', |
|
|
|
'PM0008': '充电异常', |
|
|
|
'PM0009': '任务执行超时', |
|
|
|
'PM0010': '路径规划失败', |
|
|
|
'PM0011': '货物检测异常', |
|
|
|
'PM0012': '升降机构故障', |
|
|
|
'PM0013': '旋转机构故障', |
|
|
|
'PM0014': '安全区域入侵', |
|
|
|
'PM0015': '系统过热', |
|
|
|
'PM0016': '网络连接异常', |
|
|
|
'PM0017': '定位精度异常', |
|
|
|
'PM0018': '载重超限', |
|
|
|
'PM0019': '维护提醒', |
|
|
|
'PM0020': '固件更新提醒' |
|
|
|
}; |
|
|
|
return codeMap[code] || '未知告警'; |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|
|
|
|
/deep/ .zxClass .cell { |
|
|
|
line-height: 24px; |
|
|
|
font-size: 12px; |
|
|
|
height: 24px; |
|
|
|
} |
|
|
|
.sl-svg { |
|
|
|
overflow: hidden; |
|
|
|
float: right; |
|
|
|
|