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'; const prefix = '/carbon-smart/api';
// 通风系统相关接口 // 通风系统相关接口
export enum ventilating { export enum ventilating {
//传感器获取数据
getSensorData = prefix + '/multiFuncSensorCtrl/getDeviceState',
// 排风扇相关 ============================================= // 排风扇相关 =============================================
// 获得排风扇系统的树形结构 // 获得排风扇系统的树形结构
getTree1 = prefix + '/ventilatingFanCtrl/getCtrlPanelTree', 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 sunRed from '../image/airConditioningSystem/sunRed.png';
import sunYellow from '../image/airConditioningSystem/sunYellow.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 singleModel from '../components/singleModel.vue';
import doubleSingleModel from '../components/doubleSingleModel.vue'; import doubleSingleModel from '../components/doubleSingleModel.vue';
@ -230,7 +230,7 @@
type: '温度', type: '温度',
unit: '℃', unit: '℃',
number: 20, number: 20,
url: sunBlue, url: sunGreen,
}, },
{ {
title: 'D区多功能传感器', title: 'D区多功能传感器',

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

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

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

@ -17,6 +17,7 @@
class="box-number" class="box-number"
:style="{ :style="{
left: dataSource.type === '二氧化碳' ? '95px' : '90px', left: dataSource.type === '二氧化碳' ? '95px' : '90px',
color: dataSource.fontColor ? dataSource.fontColor : '#0dffa4',
}" }"
>{{ dataSource.number }}</div >{{ dataSource.number }}</div
> >
@ -90,7 +91,6 @@
margin-right: 4px; margin-right: 4px;
} }
.box-number { .box-number {
color: #0dffa4;
font-size: 18px; font-size: 18px;
left: 72%; left: 72%;
top: 45%; 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 = [ 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 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 boxModel from './components/boxModel.vue'; import boxModel from './components/boxModel.vue';
import singleModel from '../components/singleModel.vue'; import singleModel from '../components/singleModel.vue';
@ -301,7 +302,12 @@
// //
import { items } from '/@/store/item'; 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([ 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 humidityData = 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,
},
]);
// PM2.5 // PM2.5
const pmData = ref([ 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 CO2Data = 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 fanData = ref([]); const fanData = ref([]);
// //
@ -536,11 +474,85 @@
const tabs2Ref = ref(); const tabs2Ref = ref();
// tab3 // tab3
const tabs3Ref = ref(); 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(() => { onMounted(() => {
//
getSensorData();
// //
getStateEnum(); getStateEnum();
}); });
onUnmounted(() => {}); onUnmounted(() => {
clearInterval(intervalId);
});
</script> </script>
<style lang="less"> <style lang="less">
@import url('../style/color.less'); @import url('../style/color.less');

Loading…
Cancel
Save