Browse Source

fix:对接新风系统 修改计划获取的枚举

temp
zhaohy 3 months ago
parent
commit
a57c3d5b6c
  1. 1
      hx-ai-intelligent/src/api/airConditioningSystem.ts
  2. 0
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningBox.vue
  3. 11
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue
  4. 4
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/floorHeatingModel.vue
  5. 48
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTrendModel.vue
  6. 20
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/devicePosition.ts
  7. 91
      hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/index.vue
  8. 10
      hx-ai-intelligent/src/view/equipmentControl/components/doubleSingleModel.vue
  9. 20
      hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

1
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`, // 查询地暖最新状态
}

0
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/newTreedBox.vue → hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningBox.vue

11
hx-ai-intelligent/src/view/equipmentControl/airConditioningSystem/components/conditioningModel.vue

@ -53,10 +53,10 @@
<div class="box-bottom-item-line-value">
<a-switch
:disabled="true"
:checked="selectConditioning.enableRules === 1 ? true : false"
:checked="selectConditioning.state === 1 ? true : false"
:class="{
'blue-background': selectConditioning.enableRules === 1 ? true : false,
'grey-background': selectConditioning.enableRules === 1 ? false : true,
'blue-background': selectConditioning.state === 1 ? true : false,
'grey-background': selectConditioning.state === 1 ? false : true,
}" />
</div>
</div>
@ -64,7 +64,7 @@
<div style="width: 100%; height: 40px; line-height: 40px">温度 </div>
<div style="width: 100%; height: 60px">
<a-slider
v-model:value="selectConditioning.number"
v-model:value="selectConditioning.temp"
:marks="marks"
:min="0"
:max="100"
@ -82,7 +82,7 @@
<div style="width: 100%; height: 40px; line-height: 40px"> 风量 </div>
<div style="width: 100%; height: 60px">
<a-slider
v-model:value="selectConditioning.number"
v-model:value="selectConditioning.airVol"
:marks="marks"
:min="0"
:max="100"
@ -130,6 +130,7 @@
100: 100,
});
const toggle = (data: any, selectData: any) => {
console.log(data, selectData);
dataSource.value = data;
selectConditioning.value = selectData;
};

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

@ -16,7 +16,7 @@
<div class="box-bottom-item-line">
温度
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">{{ item.number }}</span>
<span style="color: #00ffd2">{{ item.temp }}{{ item.tempUnit }}</span>
</div>
</div>
<div class="box-bottom-item-line">
@ -28,7 +28,7 @@
<div class="box-bottom-item-line">
运行时间
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">0.08~0.4Mpa</span>
<span style="color: #00ffd2">{{ item.runTime }}{{ item.runTimeUnit }}</span>
</div>
</div>
</div>

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

@ -19,48 +19,76 @@
<a-tag
style="background-color: rgba(0, 0, 0, 0.5); width: 50px; text-align: center"
:style="{
border:
'1px solid' + { '0': '', '1': '', '2': '', '3': '' }[item.runStatus.value],
color: { '0': '', '1': '', '2': '', '3': '' }[item.runStatus.value],
border: {
'0': '1px solid rgba(0, 255, 210, 1)',
'1': '1px solid rgba(255, 118, 54, 1)',
'2': '1px solid rgba(255, 188, 70, 1)',
'3': '1px solid rgba(243, 97, 99, 1)',
}[item.runStatus.value],
color: {
'0': 'rgba(0, 255, 210, 1)',
'1': 'rgba(255, 118, 54, 1)',
'2': 'rgba(255, 188, 70, 1)',
'3': 'rgba(243, 97, 99, 1)',
}[item.runStatus.value],
}"
>开启</a-tag
>{{ item.runStatus.label }}</a-tag
>
<!-- <a-tag
v-if="item?.runStatus.value === '0'"
style="background-color: rgba(0, 0, 0, 0.5); width: 50px; text-align: center"
:style="{
border:
'1px solid' +
{
'0': 'rgba(191, 205, 226, 1)',
'1': 'rgba(0, 255, 210, 1)',
}[item.switchStatus.value],
color: {
'0': 'rgba(191, 205, 226, 1)',
'1': 'rgba(0, 255, 210, 1)',
}[item.switchStatus.value],
}">
{{ { '0': '关闭', '1': '开始' }[item.switchStatus.value] }}</a-tag
> -->
</div>
</div>
<div class="box-bottom-item-line">
电机转速
<div class="box-bottom-item-line-value">
<span style="color: #f59a23">1210/分钟</span>
<span style="color: #f59a23">{{ item.motorSp }}{{ item.motorSpUnit }}</span>
</div>
</div>
<div class="box-bottom-item-line">
换热器热度
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">8</span>
<span style="color: #00ffd2"
>{{ item.converterTemp }}{{ item.converterTempUnit }}</span
>
</div>
</div>
<div class="box-bottom-item-line">
风量
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">12345m3/h</span>
<span style="color: #00ffd2">{{ item.airVol }}{{ item.airVolUnit }}</span>
</div>
</div>
<div class="box-bottom-item-line">
风速
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">22m/s</span>
<span style="color: #00ffd2">{{ item.airSp }}{{ item.airSpUnit }}</span>
</div>
</div>
<div class="box-bottom-item-line">
PM2.5
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">30</span>
<span style="color: #00ffd2">{{ item.pm2_5 }}{{ item.pm2_5Unit }}</span>
</div>
</div>
<div class="box-bottom-item-line">
二氧化碳
<div class="box-bottom-item-line-value">
<span style="color: #00ffd2">123CO2e</span>
<span style="color: #00ffd2">{{ item.co_CO2 }}{{ item.co_CO2Unit }}</span>
</div>
</div>
</div>

20
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 },
];

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

@ -81,17 +81,18 @@
<div
style="position: absolute; z-index: 2"
:style="{
left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 13%)' : ' - 13.3%)'),
left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 12.8%)' : ' - 13%)'),
bottom:
'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 8.1%)' : ' - 14%)'),
'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 7%)' : ' - 14%)'),
}">
<doubleSingleModel :dataSource="item" />
</div>
<img
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%)'),
left: 'calc(' + item.styleText.left + (item.lineType === 1 ? ' - 1.5%)' : ' - 1.8%)'),
bottom:
'calc(' + item.styleText.bottom + (item.lineType === 1 ? ' + 4.5%)' : ' - 9%)'),
transform: item.lineType === 1 ? 'rotateY(180deg)' : 'rotate(180deg)',
}"
src="../image/liftState/lift/line.png" />
@ -115,12 +116,12 @@
ref="conditioningModels"
@selectConditioningData="selectConditioningData" />
</a-drawer>
<!-- 空调箱 顶部详情 -->
<!-- 空调箱 顶部详情 现阶段没有数据 先隐藏掉 -->
<transition name="zep">
<div
v-if="selectIndex === 3 && selectConditioning && selectConditioning?.title"
v-if="selectIndex === 3 && selectConditioning && selectConditioning?.title && false"
class="newTrend-box">
<newTreedBox :selectConditioning="selectConditioning" />
<conditioningBox :selectConditioning="selectConditioning" />
</div>
</transition>
<!-- 地暖 -->
@ -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);

10
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';

20
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) => {

Loading…
Cancel
Save