Browse Source

fix:逻辑调整 添加判断 字段显示

temp
zhaohy 3 months ago
parent
commit
3d9cf0d94c
  1. 28
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  2. 3
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  3. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts

28
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.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"
@ -164,7 +167,10 @@
}; };
// //
const handleChangeAlarmFrequency = () => { const handleChangeAlarmFrequency = () => {
if (infoObject.value.alarmFrequency === 2 && !infoObject.value.intervalDurationUnit) { if (
(infoObject.value.alarmFrequency === 2 || infoObject.value.alarmFrequency === 3) &&
!infoObject.value.intervalDurationUnit
) {
infoObject.value.intervalDurationUnit = 1; infoObject.value.intervalDurationUnit = 1;
} }
}; };
@ -250,8 +256,8 @@
const btnClick = () => { const btnClick = () => {
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
// * <= // * <= 1
if (infoObject.value.alarmFrequency === 2) { if (infoObject.value.alarmFrequency === 2 || infoObject.value.alarmFrequency === 3) {
// //
let monitorTime = 0; let monitorTime = 0;
switch (infoObject.value.monitorTimeUnit) { switch (infoObject.value.monitorTimeUnit) {
@ -270,18 +276,22 @@
switch (infoObject.value.intervalDurationUnit) { switch (infoObject.value.intervalDurationUnit) {
case 1: case 1:
intervalTime = intervalTime =
Number(infoObject.value.intervalDuration) * 1 * Number(infoObject.value.repetitions); Number(infoObject.value.intervalDuration) *
1 *
Number(infoObject.value.repetitions ? infoObject.value.repetitions : 1);
break; break;
case 2: case 2:
intervalTime = intervalTime =
Number(infoObject.value.intervalDuration) * 60 * Number(infoObject.value.repetitions); Number(infoObject.value.intervalDuration) *
60 *
Number(infoObject.value.repetitions ? infoObject.value.repetitions : 1);
break; break;
case 3: case 3:
intervalTime = intervalTime =
Number(infoObject.value.intervalDuration) * Number(infoObject.value.intervalDuration) *
60 * 60 *
24 * 24 *
Number(infoObject.value.repetitions); Number(infoObject.value.repetitions ? infoObject.value.repetitions : 1);
break; break;
} }
if (intervalTime > monitorTime) { if (intervalTime > monitorTime) {
@ -297,11 +307,13 @@
// //
let data = { ...infoObject.value }; let data = { ...infoObject.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;
} }
console.log(data, '数据');
if (!data.orgId) { if (!data.orgId) {
data.orgId = orgId.value; data.orgId = orgId.value;
} }

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

@ -64,7 +64,8 @@
</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 === 2 || record.alarmFrequency.value === 3)
? record.intervalDuration + '' + record.intervalDurationUnit.label ? record.intervalDuration + '' + record.intervalDurationUnit.label
: '-' : '-'
}} }}

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

@ -127,7 +127,7 @@ export const equipmentAlarmTableConfig = (
obj.intervalDurationUnit = data.intervalDurationUnit.value; obj.intervalDurationUnit = data.intervalDurationUnit.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;

Loading…
Cancel
Save