evHistory.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div class='MicrYaHei'>
  3. <p>
  4. <span class='Micbold'>根据历史数据计算</span>
  5. <span></span>
  6. <span>本日概况</span>
  7. <span></span>
  8. <span>相似日概况</span>
  9. </p>
  10. <div class='count-data'>
  11. <div class='outdoor'>
  12. <div
  13. class='outdoor-left'
  14. :style='{"height":maxArr[0]=="--"?0+ "px":((current.tempOutdoor!="--"?current.tempOutdoor:0)/maxArr[0])*160 + "px"}'
  15. >
  16. <span>{{current.tempOutdoor=="--"?"--":current.tempOutdoor.toFixed(1)}}℃</span>
  17. </div>
  18. <div
  19. class='outdoor-right'
  20. :style='{"height":maxArr[0]=="--"?0+ "px":((similarDay.tempOutdoor!="--"?similarDay.tempOutdoor:0)/maxArr[0])*160 + "px"}'
  21. >
  22. <span>{{similarDay.tempOutdoor=="--"?"--":similarDay.tempOutdoor.toFixed(1)}}℃</span>
  23. </div>
  24. </div>
  25. <div class='indoor'>
  26. <div
  27. class='indoor-left'
  28. :style='{"height":maxArr[1]=="--"?0+ "px": ((current.tempIndoor!="--"?current.tempIndoor:0)/maxArr[1])*160 + "px"}'
  29. >
  30. <span>{{current.tempIndoor=="--"?"--":current.tempIndoor.toFixed(1)}}℃</span>
  31. </div>
  32. <div
  33. class='indoor-right'
  34. :style='{"height":maxArr[1]=="--"?0+ "px": ((similarDay.tempIndoor!="--"?similarDay.tempIndoor:0)/maxArr[1])*160 + "px"}'
  35. >
  36. <span>{{similarDay.tempIndoor=="--"?"--":similarDay.tempIndoor.toFixed(1)}}℃</span>
  37. </div>
  38. </div>
  39. <div class='coldWar'>
  40. <div class='coldWar-left' :style='{"height":maxArr[2]=="--"?0+ "px": ((current.energy!="--"?current.energy:0)/maxArr[2])*160 + "px"}'>
  41. <span>{{current.energy=="--"?"--":current.energy.toFixed(0)}}kWh</span>
  42. </div>
  43. <div
  44. class='coldWar-right'
  45. :style='{"height": maxArr[2]=="--"?0+ "px":((similarDay.energy!="--"?similarDay.energy:0)/maxArr[2])*160 + "px"}'
  46. >
  47. <span>{{similarDay.energy=="--"?"--":similarDay.energy.toFixed(0)}}kWh</span>
  48. </div>
  49. </div>
  50. </div>
  51. <div class='count-text'>
  52. <div class='outdoor-text'>室外平均温度</div>
  53. <div class='indoor-text'>室内平均温度</div>
  54. <div class='coldWar-text'>冷站能耗</div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {}
  62. },
  63. props: ['current', 'similarDay', 'maxArr'],
  64. mounted() {
  65. this.init()
  66. },
  67. methods: {
  68. init() {
  69. if (this.current) {
  70. if (this.current.tempOutdoor == '-9999' || this.current.tempOutdoor == '-9998') {
  71. this.current.tempOutdoor = '--'
  72. }
  73. if (this.current.tempIndoor == '-9999' || this.current.tempIndoor == '-9998') {
  74. this.current.tempIndoor = '--'
  75. }
  76. if (this.current.energy == '-9999' || this.current.energy == '-9998') {
  77. this.current.energy = '--'
  78. }
  79. }
  80. console.log('11111', this.current.tempOutdoor, this.current.tempIndoor, this.current.energy)
  81. console.log('22222', this.similarDay.tempOutdoor, this.similarDay.tempIndoor, this.similarDay.energy)
  82. console.log('33333', this.maxArr)
  83. }
  84. },
  85. watch: {
  86. current(val, old) {
  87. this.current = val
  88. this.init()
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. p {
  95. margin: 0;
  96. margin-top: 20px;
  97. margin-bottom: 30px;
  98. display: flex;
  99. align-items: center;
  100. span {
  101. display: inline-block;
  102. }
  103. span:nth-of-type(1) {
  104. height: 24px;
  105. font-size: 16px;
  106. color: rgba(31, 36, 41, 1);
  107. line-height: 21px;
  108. margin-right: 24px;
  109. }
  110. span:nth-of-type(2) {
  111. width: 10px;
  112. height: 10px;
  113. background: rgba(0, 145, 255, 1);
  114. margin-right: 5px;
  115. }
  116. span:nth-of-type(3) {
  117. height: 18px;
  118. font-size: 12px;
  119. color: rgba(0, 0, 0, 1);
  120. line-height: 16px;
  121. margin-right: 20px;
  122. }
  123. span:nth-of-type(4) {
  124. width: 10px;
  125. height: 10px;
  126. background: rgba(0, 214, 185, 1);
  127. margin-right: 5px;
  128. }
  129. span:nth-of-type(5) {
  130. height: 18px;
  131. font-size: 12px;
  132. color: rgba(0, 0, 0, 1);
  133. line-height: 16px;
  134. }
  135. }
  136. .count-data {
  137. height: 200px;
  138. text-align: center;
  139. border-bottom: 1px solid #e4e6e7;
  140. display: flex;
  141. justify-content: space-around;
  142. .outdoor {
  143. width: 208px;
  144. height: 200px;
  145. display: flex;
  146. justify-content: space-between;
  147. position: relative;
  148. span {
  149. width: 100%;
  150. position: absolute;
  151. top: -25px;
  152. left: 0;
  153. height: 22px;
  154. font-size: 14px;
  155. color: rgba(31, 36, 41, 1);
  156. line-height: 19px;
  157. }
  158. .outdoor-left {
  159. width: 100px;
  160. // height: 121px;
  161. background: rgba(0, 145, 255, 1);
  162. position: absolute;
  163. bottom: 0;
  164. left: 0;
  165. }
  166. .outdoor-right {
  167. width: 100px;
  168. height: 141px;
  169. background: rgba(0, 214, 185, 1);
  170. position: absolute;
  171. bottom: 0;
  172. right: 0;
  173. }
  174. }
  175. .indoor {
  176. width: 208px;
  177. height: 200px;
  178. position: relative;
  179. span {
  180. width: 100%;
  181. position: absolute;
  182. top: -25px;
  183. left: 0;
  184. height: 22px;
  185. font-size: 14px;
  186. color: rgba(31, 36, 41, 1);
  187. line-height: 19px;
  188. }
  189. .indoor-left {
  190. width: 100px;
  191. height: 121px;
  192. background: rgba(0, 145, 255, 1);
  193. position: absolute;
  194. bottom: 0;
  195. left: 0;
  196. }
  197. .indoor-right {
  198. width: 100px;
  199. height: 131px;
  200. background: rgba(0, 214, 185, 1);
  201. position: absolute;
  202. bottom: 0;
  203. right: 0;
  204. }
  205. }
  206. .coldWar {
  207. width: 208px;
  208. height: 200px;
  209. position: relative;
  210. span {
  211. width: 100%;
  212. position: absolute;
  213. top: -25px;
  214. left: 0;
  215. height: 22px;
  216. font-size: 14px;
  217. color: rgba(31, 36, 41, 1);
  218. line-height: 19px;
  219. }
  220. .coldWar-left {
  221. width: 100px;
  222. height: 84px;
  223. background: rgba(0, 145, 255, 1);
  224. position: absolute;
  225. bottom: 0;
  226. left: 0;
  227. }
  228. .coldWar-right {
  229. width: 100px;
  230. height: 137px;
  231. background: rgba(0, 214, 185, 1);
  232. position: absolute;
  233. bottom: 0;
  234. right: 0;
  235. }
  236. }
  237. }
  238. .count-text {
  239. height: 16px;
  240. font-size: 12px;
  241. color: rgba(100, 108, 115, 1);
  242. line-height: 16px;
  243. display: flex;
  244. text-align: center;
  245. margin-top: 12px;
  246. margin-bottom: 34px;
  247. justify-content: space-around;
  248. .outdoor-text,
  249. .indoor-text,
  250. .coldWar-text {
  251. width: 208px;
  252. }
  253. }
  254. </style>