From 54922e39c1c29043cebd985eb584faeec48154c5 Mon Sep 17 00:00:00 2001 From: sunmeng <1162067978@qq.com> Date: Fri, 20 Dec 2024 09:04:55 +0800 Subject: [PATCH] 1 --- src/views/page/realTime.vue | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/views/page/realTime.vue b/src/views/page/realTime.vue index e2c4349..4b11dce 100644 --- a/src/views/page/realTime.vue +++ b/src/views/page/realTime.vue @@ -937,19 +937,37 @@ export default { //3是(原数据-400) / 10 //4是(原数据-1000) / 10 countType1(data) { + if(data==undefined){ + return '' + } var num = data - 400 return num.toFixed(2) }, + countType5(data) { + if(data==undefined){ + return '' + } + var num = data / 100 + return num.toFixed(2) + }, countType2(data) { + if(data==undefined){ + return '' + } var num = data / 10 return num.toFixed(2) }, countType3(data) { - + if(data==undefined){ + return '' + } var num = (data - 400) / 10 return num.toFixed(2) }, countType4(data) { + if(data==undefined){ + return '' + } var num = (data - 1000) / 10 return num.toFixed(2) }, @@ -1477,17 +1495,17 @@ export default { this.api.getControlGetState(TargetValue).then(res => { if (res.data.code == 200) { this.voltData=res.data.data - this.voltData['1208']=this.countType2(res.data.data['1208']) + this.voltData['1208']=this.countType5(res.data.data['1208']) this.voltData['1209']=this.countType1(res.data.data['1209']) - this.voltData['1210']=this.countType2(res.data.data['1210']) + this.voltData['1210']=this.countType5(res.data.data['1210']) this.voltData['1211']=this.countType1(res.data.data['1211']) - this.voltData['1212']=this.countType2(res.data.data['1212']) + this.voltData['1212']=this.countType5(res.data.data['1212']) this.voltData['1213']=this.countType1(res.data.data['1213']) - this.voltData['1214']=this.countType2(res.data.data['1214']) + this.voltData['1214']=this.countType5(res.data.data['1214']) this.voltData['1215']=this.countType1(res.data.data['1215']) - this.voltData['1216']=this.countType2(res.data.data['1216']) + this.voltData['1216']=this.countType5(res.data.data['1216']) this.voltData['1217']=this.countType1(res.data.data['1217']) - this.voltData['1218']=this.countType2(res.data.data['1218']) + this.voltData['1218']=this.countType5(res.data.data['1218']) this.voltData['1219']=this.countType1(res.data.data['1219']) if (res.data.data["1119"]) { this.sunrise = this.insertColonEveryTwoDigits(