Browse Source

修改广合的风机频率和运行状态的问题

gh_ers
selia-zx 5 days ago
parent
commit
ef6117ad94
  1. 4
      .env.development
  2. 192
      src/views/centerairC/sysMonitor/monitorCenter.vue

4
.env.development

@ -7,11 +7,11 @@ ENV = 'development'
# 开发环境 # 开发环境
# VUE_APP_BASE_API = '/dev-api' # VUE_APP_BASE_API = '/dev-api'
# 后台 # 后台
VUE_APP_BASE_API = 'http://192.168.1.222:8080' # VUE_APP_BASE_API = 'http://192.168.1.222:8080'
# 梅州云端 # 梅州云端
# VUE_APP_BASE_API = 'http://106.55.173.225:8091' # VUE_APP_BASE_API = 'http://106.55.173.225:8091'
# 广合 # 广合
# VUE_APP_BASE_API = 'http://106.55.173.225:8092' VUE_APP_BASE_API = 'http://106.55.173.225:8092'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

192
src/views/centerairC/sysMonitor/monitorCenter.vue

@ -203,15 +203,15 @@
</div> </div>
<!-- 风机频率 --> <!-- 风机频率 -->
<div class="coolingTowerHz1" v-if="coolingTowerHz(1, 1) && coolingTowerRunClass(1, 1)"> <div class="coolingTowerHz1" v-if="coolingTowerHz(1, 1) && coolingTowerRunClass(1, 1)">
{{ coolingTowerHz1 }}Hz {{ coolingTowerHz(1, 1) }}Hz
</div> </div>
<div class="coolingTowerHz2" v-if="coolingTowerHz(1, 2) && coolingTowerRunClass(1, 2)"> <div class="coolingTowerHz2" v-if="coolingTowerHz(2, 1) && coolingTowerRunClass(2, 1)">
{{ coolingTowerHz2 }}Hz {{ coolingTowerHz(2, 1) }}Hz
</div> </div>
<!-- 1 号冷却塔风机1 --> <!-- 1 号冷却塔风机1 -->
<img class="fan-img1" v-if="coolingTowerRunClass(1, 1)" :class="{ moveClass2: coolingTowerRunClass(1, 1) }" <img class="fan-img1" v-if="coolingTowerRunClass(1, 1)" :class="{ moveClass2: coolingTowerRunClass(1, 1) }"
src="../../../assets/images/fan-img.png" alt="" /> src="../../../assets/images/fan-img.png" alt="" />
<img class="fan-img2" v-if="coolingTowerRunClass(1, 2)" :class="{ moveClass2: coolingTowerRunClass(1, 2) }" <img class="fan-img2" v-if="coolingTowerRunClass(2, 1)" :class="{ moveClass2: coolingTowerRunClass(2, 1) }"
src="../../../assets/images/fan-img.png" alt="" /> src="../../../assets/images/fan-img.png" alt="" />
<!-- 箭头 --> <!-- 箭头 -->
<img class="in-arrow" src="../../../assets/images/in-arrow.png" alt="" /> <img class="in-arrow" src="../../../assets/images/in-arrow.png" alt="" />
@ -222,8 +222,8 @@
<!-- 冷冻水流 --> <!-- 冷冻水流 -->
<div class="freezingOutWater">{{ freezingOutWater }}/h</div> <div class="freezingOutWater">{{ freezingOutWater }}/h</div>
<!-- 冷冻进出水压力 --> <!-- 冷冻进出水压力 -->
<div class="freezingInPre">{{ freezingInPre }}kpa</div> <div class="freezingInPre">{{ freezingInPre }}bar</div>
<div class="freezingOutPre">{{ freezingOutPre }}kpa</div> <div class="freezingOutPre">{{ freezingOutPre }}bar</div>
<!-- 冷却进出水温度 --> <!-- 冷却进出水温度 -->
<div class="coolingInTem">{{ coolingInTem }}</div> <div class="coolingInTem">{{ coolingInTem }}</div>
<div class="coolingOutTem">{{ coolingOutTem }}</div> <div class="coolingOutTem">{{ coolingOutTem }}</div>
@ -485,13 +485,13 @@ export default {
// 10 // 10
this.timer = setInterval(() => { this.timer = setInterval(() => {
// this.getWeatherData(); this.getWeatherData();
// this.getSystemMode(); this.getSystemMode();
// this.getPerformance(); this.getPerformance();
// this.getOneKeyButton(); this.getOneKeyButton();
// this.getMonitorList(); this.getMonitorList();
// this.getAlarnStatus(); this.getAlarnStatus();
// this.getDayData(); this.getDayData();
}, 10000); }, 10000);
// //
this.nowTimer = setInterval(() => { this.nowTimer = setInterval(() => {
@ -1310,152 +1310,52 @@ export default {
// //
return false; return false;
}, },
// ,index,11;itemx /** 冷却塔风机运行状态, index为冷却塔编号(如1号冷却塔), item为风机编号(如风机1) */
coolingTowerRunClass(index, item) { coolingTowerRunClass(index, item) {
// this.coolingTower deviceName index // coolingTower processDeviceList
let targetDevice = null; // properties collectName
for (let i = 0; i < this.coolingTower.length; i++) { for (let i = 0; i < this.coolingTower.length; i++) {
const device = this.coolingTower[i]; const device = this.coolingTower[i];
const deviceName = device.deviceName.toString(); const properties = device.properties;
// 使 deviceName , deviceName if (!properties || properties.length === 0) continue;
const firstWordMatch = deviceName.match(/^\d+/); for (let j = 0; j < properties.length; j++) {
if (firstWordMatch && firstWordMatch[0] === index.toString()) { const prop = properties[j];
targetDevice = device; const collectName = prop.collectName;
break; // collectName : "21_"
} if (
} collectName &&
collectName.includes(`${index}号冷却塔风机${item}`) &&
// false collectName.includes('运行状态') &&
if (!targetDevice) { prop.paramType === '1' &&
return false; Number(prop.collectValue) !== 0
} ) {
return true;
// properties
const properties = targetDevice.properties;
// properties
if (!properties || properties.length === 0) {
return false;
}
// paramType === 1
const filteredProperties = [];
let filterItem = {};
for (let i = 0; i < properties.length; i++) {
// console.log('properties[i].paramType',properties[i].paramType)
if (properties[i].paramType === "1") {
filteredProperties.push(properties[i]);
// filterItem = properties[i]
}
}
// // deviceList
// if (Object.keys(filterItem).length > 1) {
// filteredProperties.push(filterItem);
// }
// console.log("paramType1", filteredProperties);
// console.log("index, item", index, item);
// index item
const towerNumber = index;
const targetPropertyName = `${towerNumber}号冷却塔风机${item}运行`;
// console.log("targetPropertyName",targetPropertyName)
// collectValue "0.00"
for (let i = 0; i < filteredProperties.length; i++) {
const collectName = filteredProperties[i].collectName;
if (
collectName.includes(`${towerNumber}号冷却塔风机${item}`) &&
collectName.includes("运行") &&
Number(filteredProperties[i].collectValue) !== 0
) {
if (index === 0 && item === 1) {
// console.log(
// "true",
// filteredProperties[i].collectName === targetPropertyName &&
// Number(filteredProperties[i].collectValue) !== 0
// );
} }
return true;
} }
} }
//
return false; return false;
}, },
// ,index,11;itemx /** 冷却塔风机频率, index为冷却塔编号(如1号冷却塔), item为风机编号(如风机1),返回频率数值或false */
coolingTowerHz(index, item) { coolingTowerHz(index, item) {
// this.coolingTower deviceName index // coolingTower properties collectName
let targetDevice = null;
for (let i = 0; i < this.coolingTower.length; i++) { for (let i = 0; i < this.coolingTower.length; i++) {
const device = this.coolingTower[i]; const device = this.coolingTower[i];
const deviceName = device.deviceName.toString(); const properties = device.properties;
// 使 deviceName , deviceName if (!properties || properties.length === 0) continue;
const firstWordMatch = deviceName.match(/^\d+/); for (let j = 0; j < properties.length; j++) {
if (firstWordMatch && firstWordMatch[0] === index.toString()) { const prop = properties[j];
targetDevice = device; const collectName = prop.collectName;
break; // collectName : "21_"
} if (
} collectName &&
collectName.includes(`${index}号冷却塔风机${item}`) &&
// false collectName.includes('频率反馈') &&
if (!targetDevice) { prop.paramType === '4'
return false; ) {
} return Number(prop.collectValue);
}
// properties
const properties = targetDevice.properties;
// properties
if (!properties || properties.length === 0) {
return false;
}
// paramType === 4
const filteredProperties = [];
let filterItem = {};
for (let i = 0; i < properties.length; i++) {
// console.log('properties[i].paramType',properties[i].paramType)
if (properties[i].paramType === "4") {
filteredProperties.push(properties[i]);
// filterItem = properties[i]
}
}
// // deviceList
// if (Object.keys(filterItem).length > 1) {
// filteredProperties.push(filterItem);
// }
// console.log("paramType4", filteredProperties);
// console.log("index, item", index, item);
// index item
const towerNumber = index;
const targetPropertyName = `${towerNumber}号冷却塔风机${item}频率反馈`;
// console.log("targetPropertyName",targetPropertyName)
// console.log("filteredProperties",filteredProperties)
// collectValue "0.00"
for (let i = 0; i < filteredProperties.length; i++) {
const collectName = filteredProperties[i].collectName;
if (
collectName.includes(`${towerNumber}号冷却塔风机${item}`) &&
collectName.includes("频率反馈")
) {
// coolingTowerHz
const coolingTowerHzPropertyName = `coolingTowerHz${item}`;
// console.log(
// `coolingTowerHz${towerNumber}`,
// coolingTowerHzPropertyName
// );
// collectValue
const value = Number(filteredProperties[i].collectValue);
// 使
this[coolingTowerHzPropertyName] = value;
// console.log(
// "coolingTowerHzPropertyName])",
// coolingTowerHzPropertyName
// );
// console.log(`${coolingTowerHzPropertyName}`, value);
return true;
} }
} }
//
return false; return false;
}, },
// //

Loading…
Cancel
Save