fix:修改设备告警 能源告警字段 对接 能碳告警

This commit is contained in:
zhaohy
2024-07-24 15:13:50 +08:00
parent 9134cf4ac3
commit 9637a6f13b
10 changed files with 93 additions and 59 deletions

View File

@@ -25,6 +25,7 @@
label: 'orgName',
value: 'orgId',
}"
:disabled="true"
tree-node-filter-prop="orgName" />
</a-form-item>
<a-form-item label="数据来源" name="dataSources">
@@ -54,7 +55,8 @@
infoObject.dataSources && infoObject.dataSources[1] === 1
? 'deviceName'
: 'pointName',
value: 'id',
value:
infoObject.dataSources && infoObject.dataSources[1] === 1 ? 'deviceInfoCode' : 'id',
}" />
</a-form-item>
<a-form-item label="启用规则">
@@ -139,8 +141,6 @@
import { http } from '/nerv-lib/util';
import { dict } from '/@/api';
// import type { Rule } from 'ant-design-vue/es/form';
const visible = ref(false);
//父级数据
const energyAlarm = ref({});
@@ -311,6 +311,10 @@
infoObject.value.dataSourcesType,
infoObject.value.dataSourcesWay,
];
//设备节点
if (infoObject.value.dataSourcesWay === 2) {
infoObject.value.deviceNode = Number(infoObject.value.deviceNode);
}
delete infoObject.value.dataSourcesType;
delete infoObject.value.dataSourcesWay;
infoObject.value.comparisonType = infoObject.value.comparisonType.split(',');
@@ -348,8 +352,8 @@
enableRules: 0,
alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
};
infoObject.value.site = orgId.value;
}
visible.value = !visible.value;
};
//表单 判断规格
@@ -391,7 +395,7 @@
//处理数据
let data = { ...infoObject.value };
//关联能耗告警id
data.equipmentAlarmId = energyAlarm.value.id;
data.energyConsumptionAlarmId = energyAlarm.value.id;
data.errorCode = energyAlarm.value.errorCode;
data.dataSourcesType = data.dataSources[0];
data.dataSourcesWay = data.dataSources[1];