|
|
@ -4,6 +4,7 @@ |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
|
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
|
|
<el-button @click="showAgvMonitor()" type="success">AGV监控</el-button> |
|
|
<el-button @click="showAgvMonitor()" type="success">AGV监控</el-button> |
|
|
|
|
|
<el-button @click="showAlarmInfo()" type="warning">告警信息</el-button> |
|
|
<el-button @click="testTuskConnection()" type="info">测试连接</el-button> |
|
|
<el-button @click="testTuskConnection()" type="info">测试连接</el-button> |
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
@ -163,8 +164,6 @@ |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<a size="mini" type="primary" @click="adjustPriority(scope.row)" |
|
|
<a size="mini" type="primary" @click="adjustPriority(scope.row)" |
|
|
>调整优先级</a> |
|
|
>调整优先级</a> |
|
|
<a size="mini" type="warning" @click="changeLocation(scope.row)" |
|
|
|
|
|
>变更位置</a> |
|
|
|
|
|
<a size="mini" type="danger" style="color: red" @click="cancelTuskTask(scope.row)" |
|
|
<a size="mini" type="danger" style="color: red" @click="cancelTuskTask(scope.row)" |
|
|
>取消</a> |
|
|
>取消</a> |
|
|
</template> |
|
|
</template> |
|
|
@ -315,6 +314,102 @@ |
|
|
<el-button @click="agvMonitorVisible = false">关闭</el-button> |
|
|
<el-button @click="agvMonitorVisible = false">关闭</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 告警信息对话框 --> |
|
|
|
|
|
<el-dialog title="AGV告警信息" :visible.sync="alarmDialogVisible" width="70%" :close-on-click-modal="false"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<!-- 告警统计 --> |
|
|
|
|
|
<el-row :gutter="20" style="margin-bottom: 20px;"> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-card class="stat-card"> |
|
|
|
|
|
<div class="stat-content"> |
|
|
|
|
|
<span class="stat-number" style="color: #f56c6c;">{{ alarmStats.total }}</span> |
|
|
|
|
|
<span class="stat-label">总告警数</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-card class="stat-card"> |
|
|
|
|
|
<div class="stat-content"> |
|
|
|
|
|
<span class="stat-number" style="color: #e6a23c;">{{ alarmStats.warning }}</span> |
|
|
|
|
|
<span class="stat-label">警告</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-card class="stat-card"> |
|
|
|
|
|
<div class="stat-content"> |
|
|
|
|
|
<span class="stat-number" style="color: #f56c6c;">{{ alarmStats.error }}</span> |
|
|
|
|
|
<span class="stat-label">错误</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-card class="stat-card"> |
|
|
|
|
|
<div class="stat-content"> |
|
|
|
|
|
<span class="stat-number" style="color: #909399;">{{ alarmStats.info }}</span> |
|
|
|
|
|
<span class="stat-label">信息</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-card> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 告警列表 --> |
|
|
|
|
|
<el-table |
|
|
|
|
|
: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"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag :type="getAlarmTypeColor(scope.row.alarmType)"> |
|
|
|
|
|
{{ getAlarmTypeText(scope.row.alarmType) }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="alarmLevel" label="告警级别" width="100" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag :type="getAlarmLevelColor(scope.row.alarmLevel)"> |
|
|
|
|
|
{{ getAlarmLevelText(scope.row.alarmLevel) }} |
|
|
|
|
|
</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"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<span :style="{color: getAlarmMessageColor(scope.row.alarmLevel)}"> |
|
|
|
|
|
{{ scope.row.alarmMessage }} |
|
|
|
|
|
</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="alarmTime" label="告警时间" width="160" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ scope.row.alarmTime | dateFormat }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="status" label="状态" width="100" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag :type="scope.row.status === 'ACTIVE' ? 'danger' : 'success'"> |
|
|
|
|
|
{{ scope.row.status === 'ACTIVE' ? '活跃' : '已清除' }} |
|
|
|
|
|
</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 空状态 --> |
|
|
|
|
|
<div v-if="!alarmLoading && alarmList.length === 0" style="text-align: center; padding: 40px; color: #909399;"> |
|
|
|
|
|
<i class="el-icon-info" style="font-size: 48px; margin-bottom: 16px;"></i> |
|
|
|
|
|
<div>暂无告警信息</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="refreshAlarmInfo" type="primary">刷新</el-button> |
|
|
|
|
|
<el-button @click="alarmDialogVisible = false">关闭</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -326,6 +421,7 @@ import { |
|
|
changeLocation as changeLocationApi, |
|
|
changeLocation as changeLocationApi, |
|
|
cancelTuskTask as cancelTuskTaskApi, |
|
|
cancelTuskTask as cancelTuskTaskApi, |
|
|
getAgvStatus, |
|
|
getAgvStatus, |
|
|
|
|
|
getAgvAlarms, |
|
|
testTuskConnection as testTuskConnectionApi |
|
|
testTuskConnection as testTuskConnectionApi |
|
|
} from '@/api/automatedWarehouse/agvTask.js' |
|
|
} from '@/api/automatedWarehouse/agvTask.js' |
|
|
import { |
|
|
import { |
|
|
@ -389,6 +485,16 @@ export default { |
|
|
currentToLocation: '', |
|
|
currentToLocation: '', |
|
|
newFromLocation: '', |
|
|
newFromLocation: '', |
|
|
newToLocation: '' |
|
|
newToLocation: '' |
|
|
|
|
|
}, |
|
|
|
|
|
// 告警信息相关 |
|
|
|
|
|
alarmDialogVisible: false, |
|
|
|
|
|
alarmLoading: false, |
|
|
|
|
|
alarmList: [], |
|
|
|
|
|
alarmStats: { |
|
|
|
|
|
total: 0, |
|
|
|
|
|
warning: 0, |
|
|
|
|
|
error: 0, |
|
|
|
|
|
info: 0 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -744,6 +850,98 @@ export default { |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
this.$message.error('测试TUSK连接异常:' + error.message); |
|
|
this.$message.error('测试TUSK连接异常:' + error.message); |
|
|
}); |
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 显示告警信息 |
|
|
|
|
|
showAlarmInfo() { |
|
|
|
|
|
this.alarmDialogVisible = true; |
|
|
|
|
|
this.refreshAlarmInfo(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 刷新告警信息 |
|
|
|
|
|
refreshAlarmInfo() { |
|
|
|
|
|
this.alarmLoading = true; |
|
|
|
|
|
getAgvAlarms().then(({data}) => { |
|
|
|
|
|
this.alarmLoading = false; |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
this.alarmList = data.alarms || []; |
|
|
|
|
|
this.calculateAlarmStats(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '获取告警信息失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.alarmLoading = false; |
|
|
|
|
|
this.$message.error('获取告警信息异常:' + error.message); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 计算告警统计信息 |
|
|
|
|
|
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 |
|
|
|
|
|
}; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取告警类型文本 |
|
|
|
|
|
getAlarmTypeText(type) { |
|
|
|
|
|
const typeMap = { |
|
|
|
|
|
'SYSTEM': '系统', |
|
|
|
|
|
'HARDWARE': '硬件', |
|
|
|
|
|
'SOFTWARE': '软件', |
|
|
|
|
|
'COMMUNICATION': '通信', |
|
|
|
|
|
'SAFETY': '安全', |
|
|
|
|
|
'OPERATION': '操作' |
|
|
|
|
|
}; |
|
|
|
|
|
return typeMap[type] || type; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取告警类型颜色 |
|
|
|
|
|
getAlarmTypeColor(type) { |
|
|
|
|
|
const colorMap = { |
|
|
|
|
|
'SYSTEM': 'danger', |
|
|
|
|
|
'HARDWARE': 'warning', |
|
|
|
|
|
'SOFTWARE': 'info', |
|
|
|
|
|
'COMMUNICATION': 'warning', |
|
|
|
|
|
'SAFETY': 'danger', |
|
|
|
|
|
'OPERATION': 'primary' |
|
|
|
|
|
}; |
|
|
|
|
|
return colorMap[type] || 'info'; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取告警级别文本 |
|
|
|
|
|
getAlarmLevelText(level) { |
|
|
|
|
|
const levelMap = { |
|
|
|
|
|
'INFO': '信息', |
|
|
|
|
|
'WARNING': '警告', |
|
|
|
|
|
'ERROR': '错误', |
|
|
|
|
|
'CRITICAL': '严重' |
|
|
|
|
|
}; |
|
|
|
|
|
return levelMap[level] || level; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取告警级别颜色 |
|
|
|
|
|
getAlarmLevelColor(level) { |
|
|
|
|
|
const colorMap = { |
|
|
|
|
|
'INFO': 'info', |
|
|
|
|
|
'WARNING': 'warning', |
|
|
|
|
|
'ERROR': 'danger', |
|
|
|
|
|
'CRITICAL': 'danger' |
|
|
|
|
|
}; |
|
|
|
|
|
return colorMap[level] || 'info'; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取告警信息颜色 |
|
|
|
|
|
getAlarmMessageColor(level) { |
|
|
|
|
|
const colorMap = { |
|
|
|
|
|
'INFO': '#909399', |
|
|
|
|
|
'WARNING': '#e6a23c', |
|
|
|
|
|
'ERROR': '#f56c6c', |
|
|
|
|
|
'CRITICAL': '#f56c6c' |
|
|
|
|
|
}; |
|
|
|
|
|
return colorMap[level] || '#606266'; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
|