|
|
|
@ -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 }}m³/h</div> |
|
|
|
<div class="freezingOutWater">{{ freezingOutWater }}m³/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为多少号风机,1表示1号风机;item表示风机x |
|
|
|
/** 冷却塔风机运行状态, 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 格式: "2号冷却塔风机1_运行状态" |
|
|
|
} |
|
|
|
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("paramType为1的对象", 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为多少号风机,1表示1号风机;item表示风机x |
|
|
|
/** 冷却塔风机频率, 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 格式: "2号冷却塔风机1_频率反馈" |
|
|
|
} |
|
|
|
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("paramType为4的对象", 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; |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 冷却塔出水蝶阀启停状态 |
|
|
|
// 冷却塔出水蝶阀启停状态 |
|
|
|
|