fix:设备告警 网关告警

This commit is contained in:
zhaohy
2024-07-22 10:34:40 +08:00
parent 57d97eb3e2
commit 4c2989239d
18 changed files with 218 additions and 180 deletions

View File

@@ -42,6 +42,7 @@
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
// 改变状态
const clickSwitch = (data: any) => {
NsModal.confirm({
title: '启用状态',

View File

@@ -213,6 +213,7 @@
http.post(device.queryDevicePoint, value).then((res) => {
if (res.msg === 'success') {
res.data.forEach((item: any) => {
//显示格式
devicePointData.value.push({
value: item.id,
label: item.code + ' ( ' + item.unit + ' ) ',
@@ -336,10 +337,13 @@
item.logic = item.logic.value;
});
}
infoObject.value.valueType = infoObject.value.valueType.value;
infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || [];
delete infoObject.value.hxAlarmRuleLogicList;
// 回显 格式化
infoObject.value.deviceType = selectDevice;
infoObject.value.valueType = infoObject.value.valueType.value;
//数据类型转换
infoObject.value.ruleType = infoObject.value.ruleType + '';
}
});
@@ -450,6 +454,8 @@
abnormalDescription: null,
deviceType: [],
devicePoint: null,
valueType: null,
deviceId: null,
enableRules: 0,
alarmList: [{ logic: null, num: null, isDelete: 0 }],
};
@@ -470,6 +476,7 @@
// 确保 index 在有效范围内
if (index < infoObject.value.alarmList.length && index >= 0) {
const alarmItemToDelete = infoObject.value.alarmList[index];
// 判断删除的 是否在数据库中
if (alarmItemToDelete?.id) {
// 添加到 delAlarmList 中,并标记为已删除
delAlarmList.value.push({ ...alarmItemToDelete, isDelete: 1 });