index.vue 10 KB

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