Showing
1 changed file
with
39 additions
and
0 deletions
@@ -2,6 +2,7 @@ import { alarmLevel, statusType } from '/@/views/device/list/config/detail.confi | @@ -2,6 +2,7 @@ import { alarmLevel, statusType } from '/@/views/device/list/config/detail.confi | ||
2 | import { FormSchema } from '/@/components/Form'; | 2 | import { FormSchema } from '/@/components/Form'; |
3 | import { BasicColumn } from '/@/components/Table'; | 3 | import { BasicColumn } from '/@/components/Table'; |
4 | import moment from 'moment'; | 4 | import moment from 'moment'; |
5 | +import { findDictItemByCode } from '/@/api/system/dict'; | ||
5 | 6 | ||
6 | export enum AlarmStatus { | 7 | export enum AlarmStatus { |
7 | CLEARED_UN_ACK = 'CLEARED_UNACK', | 8 | CLEARED_UN_ACK = 'CLEARED_UNACK', |
@@ -68,6 +69,44 @@ export const alarmSearchSchemas: FormSchema[] = [ | @@ -68,6 +69,44 @@ export const alarmSearchSchemas: FormSchema[] = [ | ||
68 | }, | 69 | }, |
69 | }, | 70 | }, |
70 | { | 71 | { |
72 | + field: 'deviceName', | ||
73 | + label: '告警设备', | ||
74 | + component: 'Input', | ||
75 | + colProps: { span: 6 }, | ||
76 | + componentProps: { | ||
77 | + maxLength: 255, | ||
78 | + placeholder: '请输入告警设备', | ||
79 | + }, | ||
80 | + dynamicRules: () => { | ||
81 | + return [ | ||
82 | + { | ||
83 | + required: false, | ||
84 | + validator: (_, value) => { | ||
85 | + if (String(value).length > 255) { | ||
86 | + return Promise.reject('字数不超过255个字'); | ||
87 | + } | ||
88 | + return Promise.resolve(); | ||
89 | + }, | ||
90 | + }, | ||
91 | + ]; | ||
92 | + }, | ||
93 | + }, | ||
94 | + { | ||
95 | + field: 'severity', | ||
96 | + label: '告警级别', | ||
97 | + component: 'ApiSelect', | ||
98 | + colProps: { span: 6 }, | ||
99 | + componentProps: { | ||
100 | + placeholder: '请选择告警级别', | ||
101 | + api: findDictItemByCode, | ||
102 | + params: { | ||
103 | + dictCode: 'severity_type', | ||
104 | + }, | ||
105 | + labelField: 'itemText', | ||
106 | + valueField: 'itemValue', | ||
107 | + }, | ||
108 | + }, | ||
109 | + { | ||
71 | field: 'alarmTime', | 110 | field: 'alarmTime', |
72 | label: '告警时间', | 111 | label: '告警时间', |
73 | component: 'RangePicker', | 112 | component: 'RangePicker', |