|
@@ -9,7 +9,12 @@
|
|
|
<a-spin :spinning="loading" />
|
|
|
<div v-for="groupNum in monitorDataGroupNum" :key="groupNum" class="modal-monitor">
|
|
|
<fourBorderBg :class="`kyj${groupNum}`" :id="`nitrogenMonitor${groupNum}`">
|
|
|
- <div class="title">{{ monitorData[groupNum - 1]['strname'] }} </div>
|
|
|
+ <div class="title">
|
|
|
+ {{ monitorData[groupNum - 1]['strname'] }}
|
|
|
+ <span :style="{ color: monitorData[groupNum - 1]['AirCompressor_Status'] == '1' ? '#67fc00' : '#e9170b' }">
|
|
|
+ {{ monitorData[groupNum - 1]['AirCompressor_Status'] == '1' ? '(运行)' : '(停止)' }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
<template v-for="(preMonitor, preMonitorIndex) in preMonitorList" :key="preMonitorIndex">
|
|
|
<div v-if="preMonitor.code !== 'signal'" class="monitor-item">
|
|
|
<span class="monitor-title">{{ preMonitor.title }}:</span>
|
|
@@ -247,11 +252,12 @@
|
|
|
if (res) {
|
|
|
const result = res;
|
|
|
if (!result || result.msgTxt.length < 1) return;
|
|
|
+ monitorData.value = [];
|
|
|
result.msgTxt.forEach((item) => {
|
|
|
if (item.type && item.type.startsWith('nitrogen')) {
|
|
|
airCompressorState.length = 0;
|
|
|
let netStatus = 0;
|
|
|
- monitorData.value = item['datalist'].filter((data) => {
|
|
|
+ const dataList: any[] = item['datalist'].filter((data) => {
|
|
|
const readData = data.readData;
|
|
|
if (data['netStatus'] == 1) {
|
|
|
netStatus = 1;
|
|
@@ -264,23 +270,23 @@
|
|
|
});
|
|
|
return Object.assign(data, readData);
|
|
|
});
|
|
|
+ monitorData.value.push(...dataList);
|
|
|
monitorNetStatus.value = netStatus;
|
|
|
- console.log(monitorData, 'monitorData.value---===');
|
|
|
- const airCompressor = { readTime: monitorData.value[0]['readTime'].substring(11) };
|
|
|
- const dataArr = lodash.cloneDeep(echartData.value);
|
|
|
- //图表数据
|
|
|
- if (dataArr.length <= 5) {
|
|
|
- monitorData.value.forEach((el, index) => {
|
|
|
- airCompressor[`InputFlux${index + 1}`] = el['InputFlux'] || 0;
|
|
|
- });
|
|
|
- dataArr.push(airCompressor);
|
|
|
- } else {
|
|
|
- dataArr.shift();
|
|
|
- dataArr.push(airCompressor);
|
|
|
- }
|
|
|
- echartData.value = dataArr;
|
|
|
}
|
|
|
});
|
|
|
+ const airCompressor = { readTime: monitorData.value[0]['readTime'].substring(11) };
|
|
|
+ const dataArr = lodash.cloneDeep(echartData.value);
|
|
|
+ //图表数据
|
|
|
+ if (dataArr.length <= 5) {
|
|
|
+ monitorData.value.forEach((el, index) => {
|
|
|
+ airCompressor[`InputFlux${index + 1}`] = el['InputFlux'] || 0;
|
|
|
+ });
|
|
|
+ dataArr.push(airCompressor);
|
|
|
+ } else {
|
|
|
+ dataArr.shift();
|
|
|
+ dataArr.push(airCompressor);
|
|
|
+ }
|
|
|
+ echartData.value = dataArr;
|
|
|
if (flag) monitorDataGroupNum.value = monitorData.value.length;
|
|
|
refresh.value = true;
|
|
|
nextTick(() => {
|