fix:能源告警配置
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
'grey-background': record.enableRules === 1 ? false : true,
|
||||
}"
|
||||
@click="
|
||||
clickSwitch({ type: 2, enableRules: record.enableRules, record: record })
|
||||
clickSwitch({ type: 3, enableRules: record.enableRules, record: record })
|
||||
" />
|
||||
</template>
|
||||
</template>
|
||||
@@ -107,6 +107,7 @@
|
||||
import configureEnergyAlarms from './energyAlarm/configureEnergyAlarms.vue';
|
||||
import configureDeviceAlarms from './equipmentAlarm/configureDeviceAlarms.vue';
|
||||
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
|
||||
import { energyAlarms } from '/@/api/alarmSettings/energyAlarm';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
export default {
|
||||
@@ -133,7 +134,7 @@
|
||||
//能源告警配置
|
||||
const energyAlarmConfig = energyAlarmConfigs(
|
||||
editeEnergyAlarm,
|
||||
mainRefEquipmentAlarm,
|
||||
mainEnergyAlarmConfig,
|
||||
energyAlarm,
|
||||
configureEnergyAlarms,
|
||||
);
|
||||
@@ -157,7 +158,11 @@
|
||||
NsModal.confirm({
|
||||
title: '启用状态',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '吗?',
|
||||
content:
|
||||
'确定' +
|
||||
(data.record.enableRules === 1 ? '关闭' : '启用') +
|
||||
(data.type === 1 ? '通知' : '告警') +
|
||||
'吗?',
|
||||
onOk: () => {
|
||||
if (data.type === 1) {
|
||||
//通知方式
|
||||
@@ -167,7 +172,7 @@
|
||||
enableRules: data.record.enableRules === 1 ? 0 : 1,
|
||||
})
|
||||
.then(() => {
|
||||
NsMessage.success('操作成功');
|
||||
NsMessage.success(data.record.enableRules === 1 ? '通知已关闭' : '通知已启用');
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
});
|
||||
}
|
||||
@@ -179,19 +184,19 @@
|
||||
enableRules: data.record.enableRules === 1 ? 0 : 1,
|
||||
})
|
||||
.then(() => {
|
||||
NsMessage.success('操作成功');
|
||||
NsMessage.success(data.record.enableRules === 1 ? '告警已关闭' : '告警已启用');
|
||||
mainRefEquipmentAlarm.value?.nsTableRef.reload();
|
||||
});
|
||||
}
|
||||
//能源告警
|
||||
if (data.type === 3) {
|
||||
http
|
||||
.post(deviceAlarms.addOrUpNewData, {
|
||||
.post(energyAlarms.addOrUpNewData, {
|
||||
id: data.record.id,
|
||||
enableRules: data.record.enableRules === 1 ? 0 : 1,
|
||||
})
|
||||
.then(() => {
|
||||
NsMessage.success('操作成功');
|
||||
NsMessage.success(data.record.enableRules === 1 ? '告警已关闭' : '告警已启用');
|
||||
mainEnergyAlarmConfig.value?.nsTableRef.reload();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user