fix:修改枚举 新风系统
This commit is contained in:
6
hx-ai-intelligent/src/api/airConditioningSystem.ts
Normal file
6
hx-ai-intelligent/src/api/airConditioningSystem.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { BASE_URL } from './index';
|
||||
|
||||
export enum airConditioningSystemApi {
|
||||
getVentHostCtrlList = `${BASE_URL}/api/ventHostCtrl/getDeviceState`, // 查询新风主机最新状态
|
||||
getAcBoxCtrlList = `${BASE_URL}/api/acBoxCtrl/getDeviceState`, // 查询空调箱最新状态
|
||||
}
|
@@ -60,7 +60,7 @@
|
||||
placeholder="请选择监测频率"
|
||||
style="width: 100%"
|
||||
allowClear
|
||||
:options="MonitorFrequencyEnumm" />
|
||||
:options="MonitorFrequencyEnum" />
|
||||
</a-form-item>
|
||||
<a-form-item label="启用规则">
|
||||
<a-switch
|
||||
@@ -121,7 +121,7 @@
|
||||
const AlarmFrequencyEnum = ref([]);
|
||||
const PriorityEnum = ref([]);
|
||||
const intervalDurationUnitData = ref([]);
|
||||
const MonitorFrequencyEnumm = ref([]);
|
||||
const MonitorFrequencyEnum = ref([]);
|
||||
const rules = {
|
||||
alarmTitle: [
|
||||
{
|
||||
@@ -178,13 +178,13 @@
|
||||
let enumData = await getAllEnum({
|
||||
params: [
|
||||
'PriorityEnum',
|
||||
'MonitorFrequencyEnumm',
|
||||
'MonitorFrequencyEnum',
|
||||
'AlarmFrequencyEnum',
|
||||
'IntervalDurationUnitEnum',
|
||||
],
|
||||
});
|
||||
PriorityEnum.value = enumData.data.PriorityEnum;
|
||||
MonitorFrequencyEnumm.value = enumData.data.MonitorFrequencyEnumm;
|
||||
MonitorFrequencyEnum.value = enumData.data.MonitorFrequencyEnum;
|
||||
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
|
||||
intervalDurationUnitData.value = enumData.data.IntervalDurationUnitEnum;
|
||||
};
|
||||
|
@@ -19,8 +19,9 @@
|
||||
<a-tag
|
||||
style="background-color: rgba(0, 0, 0, 0.5); width: 50px; text-align: center"
|
||||
:style="{
|
||||
border: '1px solid' + ['#39d7bb', '#f3614d', '#ffa403'][0],
|
||||
color: ['#39d7bb', '#f3614d', '#ffa403'][0],
|
||||
border:
|
||||
'1px solid' + { '0': '', '1': '', '2': '', '3': '' }[item.runStatus.value],
|
||||
color: { '0': '', '1': '', '2': '', '3': '' }[item.runStatus.value],
|
||||
}"
|
||||
>开启</a-tag
|
||||
>
|
||||
|
@@ -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%' },
|
||||
];
|
@@ -19,7 +19,7 @@
|
||||
<div class="map-box">
|
||||
<!-- 温度 -->
|
||||
<div v-if="selectIndex === 0">
|
||||
<template v-for="(item, index) in sensor" :key="index">
|
||||
<template v-for="(item, index) in sensorData" :key="index">
|
||||
<div
|
||||
style="position: absolute"
|
||||
:style="{ left: item.styleText.left, bottom: item.styleText.bottom }">
|
||||
@@ -43,21 +43,22 @@
|
||||
<div
|
||||
style="position: absolute"
|
||||
:style="{
|
||||
left: 'calc(' + item.styleText.left + ' - 12.9%)',
|
||||
left: 'calc(' + item.styleText.left + ' - 14%)',
|
||||
bottom: 'calc(' + item.styleText.bottom + ' + 8%)',
|
||||
'z-index': 2,
|
||||
}">
|
||||
<doubleSingleModel :dataSource="item" />
|
||||
</div>
|
||||
<img
|
||||
style="width: 50px; height: 75px; position: absolute; z-index: 1"
|
||||
style="width: 50px; height: 75px; position: absolute"
|
||||
:style="{
|
||||
left: 'calc(' + item.styleText.left + ' - 1.5%)',
|
||||
left: 'calc(' + item.styleText.left + ' - 2%)',
|
||||
bottom: 'calc(' + item.styleText.bottom + ' + 4%)',
|
||||
transform: 'rotateY(180deg)',
|
||||
}"
|
||||
src="../image/liftState/lift/line.png" />
|
||||
<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 }"
|
||||
src="../image/airConditioningSystem/fan.png" />
|
||||
</template>
|
||||
@@ -78,17 +79,16 @@
|
||||
<div v-if="selectIndex === 3">
|
||||
<template v-for="(item, index) in conditioningData" :key="index">
|
||||
<div
|
||||
style="position: absolute"
|
||||
style="position: absolute; z-index: 2"
|
||||
:style="{
|
||||
left:
|
||||
'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 12.9%)' : ' - 13.3%)'),
|
||||
left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 13%)' : ' - 13.3%)'),
|
||||
bottom:
|
||||
'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 8%)' : ' - 14%)'),
|
||||
'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 8.1%)' : ' - 14%)'),
|
||||
}">
|
||||
<doubleSingleModel :dataSource="item" />
|
||||
</div>
|
||||
<img
|
||||
style="width: 50px; height: 75px; position: absolute; z-index: 1"
|
||||
style="width: 50px; height: 75px; position: absolute"
|
||||
:style="{
|
||||
left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 1.5%)' : ' - 2%)'),
|
||||
bottom: 'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 4%)' : ' - 9%)'),
|
||||
@@ -96,7 +96,7 @@
|
||||
}"
|
||||
src="../image/liftState/lift/line.png" />
|
||||
<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 }"
|
||||
src="../image/airConditioningSystem/conditioningIcon.png" />
|
||||
</template>
|
||||
@@ -174,7 +174,7 @@
|
||||
import airConditioner from '../image/airConditioningSystem/airConditioner.svg';
|
||||
import floorHeating from '../image/airConditioningSystem/floorHeating.svg';
|
||||
import selectImg from '../image/airConditioningSystem/selectImg.png';
|
||||
// 温泉颜色
|
||||
// 温度颜色
|
||||
import sunRed from '../image/airConditioningSystem/sunRed.png';
|
||||
import sunYellow from '../image/airConditioningSystem/sunYellow.png';
|
||||
import sunGreen from '../image/airConditioningSystem/sunGreen.png';
|
||||
@@ -185,7 +185,16 @@
|
||||
import conditioningModel from './components/conditioningModel.vue';
|
||||
import newTreedBox from './components/newTreedBox.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(() => {});
|
||||
onUnmounted(() => {});
|
||||
//图例
|
||||
@@ -199,139 +208,9 @@
|
||||
const newTrendModels = ref(null);
|
||||
|
||||
//温度传感器
|
||||
const sensor = 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 sensorData = 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 peopleData = ref([]);
|
||||
//新风主机
|
||||
const newTrend = ref([
|
||||
{
|
||||
@@ -379,7 +258,7 @@
|
||||
},
|
||||
{
|
||||
title: '西区',
|
||||
styleText: { left: '28%', bottom: '30%' },
|
||||
styleText: { left: '28%', bottom: '28%' },
|
||||
type: '空调箱',
|
||||
lineType: 1,
|
||||
unit: '℃',
|
||||
@@ -520,6 +399,91 @@
|
||||
const handleClose = () => {
|
||||
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>
|
||||
<style lang="less">
|
||||
.legend-box {
|
||||
|
@@ -26,10 +26,10 @@
|
||||
<div style="margin-top: 4px"> {{ dataSource.type === '地暖' ? '设置' : '风量' }} </div>
|
||||
<div style="margin-top: -5px">
|
||||
<span style="font-size: 18px; color: #0dffff; font-style: italic">
|
||||
{{ dataSource.type === '地暖' ? dataSource.setUpNumber : '18' }}
|
||||
{{ dataSource.type === '地暖' ? dataSource.setUpNumber : dataSource.airVol }}
|
||||
</span>
|
||||
<span style="font-size: 10px; margin-left: 5px">{{
|
||||
dataSource.type === '地暖' ? '℃' : 'm3/h'
|
||||
dataSource.type === '地暖' ? '℃' : dataSource.airVolUnit
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,7 +48,7 @@
|
||||
<span :style="{ fontSize: '18px', color: getColor(), fontStyle: 'italic' }">
|
||||
{{ dataSource.number }}
|
||||
</span>
|
||||
<span style="font-size: 10px; margin-left: 5px">℃</span>
|
||||
<span style="font-size: 10px; margin-left: 5px">{{ dataSource.numberUnit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,22 +65,22 @@
|
||||
const props = defineProps({
|
||||
dataSource: {
|
||||
type: Object,
|
||||
default: () => ({ title: '', number: 0 }), // 假设默认值还包括number属性
|
||||
default: () => ({ title: '', converterTemp: 0 }), // 假设默认值还包括number属性
|
||||
},
|
||||
});
|
||||
const getSunUrl = () => {
|
||||
if (props.dataSource.number > 0 && props.dataSource.number < 20) {
|
||||
if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
|
||||
return sunGreen;
|
||||
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
|
||||
} else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
|
||||
return sunYellow;
|
||||
} else {
|
||||
return sunRed;
|
||||
}
|
||||
};
|
||||
const getColor = () => {
|
||||
if (props.dataSource.number > 0 && props.dataSource.number < 20) {
|
||||
if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
|
||||
return '#0dffa4';
|
||||
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
|
||||
} else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
|
||||
return '#f59a23';
|
||||
} else {
|
||||
return '#f36163';
|
||||
|
Reference in New Issue
Block a user