Browse Source

fix:简化ns-step组件 设备告警样式 设备告警 能源告警 添加字段

temp
zhaohy 4 months ago
parent
commit
f636f426b0
  1. 100
      hx-ai-intelligent/src/components/ns-steps.vue
  2. 6
      hx-ai-intelligent/src/icon/baocun.svg
  3. 6
      hx-ai-intelligent/src/icon/bianji.svg
  4. 375
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  5. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  6. 388
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  7. 44
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  8. 6
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue
  9. 33
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts
  10. 25
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  11. 22
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue
  12. 42
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

100
hx-ai-intelligent/src/components/ns-steps.vue

@ -3,40 +3,17 @@
<template v-for="(item, index) in dataSource" :key="index">
<a-step>
<template #icon>
<img :style="{ width: item.status === '2' ? '19px' : '20px' }" :src="getSrc(item)" />
<ns-icon size="20" :name="item.src" />
</template>
<template #description>
<div
style="
width: 400px;
min-height: 0px;
background-color: #f8fafc;
margin-left: 20px;
border-radius: 4px; /* 设置圆角半径 */
padding: 12px;
">
<div style="width: 100%; height: 30px; display: flex; position: relative">
<a-tag
style="width: 60px; height: 20px; text-align: center"
:color="getColor(item)"
>{{ getStatus(item) }}</a-tag
>
<div
style="
position: absolute;
left: 35%;
top: -2px;
transform: translateX(-50%);
color: #3a3a3a;
"
>{{ item.name }}</div
>
<div style="position: absolute; right: 10px; top: -2px; color: #ff7602"
>2024-03-11 11:30:06</div
>
<div class="card">
<div class="card-title">
<a-tag class="card-title-tag" :color="item.color">{{ item.statusName }}</a-tag>
<div class="name">{{ item.name }}</div>
<div class="time">{{ item.time }}</div>
</div>
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">
工单已完成并通过验收</div
{{ item.desc }}</div
>
</div>
</template>
@ -53,37 +30,6 @@
size: any;
};
const props = withDefaults(defineProps<Props>(), {});
const getColor = (item: any) => {
switch (item.status) {
case '0':
return '#ff7602';
case '1':
return '#00a1e6';
case '2':
return '#04d919';
case '3':
return '#d9001b';
case '4':
return '#a6a6a6';
}
};
const getSrc = (item: any) => {
return '../../../../src/icon/status-' + item.status + '.svg';
};
const getStatus = (item: any) => {
switch (item.status) {
case '0':
return '待处理';
case '1':
return '处理中';
case '2':
return '已完成';
case '3':
return '超时';
case '4':
return '已关闭';
}
};
const { dataSource } = toRefs(props);
const { size } = toRefs(props);
@ -94,6 +40,38 @@
margin-left: 20px;
margin-top: 10px;
}
.card {
width: 400px;
min-height: 0px;
background-color: #f8fafc;
margin-left: 20px;
border-radius: 4px; /* 设置圆角半径 */
padding: 12px;
.card-title {
width: 100%;
height: 30px;
display: flex;
position: relative;
.card-title-tag {
width: 60px;
height: 20px;
text-align: center;
}
}
}
.name {
position: absolute;
left: 35%;
top: -2px;
transform: translateX(-50%);
color: #3a3a3a;
}
.time {
position: absolute;
right: 10px;
top: -2px;
color: #ff7602;
}
:deep(.ant-steps-item-tail) {
position: absolute !important;
top: -10px !important;

6
hx-ai-intelligent/src/icon/baocun.svg

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -320 -9 )">
<path d="M 5.72142857421875 4.29571427734375 L 5.72142857421875 0.0171428515625 L 10 0.0171428515625 L 10 4.29571427734375 L 5.72142857421875 4.29571427734375 Z M 14.564285722656251 0.3028571484375 L 19.84 5.57857142578125 C 19.9828571484375 5.57857142578125 19.9828571484375 5.864285703125001 20 6.0071428515625005 L 20 19.27 C 19.9828571484375 19.69857142578125 19.697142871093753 19.98428572265625 19.27 20 L 0.73 20 C 0.30142857421874997 19.98428572265625 0.015714277343749916 19.6985714453125 0 19.27 L 0 0.73 C 0.015714277343749916 0.30142857421874997 0.30142855468749996 0.015714277343749916 0.73 0.015714277343749916 L 4.29571427734375 0.015714277343749916 L 4.29571427734375 5.72142857421875 L 11.42571427734375 5.72142857421875 L 11.42571427734375 0.0171428515625 L 13.992857148437501 0.0171428515625 C 14.135714296875001 0.0171428515625 14.421428574218751 0.16 14.564285722656251 0.3028571484375 Z M 4.29571427734375 15.70428572265625 L 15.70428572265625 15.704285722656248 L 15.70428572265625 10 L 4.29571427734375 10 L 4.29571427734375 15.70428572265625 Z " fill-rule="nonzero" fill="#ff7602" stroke="none" transform="matrix(1 0 0 1 320 9 )" />
</g>
</svg>

