You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

152 lines
3.4 KiB

import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
const tableKeyMap = [
{
title: '序号',
dataIndex: 'address',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '优先级',
dataIndex: 'prioritys',
},
{
title: '告警类型',
dataIndex: 'alarmTypeName',
},
{
title: '告警标题',
dataIndex: 'alarmTitle',
},
{
title: '错误码',
dataIndex: 'errorCode',
},
{
title: '通知名单',
dataIndex: 'notificationList',
width: 150,
textEllipsis: true,
},
{
title: '通知方式',
dataIndex: 'notificationMethod',
},
{
title: '启用通知',
dataIndex: 'enableNotifications',
},
];
export const notificationtableConfig = (notificationManagements: any) => {
return {
title: '告警规则',
api: notificationManagementApi.getTableList,
headerActions: [],
columns: tableKeyMap,
columnActions: {
title: '操作',
actions: [
{
label: '联系方式',
name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
notificationManagements.value.toggle(data);
},
},
],
},
formConfig: {
schemas: [
{
field: 'alarmType',
label: '告警类型',
component: 'NsSelect',
componentProps: {
placeholder: '请选告警类型',
allowClear: true,
options: [
{
label: '设备告警',
value: 1,
},
{
label: '网关告警',
value: 2,
},
{
label: '能耗告警',
value: 3,
},
],
},
},
{
field: 'priority',
label: '告警优先级',
component: 'NsSelect',
componentProps: {
placeholder: '请选择告警优先级',
allowClear: true,
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
],
},
},
{
field: 'alarmTitle',
label: '告警标题',
component: 'NsInput',
componentProps: {
allowClear: true,
placeholder: '请输入告警标题关键字',
},
},
{
field: 'errorCode',
label: '错误码',
component: 'NsInput',
componentProps: {
allowClear: true,
placeholder: '请输入告警错误码',
},
},
{
field: 'enableNotifications',
label: '启用状态',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择启用状态',
options: [
{
label: '启用',
value: '1',
},
{
label: '关闭',
value: '0',
},
],
},
},
],
},
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};
};