Selaa lähdekoodia

Merge branch 'master' of http://39.106.8.246:3003/sagacloud/sagacloud-cwc-pages

lizhuang 5 vuotta sitten
vanhempi
commit
1b398a31f2

+ 26 - 8
src/views/appeal/index.vue

@@ -33,26 +33,26 @@
                                     <div class='advice MicrYaHei'>
                                         <span>策略建议</span>
                                         <span>冷机台数</span>
-                                        <span>{{shutDown(item.recommend.chillerNumSetL,true,null)}} 大{{shutDown(item.recommend.chillerNumSetS,true,null)}} 小</span>
+                                        <span>{{formatterRes(item.recommend.chillerNumSetL,true,0)}} 大{{formatterRes(item.recommend.chillerNumSetS,true,0)}} 小</span>
                                         <span>冷机出水温度</span>
-                                        <span>{{shutDown(item.recommend.chillWaterOutTempSet,false,1)}} °C</span>
+                                        <span>{{formatterRes(item.recommend.chillWaterOutTempSet,false,1)}} °C</span>
                                     </div>
                                     <div class='advice'>
                                         <span>实际执行</span>
                                         <span>冷机台数</span>
                                         <span>
                                             <font
-                                                :class='shutDown(item.real.chillerNumSetLOrg,true,null)!=shutDown(item.recommend.chillerNumSetL,true,null)?"reds":""'
-                                            >{{shutDown(item.real.chillerNumSetLOrg,true,null)}}</font> 大
+                                                :class='formatterRes(item.real.chillerNumSetLOrg,true,0)!=formatterRes(item.recommend.chillerNumSetL,true,0)?"reds":""'
+                                            >{{formatterRes(item.real.chillerNumSetLOrg,true,0)}}</font> 大
                                             <font
-                                                :class='shutDown(item.real.chillerNumSetSOrg,true,null)!=shutDown(item.recommend.chillerNumSetS,true,null)?"reds":""'
-                                            >{{shutDown(item.real.chillerNumSetSOrg,true,null)}}</font> 小
+                                                :class='formatterRes(item.real.chillerNumSetSOrg,true,0)!=formatterRes(item.recommend.chillerNumSetS,true,0)?"reds":""'
+                                            >{{formatterRes(item.real.chillerNumSetSOrg,true,0)}}</font> 小
                                         </span>
                                         <span>冷机出水温度</span>
                                         <span>
                                             <font
-                                                :class='shutDown(item.real.chillWaterOutTempSetOrg,false,1)!=shutDown(item.recommend.chillWaterOutTempSet,false,1)?"reds":""'
-                                            >{{shutDown(item.real.chillWaterOutTempSetOrg,false,1)}}</font> °C
+                                                :class='formatterRes(item.real.chillWaterOutTempSetOrg,false,1)!=formatterRes(item.recommend.chillWaterOutTempSet,false,1)?"reds":""'
+                                            >{{formatterRes(item.real.chillWaterOutTempSetOrg,false,1)}}</font> °C
                                         </span>
                                     </div>
                                     <div class='remark'>备注:{{item.remarks||'--'}}</div>
