fix:修改枚举 添加数据隔离
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
<a-select
|
||||
v-model:value="infoObject.alarmList[index - 1].logic"
|
||||
style="width: 70px; margin-left: 12px"
|
||||
:options="ljOptions" />
|
||||
:options="logicEnum" />
|
||||
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
|
||||
<a-input
|
||||
style="width: 65px; margin-left: 6px"
|
||||
@@ -139,7 +139,7 @@
|
||||
import { device, group } from '/@/api/deviceManage';
|
||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { dict } from '/@/api';
|
||||
import { dict, getEnum } from '/@/api';
|
||||
|
||||
const visible = ref(false);
|
||||
//父级数据
|
||||
@@ -256,13 +256,7 @@
|
||||
);
|
||||
};
|
||||
//逻辑
|
||||
const ljOptions = ref<SelectProps['options']>([
|
||||
{ value: 0, label: '≥' },
|
||||
{ value: 1, label: '>' },
|
||||
{ value: 2, label: '≤' },
|
||||
{ value: 3, label: '<' },
|
||||
{ value: 4, label: '=' },
|
||||
]);
|
||||
const logicEnum = ref<SelectProps['options']>([]);
|
||||
//开关
|
||||
const clickSwitch = () => {
|
||||
if (infoObject.value.enableRules === 1) {
|
||||
@@ -273,6 +267,8 @@
|
||||
};
|
||||
//父调子 页面显示方法
|
||||
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' } });
|
||||
if (energyType.data.data) {
|
||||
|
@@ -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,
|
||||
|
@@ -84,7 +84,7 @@
|
||||
placeholder="请选择取值类型"
|
||||
allow-clear
|
||||
style="width: 100%"
|
||||
:options="qzOptions" />
|
||||
:options="valueTypeEnum" />
|
||||
</a-form-item>
|
||||
<a-form-item label="异常描述" name="abnormalDescription">
|
||||
<a-textarea
|
||||
@@ -114,7 +114,7 @@
|
||||
<a-select
|
||||
v-model:value="infoObject.alarmList[index - 1].logic"
|
||||
style="width: 70px; margin-left: 12px"
|
||||
:options="ljOptions" />
|
||||
:options="logicEnum" />
|
||||
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
|
||||
<a-input
|
||||
style="width: 65px; margin-left: 6px"
|
||||
@@ -158,6 +158,7 @@
|
||||
import { device } from '/@/api/deviceManage';
|
||||
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { getAllEnum } from '/@/api';
|
||||
|
||||
const visible = ref(false);
|
||||
// 父级数据
|
||||
@@ -241,18 +242,9 @@
|
||||
);
|
||||
};
|
||||
//取值类型
|
||||
const qzOptions = ref<SelectProps['options']>([
|
||||
{ value: 1, label: '实时值' },
|
||||
{ value: 2, label: '平均值' },
|
||||
]);
|
||||
const valueTypeEnum = ref<SelectProps['options']>();
|
||||
//逻辑
|
||||
const ljOptions = ref<SelectProps['options']>([
|
||||
{ value: 0, label: '≥' },
|
||||
{ value: 1, label: '>' },
|
||||
{ value: 2, label: '≤' },
|
||||
{ value: 3, label: '<' },
|
||||
{ value: 4, label: '=' },
|
||||
]);
|
||||
const logicEnum = ref<SelectProps['options']>([]);
|
||||
|
||||
//开关
|
||||
const clickSwitch = () => {
|
||||
@@ -299,10 +291,16 @@
|
||||
}
|
||||
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) => {
|
||||
equipmentAlarm.value = info;
|
||||
|
||||
//获取枚举 回显
|
||||
getMenu();
|
||||
//获取设备类型
|
||||
await http
|
||||
.post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 })
|
||||
|
@@ -24,7 +24,7 @@
|
||||
placeholder="请选择监测时长单位"
|
||||
style="width: 100%"
|
||||
allowClear
|
||||
:options="monitorTimeUnitData" />
|
||||
:options="MonitorTimeUnitEnum" />
|
||||
</a-form-item>
|
||||
<a-form-item label="告警频率" name="alarmFrequency">
|
||||
<a-select
|
||||
@@ -32,7 +32,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="重复次数">
|
||||
@@ -49,7 +49,7 @@
|
||||
placeholder="请选择间隔时长单位"
|
||||
style="width: 80px"
|
||||
allowClear
|
||||
:options="intervalDurationUnitData" />
|
||||
:options="IntervalDurationUnitEnum" />
|
||||
</template>
|
||||
</ns-input-number>
|
||||
</a-form-item>
|
||||
@@ -59,7 +59,7 @@
|
||||
placeholder="请选择优先级"
|
||||
style="width: 100%"
|
||||
allowClear
|
||||
:options="priorityData" />
|
||||
:options="PriorityEnum" />
|
||||
</a-form-item>
|
||||
<a-form-item label="启用规则">
|
||||
<a-switch
|
||||
@@ -85,6 +85,7 @@
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
||||
import { getAllEnum } from '/@/api';
|
||||
|
||||
const visible = ref(false);
|
||||
//组织id
|
||||
@@ -107,63 +108,27 @@
|
||||
});
|
||||
const formRef = ref();
|
||||
const emit = defineEmits(['editObject']);
|
||||
const alarmFrequencyData = ref([
|
||||
{
|
||||
label: '单次',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重复',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '累计',
|
||||
value: 3,
|
||||
},
|
||||
]);
|
||||
const monitorTimeUnitData = ref([
|
||||
{
|
||||
label: '分',
|
||||
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 AlarmFrequencyEnum = ref([]);
|
||||
const MonitorTimeUnitEnum = ref([]);
|
||||
const IntervalDurationUnitEnum = ref([]);
|
||||
const PriorityEnum = ref([]);
|
||||
const getMenu = async () => {
|
||||
let menu = await getAllEnum({
|
||||
params: [
|
||||
'PriorityEnum',
|
||||
'MonitorTimeUnitEnum',
|
||||
'AlarmFrequencyEnum',
|
||||
'IntervalDurationUnitEnum',
|
||||
],
|
||||
});
|
||||
PriorityEnum.value = menu.data.PriorityEnum;
|
||||
MonitorTimeUnitEnum.value = menu.data.MonitorTimeUnitEnum;
|
||||
AlarmFrequencyEnum.value = menu.data.AlarmFrequencyEnum;
|
||||
IntervalDurationUnitEnum.value = menu.data.IntervalDurationUnitEnum;
|
||||
};
|
||||
const toggle = (value: any) => {
|
||||
//获取枚举 回显
|
||||
getMenu();
|
||||
//判断 是新增 还是修改
|
||||
if (value) {
|
||||
infoObject.value = value;
|
||||
|
@@ -2,6 +2,7 @@ import { http } from '/nerv-lib/util';
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||
import { ref } from 'vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -159,24 +160,23 @@ export const energyAlarmConfigs = (
|
||||
{
|
||||
field: 'priority',
|
||||
label: '告警优先级',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重要',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '一般',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择告警优先级',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -2,6 +2,7 @@ import { http } from '/nerv-lib/util';
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
||||
import { ref } from 'vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -158,24 +159,23 @@ export const equipmentAlarmTableConfig = (
|
||||
{
|
||||
field: 'priority',
|
||||
label: '告警优先级',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重要',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '一般',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择告警优先级',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
|
||||
import { ref } from 'vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -91,24 +92,23 @@ export const notificationtableConfig = (notificationManagements: any) => {
|
||||
{
|
||||
field: 'priority',
|
||||
label: '告警优先级',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重要',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '一般',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择告警优先级',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -56,6 +56,7 @@
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
export default defineComponent({
|
||||
components: { NsSteps },
|
||||
@@ -125,21 +126,10 @@
|
||||
const toggle = async (data) => {
|
||||
energyAlarm.value = { ...data };
|
||||
visible.value = true;
|
||||
if (energyAlarm.value.createWorkOrder === 1) {
|
||||
stateOptions.value = [
|
||||
{ value: 1, label: '待处理' },
|
||||
{ value: 2, label: '处理中' },
|
||||
{ value: 3, label: '已完成' },
|
||||
{ value: 4, label: '超时' },
|
||||
{ value: 5, label: '已关闭' },
|
||||
];
|
||||
} else {
|
||||
stateOptions.value = [
|
||||
{ value: 1, label: '待处理' },
|
||||
{ value: 2, label: '处理中' },
|
||||
{ value: 3, label: '已完成' },
|
||||
{ value: 5, label: '已关闭' },
|
||||
];
|
||||
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
|
||||
stateOptions.value = states.data;
|
||||
if (energyAlarm.value.createWorkOrder !== 1) {
|
||||
stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
|
||||
}
|
||||
await http
|
||||
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
||||
import { dict } from '/@/api';
|
||||
import { ref } from 'vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -24,7 +25,7 @@ const tableKeyMap = [
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'priority',
|
||||
dataIndex: 'dataSourcesTypeName',
|
||||
},
|
||||
{
|
||||
title: '优先级',
|
||||
@@ -107,55 +108,45 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
{
|
||||
field: 'priority',
|
||||
label: '优先级',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重要',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '一般',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择告警优先级',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'alarmLogState',
|
||||
label: '状态',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择状态',
|
||||
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '待处理',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '处理中',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '已完成',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: '超时',
|
||||
value: 4,
|
||||
},
|
||||
{
|
||||
label: '关闭',
|
||||
value: 5,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择状态',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -56,6 +56,7 @@
|
||||
import { NsMessage } from '/nerv-lib/component';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
export default defineComponent({
|
||||
components: { NsSteps },
|
||||
@@ -126,21 +127,10 @@
|
||||
const toggle = async (data) => {
|
||||
equipmentAlarm.value = { ...data };
|
||||
visible.value = true;
|
||||
if (equipmentAlarm.value.createWorkOrder === 1) {
|
||||
stateOptions.value = [
|
||||
{ value: 1, label: '待处理' },
|
||||
{ value: 2, label: '处理中' },
|
||||
{ value: 3, label: '已完成' },
|
||||
{ value: 4, label: '超时' },
|
||||
{ value: 5, label: '已关闭' },
|
||||
];
|
||||
} else {
|
||||
stateOptions.value = [
|
||||
{ value: 1, label: '待处理' },
|
||||
{ value: 2, label: '处理中' },
|
||||
{ value: 3, label: '已完成' },
|
||||
{ value: 5, label: '已关闭' },
|
||||
];
|
||||
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
|
||||
stateOptions.value = states.data;
|
||||
if (equipmentAlarm.value.createWorkOrder !== 1) {
|
||||
stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
|
||||
}
|
||||
await http
|
||||
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
||||
import { ref } from 'vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -88,55 +89,45 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
{
|
||||
field: 'priority',
|
||||
label: '优先级',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '重要',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '一般',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择告警优先级',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'alarmLogState',
|
||||
label: '状态',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择状态',
|
||||
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '待处理',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '处理中',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '已完成',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: '超时',
|
||||
value: 4,
|
||||
},
|
||||
{
|
||||
label: '关闭',
|
||||
value: 5,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择状态',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -47,6 +47,7 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import NsSteps from '/@/components/ns-steps.vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
export default defineComponent({
|
||||
components: { NsSteps },
|
||||
@@ -54,13 +55,7 @@
|
||||
setup() {
|
||||
const visible = ref(false);
|
||||
const infoObject = ref({});
|
||||
const stateOptions = ref([
|
||||
{ value: 1, label: '待处理' },
|
||||
{ value: 2, label: '处理中' },
|
||||
{ value: 3, label: '已完成' },
|
||||
{ value: 4, label: '超时' },
|
||||
{ value: 5, label: '已关闭' },
|
||||
]);
|
||||
const stateOptions = ref();
|
||||
const logList = ref([
|
||||
{ realName: '李四', state: 3, createTime: '2024-03-10 10:00:00', remarks: '完成' },
|
||||
{ realName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
|
||||
@@ -78,7 +73,9 @@
|
||||
const btnClick = () => {
|
||||
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] };
|
||||
let stateMap = {
|
||||
1: '待处理',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
|
||||
import { ref } from 'vue';
|
||||
import { getEnum } from '/@/api';
|
||||
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
@@ -104,32 +105,23 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
{
|
||||
field: 'alarmLogState',
|
||||
label: '状态',
|
||||
component: 'NsSelect',
|
||||
component: 'nsSelectApi',
|
||||
// dynamicParams: {
|
||||
// id: 'deviceName', //帮定上级联动数据
|
||||
// },
|
||||
componentProps: {
|
||||
placeholder: '请选择状态',
|
||||
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '待处理',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '处理中',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '已完成',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: '超时',
|
||||
value: 4,
|
||||
},
|
||||
{
|
||||
label: '关闭',
|
||||
value: 5,
|
||||
},
|
||||
],
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
placeholder: '请选择状态',
|
||||
showSearch: true,
|
||||
filterOption: (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
},
|
||||
// autoSelectFirst: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user