Files
SaaS-lib/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts

146 lines
3.3 KiB
TypeScript
Raw Normal View History

import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
2024-07-19 14:13:01 +08:00
const tableKeyMap = [
{
title: '序号',
dataIndex: 'address',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '告警编号',
dataIndex: 'alarmCode',
2024-07-19 14:13:01 +08:00
},
{
title: '告警描述',
dataIndex: 'alarmDescription',
2024-07-19 14:13:01 +08:00
},
{
title: '优先级',
dataIndex: 'priority',
2024-07-19 14:13:01 +08:00
},
{
title: '状态',
dataIndex: 'alarmLogState',
2024-07-19 14:13:01 +08:00
},
{
title: '错误码',
dataIndex: 'errorCode',
2024-07-19 14:13:01 +08:00
},
{
title: '设备信息',
dataIndex: 'deviceInfo',
2024-07-19 14:13:01 +08:00
},
{
title: '更新时间',
dataIndex: 'updateTime',
2024-07-19 14:13:01 +08:00
},
{
title: '断网时长',
dataIndex: 'durationOfNetworkDisconnection',
2024-07-19 14:13:01 +08:00
},
];
export const notificationtableConfig = (look: any, status: any) => {
return {
title: '告警记录',
api: gatewayAlarmApi.getTableList,
2024-07-19 14:13:01 +08:00
headerActions: [{}],
columns: tableKeyMap,
// rowSelection: null, 选择按钮
columnActions: {
title: '操作',
actions: [
{
label: '详情',
name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
console.log(look.value);
look.value.toggle(data);
},
},
{
label: '状态',
name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
status.value.toggle(data);
},
},
],
},
formConfig: {
schemas: [
// {
// field: 'name',
// label: '告警类型',
// component: 'NsSelect',
// defaultValue: '2',
// componentProps: {
// placeholder: '请选择告警优先级',
// disabled: true, // 不可选择
// options: [
// {
// label: '紧急',
// value: '1',
// },
// {
// label: '重要',
// value: '2',
// },
// {
// label: '一般',
// value: '3',
// },
// ],
// },
// },
2024-07-19 14:13:01 +08:00
{
field: 'alarmLogState',
2024-07-19 14:13:01 +08:00
label: '状态',
component: 'NsSelect',
componentProps: {
placeholder: '请选择状态',
allowClear: true,
2024-07-19 14:13:01 +08:00
options: [
{
label: '待处理',
value: 1,
2024-07-19 14:13:01 +08:00
},
{
label: '处理中',
value: 2,
2024-07-19 14:13:01 +08:00
},
{
label: '已完成',
value: 3,
2024-07-19 14:13:01 +08:00
},
{
label: '超时',
value: 4,
2024-07-19 14:13:01 +08:00
},
{
label: '关闭',
value: 5,
2024-07-19 14:13:01 +08:00
},
],
},
},
{
field: 'createTime',
2024-07-19 16:22:15 +08:00
label: '数据日期',
2024-07-19 14:13:01 +08:00
component: 'NsRangePicker',
fieldMap: ['startTime', 'endTime'],
2024-07-19 14:13:01 +08:00
componentProps: {
valueFormat: 'YYYY-MM-DD',
placeholder: ['开始日期', '结束日期'],
},
},
],
},
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};
};