Browse Source

agv任务管理

master
han\hanst 4 months ago
parent
commit
369285fe8c
  1. 202
      src/views/modules/automatedWarehouse/agvTask.vue

202
src/views/modules/automatedWarehouse/agvTask.vue

@ -4,6 +4,7 @@
<el-col :span="24">
<el-button @click="getDataList()" type="primary">查询</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>
<download-excel
:fields="fields()"
@ -163,8 +164,6 @@
<template slot-scope="scope">
<a size="mini" type="primary" @click="adjustPriority(scope.row)"
>调整优先级</a>
<a size="mini" type="warning" @click="changeLocation(scope.row)"
>变更位置</a>
<a size="mini" type="danger" style="color: red" @click="cancelTuskTask(scope.row)"
>取消</a>
</template>
@ -315,6 +314,102 @@
<el-button @click="agvMonitorVisible = false">关闭</el-button>
</div>
</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>
</template>
@ -326,6 +421,7 @@ import {
changeLocation as changeLocationApi,
cancelTuskTask as cancelTuskTaskApi,
getAgvStatus,
getAgvAlarms,
testTuskConnection as testTuskConnectionApi
} from '@/api/automatedWarehouse/agvTask.js'
import {
@ -389,6 +485,16 @@ export default {
currentToLocation: '',
newFromLocation: '',
newToLocation: ''
},
//
alarmDialogVisible: false,
alarmLoading: false,
alarmList: [],
alarmStats: {
total: 0,
warning: 0,
error: 0,
info: 0
}
}
},
@ -744,6 +850,98 @@ export default {
}).catch(error => {
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';
}
},
}

Loading…
Cancel
Save