工单告警完善
This commit is contained in:
@@ -11,19 +11,11 @@ import {
|
||||
getAlarmList,
|
||||
getAlarmDetail
|
||||
} from '../../api/alarmApi.js';
|
||||
import { alarmTypeMap } from '@/constants.js';
|
||||
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
// ====================== 枚举配置 ======================
|
||||
const alarmTypeMap = {
|
||||
1: '设备故障',
|
||||
2: '数据异常',
|
||||
3: '通信中断',
|
||||
4: '性能告警',
|
||||
5: '安全告警',
|
||||
6: '环境告警'
|
||||
};
|
||||
|
||||
const alarmLevelConfig = {
|
||||
1: { description: '严重', color: '#FF4D4F' },
|
||||
@@ -120,6 +112,7 @@ const AlarmHistory = () => {
|
||||
setQueryParams({
|
||||
deviceId: values.deviceId || '',
|
||||
alarmLevel: values.alarmLevel || '',
|
||||
alarmType: values.alarmType || '',
|
||||
handleStatus: values.handleStatus || '',
|
||||
startTime,
|
||||
endTime,
|
||||
@@ -142,6 +135,12 @@ const AlarmHistory = () => {
|
||||
},
|
||||
{ title: '设备ID', dataIndex: 'deviceId', width: 160 },
|
||||
{ title: '设备名称', dataIndex: 'deviceName', ellipsis: true },
|
||||
{
|
||||
title: '告警类型',
|
||||
dataIndex: 'alarmType',
|
||||
width: 130,
|
||||
render: (t) => alarmTypeMap[t] || '-'
|
||||
},
|
||||
{
|
||||
title: '告警级别',
|
||||
width: 100,
|
||||
@@ -201,6 +200,16 @@ const AlarmHistory = () => {
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="alarmType" label="告警类型">
|
||||
<Select placeholder="全部" style={{ width: 150 }} allowClear>
|
||||
<Option value="UAV_FAULT">无人机故障</Option>
|
||||
<Option value="MOWER_FAULT">割草机故障</Option>
|
||||
<Option value="OTHER_DEVICE_FAULT">其他设备故障</Option>
|
||||
<Option value="SERVER_FAILURE">服务器故障</Option>
|
||||
<Option value="SYSTEM_ERROR">系统错误</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="handleStatus" label="处理状态">
|
||||
<Select placeholder="全部" style={{ width: 130 }} allowClear>
|
||||
<Option value={1}>待处理</Option>
|
||||
@@ -266,6 +275,7 @@ const AlarmHistory = () => {
|
||||
<Descriptions.Item label="告警时间">
|
||||
{currentAlarm?.alarmTime ? dayjs(currentAlarm.alarmTime).format('YYYY-MM-DD HH:mm:ss') : '-'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="告警类型">{alarmTypeMap[currentAlarm?.alarmType] || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="告警级别">
|
||||
<Tag color={levelColor[currentAlarm?.alarmLevel]} style={{ border: 'none', color: '#fff' }}>
|
||||
{levelText[currentAlarm?.alarmLevel]}
|
||||
|
||||
Reference in New Issue
Block a user