|
@@ -106,7 +106,7 @@
|
|
import echartLine from '../common/echartLine.vue';
|
|
import echartLine from '../common/echartLine.vue';
|
|
import MeasurePoint from '../common/measurePoint.vue';
|
|
import MeasurePoint from '../common/measurePoint.vue';
|
|
import { ventTunColumns } from '../alarm.data';
|
|
import { ventTunColumns } from '../alarm.data';
|
|
- import { realTimeNetCal } from '../alarm.api';
|
|
|
|
|
|
+ import { realTimeNetCal, modalParam } from '../alarm.api';
|
|
// import moment from 'moment';
|
|
// import moment from 'moment';
|
|
|
|
|
|
//巷道阻力分析数据
|
|
//巷道阻力分析数据
|
|
@@ -382,30 +382,33 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
async function getRealTimeNetData() {
|
|
async function getRealTimeNetData() {
|
|
- const res = await realTimeNetCal({ modelID: '8110' });
|
|
|
|
- if (res && res['result']) ventTunDataSource.value = res['result']['tuns'];
|
|
|
|
- let data = [];
|
|
|
|
- ventTunDataSource.value.forEach((el) => {
|
|
|
|
- if (el['dHTotal'] && el['oldHTotal']) {
|
|
|
|
- el['leveld'] = ((el['dHTotal'] - el['oldHTotal']) / el['oldHTotal']) * 100;
|
|
|
|
- data.push(el['leveld']);
|
|
|
|
|
|
+ const modalData = await modalParam({});
|
|
|
|
+ if (modalData && modalData.param && modalData.param.records.length && modalData.param.records.length > 0) {
|
|
|
|
+ const res = await realTimeNetCal({ modelID: modalData.param.records[0]['defaultmodelid'] });
|
|
|
|
+ if (res && res['result']) ventTunDataSource.value = res['result']['tuns'];
|
|
|
|
+ let data = [];
|
|
|
|
+ ventTunDataSource.value.forEach((el) => {
|
|
|
|
+ if (el['dHTotal'] && el['oldHTotal']) {
|
|
|
|
+ el['leveld'] = ((el['dHTotal'] - el['oldHTotal']) / el['oldHTotal']) * 100;
|
|
|
|
+ data.push(el['leveld']);
|
|
|
|
+ } else {
|
|
|
|
+ data = [];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ let maxLevel = data.length != 0 ? data.reduce((a, b) => (a.leveld > b.leveld ? a : b)).leveld : 0;
|
|
|
|
+ // hdData.address = data.length != 0 ? data.reduce((a, b) => (a.leveld > b.leveld ? a : b)).strName : '';
|
|
|
|
+ console.log(hdData.maxLevel);
|
|
|
|
+ if (maxLevel == 0) {
|
|
|
|
+ hdData.maxLevel = '正常';
|
|
|
|
+ } else if (maxLevel > 0 && maxLevel <= 1) {
|
|
|
|
+ hdData.maxLevel = '低风险';
|
|
|
|
+ } else if (maxLevel > 1 && maxLevel <= 3) {
|
|
|
|
+ hdData.maxLevel = '一般风险';
|
|
|
|
+ } else if (maxLevel > 3 && maxLevel <= 5) {
|
|
|
|
+ hdData.maxLevel = '较大风险';
|
|
} else {
|
|
} else {
|
|
- data = [];
|
|
|
|
|
|
+ hdData.maxLevel = '重大风险';
|
|
}
|
|
}
|
|
- });
|
|
|
|
- let maxLevel = data.length != 0 ? data.reduce((a, b) => (a.leveld > b.leveld ? a : b)).leveld : 0;
|
|
|
|
- // hdData.address = data.length != 0 ? data.reduce((a, b) => (a.leveld > b.leveld ? a : b)).strName : '';
|
|
|
|
- console.log(hdData.maxLevel);
|
|
|
|
- if (maxLevel == 0) {
|
|
|
|
- hdData.maxLevel = '正常';
|
|
|
|
- } else if (maxLevel > 0 && maxLevel <= 1) {
|
|
|
|
- hdData.maxLevel = '低风险';
|
|
|
|
- } else if (maxLevel > 1 && maxLevel <= 3) {
|
|
|
|
- hdData.maxLevel = '一般风险';
|
|
|
|
- } else if (maxLevel > 3 && maxLevel <= 5) {
|
|
|
|
- hdData.maxLevel = '较大风险';
|
|
|
|
- } else {
|
|
|
|
- hdData.maxLevel = '重大风险';
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|