6
hx-ai-intelligent/src/icon/bianji.svg

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -320 -9 )">
<path d="M 17.482232142857143 6.05310267857143 L 7.481830357142856 16.053526785714283 L 3.946339285714287 12.518035714285713 L 13.946741071428567 2.5176116071428565 L 17.482232142857143 6.05310267857143 Z M 2.8571428571428568 17.142857142857142 L 2.8571428571428568 13.607142857142856 L 6.392857142857144 17.142857142857142 L 2.8571428571428568 17.142857142857142 Z M 18.013392857142858 0.4017857142857143 L 19.598214285714285 1.9866071428571428 C 20.133928571428573 2.5223214285714284 20.133928571428573 3.3995535714285703 19.598214285714285 3.937500000000002 L 18.55357142857143 4.982142857142853 L 15.017857142857142 1.4464285714285705 L 16.062499999999996 0.4017857142857143 C 16.598214285714285 -0.13392857142857142 17.47544642857143 -0.13392857142857142 18.013392857142858 0.4017857142857143 Z M 0 15.714285714285714 L 1.4285714285714284 15.714285714285714 L 1.4285714285714284 18.571428571424978 L 1.4285714285714284 20 L 0 20 L 0 15.714285714285714 Z M 18.571428571428573 20 L 1.4285714285714284 20 L 1.4285714285714284 18.571428571428573 L 18.571428571428573 18.571428571428573 L 18.571428571428573 20 Z M 20 15.714285714285714 L 20 20 L 18.571428571428573 20 L 18.571428571428573 15.714285714285714 L 20 15.714285714285714 Z " fill-rule="nonzero" fill="#ff7602" stroke="none" transform="matrix(1 0 0 1 320 9 )" />
</g>
</svg>

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

