事件告警修改

This commit is contained in:
lxj
2025-08-15 14:08:35 +08:00
parent 8da35d2d4b
commit 81de99b015
4 changed files with 64 additions and 147 deletions

View File

@@ -1,8 +1,9 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
import { h } from 'vue';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
import { DictEnum } from '@vben/constants';
export const querySchema: FormSchemaGetter = () => [
{
@@ -13,11 +14,8 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
options: [
{ label: '特大', value: '特大' },
{ label: '重要', value: '重要' },
{ label: '一般', value: '一般' },
],
getPopupContainer,
options: getDictOptions(DictEnum.alarm_level),
},
fieldName: 'level',
label: '级别',
@@ -25,13 +23,10 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
options: [
{ label: '待分配', value: '待分配' },
{ label: '处理中', value: '处理中' },
{ label: '已完成', value: '已完成' },
],
getPopupContainer,
options: getDictOptions(DictEnum.alarm_state),
},
fieldName: 'processingStatus',
fieldName: 'state',
label: '处理状态',
},
];
@@ -40,29 +35,25 @@ export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '预警编号',
field: 'alarmId',
width: 150,
field: 'id',
},
{
title: '预警时间',
field: 'alarmTime',
width: 150,
field: 'reportTime',
},
{
title: '设备名称',
field: 'deviceName',
width: 150,
},
{
title: '级别',
field: 'level',
width: 100,
slots: {
default: ({ row }: any) => {
const levelColors: Record<string, string> = {
: 'red',
: 'orange',
: 'blue',
1: 'red',
2: 'orange',
3: 'blue',
};
return h(
'span',
@@ -72,64 +63,31 @@ export const columns: VxeGridProps['columns'] = [
fontWeight: 'bold',
},
},
row.level,
row.levelName,
);
},
},
},
{
title: '预警类型',
field: 'alarmType',
width: 120,
},
{
title: '描述',
field: 'description',
minWidth: 200,
},
{
title: '所在位置',
field: 'location',
width: 150,
},
{
title: '处理状态',
field: 'processingStatus',
width: 100,
field: 'alarmTypeName',
slots: {
default: ({ row }: any) => {
const statusColors: Record<string, string> = {
: 'red',
: 'orange',
: 'green',
};
return h(
'span',
{
style: {
color: statusColors[row.processingStatus] || '#666',
fontWeight: 'bold',
},
},
row.processingStatus,
);
return h('span', row.bigTypeName + '-' + row.smallTypeName);
},
},
},
{
title: '处理情况',
field: 'processingDetails',
width: 150,
title: '处理状态',
field: 'stateName',
},
{
title: '预期处理时间',
field: 'expectedProcessingTime',
width: 150,
field: 'processSt',
},
{
title: '处理时间',
field: 'processingTime',
width: 150,
field: 'processEt',
},
{
field: 'action',