From a57c3d5b6cee5024bf03b6fe349e17f8888ce554 Mon Sep 17 00:00:00 2001
From: zhaohy <1695786511@qq.com>
Date: Thu, 22 Aug 2024 13:26:00 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E5=AF=B9=E6=8E=A5=E6=96=B0=E9=A3=8E?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9F=20=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92?=
=?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=9A=84=E6=9E=9A=E4=B8=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/api/airConditioningSystem.ts | 1 +
.../{newTreedBox.vue => conditioningBox.vue} | 0
.../components/conditioningModel.vue | 11 ++-
.../components/floorHeatingModel.vue | 4 +-
.../components/newTrendModel.vue | 48 ++++++++--
.../airConditioningSystem/devicePosition.ts | 20 ++++
.../airConditioningSystem/index.vue | 91 ++++++++++++++++---
.../components/doubleSingleModel.vue | 10 +-
.../view/equipmentControl/planToAdd/index.vue | 20 ++--
9 files changed, 158 insertions(+), 47 deletions(-)
rename hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/{newTreedBox.vue => conditioningBox.vue} (100%)
diff --git a/hx-ai-intelligent/src/api/airConditioningSystem.ts b/hx-ai-intelligent/src/api/airConditioningSystem.ts
index 47d6418..2cd6a00 100644
--- a/hx-ai-intelligent/src/api/airConditioningSystem.ts
+++ b/hx-ai-intelligent/src/api/airConditioningSystem.ts
@@ -3,4 +3,5 @@ import { BASE_URL } from './index';
export enum airConditioningSystemApi {
getVentHostCtrlList = `${BASE_URL}/api/ventHostCtrl/getDeviceState`, // 查询新风主机最新状态
getAcBoxCtrlList = `${BASE_URL}/api/acBoxCtrl/getDeviceState`, // 查询空调箱最新状态
+ getTempSysCtrlList = `${BASE_URL}/api/tempSysCtrl/getFloorHeatingState`, // 查询地暖最新状态
}
diff --git a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTreedBox.vue b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningBox.vue
similarity index 100%
rename from hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTreedBox.vue
rename to hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningBox.vue
diff --git a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue
index d253b5a..85ed84f 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue
@@ -53,10 +53,10 @@
@@ -64,7 +64,7 @@
温度
{
+ console.log(data, selectData);
dataSource.value = data;
selectConditioning.value = selectData;
};
diff --git a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/floorHeatingModel.vue b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/floorHeatingModel.vue
index 8fa9b45..dc246fc 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/floorHeatingModel.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/floorHeatingModel.vue
@@ -16,7 +16,7 @@
温度
- {{ item.number }}℃
+ {{ item.temp }}{{ item.tempUnit }}
@@ -28,7 +28,7 @@
运行时间
- 0.08~0.4Mpa
+ {{ item.runTime }}{{ item.runTimeUnit }}
diff --git a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue
index ec70d53..df4da09 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue
@@ -19,48 +19,76 @@
开启{{ item.runStatus.label }}
+
电机转速
- 1210转/分钟
+ {{ item.motorSp }}{{ item.motorSpUnit }}
换热器热度
- 8℃
+ {{ item.converterTemp }}{{ item.converterTempUnit }}
风量
- 12345m3/h
+ {{ item.airVol }}{{ item.airVolUnit }}
风速
- 22m/s
+ {{ item.airSp }}{{ item.airSpUnit }}
PM2.5
- 30
+ {{ item.pm2_5 }}{{ item.pm2_5Unit }}
二氧化碳
- 123CO2e
+ {{ item.co_CO2 }}{{ item.co_CO2Unit }}
diff --git a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts
index d54fea1..64411a1 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts
+++ b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts
@@ -16,3 +16,23 @@ export const newTrendPosition = [
{ left: '61.5%', bottom: '54%' },
{ left: '63%', bottom: '36%' },
];
+//空调箱
+export const airConditioningPosition = [
+ { styleText: { left: '13%', bottom: '23%' }, lineType: 1 },
+ { styleText: { left: '28%', bottom: '28%' }, lineType: 1 },
+ { styleText: { left: '38%', bottom: '45.5%' }, lineType: 1 },
+ { styleText: { left: '38%', bottom: '45.5%' }, lineType: 1 },
+ { styleText: { left: '57%', bottom: '53%' }, lineType: 1 },
+ { styleText: { left: '73%', bottom: '53%' }, lineType: 1 },
+ { styleText: { left: '68%', bottom: '38%' }, lineType: '' },
+ { styleText: { left: '43.5%', bottom: '22%' }, lineType: '' },
+];
+//地暖
+export const floorHeatingPosition = [
+ { styleText: { left: '13.5%', bottom: '34%' }, lineType: '' },
+ { styleText: { left: '19.5%', bottom: '38.5%' }, lineType: 1 },
+ { styleText: { left: '33%', bottom: '43%' }, lineType: 1 },
+ { styleText: { left: '46%', bottom: '49.5%' }, lineType: 1 },
+ { styleText: { left: '57.5%', bottom: '56%' }, lineType: 1 },
+ { styleText: { left: '69.5%', bottom: '62%' }, lineType: 1 },
+];
diff --git a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
index acf191d..6ec4541 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
@@ -81,17 +81,18 @@
@@ -115,12 +116,12 @@
ref="conditioningModels"
@selectConditioningData="selectConditioningData" />
-
+
-
+
@@ -183,7 +184,7 @@
import doubleSingleModel from '../components/doubleSingleModel.vue';
import newTrendModel from './components/newTrendModel.vue';
import conditioningModel from './components/conditioningModel.vue';
- import newTreedBox from './components/newTreedBox.vue';
+ import conditioningBox from './components/conditioningBox.vue';
import floorHeatingModel from './components/floorHeatingModel.vue';
import { http } from '/nerv-lib/util/http';
import { ventilating } from '/@/api/ventilatingSystem';
@@ -192,7 +193,12 @@
// 全局变量
import { items } from '/@/store/item';
// 定位数据
- import { devicePosition, newTrendPosition } from './devicePosition';
+ import {
+ devicePosition,
+ newTrendPosition,
+ airConditioningPosition,
+ floorHeatingPosition,
+ } from './devicePosition';
// 全局变量
const state = items();
onMounted(() => {});
@@ -457,7 +463,6 @@
siteId: state.siteId,
})
.then((res) => {
- console.log(res);
if (res.msg === 'success') {
res.data.forEach((item: any, index: number) => {
newTrend.value.push({
@@ -473,13 +478,69 @@
}
});
};
- //实时获取数据 暂定一分钟
- const intervalId = setInterval(getSensorData, 60000);
- onMounted(() => {
- //获取传感器数据
+ const getAcBoxCtrlList = () => {
+ conditioningData.value = [];
+ http
+ .get(airConditioningSystemApi.getAcBoxCtrlList, {
+ projectId: state.projectId,
+ siteId: state.siteId,
+ })
+ .then((res) => {
+ if (res.msg === 'success') {
+ res.data.forEach((item: any, index: number) => {
+ conditioningData.value.push({
+ title: item.deviceInfoName,
+ styleText: airConditioningPosition[index].styleText,
+ type: '空调箱',
+ numberUnit: item.record.tempUnit,
+ lineType: airConditioningPosition[index].lineType,
+ number: item.record.temp,
+ url: freshAir,
+ state: item.record.switchStatus.value,
+ ...item.record,
+ });
+ });
+ }
+ });
+ };
+ const getTempSysCtrlList = () => {
+ floorHeatingData.value = [];
+ http
+ .get(airConditioningSystemApi.getTempSysCtrlList, {
+ projectId: state.projectId,
+ siteId: state.siteId,
+ })
+ .then((res) => {
+ console.log(res, '地暖');
+ if (res.msg === 'success') {
+ res.data.forEach((item: any, index: number) => {
+ floorHeatingData.value.push({
+ title: item.deviceInfoName,
+ styleText: floorHeatingPosition[index].styleText,
+ type: '地暖',
+ number: item.record.temp,
+ numberUnit: item.record.tempUnit,
+ lineType: floorHeatingPosition[index].lineType,
+ ...item.record,
+ });
+ });
+ }
+ });
+ };
+ const fetchData = () => {
+ //传感器
getSensorData();
- //获取新风主机
+ //新风主机
getnewTrendData();
+ //获取空调箱
+ getAcBoxCtrlList();
+ //获取地暖
+ getTempSysCtrlList();
+ };
+ //实时获取数据 暂定一分钟
+ const intervalId = setInterval(fetchData, 60000);
+ onMounted(() => {
+ fetchData();
});
onUnmounted(() => {
clearInterval(intervalId);
diff --git a/hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue b/hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue
index 7b7a4d8..9b75557 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue
@@ -65,22 +65,22 @@
const props = defineProps({
dataSource: {
type: Object,
- default: () => ({ title: '', converterTemp: 0 }), // 假设默认值还包括number属性
+ default: () => ({ title: '', number: 0 }), // 假设默认值还包括number属性
},
});
const getSunUrl = () => {
- if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
+ if (props.dataSource.number >= 0 && props.dataSource.number < 20) {
return sunGreen;
- } else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
+ } else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
return sunYellow;
} else {
return sunRed;
}
};
const getColor = () => {
- if (props.dataSource.converterTemp > 0 && props.dataSource.converterTemp < 20) {
+ if (props.dataSource.number >= 0 && props.dataSource.number < 20) {
return '#0dffa4';
- } else if (props.dataSource.converterTemp >= 20 && props.dataSource.converterTemp < 30) {
+ } else if (props.dataSource.number >= 20 && props.dataSource.number < 30) {
return '#f59a23';
} else {
return '#f36163';
diff --git a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
index e087c94..df8920a 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
@@ -41,7 +41,7 @@
{ field: 'planGroupName', component: 'NsInput', show: false },
{ field: 'planName', component: 'NsInput', show: false },
{ field: 'projectId', component: 'NsInput', show: false },
- { field: 'deviceType', component: 'NsInput', show: false },
+ { field: 'ctrlType', component: 'NsInput', show: false },
{ field: 'orgId', component: 'NsInput', show: false },
{
field: 'createTime',
@@ -74,27 +74,27 @@
});
const config = ref(null);
const enumDataList: any = () => {
- return getEnum({ params: { enumType: 'CtrlDeviceType' } });
+ return getEnum({ params: { enumType: 'DeviceCtrlType' } });
};
const getConfigData = async () => {
const enumData = await enumDataList();
config.value = {
title: '计划库',
api: planToAddApi.getActivatedPlanListByTree,
- params: { orgId, projectId, deviceType: enumData.data[0].value },
+ params: { orgId, projectId, ctrlType: enumData.data[0].value },
treeConfig: {
defaultExpandAll: true,
header: {
icon: 'name',
title: '执行计划',
},
- params: { projectId, deviceType: enumData.data[0].value },
+ params: { projectId, ctrlType: enumData.data[0].value },
dynamicParams: {
id: 'id',
pid: 'pid',
level: 'level',
projectId: 'projectId',
- deviceType: 'deviceType',
+ ctrlType: 'ctrlType',
},
api: planToAddApi.getActivatedPlanTree,
fieldNames: {
@@ -103,23 +103,23 @@
pid: 'pid',
level: 'level',
projectId: 'projectId',
- deviceType: 'deviceType',
+ ctrlType: 'ctrlType',
children: 'childList',
},
formConfig: {
schemas: [
{
- field: 'deviceType',
- label: '告警优先级',
+ field: 'ctrlType',
+ label: '类型',
component: 'nsSelectApi',
autoSubmit: true,
componentProps: {
- api: () => getEnum({ params: { enumType: 'CtrlDeviceType' } }),
+ api: () => getEnum({ params: { enumType: 'DeviceCtrlType' } }),
immediate: true,
resultField: 'data',
labelField: 'label',
valueField: 'value',
- placeholder: '请选择告警优先级',
+ placeholder: '请选择',
showSearch: true,
autoSelectFirst: true,
filterOption: (input: string, option: any) => {