Browse Source

fix:通风系统对接接口

temp
zhaohy 1 month ago
parent
commit
933e4b26a8
  1. 2
      hx-ai-intelligent/src/api/ventilatingSystem.ts
  2. 4
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
  3. 4
      hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue
  4. 2
      hx-ai-intelligent/src/view/equipmentControl/components/singleModel.vue
  5. 0
      hx-ai-intelligent/src/view/equipmentControl/image/airConditioningSystem/sunGreen.png
  6. 8
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/devicePosition.ts
  7. 160
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

2
hx-ai-intelligent/src/api/ventilatingSystem.ts

@ -2,6 +2,8 @@
const prefix = '/carbon-smart/api';
// 通风系统相关接口
export enum ventilating {
//传感器获取数据
getSensorData = prefix + '/multiFuncSensorCtrl/getDeviceState',
// 排风扇相关 =============================================
// 获得排风扇系统的树形结构
getTree1 = prefix + '/ventilatingFanCtrl/getCtrlPanelTree',

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

@ -177,7 +177,7 @@
//
import sunRed from '../image/airConditioningSystem/sunRed.png';
import sunYellow from '../image/airConditioningSystem/sunYellow.png';
import sunBlue from '../image/airConditioningSystem/sunBlue.png';
import sunGreen from '../image/airConditioningSystem/sunGreen.png';
import singleModel from '../components/singleModel.vue';
import doubleSingleModel from '../components/doubleSingleModel.vue';
@ -230,7 +230,7 @@
type: '温度',
unit: '℃',
number: 20,
url: sunBlue,
url: sunGreen,
},
{
title: 'D区多功能传感器',

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

@ -57,7 +57,7 @@
<script lang="ts" setup>
import sunRed from '../image/airConditioningSystem/sunRed.png';
import sunYellow from '../image/airConditioningSystem/sunYellow.png';
import sunBlue from '../image/airConditioningSystem/sunBlue.png';
import sunGreen from '../image/airConditioningSystem/sunGreen.png';
import electricFan from '../image/airConditioningSystem/electricFan.png';
import setUp from '../image/airConditioningSystem/setUp.png';
@ -70,7 +70,7 @@
});
const getSunUrl = () => {
if (props.dataSource.number > 0 && props.dataSource.number < 20) {
return sunBlue;
return sunGreen;
} else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
return sunYellow;
} else {

2
hx-ai-intelligent/src/view/equipmentControl/components/singleModel.vue

@ -17,6 +17,7 @@
class="box-number"
:style="{
left: dataSource.type === '二氧化碳' ? '95px' : '90px',
color: dataSource.fontColor ? dataSource.fontColor : '#0dffa4',
}"
>{{ dataSource.number }}</div
>
@ -90,7 +91,6 @@
margin-right: 4px;
}
.box-number {
color: #0dffa4;
font-size: 18px;
left: 72%;
top: 45%;

0
hx-ai-intelligent/src/view/equipmentControl/image/airConditioningSystem/sunBlue.png → hx-ai-intelligent/src/view/equipmentControl/image/airConditioningSystem/sunGreen.png

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

8
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/devicePosition.ts

@ -1,3 +1,11 @@
//传感器位置
export const devicePosition = [
{ styleText: { left: '46.8%', bottom: '74%' } },
{ styleText: { left: '47%', bottom: '62%' } },
{ styleText: { left: '47.2%', bottom: '47%' } },
{ styleText: { left: '47.3%', bottom: '34%' } },
];
// 排风扇
export const devicePosition1 = [
{

160
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

@ -287,6 +287,7 @@
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';
import boxModel from './components/boxModel.vue';
import singleModel from '../components/singleModel.vue';
@ -301,7 +302,12 @@
//
import { items } from '/@/store/item';
//
import { devicePosition1, devicePosition2, devicePosition3 } from './devicePosition';
import {
devicePosition1,
devicePosition2,
devicePosition3,
devicePosition,
} from './devicePosition';
// =======================================================================
@ -433,81 +439,13 @@
});
};
//
const sensorData = ref([
{
title: '多功能传感器A',
styleText: { left: '48%', bottom: '64%' },
type: '温度',
unit: '℃',
number: 20,
url: sunRed,
},
{
title: '多功能传感器B',
styleText: { left: '48.2%', bottom: '43%' },
type: '温度',
unit: '℃',
number: 20,
url: sunYellow,
},
]);
const sensorData = ref([]);
// 湿
const humidityData = ref([
{
title: '多功能传感器A',
styleText: { left: '48%', bottom: '64%' },
type: '湿度',
unit: '%',
number: 20,
url: humidity,
},
{
title: '多功能传感器B',
styleText: { left: '48.2%', bottom: '43%' },
type: '湿度',
unit: '%',
number: 20,
url: humidity,
},
]);
const humidityData = ref([]);
// PM2.5
const pmData = ref([
{
title: '多功能传感器A',
styleText: { left: '48%', bottom: '64%' },
type: 'pm2.5',
unit: '',
number: 20,
url: PM25,
},
{
title: '多功能传感器B',
styleText: { left: '48.2%', bottom: '43%' },
type: 'pm2.5',
unit: '',
number: 20,
url: PM25,
},
]);
const pmData = ref([]);
//
const CO2Data = ref([
{
title: '多功能传感器A',
styleText: { left: '48%', bottom: '64%' },
type: '二氧化碳',
unit: 'CO2e',
number: 20,
url: CO2,
},
{
title: '多功能传感器B',
styleText: { left: '48.2%', bottom: '43%' },
type: '二氧化碳',
unit: 'CO2e',
number: 99,
url: CO2,
},
]);
const CO2Data = ref([]);
//
const fanData = ref([]);
//
@ -536,11 +474,85 @@
const tabs2Ref = ref();
// tab3
const tabs3Ref = ref();
//
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 = [];
humidityData.value = [];
pmData.value = [];
CO2Data.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].styleText,
type: '温度',
unit: item.record.tempUnit,
number: item.record.temp,
url: getSunUrl(item.record.temp),
fontColor: getColor(item.record.temp),
});
humidityData.value.push({
title: item.deviceInfoName,
styleText: devicePosition[index].styleText,
type: '湿度',
unit: item.record.humidityUnit,
number: item.record.humidity,
url: humidity,
});
pmData.value.push({
title: item.deviceInfoName,
styleText: devicePosition[index].styleText,
type: 'pm2.5',
unit: item.record.pm2_5Unit,
number: item.record.pm2_5,
url: PM25,
});
CO2Data.value.push({
title: item.deviceInfoName,
styleText: devicePosition[index].styleText,
type: '二氧化碳',
unit: item.record.co_CO2Unit,
number: item.record.co_CO2,
url: CO2,
});
});
}
});
};
//
const intervalId = setInterval(getSensorData, 60000);
onMounted(() => {
//
getSensorData();
//
getStateEnum();
});
onUnmounted(() => {});
onUnmounted(() => {
clearInterval(intervalId);
});
</script>
<style lang="less">
@import url('../style/color.less');

Loading…
Cancel
Save