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.
 
 
 
 
 
 

162 lines
3.7 KiB

import { dateUtil } from '/nerv-lib/util/date-util';
import data from '../notificationManagementMock.json';
import { http } from '/nerv-lib/util';
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { ref } from 'vue';
const tableKeyMap = [
{
title: '序号',
dataIndex: 'address',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '告警编号',
dataIndex: 'alarmCode',
},
{
title: '告警描述',
dataIndex: 'alarmTitle',
},
{
title: '优先级',
dataIndex: 'priority',
},
{
title: '状态',
dataIndex: 'alarmLogState',
},
{
title: '错误码',
dataIndex: 'errorCode',
},
{
title: '设备信息',
dataIndex: 'deviceInfo',
},
{
title: '更新时间',
dataIndex: 'updateTime',
},
{
title: '重复次数',
dataIndex: 'alarmRepetitions',
},
];
const mockData = ref(data.listData);
export const notificationtableConfig = (look: any, status: any) => {
return {
title: '告警记录',
api: equipmentAlarmApi.getTableList,
value: mockData.value,
headerActions: [{}],
scroll: { x: 2000 },
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: [
{
field: 'priority',
label: '优先级',
component: 'NsSelect',
componentProps: {
placeholder: '请选择告警优先级',
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
],
},
},
{
field: 'alarmLogState',
label: '状态',
component: 'NsSelect',
componentProps: {
placeholder: '请选择状态',
options: [
{
label: '待处理',
value: 1,
},
{
label: '处理中',
value: 2,
},
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
},
],
},
},
{
field: 'errorCode',
label: '错误码',
component: 'NsSelectApi',
componentProps: {
placeholder: '请选择错误码',
autoSelectFirst: false,
api: equipmentAlarmApi.getCodeList,
resultField: 'data',
labelField: 'errorCode',
valueField: 'errorCode',
},
},
{
field: 'createTime',
label: '数据日期',
component: 'NsRangePicker',
fieldMap: ['manufactureBeginDate', 'manufactureEndDate'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
placeholder: ['开始日期', '结束日期'],
},
},
],
},
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};
};