Browse Source

节能率

guoxiaohuan 5 years ago
parent
commit
72c3944dd7
2 changed files with 74 additions and 28 deletions
  1. 51 22
      src/views/evaluate/evTwoLevelMenu.vue
  2. 23 6
      src/views/evaluate/index.vue

+ 51 - 22
src/views/evaluate/evTwoLevelMenu.vue

@@ -205,28 +205,29 @@ export default {
             this.energySavingRate = ''
             this.chillerExecuteRateReal = ''
             querychiller(params).then(res => {
-                // 节能率
-                if (res.content[0].energySavingRate != undefined) {
-                    if (res.content[0].energySavingRate == -9999) {
-                        this.energySavingRate = 'x'
-                    } else {
-                        this.energySavingRate = res.content[0].energySavingRate.toFixed(1)
-                    }
-                } else {
-                    this.energySavingRate = '--'
-                }
-                console.log('节能率', this.energySavingRate)
-                // 准确率
-                if (res.content[0].accuracy != undefined) {
-                    if (res.content[0].accuracy == -9999) {
-                        this.accuracy = 'x'
-                    } else {
-                        this.accuracy = res.content[0].accuracy.toFixed(1)
-                    }
-                } else {
-                    this.accuracy = '--'
-                }
-                console.log('准确率', this.accuracy)
+                console.log('res', res)
+                // // 节能率
+                // if (res.content[0].energySavingRate != undefined) {
+                //     if (res.content[0].energySavingRate == -9999) {
+                //         this.energySavingRate = 'x'
+                //     } else {
+                //         this.energySavingRate = res.content[0].energySavingRate.toFixed(1)
+                //     }
+                // } else {
+                //     this.energySavingRate = '--'
+                // }
+                // console.log('节能率', this.energySavingRate)
+                // // 准确率
+                // if (res.content[0].accuracy != undefined) {
+                //     if (res.content[0].accuracy == -9999) {
+                //         this.accuracy = 'x'
+                //     } else {
+                //         this.accuracy = res.content[0].accuracy.toFixed(1)
+                //     }
+                // } else {
+                //     this.accuracy = '--'
+                // }
+                // console.log('准确率', this.accuracy)
 
                 //执行率
                 if (res.content[0].chillerExecuteRateReal != undefined) {
@@ -271,9 +272,37 @@ export default {
             this.similarDay = {}
             this.samples = []
             energyDayQuery(date, {}).then(res => {
+                console.log('sssssssssss', res)
                 if (res.result == 'success') {
                     // 本日概况
                     this.current = res.current ? res.current : {}
+                    if (Object.keys(res.current).length > 0) {
+                        this.energySavingRate = res.current.energySavingRate
+                        this.accuracy = res.current.accuracy
+
+                        // 节能率
+                        if (this.energySavingRate != undefined) {
+                            if (this.energySavingRate == -9999) {
+                                this.energySavingRate = 'x'
+                            } else {
+                                this.energySavingRate = this.energySavingRate.toFixed(1)
+                            }
+                        } else {
+                            this.energySavingRate = '--'
+                        }
+                        console.log('节能率', this.energySavingRate)
+                        // 准确率
+                        if (this.accuracy != undefined) {
+                            if (this.accuracy == -9999) {
+                                this.accuracy = 'x'
+                            } else {
+                                this.accuracy = this.accuracy.toFixed(1)
+                            }
+                        } else {
+                            this.accuracy = '--'
+                        }
+                        console.log('准确率', this.accuracy)
+                    }
                     console.log('相似度', this.current.similarity)
                     // 相似日概况
                     this.similarDay = res.similarDay ? res.similarDay : {}

+ 23 - 6
src/views/evaluate/index.vue

@@ -161,7 +161,7 @@ export default {
                         },
                         data: [
                             {
-                                value: data,
+                                value: data == 'x' || data == '--' ? 0 : data,
                                 label: {
                                     normal: {
                                         show: true
@@ -169,7 +169,7 @@ export default {
                                 }
                             },
                             {
-                                value: 100 - data,
+                                value: data == 'x' || data == '--' ? 100 : 100 - data,
                                 name: '',
                                 label: {
                                     normal: {
@@ -203,12 +203,16 @@ export default {
             }
             runDataQury(null, { getParams }).then(res => {
                 if (res.result == 'success') {
-                    this.tindoorFillRate = res.tindoorFillRate != undefined && res.tindoorFillRate != -9999 ? res.tindoorFillRate.toFixed(1) : 0 //室内温度满足率
+                    // this.tindoorFillRate = res.tindoorFillRate != undefined && res.tindoorFillRate != -9999 ? res.tindoorFillRate.toFixed(1) : 0 //室内温度满足率
+                    this.tindoorFillRate = this.formatterRate(res.tindoorFillRate)
                     console.log('室内温度满足率', this.tindoorFillRate)
-                    this.energySavingRate = res.energySavingRate != undefined && res.energySavingRate != -9999 ? res.energySavingRate.toFixed(1) : 0 //节能率
+                    // this.energySavingRate = res.energySavingRate != undefined && res.energySavingRate != -9999 ? res.energySavingRate.toFixed(1) : 0 //节能率
+                    this.energySavingRate = this.formatterRate(res.energySavingRate)
                     console.log('节能率', this.energySavingRate)
-                    this.chillerExecuteRate =
-                        res.chillerExecuteRate != undefined && res.chillerExecuteRate != -9999 ? res.chillerExecuteRate.toFixed(1) : 0 //略执行率
+                    // this.chillerExecuteRate =
+                    //     res.chillerExecuteRate != undefined && res.chillerExecuteRate != -9999 ? res.chillerExecuteRate.toFixed(1) : 0 //略执行率
+                    this.chillerExecuteRate = this.formatterRate(res.chillerExecuteRate)
+
                     console.log('略执行率', this.chillerExecuteRate)
                     this.energySaving = res.energySaving != undefined && res.energySaving != -9999 ? res.energySaving.toFixed(0) : 0 //节能量
                     console.log('节能量', this.energySaving)
@@ -224,6 +228,19 @@ export default {
                 }
             })
         },
+        formatterRate(num) {
+            if (num != undefined) {
+                if (num == '-9999') {
+                    return 'x'
+                } else if (num == '-9998') {
+                    return '--'
+                } else {
+                    return num.toFixed(1)
+                }
+            } else {
+                return 0
+            }
+        },
         queryRate() {
             if (this.tindoorFillRate) {
                 this.rate(this.tindoorFillRate, '#rate1', ['#0091FF', '#E1F2FF'])