index.vue 11 KB

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