index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <div>
  3. <Head :headText="headText"></Head>
  4. <div class="nav-right">
  5. <el-radio v-model="radio" label="1">近30天</el-radio>
  6. <el-radio v-model="radio" label="2" style="margin-right:10px;">自定义</el-radio>
  7. <div class="count-top-right">
  8. <span class="arrow-left" @click="daterangeLeft"></span>
  9. <span class="arrow-line arrow-line1" @click="daterangeLeft"></span>
  10. <el-date-picker
  11. v-model="pickerVal2"
  12. type="daterange"
  13. format="yyyy.MM.dd"
  14. value-format="yyyy.MM.dd"
  15. range-separator="至"
  16. start-placeholder="开始日期"
  17. end-placeholder="结束日期"
  18. ></el-date-picker>
  19. <span class="arrow-line" @click="daterangeRight"></span>
  20. <span class="arrow-right" @click="daterangeRight"></span>
  21. </div>
  22. </div>
  23. <div class="evaluateContainer">
  24. <div class="ev-content">
  25. <div class="ev-cont-div">
  26. <p class="ev-top Micbold">室内温度满足率</p>
  27. <div class="ev-bottom">
  28. <div class="ev-bottom-left">
  29. <ev-satisfaction-rate :tindoorFillRate="tindoorFillRate"></ev-satisfaction-rate>
  30. </div>
  31. <div class="ev-bottom-right MicrYaHei">
  32. <p>
  33. <span>超限时长</span>
  34. <span>{{'--'}}</span>
  35. <span>h/日</span>
  36. </p>
  37. <p>
  38. <span>超限程度</span>
  39. <span>{{tindoorOverrunDegree}}</span>
  40. <span>°C</span>
  41. </p>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="ev-cont-div">
  46. <p class="ev-top">节能率</p>
  47. <div class="ev-bottom">
  48. <div class="ev-bottom-left">
  49. <ev-energy-saving-rate :energySavingRate="energySavingRate"></ev-energy-saving-rate>
  50. </div>
  51. <div class="ev-bottom-right">
  52. <p>
  53. <span>节能量</span>
  54. <span>{{energySaving}}</span>
  55. <span>kW</span>
  56. </p>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="ev-cont-div">
  61. <p class="ev-top">策略执行率</p>
  62. <div class="ev-bottom">
  63. <div class="ev-bottom-left">
  64. <ev-implementation-rate :chillerExecuteRate="chillerExecuteRate"></ev-implementation-rate>
  65. </div>
  66. <div class="ev-bottom-right">
  67. <p>
  68. <span>执行数量</span>
  69. <span>{{isExecutedNum}}</span>
  70. <span>条</span>
  71. </p>
  72. <p>
  73. <span>已发策略</span>
  74. <span>{{allReceivedNum}}</span>
  75. <span>条</span>
  76. </p>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="ev-footer">
  82. <ev-indoor-temperature :date="date"></ev-indoor-temperature>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import Head from "../main/index";
  89. import EvEnergySavingRate from "./evEnergySavingRate";
  90. import EvImplementationRate from "./evImplementationRate";
  91. import EvSatisfactionRate from "./evSatisfactionRate";
  92. import EvIndoorTemperature from "./evIndoorTemperature";
  93. import { runDataQury } from "@/api/evaluate/evaluate.js";
  94. var moment = require("moment");
  95. import "moment/locale/zh-cn";
  96. export default {
  97. data() {
  98. return {
  99. headText: "运行评价",
  100. date: "2",
  101. pickerVal2: "",
  102. radio: "1",
  103. tindoorFillRate: "", //室内温度满足率
  104. energySavingRate: "", //节能率
  105. chillerExecuteRate: "", //略执行率
  106. energySaving: "", //节能量
  107. isExecutedNum: "", //已执行数量
  108. allReceivedNum: "", //共收到数量
  109. tindoorOverrunDegree: "" //超限程度
  110. };
  111. },
  112. components: {
  113. Head,
  114. EvEnergySavingRate,
  115. EvImplementationRate,
  116. EvSatisfactionRate,
  117. EvIndoorTemperature
  118. },
  119. mounted() {
  120. this.query();
  121. },
  122. methods: {
  123. formatter(date) {
  124. return moment.unix(date / 1000).format("YYYYMMDD");
  125. },
  126. query() {
  127. this.runDataQuryArr = [];
  128. runDataQury({}).then(res => {
  129. if (res.result == "success") {
  130. this.tindoorFillRate = res.tindoorFillRate; //室内温度满足率
  131. this.energySavingRate = res.energySavingRate; //节能率
  132. this.chillerExecuteRate = res.chillerExecuteRate; //略执行率
  133. this.energySaving = res.energySaving; //节能量
  134. this.isExecutedNum = res.isExecutedNum; //已执行数量
  135. this.allReceivedNum = res.allReceivedNum; //共收到数量
  136. this.tindoorOverrunDegree = res.tindoorOverrunDegree; //超限程度
  137. }
  138. });
  139. },
  140. daterangeLeft() {
  141. if (this.pickerVal2.length > 0) {
  142. let dateTime = new Date(this.pickerVal2[0]);
  143. let newData = this.formatter(
  144. new Date(dateTime.setDate(dateTime.getDate() - 1))
  145. );
  146. this.pickerVal2[0] =
  147. newData.slice(0, 4) +
  148. "." +
  149. newData.slice(4, 6) +
  150. "." +
  151. newData.slice(6, 8);
  152. this.pickerVal2 = [this.pickerVal2[0], this.pickerVal2[1]];
  153. }
  154. },
  155. daterangeRight() {
  156. if (this.pickerVal2.length > 0) {
  157. let dateTime = new Date(this.pickerVal2[1]);
  158. let newData = this.formatter(
  159. new Date(dateTime.setDate(dateTime.getDate() + 1))
  160. );
  161. this.pickerVal2[1] =
  162. newData.slice(0, 4) +
  163. "." +
  164. newData.slice(4, 6) +
  165. "." +
  166. newData.slice(6, 8);
  167. }
  168. this.pickerVal2 = [this.pickerVal2[0], this.pickerVal2[1]];
  169. }
  170. }
  171. };
  172. </script>
  173. <style lang="scss" scoped>
  174. .nav-right {
  175. height: 48px;
  176. position: fixed;
  177. right: 24px;
  178. top: 53px;
  179. z-index: 1;
  180. display: flex;
  181. align-items: center;
  182. .count-top-right {
  183. width: 254px;
  184. height: 32px;
  185. background: rgba(255, 255, 255, 1);
  186. border-radius: 4px;
  187. border: 1px solid rgba(195, 198, 203, 1);
  188. display: flex;
  189. align-items: center;
  190. .arrow-left {
  191. width: 16px;
  192. height: 16px;
  193. background: url("../../assets/left.png");
  194. margin-right: 5px;
  195. margin-left: 7px;
  196. cursor: pointer;
  197. }
  198. .arrow-right {
  199. margin-right: 7px;
  200. margin-left: 5px;
  201. width: 16px;
  202. height: 16px;
  203. background: url("../../assets/right.png");
  204. cursor: pointer;
  205. }
  206. .arrow-line {
  207. display: inline-block;
  208. width: 2px;
  209. height: 16px;
  210. background: rgba(228, 229, 231, 1);
  211. }
  212. .arrow-line1 {
  213. margin-right: 3.5px;
  214. }
  215. }
  216. }
  217. .evaluateContainer {
  218. padding: 0 24px;
  219. background: #fff;
  220. .ev-content {
  221. margin-top: 20px;
  222. display: flex;
  223. .ev-cont-div {
  224. padding: 16px 20px;
  225. background: rgba(248, 249, 250, 1);
  226. border-radius: 6px;
  227. border: 1px solid rgba(238, 238, 238, 1);
  228. margin-right: 12px;
  229. flex: 1;
  230. .ev-top {
  231. margin: 0;
  232. height: 24px;
  233. font-size: 16px;
  234. color: rgba(31, 36, 41, 1);
  235. line-height: 21px;
  236. }
  237. .ev-bottom {
  238. display: flex;
  239. align-items: center;
  240. p {
  241. margin: 0;
  242. }
  243. .ev-bottom-left {
  244. width: 124px;
  245. height: 124px;
  246. justify-content: flex-start;
  247. margin: 0;
  248. }
  249. .ev-bottom-right {
  250. p {
  251. font-size: 14px;
  252. color: rgba(100, 108, 115, 1);
  253. line-height: 19px;
  254. span {
  255. display: inline-block;
  256. }
  257. span:nth-of-type(1) {
  258. margin-right: 12px;
  259. }
  260. span:nth-of-type(2) {
  261. font-size: 18px;
  262. font-family: Persagy;
  263. color: rgba(32, 35, 42, 1);
  264. line-height: 22px;
  265. }
  266. span:nth-of-type(3) {
  267. font-size: 10px;
  268. }
  269. }
  270. p:nth-of-type(1) {
  271. margin-bottom: 10px;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. .ev-footer {
  278. width: 100%;
  279. height: 430px;
  280. margin-top: 36px;
  281. }
  282. }
  283. </style>
  284. <style lang="scss">
  285. .count-top-right {
  286. .count-top-right .el-input__inner {
  287. margin: 7px 0;
  288. }
  289. .el-input__inner {
  290. width: 210px;
  291. margin: 7px 6px;
  292. height: 22px;
  293. line-height: 22px;
  294. font-size: 12px;
  295. border: none;
  296. }
  297. .el-input__icon {
  298. display: none;
  299. }
  300. .el-range-editor.el-input__inner {
  301. padding: 3px 0;
  302. }
  303. .el-input--prefix .el-input__inner {
  304. padding-left: 5px;
  305. }
  306. .el-input--suffix .el-input__inner {
  307. padding-right: 5px;
  308. }
  309. .el-date-editor .el-range-input {
  310. width: 45%;
  311. }
  312. .el-date-editor .el-range-separator {
  313. line-height: 18px;
  314. color: #8d9399;
  315. }
  316. .el-date-editor .el-range-input {
  317. color: #1f2329;
  318. }
  319. .el-date-editor .el-range-separator {
  320. padding: 0 15px;
  321. }
  322. .el-radio__label {
  323. height: 22px;
  324. font-size: 14px;
  325. font-family: MicrosoftYaHei;
  326. color: rgba(31, 36, 41, 1);
  327. line-height: 19px;
  328. padding-left: 5px;
  329. }
  330. .el-radio {
  331. margin-right: 20px !important;
  332. }
  333. }
  334. </style>