Browse Source

fix:修改枚举 添加数据隔离

temp
zhaohy 4 months ago
parent
commit
7aa949bdcf
  1. 14
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  2. 93
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  3. 26
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  4. 85
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  5. 32
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts
  6. 32
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  7. 32
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts
  8. 20
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue
  9. 73
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts
  10. 20
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue
  11. 71
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts
  12. 13
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue
  13. 40
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts

14
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue

@ -96,7 +96,7 @@
<a-select <a-select
v-model:value="infoObject.alarmList[index - 1].logic" v-model:value="infoObject.alarmList[index - 1].logic"
style="width: 70px; margin-left: 12px" style="width: 70px; margin-left: 12px"
:options="ljOptions" /> :options="logicEnum" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span> <span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input <a-input
style="width: 65px; margin-left: 6px" style="width: 65px; margin-left: 6px"
@ -139,7 +139,7 @@
import { device, group } from '/@/api/deviceManage'; import { device, group } from '/@/api/deviceManage';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm'; import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { dict } from '/@/api'; import { dict, getEnum } from '/@/api';
const visible = ref(false); const visible = ref(false);
// //
@ -256,13 +256,7 @@
); );
}; };
// //
const ljOptions = ref<SelectProps['options']>([ const logicEnum = ref<SelectProps['options']>([]);
{ value: 0, label: '≥' },
{ value: 1, label: '>' },
{ value: 2, label: '≤' },
{ value: 3, label: '<' },
{ value: 4, label: '=' },
]);
// //
const clickSwitch = () => { const clickSwitch = () => {
if (infoObject.value.enableRules === 1) { if (infoObject.value.enableRules === 1) {
@ -273,6 +267,8 @@
}; };
// //
const toggle = async (value: any, info: any) => { const toggle = async (value: any, info: any) => {
let menu = await getEnum({ params: { enumType: 'LogicEnum' } });
logicEnum.value = menu.data;
// //
let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } }); let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
if (energyType.data.data) { if (energyType.data.data) {

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

@ -18,7 +18,7 @@
placeholder="请选择告警频率" placeholder="请选择告警频率"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="alarmFrequencyData" :options="AlarmFrequencyEnum"
@change="handleChangeAlarmFrequency" /> @change="handleChangeAlarmFrequency" />
</a-form-item> </a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数"> <a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
@ -45,7 +45,7 @@
placeholder="请选择优先级" placeholder="请选择优先级"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="priorityData" /> :options="PriorityEnum" />
</a-form-item> </a-form-item>
<a-form-item label="监测频率" name="monitorFrequency"> <a-form-item label="监测频率" name="monitorFrequency">
<a-select <a-select
@ -53,7 +53,7 @@
placeholder="请选择监测频率" placeholder="请选择监测频率"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="monitorFrequencyData" /> :options="MonitorFrequencyEnumm" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则"> <a-form-item label="启用规则">
<a-switch <a-switch
@ -79,6 +79,7 @@
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm'; import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { getAllEnum } from '/@/api';
const visible = ref(false); const visible = ref(false);
// //
@ -104,70 +105,11 @@
}); });
const formRef = ref(); const formRef = ref();
const emit = defineEmits(['editObject']); const emit = defineEmits(['editObject']);
const alarmFrequencyData = ref([ //
{ const AlarmFrequencyEnum = ref([]);
label: '单次', const PriorityEnum = ref([]);
value: 1, const intervalDurationUnitData = ref([]);
}, const MonitorFrequencyEnumm = ref([]);
{
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 rules = { const rules = {
alarmTitle: [ alarmTitle: [
{ {
@ -220,12 +162,29 @@
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }], priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
monitorTimeUnit: [{ 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) => { const toggle = (value: any) => {
//
getMenu();
// //
if (value) { if (value) {
infoObject.value = value; infoObject.value = value;
} else { } else {
infoObject.value = { infoObject.value = {
orgId: null,
alarmTitle: null, alarmTitle: null,
alarmFrequency: null, alarmFrequency: null,
priority: null, priority: null,

26
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -84,7 +84,7 @@
placeholder="请选择取值类型" placeholder="请选择取值类型"
allow-clear allow-clear
style="width: 100%" style="width: 100%"
:options="qzOptions" /> :options="valueTypeEnum" />
</a-form-item> </a-form-item>
<a-form-item label="异常描述" name="abnormalDescription"> <a-form-item label="异常描述" name="abnormalDescription">
<a-textarea <a-textarea
@ -114,7 +114,7 @@
<a-select <a-select
v-model:value="infoObject.alarmList[index - 1].logic" v-model:value="infoObject.alarmList[index - 1].logic"
style="width: 70px; margin-left: 12px" style="width: 70px; margin-left: 12px"
:options="ljOptions" /> :options="logicEnum" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span> <span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input <a-input
style="width: 65px; margin-left: 6px" style="width: 65px; margin-left: 6px"
@ -158,6 +158,7 @@
import { device } from '/@/api/deviceManage'; import { device } from '/@/api/deviceManage';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { getAllEnum } from '/@/api';
const visible = ref(false); const visible = ref(false);
// //
@ -241,18 +242,9 @@
); );
}; };
// //
const qzOptions = ref<SelectProps['options']>([ const valueTypeEnum = ref<SelectProps['options']>();
{ value: 1, label: '实时值' },
{ value: 2, label: '平均值' },
]);
// //
const ljOptions = ref<SelectProps['options']>([ const logicEnum = ref<SelectProps['options']>([]);
{ value: 0, label: '≥' },
{ value: 1, label: '>' },
{ value: 2, label: '≤' },
{ value: 3, label: '<' },
{ value: 4, label: '=' },
]);
// //
const clickSwitch = () => { const clickSwitch = () => {
@ -299,10 +291,16 @@
} }
return null; // null return null; // null
}; };
const getMenu = async () => {
let menu = await getAllEnum({ params: ['LogicEnum', 'ValueTypeEnum'] });
logicEnum.value = menu.data.LogicEnum;
valueTypeEnum.value = menu.data.ValueTypeEnum;
};
// //
const toggle = async (value: any, info: any) => { const toggle = async (value: any, info: any) => {
equipmentAlarm.value = info; equipmentAlarm.value = info;
//
getMenu();
// //
await http await http
.post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 }) .post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 })

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

@ -24,7 +24,7 @@
placeholder="请选择监测时长单位" placeholder="请选择监测时长单位"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="monitorTimeUnitData" /> :options="MonitorTimeUnitEnum" />
</a-form-item> </a-form-item>
<a-form-item label="告警频率" name="alarmFrequency"> <a-form-item label="告警频率" name="alarmFrequency">
<a-select <a-select
@ -32,7 +32,7 @@
placeholder="请选择告警频率" placeholder="请选择告警频率"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="alarmFrequencyData" :options="AlarmFrequencyEnum"
@change="handleChangeAlarmFrequency" /> @change="handleChangeAlarmFrequency" />
</a-form-item> </a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数"> <a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
@ -49,7 +49,7 @@
placeholder="请选择间隔时长单位" placeholder="请选择间隔时长单位"
style="width: 80px" style="width: 80px"
allowClear allowClear
:options="intervalDurationUnitData" /> :options="IntervalDurationUnitEnum" />
</template> </template>
</ns-input-number> </ns-input-number>
</a-form-item> </a-form-item>
@ -59,7 +59,7 @@
placeholder="请选择优先级" placeholder="请选择优先级"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="priorityData" /> :options="PriorityEnum" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则"> <a-form-item label="启用规则">
<a-switch <a-switch
@ -85,6 +85,7 @@
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { getAllEnum } from '/@/api';
const visible = ref(false); const visible = ref(false);
//id //id
@ -107,63 +108,27 @@
}); });
const formRef = ref(); const formRef = ref();
const emit = defineEmits(['editObject']); const emit = defineEmits(['editObject']);
const alarmFrequencyData = ref([ const AlarmFrequencyEnum = ref([]);
{ const MonitorTimeUnitEnum = ref([]);
label: '单次', const IntervalDurationUnitEnum = ref([]);
value: 1, const PriorityEnum = ref([]);
}, const getMenu = async () => {
{ let menu = await getAllEnum({
label: '重复', params: [
value: 2, 'PriorityEnum',
}, 'MonitorTimeUnitEnum',
{ 'AlarmFrequencyEnum',
label: '累计', 'IntervalDurationUnitEnum',
value: 3, ],
}, });
]); PriorityEnum.value = menu.data.PriorityEnum;
const monitorTimeUnitData = ref([ MonitorTimeUnitEnum.value = menu.data.MonitorTimeUnitEnum;
{ AlarmFrequencyEnum.value = menu.data.AlarmFrequencyEnum;
label: '分', IntervalDurationUnitEnum.value = menu.data.IntervalDurationUnitEnum;
value: 1, };
},
{
label: '时',
value: 2,
},
{
label: '天',
value: 3,
},
]);
const intervalDurationUnitData = ref([
{
label: '分',
value: 1,
},
{
label: '时',
value: 2,
},
{
label: '天',
value: 3,
},
]);
const priorityData = ref([
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
]);
const toggle = (value: any) => { const toggle = (value: any) => {
//
getMenu();
// //
if (value) { if (value) {
infoObject.value = value; infoObject.value = value;

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

@ -2,6 +2,7 @@ import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm'; import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { ref } from 'vue'; import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -159,24 +160,23 @@ export const energyAlarmConfigs = (
{ {
field: 'priority', field: 'priority',
label: '告警优先级', label: '告警优先级',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择告警优先级', api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '紧急', valueField: 'value',
value: 1, placeholder: '请选择告警优先级',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '重要', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '一般',
value: 3,
},
],
}, },
}, },
{ {

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

@ -2,6 +2,7 @@ import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { ref } from 'vue'; import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -158,24 +159,23 @@ export const equipmentAlarmTableConfig = (
{ {
field: 'priority', field: 'priority',
label: '告警优先级', label: '告警优先级',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择告警优先级', api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '紧急', valueField: 'value',
value: 1, placeholder: '请选择告警优先级',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '重要', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '一般',
value: 3,
},
],
}, },
}, },
{ {

32
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts

@ -1,5 +1,6 @@
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements'; import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
import { ref } from 'vue'; import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -91,24 +92,23 @@ export const notificationtableConfig = (notificationManagements: any) => {
{ {
field: 'priority', field: 'priority',
label: '告警优先级', label: '告警优先级',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择告警优先级', api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '紧急', valueField: 'value',
value: 1, placeholder: '请选择告警优先级',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '重要', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '一般',
value: 3,
},
],
}, },
}, },
{ {

20
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue

@ -56,6 +56,7 @@
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm'; import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
import { getEnum } from '/@/api';
export default defineComponent({ export default defineComponent({
components: { NsSteps }, components: { NsSteps },
@ -125,21 +126,10 @@
const toggle = async (data) => { const toggle = async (data) => {
energyAlarm.value = { ...data }; energyAlarm.value = { ...data };
visible.value = true; visible.value = true;
if (energyAlarm.value.createWorkOrder === 1) { let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
stateOptions.value = [ stateOptions.value = states.data;
{ value: 1, label: '待处理' }, if (energyAlarm.value.createWorkOrder !== 1) {
{ value: 2, label: '处理中' }, stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
{ value: 3, label: '已完成' },
{ value: 4, label: '超时' },
{ value: 5, label: '已关闭' },
];
} else {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 5, label: '已关闭' },
];
} }
await http await http
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, { .post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {

73
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts

@ -1,6 +1,7 @@
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm'; import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
import { dict } from '/@/api'; import { dict } from '/@/api';
import { ref } from 'vue'; import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -24,7 +25,7 @@ const tableKeyMap = [
}, },
{ {
title: '类型', title: '类型',
dataIndex: 'priority', dataIndex: 'dataSourcesTypeName',
}, },
{ {
title: '优先级', title: '优先级',
@ -107,55 +108,45 @@ export const notificationtableConfig = (look: any, status: any) => {
{ {
field: 'priority', field: 'priority',
label: '优先级', label: '优先级',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择告警优先级', api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '紧急', valueField: 'value',
value: 1, placeholder: '请选择告警优先级',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '重要', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '一般',
value: 3,
},
],
}, },
}, },
{ {
field: 'alarmLogState', field: 'alarmLogState',
label: '状态', label: '状态',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择状态', api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '待处理', valueField: 'value',
value: 1, placeholder: '请选择状态',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '处理中', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
},
],
}, },
}, },
{ {

20
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

@ -56,6 +56,7 @@
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm'; import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { getEnum } from '/@/api';
export default defineComponent({ export default defineComponent({
components: { NsSteps }, components: { NsSteps },
@ -126,21 +127,10 @@
const toggle = async (data) => { const toggle = async (data) => {
equipmentAlarm.value = { ...data }; equipmentAlarm.value = { ...data };
visible.value = true; visible.value = true;
if (equipmentAlarm.value.createWorkOrder === 1) { let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
stateOptions.value = [ stateOptions.value = states.data;
{ value: 1, label: '待处理' }, if (equipmentAlarm.value.createWorkOrder !== 1) {
{ value: 2, label: '处理中' }, stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
{ value: 3, label: '已完成' },
{ value: 4, label: '超时' },
{ value: 5, label: '已关闭' },
];
} else {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 5, label: '已关闭' },
];
} }
await http await http
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, { .post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {

71
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts

@ -1,5 +1,6 @@
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm'; import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { ref } from 'vue'; import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -88,55 +89,45 @@ export const notificationtableConfig = (look: any, status: any) => {
{ {
field: 'priority', field: 'priority',
label: '优先级', label: '优先级',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择告警优先级', api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '紧急', valueField: 'value',
value: 1, placeholder: '请选择告警优先级',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '重要', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '一般',
value: 3,
},
],
}, },
}, },
{ {
field: 'alarmLogState', field: 'alarmLogState',
label: '状态', label: '状态',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择状态', api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '待处理', valueField: 'value',
value: 1, placeholder: '请选择状态',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '处理中', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
},
],
}, },
}, },
{ {

13
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue

@ -47,6 +47,7 @@
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { ref } from 'vue'; import { ref } from 'vue';
import NsSteps from '/@/components/ns-steps.vue'; import NsSteps from '/@/components/ns-steps.vue';
import { getEnum } from '/@/api';
export default defineComponent({ export default defineComponent({
components: { NsSteps }, components: { NsSteps },
@ -54,13 +55,7 @@
setup() { setup() {
const visible = ref(false); const visible = ref(false);
const infoObject = ref({}); const infoObject = ref({});
const stateOptions = ref([ const stateOptions = ref();
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 4, label: '超时' },
{ value: 5, label: '已关闭' },
]);
const logList = ref([ const logList = ref([
{ realName: '李四', state: 3, createTime: '2024-03-10 10:00:00', remarks: '完成' }, { realName: '李四', state: 3, createTime: '2024-03-10 10:00:00', remarks: '完成' },
{ realName: '王五', state: 5, createTime: '2024-03-10 10:00:00' }, { realName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
@ -78,7 +73,9 @@
const btnClick = () => { const btnClick = () => {
visible.value = false; visible.value = false;
}; };
const toggle = (data) => { const toggle = async (data) => {
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
stateOptions.value = states.data;
infoObject.value = { ...logList.value[0] }; infoObject.value = { ...logList.value[0] };
let stateMap = { let stateMap = {
1: '待处理', 1: '待处理',

40
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts

@ -1,5 +1,6 @@
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm'; import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
import { ref } from 'vue'; import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@ -104,32 +105,23 @@ export const notificationtableConfig = (look: any, status: any) => {
{ {
field: 'alarmLogState', field: 'alarmLogState',
label: '状态', label: '状态',
component: 'NsSelect', component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: { componentProps: {
placeholder: '请选择状态', api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
immediate: true,
allowClear: true, allowClear: true,
options: [ resultField: 'data',
{ labelField: 'label',
label: '待处理', valueField: 'value',
value: 1, placeholder: '请选择状态',
}, showSearch: true,
{ filterOption: (input: string, option: any) => {
label: '处理中', return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
value: 2, },
}, // autoSelectFirst: true,
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
},
],
}, },
}, },
{ {

Loading…
Cancel
Save