@@ -180,6 +180,24 @@ export default {
         this.init()
     },
     methods: {
+        formatterRes(res, type, num) {
+            if (res == '-9999') {
+                return 'x'
+            } else if (res == '-9998') {
+                if (type) {
+                    return 0
+                } else {
+                    return '--'
+                }
+            } else {
+                if (res != undefined) {
+                    res = res.toFixed(num)
+                } else {
+                    return '--'
+                }
+                return res
+            }
+        },
         lookQuickData(item) {
             this.viewSnapshots = true
             this.time = item.recommend.time

+ 6 - 18
src/views/evaluate/evHistory.vue

@@ -11,48 +11,36 @@
             <div class='outdoor'>
                 <div class='outdoor-left' :style='{"height":formatter(current.tempOutdoor,maxArr[0])+ "px"}'>
                     <span>
-                        <font
-                            :class='formatterNum(current.tempOutdoor,1)=="x"||formatterNum(current.tempOutdoor,1)=="0"||formatterNum(current.tempOutdoor,1)=="--"?"red":""'
-                        >{{formatterNum(current.tempOutdoor,1)+'&nbsp;'}}</font>℃
+                        <font :class='formatterNum(current.tempOutdoor,1)=="x"?"red":""'>{{formatterNum(current.tempOutdoor,1)+'&nbsp;'}}</font>℃
                     </span>
                 </div>
                 <div class='outdoor-right' :style='{"height":formatter(similarDay.tempOutdoor,maxArr[0])+ "px"}'>
                     <span>
-                        <font
-                            :class='formatterNum(similarDay.tempOutdoor,1)=="x"||formatterNum(similarDay.tempOutdoor,1)=="0"||formatterNum(similarDay.tempOutdoor,1)=="--"?"red":""'
-                        >{{formatterNum(similarDay.tempOutdoor,1)+'&nbsp;'}}</font>℃
+                        <font :class='formatterNum(similarDay.tempOutdoor,1)=="x"?"red":""'>{{formatterNum(similarDay.tempOutdoor,1)+'&nbsp;'}}</font>℃
                     </span>
                 </div>
             </div>
             <div class='indoor'>
                 <div class='indoor-left' :style='{"height":formatter(current.tempIndoor,maxArr[1])+ "px"}'>
                     <span>
-                        <font
-                            :class='formatterNum(current.tempIndoor,1)=="x"||formatterNum(current.tempIndoor,1)=="0"||formatterNum(current.tempIndoor,1)=="--"?"red":""'
-                        >{{formatterNum(current.tempIndoor,1)+'&nbsp;'}}</font>℃
+                        <font :class='formatterNum(current.tempIndoor,1)=="x"?"red":""'>{{formatterNum(current.tempIndoor,1)+'&nbsp;'}}</font>℃
                     </span>
                 </div>
                 <div class='indoor-right' :style='{"height":formatter(similarDay.tempIndoor,maxArr[1])+ "px"}'>
                     <span>
-                        <font
-                            :class='formatterNum(similarDay.tempIndoor,1)=="x"||formatterNum(similarDay.tempIndoor,1)=="0"||formatterNum(similarDay.tempIndoor,1)=="--"?"red":""'
-                        >{{formatterNum(similarDay.tempIndoor,1)+'&nbsp;'}}</font>℃
+                        <font :class='formatterNum(similarDay.tempIndoor,1)=="x"?"red":""'>{{formatterNum(similarDay.tempIndoor,1)+'&nbsp;'}}</font>℃
                     </span>
                 </div>
             </div>
             <div class='coldWar'>
                 <div class='coldWar-left' :style='{"height":formatter(current.energy,maxArr[2])+ "px"}'>
                     <span>
-                        <font
-                            :class='formatterNum(current.energy,0)=="x"||formatterNum(current.energy,0)=="0"||formatterNum(current.energy,0)=="--"?"red":""'
-                        >{{formatterNum(current.energy,0)+'&nbsp;'}}</font>kWh
+                        <font :class='formatterNum(current.energy,0)=="x"?"red":""'>{{formatterNum(current.energy,0)+'&nbsp;'}}</font>kWh
                     </span>
                 </div>
                 <div class='coldWar-right' :style='{"height":formatter(similarDay.energy,maxArr[2])+ "px"}'>
                     <span>
-                        <font
-                            :class='formatterNum(similarDay.energy,0)=="x"||formatterNum(similarDay.energy,0)=="0"||formatterNum(similarDay.energy,0)=="--"?"red":""'
-                        >{{formatterNum(similarDay.energy,0)+'&nbsp;'}}</font>kWh
+                        <font :class='formatterNum(similarDay.energy,0)=="x"?"red":""'>{{formatterNum(similarDay.energy,0)+'&nbsp;'}}</font>kWh
                     </span>
                 </div>
             </div>

+ 1 - 1
src/views/evaluate/evSnapshotsDialog.vue

@@ -228,7 +228,7 @@ export default {
     methods: {
         formatterRes(res, type, num) {
             if (res == '-9999') {
-                return x
+                return 'x'
             } else if (res == '-9998') {
                 if (type) {
                     return 0

+ 1 - 1
src/views/strategy/waterUnit.vue

@@ -92,7 +92,7 @@ export default {
     methods: {
         formatterRes(res, type, num) {
             if (res == '-9999') {
-                return x
+                return 'x'
             } else if (res == '-9998') {
                 if (type) {
                     return 0