fix:能源告警配置
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import data from '../notificationManagementMock.json';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
|
||||
import { energyAlarms } from '/@/api/alarmSettings/energyAlarm';
|
||||
|
||||
import { ref } from 'vue';
|
||||
const tableKeyMap = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -31,14 +29,13 @@ const tableKeyMap = [
|
||||
},
|
||||
{
|
||||
title: '监测时长',
|
||||
dataIndex: 'monitor',
|
||||
dataIndex: 'monitorFrequency',
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
dataIndex: 'enableRules',
|
||||
},
|
||||
];
|
||||
const mockData = ref(data.listData);
|
||||
const doWnload = (url: any) => {
|
||||
const a = document.createElement('a');
|
||||
document.body.appendChild(a);
|
||||
@@ -51,14 +48,13 @@ const doWnload = (url: any) => {
|
||||
|
||||
export const energyAlarmConfigs = (
|
||||
editeEnergyAlarm: any,
|
||||
mainRefEquipmentAlarm: any,
|
||||
mainEnergyAlarmConfig: any,
|
||||
energyAlarm: any,
|
||||
configureDeviceAlarms: any,
|
||||
) => {
|
||||
return {
|
||||
title: '告警规则',
|
||||
api: deviceAlarms.getTableList,
|
||||
value: mockData.value,
|
||||
api: energyAlarms.getTableList,
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
@@ -73,7 +69,6 @@ export const energyAlarmConfigs = (
|
||||
name: 'groupImport',
|
||||
type: 'primary',
|
||||
extra: {
|
||||
// api: props.postImportApi, // 导入接口名
|
||||
title: '设备信息', // 弹窗title
|
||||
templateName: 'whiteListUser', // 所使用的文件名称
|
||||
indexName: '设备id', // 匹配类型字段
|
||||
@@ -122,9 +117,9 @@ export const energyAlarmConfigs = (
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: (data: any) => {
|
||||
http.post(deviceAlarms.del, { id: data.id }).then(() => {
|
||||
http.post(energyAlarms.del, { id: data.id }).then(() => {
|
||||
NsMessage.success('操作成功');
|
||||
mainRefEquipmentAlarm.value?.nsTableRef.reload();
|
||||
mainEnergyAlarmConfig.value?.nsTableRef.reload();
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -139,6 +134,7 @@ export const energyAlarmConfigs = (
|
||||
component: 'NsSelect',
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
@@ -160,6 +156,7 @@ export const energyAlarmConfigs = (
|
||||
label: '告警标题',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入告警标题关键字',
|
||||
},
|
||||
},
|
||||
@@ -168,6 +165,7 @@ export const energyAlarmConfigs = (
|
||||
label: '错误码',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入告警错误码',
|
||||
},
|
||||
},
|
||||
@@ -176,6 +174,7 @@ export const energyAlarmConfigs = (
|
||||
label: '启用状态',
|
||||
component: 'NsSelect',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请选择启用状态',
|
||||
options: [
|
||||
{
|
||||
|
Reference in New Issue
Block a user