guoxiaohuan 5 years ago
parent
commit
3628a39e91

+ 6 - 4
src/views/appeal/appealDetail.vue

@@ -43,11 +43,13 @@
                     申请原因描述:
                     <b style='font-size: 14px;font-weight: normal;color: #646c73;'>{{detailObj.reason||'--'}}</b>
                 </span>
-                 <span>
+                <span>
                     审核结果:
-                    <b style='font-size: 14px;font-weight: normal;color: #646c73;'>{{detailObj.status=='303'?'通过':(detailObj.status=='304'?'不通过':(detailObj.status=='306'?'过期未申诉':'--'))}}</b>
+                    <b
+                        style='font-size: 14px;font-weight: normal;color: #646c73;'
+                    >{{detailObj.status=='303'?'通过':(detailObj.status=='304'?'不通过':(detailObj.status=='306'?'过期未申诉':'--'))}}</b>
                 </span>
-                 <span>
+                <span>
                     审批意见:
                     <b style='font-size: 14px;font-weight: normal;color: #646c73;'>{{detailObj.comment||'--'}}</b>
                 </span>
@@ -206,7 +208,7 @@ export default {
                 if (res.result == 'success') {
                     this.$message.success('申诉成功')
                 } else {
-                    this.$message.error('申诉失败: ' + res.message)
+                    this.$message.error('申诉提示: ' + res.message)
                 }
                 this.$router.push('/appeal')
             })

+ 1 - 1
src/views/appeal/appealDetails.vue

@@ -173,7 +173,7 @@ export default {
                 if (res.result == 'success') {
                     this.$message.success('申诉成功')
                 } else {
-                    this.$message.error('申诉失败: ' + res.message)
+                    this.$message.error('申诉提示: ' + res.message)
                 }
                 this.$router.push('/strategy')
             })

+ 42 - 30
src/views/evaluate/evHistory.vue

@@ -9,42 +9,27 @@
         </p>
         <div class='count-data'>
             <div class='outdoor'>
-                <div
-                    class='outdoor-left'
-                    :style='{"height":maxArr[0]=="--"?0+ "px":((current.tempOutdoor!="--"?current.tempOutdoor:0)/maxArr[0])*160 + "px"}'
-                >
-                    <span>{{current.tempOutdoor=="--"?"--":current.tempOutdoor.toFixed(1)}}℃</span>
+                <div class='outdoor-left' :style='{"height":formatter(current.tempOutdoor,maxArr[0])+ "px"}'>
+                    <span>{{formatterNum(current.tempOutdoor,1)}}℃</span>
                 </div>
-                <div
-                    class='outdoor-right'
-                    :style='{"height":maxArr[0]=="--"?0+ "px":((similarDay.tempOutdoor!="--"?similarDay.tempOutdoor:0)/maxArr[0])*160 + "px"}'
-                >
-                    <span>{{similarDay.tempOutdoor=="--"?"--":similarDay.tempOutdoor.toFixed(1)}}℃</span>
+                <div class='outdoor-right' :style='{"height":formatter(similarDay.tempOutdoor,maxArr[0])+ "px"}'>
+                    <span>{{formatterNum(similarDay.tempOutdoor,1)}}℃</span>
                 </div>
             </div>
             <div class='indoor'>
-                <div
-                    class='indoor-left'
-                    :style='{"height":maxArr[1]=="--"?0+ "px": ((current.tempIndoor!="--"?current.tempIndoor:0)/maxArr[1])*160 + "px"}'
-                >
-                    <span>{{current.tempIndoor=="--"?"--":current.tempIndoor.toFixed(1)}}℃</span>
+                <div class='indoor-left' :style='{"height":formatter(current.tempIndoor,maxArr[1])+ "px"}'>
+                    <span>{{formatterNum(current.tempIndoor,1)}}℃</span>
                 </div>
-                <div
-                    class='indoor-right'
-                    :style='{"height":maxArr[1]=="--"?0+ "px": ((similarDay.tempIndoor!="--"?similarDay.tempIndoor:0)/maxArr[1])*160 + "px"}'
-                >
-                    <span>{{similarDay.tempIndoor=="--"?"--":similarDay.tempIndoor.toFixed(1)}}℃</span>
+                <div class='indoor-right' :style='{"height":formatter(similarDay.tempIndoor,maxArr[1])+ "px"}'>
+                    <span>{{formatterNum(similarDay.tempIndoor,1)}}℃</span>
                 </div>
             </div>
             <div class='coldWar'>
