fix:修改枚举 添加数据隔离
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
placeholder="请选择告警频率"
|
||||
style="width: 100%"
|
||||
allowClear
|
||||
:options="alarmFrequencyData"
|
||||
:options="AlarmFrequencyEnum"
|
||||
@change="handleChangeAlarmFrequency" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
||||
@@ -45,7 +45,7 @@
|
||||
placeholder="请选择优先级"
|
||||
style="width: 100%"
|
||||
allowClear
|
||||
:options="priorityData" />
|
||||
:options="PriorityEnum" />
|
||||
</a-form-item>
|
||||
<a-form-item label="监测频率" name="monitorFrequency">
|
||||
<a-select
|
||||
@@ -53,7 +53,7 @@
|
||||
placeholder="请选择监测频率"
|
||||
style="width: 100%"
|
||||
allowClear
|
||||
:options="monitorFrequencyData" />
|
||||
:options="MonitorFrequencyEnumm" />
|
||||
</a-form-item>
|
||||
<a-form-item label="启用规则">
|
||||
<a-switch
|
||||
@@ -79,6 +79,7 @@
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||
import { getAllEnum } from '/@/api';
|
||||
|
||||
const visible = ref(false);
|
||||
// 间隔单位 默认值
|
||||
@@ -104,70 +105,11 @@
|
||||
});
|
||||
const formRef = ref();
|
||||
const emit = defineEmits(['editObject']);
|
||||
const alarmFrequencyData = ref([
|
||||
{
|
||||
label: '单次',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重复',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '累计',
|
||||
value: 3,
|
||||
},
|
||||
]);
|
||||
const priorityData = ref([
|
||||
{
|
||||
label: '紧急',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重要',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '一般',
|
||||
value: 3,
|
||||
},
|
||||
]);
|
||||
const intervalDurationUnitData = ref([
|
||||
{
|
||||
label: '分',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '时',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '天',
|
||||
value: 3,
|
||||
},
|
||||
]);
|
||||
const monitorFrequencyData = ref([
|
||||
{
|
||||
label: '小时',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '每日',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '每周',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: '月度',
|
||||
value: 4,
|
||||
},
|
||||
{
|
||||
label: '年度',
|
||||
value: 5,
|
||||
},
|
||||
]);
|
||||
//告警频率 优先级 监测频率
|
||||
const AlarmFrequencyEnum = ref([]);
|
||||
const PriorityEnum = ref([]);
|
||||
const intervalDurationUnitData = ref([]);
|
||||
const MonitorFrequencyEnumm = ref([]);
|
||||
const rules = {
|
||||
alarmTitle: [
|
||||
{
|
||||
@@ -220,12 +162,29 @@
|
||||
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
|
||||
monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }],
|
||||
};
|
||||
const getMenu = async () => {
|
||||
let menu = await getAllEnum({
|
||||
params: [
|
||||
'PriorityEnum',
|
||||
'MonitorFrequencyEnumm',
|
||||
'AlarmFrequencyEnum',
|
||||
'IntervalDurationUnitEnum',
|
||||
],
|
||||
});
|
||||
PriorityEnum.value = menu.data.PriorityEnum;
|
||||
MonitorFrequencyEnumm.value = menu.data.MonitorFrequencyEnumm;
|
||||
AlarmFrequencyEnum.value = menu.data.AlarmFrequencyEnum;
|
||||
intervalDurationUnitData.value = menu.data.IntervalDurationUnitEnum;
|
||||
};
|
||||
const toggle = (value: any) => {
|
||||
//获取枚举 回显
|
||||
getMenu();
|
||||
//判断 是新增 还是修改
|
||||
if (value) {
|
||||
infoObject.value = value;
|
||||
} else {
|
||||
infoObject.value = {
|
||||
orgId: null,
|
||||
alarmTitle: null,
|
||||
alarmFrequency: null,
|
||||
priority: null,
|
||||
|
Reference in New Issue
Block a user