平均/目标修改

pull/96/head
孙萌 2024-01-19 10:32:51 +08:00
parent 3768e57d72
commit 5edf37db7c
1 changed files with 25 additions and 27 deletions

View File

@ -1,7 +1,8 @@
<template> <template>
<div class="formula realTime"> <div class="formula realTime">
<!-- 生态气象站 --> <!-- 生态气象站 -->
<div class="page-content new-data" v-if="deviceName == 30" :class="deviceName == 10 || deviceName == 30 ? 'control-page' : ''"> <div class="page-content new-data" v-if="deviceName == 30"
:class="deviceName == 10 || deviceName == 30 ? 'control-page' : ''">
<div class="table-title"> <div class="table-title">
<img src="../../assets/image/real-time.png" alt="" /> <img src="../../assets/image/real-time.png" alt="" />
@ -12,7 +13,7 @@
}}</span> --> }}</span> -->
{{ list[0].updateTime ? list[0].updateTime : '' }} {{ list[0].updateTime ? list[0].updateTime : '' }}
</div> </div>
<div class="flex-list realTime-bottom" :class="deviceName==30?'weather':''"> <div class="flex-list realTime-bottom" :class="deviceName == 30 ? 'weather' : ''">
<div class="left-view-new"> <div class="left-view-new">
<div class="list-view" v-for="item, index in list " :key="index"> <div class="list-view" v-for="item, index in list " :key="index">
<img :src="item.img" alt=""> <img :src="item.img" alt="">
@ -502,7 +503,7 @@ export default {
this.deviceName = store.equipmentList[this.indexs - 1].deviceName this.deviceName = store.equipmentList[this.indexs - 1].deviceName
this.deviceState = store.equipmentList[this.indexs - 1].deviceState this.deviceState = store.equipmentList[this.indexs - 1].deviceState
// this.getTime() // this.getTime()
console.log(store.equipmentList[this.indexs - 1].deviceName,this.indexs - 1,77); console.log(store.equipmentList[this.indexs - 1].deviceName, this.indexs - 1, 77);
setTimeout(() => { setTimeout(() => {
that.dataInit(); that.dataInit();
that.timer && clearInterval(that.timer) that.timer && clearInterval(that.timer)
@ -855,24 +856,25 @@ export default {
// name = '2#' + el.environmentDataId // name = '2#' + el.environmentDataId
// } // }
// } else { // } else {
// name = el.equipmentNumber + '#' + el.environmentDataId // if (el.targetValue == 1) {
// name = el.equipmentNumber + '#' + el.environmentDataId
// } else {
// name = el.equipmentNumber + '#' + el.environmentDataId
// }
// } // }
if (el.equipmentNumber == 0) { if (el.targetValue == 1) {
name = '目标' + el.environmentDataId
name = '1#平均' + el.environmentDataId
} else if (el.equipmentNumber == 15) {
name = '2#平均' + el.environmentDataId
} else { } else {
if (el.targetValue == 1) { if (el.equipmentNumber == 0) {
name = el.equipmentNumber + '#目标' + el.environmentDataId name = '1#平均' + el.environmentDataId
} else if (el.equipmentNumber == 15) {
name = '2#平均' + el.environmentDataId
} else { } else {
name = el.equipmentNumber + '#' + el.environmentDataId name = el.equipmentNumber + '#' + el.environmentDataId
} }
} }
this.list.push({ this.list.push({
...el, ...el,
name: name, name: name,
@ -942,17 +944,13 @@ export default {
num = el.environmentData + el1.unit num = el.environmentData + el1.unit
} }
// } // }
if (el.equipmentNumber == 0) { if (el.targetValue == 1) {
name = '目标' + el.environmentDataId
name = '1#平均' + el.environmentDataId
} else if (el.equipmentNumber == 15) {
name = '2#平均' + el.environmentDataId
} else { } else {
if (el.targetValue == 1) { if (el.equipmentNumber == 0) {
name = el.equipmentNumber + '#目标' + el.environmentDataId name = '1#平均' + el.environmentDataId
} else if (el.equipmentNumber == 15) {
name = '2#平均' + el.environmentDataId
} else { } else {
name = el.equipmentNumber + '#' + el.environmentDataId name = el.equipmentNumber + '#' + el.environmentDataId
} }
@ -1038,20 +1036,20 @@ export default {
} else if (this.deviceName == 30) { } else if (this.deviceName == 30) {
this.api.getControlRtDatastation(formData).then(res => { this.api.getControlRtDatastation(formData).then(res => {
this.controlList = [] this.controlList = []
this.list=[] this.list = []
if (res.data.code == 200) { if (res.data.code == 200) {
res.data.data.forEach((el, index) => { res.data.data.forEach((el, index) => {
list.forEach((el1, index1) => { list.forEach((el1, index1) => {
if (el.formula == el1.value) { if (el.formula == el1.value) {
// console.log(el1); // console.log(el1);
var num = 0 var num = 0
var name='' var name = ''
if (el.equipmentStart == 0) { if (el.equipmentStart == 0) {
num = '故障' num = '故障'
} else { } else {
num = el.environmentData + el1.unit num = el.environmentData + el1.unit
} }
this.list.push({ this.list.push({
...el, ...el,
name: el.environmentDataId, name: el.environmentDataId,