@ -8,18 +8,66 @@
:cancel="handleClose"
placement="right"
@close="handleClose">
<ns-form ref="formRef" :schemas="schemas" :model="infoObject" formLayout="vertical" />
<div style="margin-left: 52px">
应用规则:
<a-switch
:checked="infoObject?.enableRules === 1 ? true : false"
:class="{
'blue-background': infoObject?.enableRules === 1 ? true : false,
'grey-background': infoObject?.enableRules === 1 ? false : true,
}"
style="margin-left: 6px"
@change="changeSwitch" />
</div>
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item name="alarmTitle" label="告警标题">
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" />
</a-form-item>
<a-form-item label="告警频率" name="alarmFrequency">
<a-select
v-model:value="infoObject.alarmFrequency"
placeholder="请选择告警频率"
style="width: 100%"
allowClear
:options="alarmFrequencyData" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长">
<ns-input-number
style="width: 60%"
v-model:value="infoObject.intervalDuration"
placeholder="请输入间隔时长" />
<a-select
v-model:value="infoObject.intervalDurationUnit"
placeholder="请选择间隔时长单位"
style="width: 40%"
allowClear
:options="intervalDurationUnitData" />
</a-form-item>
<a-form-item label="优先级" name="priority">
<a-select
v-model:value="infoObject.priority"
placeholder="请选择优先级"
style="width: 100%"
allowClear
:options="priorityData" />
</a-form-item>
<a-form-item label="监测频率" name="monitorFrequency">
<a-select
v-model:value="infoObject.monitorFrequency"
placeholder="请选择监测频率"
style="width: 100%"
allowClear
:options="monitorFrequencyData" />
</a-form-item>
<a-form-item label="启用规则">
<a-switch
:checked="infoObject?.enableRules === 1 ? true : false"
:class="{
'blue-background': infoObject?.enableRules === 1 ? true : false,
'grey-background': infoObject?.enableRules === 1 ? false : true,
}"
style="margin-left: 6px"
@change="changeSwitch" />
</a-form-item>
<a-form-item label="是否创建工单" name="createWorkOrder">
<a-radio-group v-model:value="infoObject.createWorkOrder">
<a-radio value="1"> </a-radio>
<a-radio value="0"> </a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ns-drawer>
</template>
<script lang="ts" setup>
@ -31,175 +79,147 @@
const visible = ref(false);
//
const infoObject = ref({
alarmTitle: null,
alarmFrequency: null,
priority: null,
monitorFrequency: null,
createWorkOrder: null,
enableRules: 0,
});
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 rules = {
alarmTitle: [
{
required: true,
message: '请输入告警标题',
trigger: 'change',
validator: (rules: any, alarmTitle: any, cbfn: any) => {
if (alarmTitle && alarmTitle.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
alarmFrequency: [{ required: true, message: '请选择告警频率', trigger: 'change' }],
intervalDuration: [
{
required: true,
message: '请输入正确的间隔时长',
trigger: 'change',
validator: (rules: any, intervalDuration: any, cbfn: any) => {
if (intervalDuration && intervalDuration > 0) {
cbfn();
} else {
cbfn('请输入正确的间隔时长');
}
if (!infoObject.value.intervalDurationUnit) {
cbfn('请选择间隔时长单位');
}
},
},
],
repetitions: [
{
required: true,
message: '请输入正确的重复次数',
trigger: 'change',
validator: (rules: any, repetitions: any, cbfn: any) => {
if (repetitions && repetitions > 0) {
cbfn();
} else {
cbfn('请输入正确的重复次数');
}
},
},
],
createWorkOrder: [{ required: true, message: '请选择是否创建工单', trigger: 'change' }],
monitorFrequency: [{ required: true, message: '请选择监测频率', trigger: 'change' }],
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }],
};
const toggle = (value: any) => {
//
if (value) {
infoObject.value = value;
} else {
infoObject.value = {
alarmTitle: null,
alarmFrequency: null,
priority: null,
monitorFrequency: null,
createWorkOrder: null,
enableRules: 0,
};
}
visible.value = !visible.value;
};
const schemas = [
{
field: 'basicInfo',
label: '',
displayFormItem: false,
class: 'ns-form-item-full',
component: 'NsChildForm',
componentProps: {
schemas: [
{
field: 'alarmTitle',
label: '告警标题',
component: 'NsInput',
rules: [
{
required: true,
message: '告警标题不能为空',
trigger: 'change',
validator: (rules: any, alarmTitle: any, cbfn: any) => {
if (alarmTitle && alarmTitle.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
componentProps: {
placeholder: '请输入告警标题',
maxLength: 20,
},
},
{
field: 'repetitions',
label: '重复次数',
rules: [
{
required: true,
message: '重复次数不能为空',
trigger: 'change',
},
],
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择重复次数',
options: [
{
label: '单次',
value: 1,
},
{
label: '重复',
value: 2,
},
{
label: '累计',
value: 3,
},
],
},
},
{
field: 'priority',
label: '优先级',
component: 'NsSelect',
rules: [
{
required: true,
message: '优先级不能为空',
trigger: 'change',
},
],
componentProps: {
allowClear: true,
placeholder: '请选择优先级',
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
],
},
},
{
field: 'monitorFrequency',
label: '监测频率',
component: 'NsSelect',
rules: [
{
required: true,
message: '监测频率不能为空',
trigger: 'change',
},
],
componentProps: {
allowClear: true,
placeholder: '请选择优先级',
options: [
{
label: '小时',
value: 1,
},
{
label: '每日',
value: 2,
},
{
label: '每周',
value: 3,
},
{
label: '月度',
value: 4,
},
{
label: '年度',
value: 5,
},
],
},
},
{
label: '是否创建工单',
field: 'createWorkOrder',
component: 'NsRadioGroup',
rules: [
{
required: true,
message: '是否创建工单不能为空',
trigger: 'change',
},
],
componentProps: {
radioType: 'radio',
options: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
],
},
},
],
},
},
];
//
const changeSwitch = () => {
switch (infoObject.value.enableRules) {
@ -213,9 +233,16 @@
};
const btnClick = () => {
//
formRef.value.triggerSubmit().then(() => {
formRef.value.validate().then(() => {
let data = { ...infoObject.value };
data.createWorkOrder = Number(data.createWorkOrder);
if (data.alarmFrequency !== 2) {
data.repetitions = null;
data.intervalDuration = null;
data.intervalDurationUnit = null;
}
//
http.post(energyAlarms.addOrUpNewData, infoObject.value).then(() => {
http.post(energyAlarms.addOrUpNewData, data).then(() => {
emit('editObject', null);
if (infoObject.value.id) {
NsMessage.success('告警编辑成功');
@ -228,8 +255,13 @@
};
const handleClose = () => {
//
formRef.value.formElRef.clearValidate();
formRef.value.resetFields();
infoObject.value = {
alarmTitle: null,
alarmFrequency: null,
priority: null,
monitorFrequency: null,
createWorkOrder: null,
enableRules: 0,
};
visible.value = false;
@ -269,4 +301,9 @@
.grey-background.ant-switch .ant-switch-handle {
background-color: grey !important;
}
:deep(.ant-form-item-label) {
z-index: 20;
text-align: right;
width: 23%;
}
</style>

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

@ -190,7 +190,7 @@
//
getDevicePage({
orgId: orgId.value,
code: selectedOptions[selectedOptions.length - 1].code,
deviceCode: selectedOptions[selectedOptions.length - 1].code,
pageNum: 1,
pageSize: 999,
});

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

@ -8,18 +8,72 @@
:cancel="handleClose"
placement="right"
@close="handleClose">
<ns-form ref="formRef" :schemas="schemas" :model="infoObject" formLayout="vertical" />
<div style="margin-left: 52px">
应用规则:
<a-switch
:checked="infoObject?.enableRules === 1 ? true : false"
:class="{
'blue-background': infoObject?.enableRules === 1 ? true : false,
'grey-background': infoObject?.enableRules === 1 ? false : true,
}"
style="margin-left: 6px"
@change="changeSwitch" />
</div>
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item name="alarmTitle" label="告警标题">
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" />
</a-form-item>
<a-form-item label="告警频率" name="alarmFrequency">
<a-select
v-model:value="infoObject.alarmFrequency"
placeholder="请选择告警频率"
style="width: 100%"
allowClear
:options="alarmFrequencyData" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="intervalDuration" label="间隔时长">
<ns-input-number
style="width: 60%"
v-model:value="infoObject.intervalDuration"
placeholder="请输入间隔时长" />
<a-select
v-model:value="infoObject.intervalDurationUnit"
placeholder="请选择间隔时长单位"
style="width: 40%"
allowClear
:options="intervalDurationUnitData" />
</a-form-item>
<a-form-item name="monitorTime" label="监测时长">
<ns-input-number
allowClear
v-model:value="infoObject.monitorTime"
placeholder="请输入监测时长" />
</a-form-item>
<a-form-item label="监测时长单位" name="monitorTimeUnit">
<a-select
v-model:value="infoObject.monitorTimeUnit"
placeholder="请选择监测时长单位"
style="width: 100%"
allowClear
:options="monitorTimeUnitData" />
</a-form-item>
<a-form-item label="优先级" name="priority">
<a-select
v-model:value="infoObject.priority"
placeholder="请选择优先级"
style="width: 100%"
allowClear
:options="priorityData" />
</a-form-item>
<a-form-item label="启用规则">
<a-switch
:checked="infoObject?.enableRules === 1 ? true : false"
:class="{
'blue-background': infoObject?.enableRules === 1 ? true : false,
'grey-background': infoObject?.enableRules === 1 ? false : true,
}"
style="margin-left: 6px"
@change="changeSwitch" />
</a-form-item>
<a-form-item label="是否创建工单" name="createWorkOrder">
<a-radio-group v-model:value="infoObject.createWorkOrder">
<a-radio value="1"> </a-radio>
<a-radio value="0"> </a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</ns-drawer>
</template>
<script lang="ts" setup>
@ -32,11 +86,72 @@
//
const infoObject = ref({
id: null,
accountNo: null,
alarmTitle: null,
alarmFrequency: null,
monitorTime: null,
monitorTimeUnit: null,
priority: null,
createWorkOrder: null,
enableRules: 0,
});
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 toggle = (value: any) => {
//
if (value) {
@ -50,174 +165,69 @@
}
visible.value = !visible.value;
};
const schemas = [
{
field: 'basicInfo',
label: '',
displayFormItem: false,
class: 'ns-form-item-full',
component: 'NsChildForm',
componentProps: {
schemas: [
{
field: 'alarmTitle',
label: '告警标题',
component: 'NsInput',
rules: [
{
required: true,
message: '告警标题不能为空',
trigger: 'change',
validator: (rules: any, alarmTitle: any, cbfn: any) => {
if (alarmTitle && alarmTitle.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
componentProps: {
placeholder: '请输入告警标题',
maxLength: 20,
},
},
{
field: 'repetitions',
label: '重复次数',
rules: [
{
required: true,
message: '重复次数不能为空',
trigger: 'change',
},
],
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择重复次数',
options: [
{
label: '单次',
value: 1,
},
{
label: '重复',
value: 2,
},
{
label: '累计',
value: 3,
},
],
},
},
{
field: 'monitorTime',
label: '检测时长',
component: 'NsInputNumber',
rules: [
{
required: true,
validator: (rules: any, value: any, cbfn: any) => {
if (value && /^[0-9]*$/.test(value)) {
cbfn();
} else {
cbfn('请输入正确的监测时长');
}
},
trigger: 'change',
},
],
componentProps: {
placeholder: '请输入监测时长',
// maxLength: 30,
},
},
{
field: 'monitorTimeUnit',
label: '监测时长单位',
component: 'NsSelect',
rules: [
{
required: true,
message: '监测时长单位不能为空',
trigger: 'change',
},
],
componentProps: {
allowClear: true,
placeholder: '请选择监测时长单位',
options: [
{
label: '分',
value: 1,
},
{
label: '时',
value: 2,
},
{
label: '天',
value: 3,
},
],
},
},
{
field: 'priority',
label: '优先级',
component: 'NsSelect',
rules: [
{
required: true,
message: '优先级不能为空',
trigger: 'change',
},
],
componentProps: {
allowClear: true,
placeholder: '请选择优先级',
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
],
},
},
{
label: '是否创建工单',
field: 'createWorkOrder',
component: 'NsRadioGroup',
rules: [
{
required: true,
message: '是否创建工单不能为空',
trigger: 'change',
},
],
componentProps: {
radioType: 'radio',
options: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
],
},
},
],
//
const rules = {
alarmTitle: [
{
required: true,
message: '请输入告警标题',
trigger: 'change',
validator: (rules: any, alarmTitle: any, cbfn: any) => {
if (alarmTitle && alarmTitle.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
},
];
],
alarmFrequency: [{ required: true, message: '请选择告警频率', trigger: 'change' }],
monitorTime: [
{
required: true,
message: '请输入正确的监测时长',
trigger: 'change',
validator: (rules: any, monitorTime: any, cbfn: any) => {
if (monitorTime && monitorTime > 0) {
cbfn();
} else {
cbfn('请输入正确的监测时长');
}
},
},
],
intervalDuration: [
{
required: true,
message: '请输入正确的间隔时长',
trigger: 'change',
validator: (rules: any, monitorTime: any, cbfn: any) => {
if (monitorTime && monitorTime > 0) {
cbfn();
} else {
cbfn('请输入正确的间隔时长');
}
},
},
],
repetitions: [
{
required: true,
message: '请输入正确的重复次数',
trigger: 'change',
validator: (rules: any, repetitions: any, cbfn: any) => {
if (repetitions && repetitions > 0) {
cbfn();
} else {
cbfn('请输入正确的重复次数');
}
},
},
],
createWorkOrder: [{ required: true, message: '请选择是否创建工单', trigger: 'change' }],
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }],
};
//
const changeSwitch = () => {
switch (infoObject.value.enableRules) {
@ -231,9 +241,16 @@
};
const btnClick = () => {
//
formRef.value.triggerSubmit().then(() => {
formRef.value.validate().then(() => {
//
http.post(deviceAlarms.addOrUpNewData, infoObject.value).then(() => {
let data = { ...infoObject.value };
data.createWorkOrder = Number(data.createWorkOrder);
if (data.alarmFrequency !== 2) {
data.repetitions = null;
data.intervalDuration = null;
data.intervalDurationUnit = null;
}
http.post(deviceAlarms.addOrUpNewData, data).then(() => {
if (infoObject.value.id) {
NsMessage.success('告警编辑成功');
} else {
@ -246,7 +263,7 @@
};
const handleClose = () => {
//
formRef.value.formElRef.clearValidate();
formRef.value.resetFields();
visible.value = false;
};
defineExpose({
@ -284,4 +301,9 @@
.grey-background.ant-switch .ant-switch-handle {
background-color: grey !important;
}
:deep(.ant-form-item-label) {
z-index: 20;
text-align: right;
width: 23%;
}
</style>

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

@ -48,14 +48,26 @@
{{
record.monitorTime && record.monitorTimeUnit
? record.monitorTime + '' + record.monitorTimeUnit.label
: '-'
: ''
}}
</template>
<template v-if="column.dataIndex === 'repetition'">
{{ record.repetitions.label }}
</template>
<template v-if="column.dataIndex === 'prioritys'">
{{ record.priority ? record.priority.label : '-' }}
{{ record.priority ? record.priority.label : '' }}
</template>
<template v-if="column.dataIndex === 'alarmFrequency'">
{{ record.alarmFrequency ? record.alarmFrequency.label : '' }}
</template>
<template v-if="column.dataIndex === 'repetitions'">
{{
record.repetitions && record.alarmFrequency.value === 2 ? record.repetitions : ''
}}
</template>
<template v-if="column.dataIndex === 'interval'">
{{
record.intervalDuration && record.alarmFrequency.value === 2
? record.intervalDuration + '' + record.intervalDurationUnit.label
: ''
}}
</template>
</template>
</ns-view-list-table>
@ -89,14 +101,26 @@
clickSwitch({ type: 3, enableRules: record.enableRules, record: record })
" />
</template>
<template v-if="column.dataIndex === 'monitorFrequencys'">
<template v-if="column.dataIndex === 'monitorFrequency'">
{{ record.monitorFrequency.label }}
</template>
<template v-if="column.dataIndex === 'rep'">
{{ record.repetitions.label }}
<template v-if="column.dataIndex === 'alarmFrequency'">
{{ record.alarmFrequency ? record.alarmFrequency.label : '' }}
</template>
<template v-if="column.dataIndex === 'prioritys'">
{{ record.priority ? record.priority.label : '-' }}
<template v-if="column.dataIndex === 'priority'">
{{ record.priority ? record.priority.label : '' }}
</template>
<template v-if="column.dataIndex === 'repetitions'">
{{
record.repetitions && record.alarmFrequency.value === 2 ? record.repetitions : ''
}}
</template>
<template v-if="column.dataIndex === 'interval'">
{{
record.intervalDuration && record.alarmFrequency.value === 2
? record.intervalDuration + '' + record.intervalDurationUnit.label
: ''
}}
</template>
</template>
</ns-view-list-table>

6
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue

@ -1,8 +1,8 @@
<template>
<a-modal
<ns-modal
v-model:visible="show"
width="1100px"
style="top: 50%; transform: translateY(-50%); overflow-y: hidden"
style="overflow-y: hidden"
title="添加联系人"
@ok="handleOk"
@cancel="handleCancel">
@ -65,7 +65,7 @@
</div>
</div>
</div>
</a-modal>
</ns-modal>
</template>
<script lang="ts">

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

@ -12,7 +12,7 @@ const tableKeyMap = [
},
{
title: '优先级',
dataIndex: 'prioritys',
dataIndex: 'priority',
},
{
title: '告警标题',
@ -23,12 +23,20 @@ const tableKeyMap = [
dataIndex: 'errorCode',
},
{
title: '告警频率',
dataIndex: 'alarmFrequency',
},
{
title: '重复次数',
dataIndex: 'rep',
dataIndex: 'repetitions',
},
{
title: '频率间隔',
dataIndex: 'interval',
},
{
title: '监测时长',
dataIndex: 'monitorFrequencys',
dataIndex: 'monitorFrequency',
},
{
title: '是否启用',
@ -99,9 +107,24 @@ export const energyAlarmConfigs = (
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
const obj = { ...data };
obj.monitorFrequency = data.monitorFrequency.value;
obj.priority = data.priority.value;
obj.repetitions = data.repetitions.value;
if (obj.alarmFrequency) {
obj.alarmFrequency = data.alarmFrequency.value;
}
if (obj.intervalDurationUnit) {
obj.intervalDurationUnit = data.intervalDurationUnit.value;
}
if (obj.monitorFrequency) {
obj.monitorFrequency = data.monitorFrequency.value;
}
if (obj.createWorkOrder) {
obj.createWorkOrder = data.createWorkOrder + '';
}
if (obj.alarmFrequency !== 2) {
obj.repetitions = null;
obj.intervalDuration = null;
obj.intervalDurationUnit = null;
}
editeEnergyAlarm.value.toggle(obj);
},
},

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

@ -23,8 +23,16 @@ const tableKeyMap = [
dataIndex: 'errorCode',
},
{
title: '告警频率',
dataIndex: 'alarmFrequency',
},
{
title: '重复次数',
dataIndex: 'repetition',
dataIndex: 'repetitions',
},
{
title: '频率间隔',
dataIndex: 'interval',
},
{
title: '监测时长',
@ -101,7 +109,20 @@ export const equipmentAlarmTableConfig = (
handle: (data: any) => {
const obj = { ...data };
obj.priority = data.priority.value;
obj.repetitions = data.repetitions.value;
if (obj.alarmFrequency) {
obj.alarmFrequency = data.alarmFrequency.value;
}
if (obj.intervalDurationUnit) {
obj.intervalDurationUnit = data.intervalDurationUnit.value;
}
if (obj.createWorkOrder) {
obj.createWorkOrder = data.createWorkOrder + '';
}
if (obj.alarmFrequency !== 2) {
obj.repetitions = null;
obj.intervalDuration = null;
obj.intervalDurationUnit = null;
}
obj.monitorTimeUnit = data.monitorTimeUnit.value;
editEquipmentAlarm.value.toggle(obj);
},

22
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue

@ -10,15 +10,7 @@
@close="handleClose">
<div style="width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden">
<!-- top -->
<div
style="
width: 100%;
height: 35px;
display: flex;
position: relative;
font-size: 16px;
border-bottom: 1px solid #2778ff; /* 设置底部边框为1像素实线,并指定颜色 */
">
<div class="box">
<div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
告警编号20230310001
@ -201,7 +193,7 @@
itemStyle: {
normal: {
barBorderRadius: 0,
color: '#6395F9',
color: '#2778FF',
},
},
symbol: 'circle', //
@ -227,13 +219,21 @@
});
</script>
<style scoped lang="less">
.box {
width: 100%;
height: 35px;
display: flex;
position: relative;
font-size: @font-size-base;
border-bottom: 1px solid @primary-color;
}
.card {
position: absolute;
left: 0px;
top: 0px;
width: 5px;
height: 35px;
background-color: #2778ff;
background-color: @primary-color;
}
:deep(.ant-descriptions-item-label) {
width: 25%;

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

@ -19,12 +19,19 @@
placeholder="请选择设备点位"
style="width: 85%"
:options="statusOptions"
:disabled="showEdit"
:filter-option="filterDevicePoint" />
<ns-icon
size="20"
@click="() => (showEdit = !showEdit)"
style="margin-left: 20px"
:name="showEdit ? 'bianji' : 'baocun'" />
</a-form-item>
<a-form-item label="备注" name="desc">
<a-textarea
v-model:value="infoObject.desc"
placeholder="请输入异常描述"
:disabled="showEdit"
style="width: 85%"
:autoSize="{ minRows: 4, maxRows: 4 }" />
</a-form-item>
@ -53,6 +60,7 @@
setup() {
const visible = ref(false);
const showEdit = ref(true);
const infoObject = ref({});
const statusOptions = ref([
{ value: '0', label: '待处理' },
@ -62,11 +70,11 @@
{ value: '4', label: '已关闭' },
]);
const logList = ref([
{ name: '李四', status: '2' },
{ name: '王五', status: '4' },
{ name: '王五', status: '3' },
{ name: '王五', status: '1' },
{ name: '赵六', status: '0' },
{ name: '李四', status: '2', time: '2024-03-10 10:00:00', desc: '完成' },
{ name: '王五', status: '4', time: '2024-03-10 10:00:00' },
{ name: '王五', status: '3', time: '2024-03-10 10:00:00' },
{ name: '王五', status: '1', time: '2024-03-10 10:00:00', desc: '创建工单' },
{ name: '赵六', status: '0', time: '2024-03-10 10:00:00' },
]);
const config = ref({
size: logList.value.length,
@ -79,9 +87,26 @@
console.log('btnClick');
};
const toggle = (data) => {
console.log(data, 'data');
infoObject.value = logList.value[0];
console.log(infoObject.value, 'infoObject.value');
infoObject.value = { ...logList.value[0] };
let statusMap = {
0: '待处理',
1: '处理中',
2: '已完成',
3: '超时',
4: '已关闭',
};
let colorMap = {
0: '#ff7602',
1: '#00a1e6',
2: '#04d919',
3: '#d9001b',
4: '#a6a6a6',
};
logList.value.forEach((item) => {
item.statusName = statusMap[item.status];
item.color = colorMap[item.status];
item.src = 'status-' + item.status;
});
visible.value = true;
};
const createOrder = () => {
@ -112,6 +137,7 @@
};
return {
infoObject,
showEdit,
statusOptions,
btnClick,
createOrder,

Loading…
Cancel
Save