Browse Source

fix:告警设置修改逻辑

temp
zhaohy 3 months ago
parent
commit
b89794d8be
  1. 12
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  2. 5
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  3. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  4. 5
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts
  5. 3
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts

12
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue

@ -27,7 +27,10 @@
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数"> <a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" /> <ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
</a-form-item> </a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长"> <a-form-item
v-if="infoObject.alarmFrequency === 2 || infoObject.alarmFrequency === 3"
name="intervalDuration"
label="间隔时长">
<ns-input-number <ns-input-number
style="width: 100%" style="width: 100%"
v-model:value="infoObject.intervalDuration" v-model:value="infoObject.intervalDuration"
@ -87,9 +90,12 @@
const visible = ref(false); const visible = ref(false);
// //
const handleChangeAlarmFrequency = () => { const handleChangeAlarmFrequency = () => {
if (infoObject.value.alarmFrequency === 2 && !infoObject.value.intervalDurationUnit) { if (infoObject.value.alarmFrequency !== 1 && !infoObject.value.intervalDurationUnit) {
infoObject.value.intervalDurationUnit = 1; infoObject.value.intervalDurationUnit = 1;
} }
if (infoObject.value.alarmFrequency === 3) {
infoObject.value.repetitions = null;
}
}; };
//id //id
const orgId = ref(''); const orgId = ref('');
@ -217,7 +223,7 @@
data.orgId = orgId.value; data.orgId = orgId.value;
} }
data.createWorkOrder = Number(data.createWorkOrder); data.createWorkOrder = Number(data.createWorkOrder);
if (data.alarmFrequency !== 2) { if (data.alarmFrequency === 1) {
data.repetitions = null; data.repetitions = null;
data.intervalDuration = null; data.intervalDuration = null;
data.intervalDurationUnit = null; data.intervalDurationUnit = null;

5
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue

@ -173,6 +173,11 @@
) { ) {
infoObject.value.intervalDurationUnit = 1; infoObject.value.intervalDurationUnit = 1;
} }
console.log(infoObject.value.alarmFrequency);
if (infoObject.value.alarmFrequency === 3) {
infoObject.value.repetitions = null;
}
}; };
// //
const rules = { const rules = {

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue

@ -118,7 +118,7 @@
</template> </template>
<template v-if="column.dataIndex === 'interval'"> <template v-if="column.dataIndex === 'interval'">
{{ {{
record.intervalDuration && record.alarmFrequency.value === 2 record.intervalDuration && record.alarmFrequency.value !== 1
? record.intervalDuration + '' + record.intervalDurationUnit.label ? record.intervalDuration + '' + record.intervalDurationUnit.label
: '-' : '-'
}} }}

5
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts

@ -136,11 +136,14 @@ export const energyAlarmConfigs = (
obj.monitorFrequency = data.monitorFrequency.value; obj.monitorFrequency = data.monitorFrequency.value;
} }
obj.createWorkOrder = obj.createWorkOrder + ''; obj.createWorkOrder = obj.createWorkOrder + '';
if (obj.alarmFrequency !== 2) { if (obj.alarmFrequency === 1) {
obj.repetitions = null; obj.repetitions = null;
obj.intervalDuration = null; obj.intervalDuration = null;
obj.intervalDurationUnit = null; obj.intervalDurationUnit = null;
} }
if (obj.alarmFrequency === 3) {
obj.repetitions = null;
}
editeEnergyAlarm.value.toggle(obj); editeEnergyAlarm.value.toggle(obj);
}, },
}, },

3
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts

@ -132,6 +132,9 @@ export const equipmentAlarmTableConfig = (
obj.intervalDuration = null; obj.intervalDuration = null;
obj.intervalDurationUnit = null; obj.intervalDurationUnit = null;
} }
if (obj.alarmFrequency === 3) {
obj.repetitions = null;
}
obj.monitorTimeUnit = data.monitorTimeUnit.value; obj.monitorTimeUnit = data.monitorTimeUnit.value;
editEquipmentAlarm.value.toggle(obj); editEquipmentAlarm.value.toggle(obj);
}, },

Loading…
Cancel
Save