Browse Source

fix:修改枚举 新风系统

temp
zhaohy 3 months ago
parent
commit
12990f86d2
  1. 6
      hx-ai-intelligent/src/api/airConditioningSystem.ts
  2. 8
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  3. 5
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue
  4. 18
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts
  5. 254
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
  6. 16
      hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue

6
hx-ai-intelligent/src/api/airConditioningSystem.ts

@ -0,0 +1,6 @@
import { BASE_URL } from './index';
export enum airConditioningSystemApi {
getVentHostCtrlList = `${BASE_URL}/api/ventHostCtrl/getDeviceState`, // 查询新风主机最新状态
getAcBoxCtrlList = `${BASE_URL}/api/acBoxCtrl/getDeviceState`, // 查询空调箱最新状态
}

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

@ -60,7 +60,7 @@
placeholder="请选择监测频率" placeholder="请选择监测频率"
style="width: 100%" style="width: 100%"
allowClear allowClear
:options="MonitorFrequencyEnumm" /> :options="MonitorFrequencyEnum" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则"> <a-form-item label="启用规则">
<a-switch <a-switch
@ -121,7 +121,7 @@
const AlarmFrequencyEnum = ref([]); const AlarmFrequencyEnum = ref([]);
const PriorityEnum = ref([]); const PriorityEnum = ref([]);
const intervalDurationUnitData = ref([]); const intervalDurationUnitData = ref([]);
const MonitorFrequencyEnumm = ref([]); const MonitorFrequencyEnum = ref([]);
const rules = { const rules = {
alarmTitle: [ alarmTitle: [
{ {
@ -178,13 +178,13 @@
let enumData = await getAllEnum({ let enumData = await getAllEnum({
params: [ params: [
'PriorityEnum', 'PriorityEnum',
'MonitorFrequencyEnumm', 'MonitorFrequencyEnum',
'AlarmFrequencyEnum', 'AlarmFrequencyEnum',
'IntervalDurationUnitEnum', 'IntervalDurationUnitEnum',
], ],
}); });
PriorityEnum.value = enumData.data.PriorityEnum; PriorityEnum.value = enumData.data.PriorityEnum;
MonitorFrequencyEnumm.value = enumData.data.MonitorFrequencyEnumm; MonitorFrequencyEnum.value = enumData.data.MonitorFrequencyEnum;
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum; AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
intervalDurationUnitData.value = enumData.data.IntervalDurationUnitEnum; intervalDurationUnitData.value = enumData.data.IntervalDurationUnitEnum;
}; };

5
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue

@ -19,8 +19,9 @@
<a-tag <a-tag
style="background-color: rgba(0, 0, 0, 0.5); width: 50px; text-align: center" style="background-color: rgba(0, 0, 0, 0.5); width: 50px; text-align: center"
:style="{ :style="{
border: '1px solid' + ['#39d7bb', '#f3614d', '#ffa403'][0], border:
color: ['#39d7bb', '#f3614d', '#ffa403'][0], '1px solid' + { '0': '', '1': '', '2': '', '3': '' }[item.runStatus.value],
color: { '0': '', '1': '', '2': '', '3': '' }[item.runStatus.value],
}" }"
>开启</a-tag >开启</a-tag
> >

18
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts

@ -0,0 +1,18 @@
//传感器位置
export const devicePosition = [
{ left: '28%', bottom: '44%' },
{ left: '35%', bottom: '23%' },
{ left: '47%', bottom: '31%' },
{ left: '38.5%', bottom: '49%' },
{ left: '65%', bottom: '43%' },
{ left: '52%', bottom: '55.5%' },
{ left: '76%', bottom: '48%' },
{ left: '63%', bottom: '60%' },
];
// 新风主机
export const newTrendPosition = [
{ left: '43%', bottom: '44%' },
{ left: '45%', bottom: '23%' },
{ left: '61.5%', bottom: '54%' },
{ left: '63%', bottom: '36%' },
];

254
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue

@ -19,7 +19,7 @@
<div class="map-box"> <div class="map-box">
<!-- 温度 --> <!-- 温度 -->
<div v-if="selectIndex === 0"> <div v-if="selectIndex === 0">
<template v-for="(item, index) in sensor" :key="index"> <template v-for="(item, index) in sensorData" :key="index">
<div <div
style="position: absolute" style="position: absolute"
:style="{ left: item.styleText.left, bottom: item.styleText.bottom }"> :style="{ left: item.styleText.left, bottom: item.styleText.bottom }">
@ -43,21 +43,22 @@
<div <div
style="position: absolute" style="position: absolute"
:style="{ :style="{
left: 'calc(' + item.styleText.left + ' - 12.9%)', left: 'calc(' + item.styleText.left + ' - 14%)',
bottom: 'calc(' + item.styleText.bottom + ' + 8%)', bottom: 'calc(' + item.styleText.bottom + ' + 8%)',
'z-index': 2,
}"> }">
<doubleSingleModel :dataSource="item" /> <doubleSingleModel :dataSource="item" />
</div> </div>
<img <img
style="width: 50px; height: 75px; position: absolute; z-index: 1" style="width: 50px; height: 75px; position: absolute"
:style="{ :style="{
left: 'calc(' + item.styleText.left + ' - 1.5%)', left: 'calc(' + item.styleText.left + ' - 2%)',
bottom: 'calc(' + item.styleText.bottom + ' + 4%)', bottom: 'calc(' + item.styleText.bottom + ' + 4%)',
transform: 'rotateY(180deg)', transform: 'rotateY(180deg)',
}" }"
src="../image/liftState/lift/line.png" /> src="../image/liftState/lift/line.png" />
<img <img
style="width: 42px; height: 42px; position: absolute" style="width: 42px; height: 42px; position: absolute; z-index: 2"
:style="{ left: item.styleText.left, bottom: item.styleText.bottom }" :style="{ left: item.styleText.left, bottom: item.styleText.bottom }"
src="../image/airConditioningSystem/fan.png" /> src="../image/airConditioningSystem/fan.png" />
</template> </template>
@ -78,17 +79,16 @@
<div v-if="selectIndex === 3"> <div v-if="selectIndex === 3">
<template v-for="(item, index) in conditioningData" :key="index"> <template v-for="(item, index) in conditioningData" :key="index">
<div <div
style="position: absolute" style="position: absolute; z-index: 2"
:style="{ :style="{
left: left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 13%)' : ' - 13.3%)'),
'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 12.9%)' : ' - 13.3%)'),
bottom: bottom:
'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 8%)' : ' - 14%)'), 'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 8.1%)' : ' - 14%)'),
}"> }">
<doubleSingleModel :dataSource="item" /> <doubleSingleModel :dataSource="item" />
</div> </div>
<img <img
style="width: 50px; height: 75px; position: absolute; z-index: 1" style="width: 50px; height: 75px; position: absolute"
:style="{ :style="{
left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 1.5%)' : ' - 2%)'), left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 1.5%)' : ' - 2%)'),
bottom: 'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 4%)' : ' - 9%)'), bottom: 'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 4%)' : ' - 9%)'),
@ -96,7 +96,7 @@
}" }"
src="../image/liftState/lift/line.png" /> src="../image/liftState/lift/line.png" />
<img <img
style="width: 42px; height: 42px; position: absolute" style="width: 42px; height: 42px; position: absolute; z-index: 2"
:style="{ left: item.styleText.left, bottom: item.styleText.bottom }" :style="{ left: item.styleText.left, bottom: item.styleText.bottom }"
src="../image/airConditioningSystem/conditioningIcon.png" /> src="../image/airConditioningSystem/conditioningIcon.png" />
</template> </template>
@ -174,7 +174,7 @@
import airConditioner from '../image/airConditioningSystem/airConditioner.svg'; import airConditioner from '../image/airConditioningSystem/airConditioner.svg';
import floorHeating from '../image/airConditioningSystem/floorHeating.svg'; import floorHeating from '../image/airConditioningSystem/floorHeating.svg';
import selectImg from '../image/airConditioningSystem/selectImg.png'; import selectImg from '../image/airConditioningSystem/selectImg.png';
// //
import sunRed from '../image/airConditioningSystem/sunRed.png'; import sunRed from '../image/airConditioningSystem/sunRed.png';
import sunYellow from '../image/airConditioningSystem/sunYellow.png'; import sunYellow from '../image/airConditioningSystem/sunYellow.png';
import sunGreen from '../image/airConditioningSystem/sunGreen.png'; import sunGreen from '../image/airConditioningSystem/sunGreen.png';
@ -185,7 +185,16 @@
import conditioningModel from './components/conditioningModel.vue'; import conditioningModel from './components/conditioningModel.vue';
import newTreedBox from './components/newTreedBox.vue'; import newTreedBox from './components/newTreedBox.vue';
import floorHeatingModel from './components/floorHeatingModel.vue'; import floorHeatingModel from './components/floorHeatingModel.vue';
import { http } from '/nerv-lib/util/http';
import { ventilating } from '/@/api/ventilatingSystem';
import { airConditioningSystemApi } from '/@/api/airConditioningSystem';
//
import { items } from '/@/store/item';
//
import { devicePosition, newTrendPosition } from './devicePosition';
//
const state = items();
onMounted(() => {}); onMounted(() => {});
onUnmounted(() => {}); onUnmounted(() => {});
// //
@ -199,139 +208,9 @@
const newTrendModels = ref(null); const newTrendModels = ref(null);
// //
const sensor = ref([ const sensorData = ref([]);
{
title: 'H区多功能传感器',
styleText: { left: '28%', bottom: '44%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
{
title: 'G区多功能传感器',
styleText: { left: '35%', bottom: '23%' },
type: '温度',
unit: '℃',
number: 20,
url: sunYellow,
},
{
title: 'F区多功能传感器',
styleText: { left: '47%', bottom: '31%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
{
title: 'E区多功能传感器',
styleText: { left: '38.5%', bottom: '49%' },
type: '温度',
unit: '℃',
number: 20,
url: sunGreen,
},
{
title: 'D区多功能传感器',
styleText: { left: '65%', bottom: '43%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
{
title: 'C区多功能传感器',
styleText: { left: '52%', bottom: '55.5%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
{
title: 'B区多功能传感器',
styleText: { left: '76%', bottom: '48%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
{
title: 'A区多功能传感器',
styleText: { left: '63%', bottom: '60%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
]);
// //
const peopleData = ref([ const peopleData = ref([]);
{
title: 'H区人流传感器',
styleText: { left: '36%', bottom: '21%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'G区人流传感器',
styleText: { left: '28.5%', bottom: '43.5%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'E区人流传感器',
styleText: { left: '39%', bottom: '48%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'F区人流传感器',
styleText: { left: '47.5%', bottom: '29.5%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'D区人流传感器',
styleText: { left: '66%', bottom: '42%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'C区人流传感器',
styleText: { left: '53%', bottom: '54.5%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'B区人流传感器',
styleText: { left: '77%', bottom: '47%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
{
title: 'A区人流传感器',
styleText: { left: '64%', bottom: '59%' },
type: '人流',
unit: '人',
number: 120,
url: people,
},
]);
// //
const newTrend = ref([ const newTrend = ref([
{ {
@ -379,7 +258,7 @@
}, },
{ {
title: '西区', title: '西区',
styleText: { left: '28%', bottom: '30%' }, styleText: { left: '28%', bottom: '28%' },
type: '空调箱', type: '空调箱',
lineType: 1, lineType: 1,
unit: '℃', unit: '℃',
@ -520,6 +399,91 @@
const handleClose = () => { const handleClose = () => {
selectIndex.value = 0; selectIndex.value = 0;
}; };
//
const getSunUrl = (number: any) => {
if (number > 0 && number < 20) {
return sunGreen;
} else if (number >= 20 && number < 30) {
return sunYellow;
} else {
return sunRed;
}
};
//
const getColor = (number: any) => {
if (number > 0 && number < 20) {
return '#0dffa4';
} else if (number >= 20 && number < 30) {
return '#f59a23';
} else {
return '#f36163';
}
};
//
const getSensorData = () => {
sensorData.value = [];
peopleData.value = [];
http
.get(ventilating.getSensorData, { projectId: state.projectId, siteId: state.siteId })
.then((res) => {
if (res.msg === 'success') {
res.data.forEach((item: any, index: number) => {
sensorData.value.push({
title: item.deviceInfoName,
styleText: devicePosition[index],
type: '温度',
unit: item.record.tempUnit,
number: item.record.temp,
url: getSunUrl(item.record.temp),
fontColor: getColor(item.record.temp),
});
peopleData.value.push({
title: item.deviceInfoName,
styleText: devicePosition[index],
type: '人流',
unit: item.record.peopleNumUnit,
number: item.record.peopleNum,
url: people,
});
});
}
});
};
const getnewTrendData = () => {
newTrend.value = [];
http
.get(airConditioningSystemApi.getVentHostCtrlList, {
projectId: state.projectId,
siteId: state.siteId,
})
.then((res) => {
console.log(res);
if (res.msg === 'success') {
res.data.forEach((item: any, index: number) => {
newTrend.value.push({
title: item.deviceInfoName,
styleText: newTrendPosition[index],
type: '新风主机',
number: item.record.converterTemp,
numberUnit: item.record.converterTempUnit,
url: freshAir,
...item.record,
});
});
}
});
};
//
const intervalId = setInterval(getSensorData, 60000);
onMounted(() => {
//
getSensorData();
//
getnewTrendData();
});
onUnmounted(() => {
clearInterval(intervalId);
});
</script> </script>
<style lang="less"> <style lang="less">
.legend-box { .legend-box {

16
hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue

@ -26,10 +26,10 @@
<div style="margin-top: 4px"> {{ dataSource.type === '地暖' ? '设置' : '风量' }} </div> <div style="margin-top: 4px"> {{ dataSource.type === '地暖' ? '设置' : '风量' }} </div>
<div style="margin-top: -5px"> <div style="margin-top: -5px">
<span style="font-size: 18px; color: #0dffff; font-style: italic"> <span style="font-size: 18px; color: #0dffff; font-style: italic">
{{ dataSource.type === '地暖' ? dataSource.setUpNumber : '18' }} {{ dataSource.type === '地暖' ? dataSource.setUpNumber : dataSource.airVol }}
</span> </span>
<span style="font-size: 10px; margin-left: 5px">{{ <span style="font-size: 10px; margin-left: 5px">{{
dataSource.type === '地暖' ? '℃' : 'm3/h' dataSource.type === '地暖' ? '℃' : dataSource.airVolUnit
}}</span> }}</span>
</div> </div>
</div> </div>
@ -48,7 +48,7 @@
<span :style="{ fontSize: '18px', color: getColor(), fontStyle: 'italic' }"> <span :style="{ fontSize: '18px', color: getColor(), fontStyle: 'italic' }">
{{ dataSource.number }} {{ dataSource.number }}
</span> </span>
<span style="font-size: 10px; margin-left: 5px"></span> <span style="font-size: 10px; margin-left: 5px">{{ dataSource.numberUnit }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -65,22 +65,22 @@
const props = defineProps({ const props = defineProps({
dataSource: { dataSource: {
type: Object, type: Object,
default: () => ({ title: '', number: 0 }), // number default: () => ({ title: '', converterTemp: 0 }), // number
}, },
}); });
const getSunUrl = () => { const getSunUrl = () => {
if (props.dataSource.number > 0 && props.dataSource.number < 20) { if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
return sunGreen; return sunGreen;
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) { } else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
return sunYellow; return sunYellow;
} else { } else {
return sunRed; return sunRed;
} }
}; };
const getColor = () => { const getColor = () => {
if (props.dataSource.number > 0 && props.dataSource.number < 20) { if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
return '#0dffa4'; return '#0dffa4';
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) { } else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
return '#f59a23'; return '#f59a23';
} else { } else {
return '#f36163'; return '#f36163';

Loading…
Cancel
Save