-                <div class='coldWar-left' :style='{"height":maxArr[2]=="--"?0+ "px": ((current.energy!="--"?current.energy:0)/maxArr[2])*160 + "px"}'>
-                    <span>{{current.energy=="--"?"--":current.energy.toFixed(0)}}kWh</span>
+                <div class='coldWar-left' :style='{"height":formatter(current.energy,maxArr[2])+ "px"}'>
+                    <span>{{formatterNum(current.energy,0)}}kWh</span>
                 </div>
-                <div
-                    class='coldWar-right'
-                    :style='{"height": maxArr[2]=="--"?0+ "px":((similarDay.energy!="--"?similarDay.energy:0)/maxArr[2])*160 + "px"}'
-                >
-                    <span>{{similarDay.energy=="--"?"--":similarDay.energy.toFixed(0)}}kWh</span>
+                <div class='coldWar-right' :style='{"height":formatter(similarDay.energy,maxArr[2])+ "px"}'>
+                    <span>{{formatterNum(similarDay.energy,0)}}kWh</span>
                 </div>
             </div>
         </div>
@@ -65,15 +50,42 @@ export default {
         this.init()
     },
     methods: {
+        formatter(a, b) {
+            if (a == 0 || b == 0) {
+                return 0
+            }
+            if (a != 'x' && a != '--') {
+                return (a / b) * 160
+            } else {
+                return 0
+            }
+        },
+        formatterNum(a, b) {
+            if (a == 0) {
+                return 0
+            }
+            if (a != 'x' && a != '--') {
+                return a.toFixed(b)
+            } else {
+                return a
+            }
+        },
         init() {
             if (this.current) {
-                if (this.current.tempOutdoor == '-9999' || this.current.tempOutdoor == '-9998') {
+                if (this.current.tempOutdoor == '-9999') {
+                    this.current.tempOutdoor = 'x'
+                } else if (this.current.tempOutdoor == '-9998') {
                     this.current.tempOutdoor = '--'
                 }
-                if (this.current.tempIndoor == '-9999' || this.current.tempIndoor == '-9998') {
+                if (this.current.tempIndoor == '-9999') {
+                    this.current.tempIndoor = 'x'
+                } else if (this.current.tempIndoor == '-9998') {
                     this.current.tempIndoor = '--'
                 }
-                if (this.current.energy == '-9999' || this.current.energy == '-9998') {
+
+                if (this.current.energy == '-9999') {
+                    this.current.energy = 'x'
+                } else if (this.current.energy == '-9998') {
                     this.current.energy = '--'
                 }
             }

+ 12 - 4
src/views/evaluate/evTwoLevelMenu.vue

@@ -278,24 +278,32 @@ export default {
                             maxEnergy = this.maxMethod(this.sortMethod(energy))
                         this.maxArr.push(maxOutsiteTemp, maxIndoorTemp, maxEnergy)
                     } else {
-                        if (this.current.tempOutdoor == '-9999' || this.current.tempOutdoor == '-9998') {
+                        if (this.current.tempOutdoor == '-9999') {
+                            this.maxArr[0] = 'x'
+                        } else if (this.current.tempOutdoor == '-9998') {
                             this.maxArr[0] = '--'
                         } else {
                             this.maxArr[0] = this.current.tempOutdoor * 1.2
                         }
-                        if (this.current.tempIndoor == '-9999' || this.current.tempIndoor == '-9998') {
+
+                        if (this.current.tempIndoor == '-9999') {
+                            this.maxArr[1] = 'x'
+                        } else if (this.current.tempIndoor == '-9998') {
                             this.maxArr[1] = '--'
                         } else {
                             this.maxArr[1] = this.current.tempIndoor * 1.2
                         }
-                        if (this.current.energy == '-9999' || this.current.energy == '-9998') {
+
+                        if (this.current.energy == '-9999') {
+                            this.maxArr[2] = 'x'
+                        } else if (this.current.energy == '-9998') {
                             this.maxArr[2] = '--'
                         } else {
                             this.maxArr[2] = this.current.energy * 1.2
                         }
                     }
                 } else {
-                    this.$message.error('申诉失败: ' + res.message)
+                    this.$message.error('申诉提示: ' + res.message)
                 }
             })
         },