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

174 lines
3.9 KiB
TypeScript
Raw Normal View History

2024-07-22 10:34:40 +08:00
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
2024-07-25 11:55:32 +08:00
import { ref } from 'vue';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
2024-07-22 10:34:40 +08:00
2024-07-16 15:42:49 +08:00
const tableKeyMap = [
{
title: '序号',
dataIndex: 'address',
2024-07-22 15:25:47 +08:00
width: 80,
2024-07-16 15:42:49 +08:00
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '告警编号',
2024-07-22 10:34:40 +08:00
dataIndex: 'alarmCode',
2024-07-16 15:42:49 +08:00
},
{
title: '告警描述',
2024-07-22 10:34:40 +08:00
dataIndex: 'alarmTitle',
2024-07-16 15:42:49 +08:00
},
{
title: '优先级',
2024-07-22 10:34:40 +08:00
dataIndex: 'priority',
2024-07-25 11:55:32 +08:00
width: 80,
2024-07-16 15:42:49 +08:00
},
{
title: '状态',
2024-07-22 10:34:40 +08:00
dataIndex: 'alarmLogState',
2024-07-25 11:55:32 +08:00
width: 100,
2024-07-16 15:42:49 +08:00
},
{
title: '错误码',
2024-07-22 10:34:40 +08:00
dataIndex: 'errorCode',
2024-07-25 11:55:32 +08:00
width: 100,
2024-07-16 15:42:49 +08:00
},
{
title: '设备信息',
2024-07-22 10:34:40 +08:00
dataIndex: 'deviceInfo',
2024-07-25 11:55:32 +08:00
width: 400,
// textEllipsis: true,
2024-07-16 15:42:49 +08:00
},
{
title: '更新时间',
2024-07-22 10:34:40 +08:00
dataIndex: 'updateTime',
2024-07-16 15:42:49 +08:00
},
{
title: '重复次数',
2024-07-22 10:34:40 +08:00
dataIndex: 'alarmRepetitions',
2024-07-25 11:55:32 +08:00
width: 80,
2024-07-16 15:42:49 +08:00
},
];
export const notificationtableConfig = (look: any, status: any) => {
return {
title: '告警记录',
2024-07-22 10:34:40 +08:00
api: equipmentAlarmApi.getTableList,
2024-07-16 15:42:49 +08:00
headerActions: [{}],
2024-07-22 10:34:40 +08:00
scroll: { x: 2000 },
2024-07-16 15:42:49 +08:00
columns: tableKeyMap,
// rowSelection: null, 选择按钮
columnActions: {
title: '操作',
actions: [
{
label: '详情',
name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
look.value.toggle(data);
},
},
{
label: '状态',
name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
status.value.toggle(data);
},
},
],
},
formConfig: {
schemas: [
{
2024-07-22 10:34:40 +08:00
field: 'priority',
label: '优先级',
2024-07-16 15:42:49 +08:00
component: 'NsSelect',
componentProps: {
placeholder: '请选择告警优先级',
2024-07-23 08:35:51 +08:00
allowClear: true,
2024-07-16 15:42:49 +08:00
options: [
{
label: '紧急',
2024-07-22 10:34:40 +08:00
value: 1,
2024-07-16 15:42:49 +08:00
},
{
label: '重要',
2024-07-22 10:34:40 +08:00
value: 2,
2024-07-16 15:42:49 +08:00
},
{
label: '一般',
2024-07-22 10:34:40 +08:00
value: 3,
2024-07-16 15:42:49 +08:00
},
],
},
},
{
2024-07-22 10:34:40 +08:00
field: 'alarmLogState',
2024-07-16 15:42:49 +08:00
label: '状态',
component: 'NsSelect',
componentProps: {
placeholder: '请选择状态',
2024-07-23 08:35:51 +08:00
allowClear: true,
2024-07-16 15:42:49 +08:00
options: [
{
label: '待处理',
2024-07-22 10:34:40 +08:00
value: 1,
2024-07-16 15:42:49 +08:00
},
{
label: '处理中',
2024-07-22 10:34:40 +08:00
value: 2,
2024-07-16 15:42:49 +08:00
},
{
label: '已完成',
2024-07-22 10:34:40 +08:00
value: 3,
2024-07-16 15:42:49 +08:00
},
{
label: '超时',
2024-07-22 10:34:40 +08:00
value: 4,
2024-07-16 15:42:49 +08:00
},
{
label: '关闭',
2024-07-22 10:34:40 +08:00
value: 5,
2024-07-16 15:42:49 +08:00
},
],
},
},
{
2024-07-22 10:34:40 +08:00
field: 'errorCode',
2024-07-16 15:42:49 +08:00
label: '错误码',
2024-07-22 10:34:40 +08:00
component: 'NsSelectApi',
2024-07-16 15:42:49 +08:00
componentProps: {
2024-07-23 08:35:51 +08:00
allowClear: true,
2024-07-22 10:34:40 +08:00
placeholder: '请选择错误码',
autoSelectFirst: false,
api: equipmentAlarmApi.getCodeList,
resultField: 'data',
labelField: 'errorCode',
valueField: 'errorCode',
2024-07-16 15:42:49 +08:00
},
},
{
field: 'createTime',
2024-07-19 16:22:15 +08:00
label: '数据日期',
2024-07-16 15:42:49 +08:00
component: 'NsRangePicker',
2024-07-23 08:35:51 +08:00
allowClear: true,
fieldMap: ['startTime', 'endTime'],
2024-07-16 15:42:49 +08:00
componentProps: {
valueFormat: 'YYYY-MM-DD',
placeholder: ['开始日期', '结束日期'],
2024-07-16 15:42:49 +08:00
},
},
],
},
2024-07-25 11:55:32 +08:00
params: { orgId: orgId.value },
2024-07-16 15:42:49 +08:00
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};
};