evTwoLevelMenu.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <div class="evTwoContainer">
  3. <div class="evTwoContainer-out">
  4. <Head :headText="headText"></Head>
  5. <div class="count-top">
  6. <div class="count-top-left MicrYaHei">
  7. <span @click="jumpIndex">首页</span>
  8. <span>></span>
  9. <span>单日运行评价</span>
  10. </div>
  11. <ul class="MicrYaHei">
  12. <div style="min-width:300px;"></div>
  13. <div>
  14. <li :class="{current: num == 1}" @click="changeNum(1)">室内温度</li>
  15. <li :class="{current: num==2}" @click="changeNum(2)">节能率</li>
  16. <li :class="{current: num==3}" @click="changeNum(3)">执行率</li>
  17. </div>
  18. <div class="count-top-right">
  19. <date-temp v-if="date" @pickerVal="pickerVal" :date="date"></date-temp>
  20. </div>
  21. </ul>
  22. <div class="count-bottom">
  23. <div v-show="num == 1">
  24. <ev-rate-title :tab="1" :rate="tindoorFillRate" :accuracy="null"></ev-rate-title>
  25. <div class="count-bottom-switch">
  26. <span class="switchSpan">只显示不满足的点位</span>
  27. <el-switch v-model="value2"></el-switch>
  28. </div>
  29. <div class="count-bottom-content">
  30. <ev-two-table v-if="dataList.length>=0" :switch="value2" :dataList="dataList"></ev-two-table>
  31. </div>
  32. <div class="count-bottom-foot">
  33. <ev-stacked-line v-if="stackArr.length>0" :stackArr="stackArr"></ev-stacked-line>
  34. </div>
  35. </div>
  36. <div v-show="num == 2">
  37. <ev-rate-title :tab="2" :rate="energySavingRate" :accuracy="accuracy"></ev-rate-title>
  38. <div class="count-historical-data">
  39. <ev-history
  40. v-if="Object.keys(current).length>0||Object.keys(similarDay).length>0||Object.keys(maxArr).length>0"
  41. :current="current"
  42. :similarDay="similarDay"
  43. :maxArr="maxArr"
  44. ></ev-history>
  45. <div class="count-foot">
  46. <div class="count-foot-title">
  47. <span class="Micbold">相似日概况</span>
  48. <span class="MicrYaHei">相似度高</span>
  49. </div>
  50. <div class="count-foot-table">
  51. <ev-energy-table v-if="samples.length>=0" :samples="samples"></ev-energy-table>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div v-show="num == 3">
  57. <ev-rate-title :tab="3" :rate="null" :accuracy="null"></ev-rate-title>
  58. <ev-card v-if="cardList.length>0" :cardList="cardList"></ev-card>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import Head from "../main/index";
  67. import EvTwoTable from "./evTwoTable";
  68. import EvStackedLine from "./evStackedLine";
  69. import EvEnergyTable from "./evEnergyTable";
  70. import EvCard from "./evCard"; //执行率
  71. import EvRateTitle from "./evRateTitle";
  72. import EvHistory from "./evHistory";
  73. import DateTemp from "./dateTemp";
  74. import {
  75. runDataQury,
  76. energyDayQuery,
  77. querychiller,
  78. querySpace,
  79. queryHisdataQueryPeriodData,
  80. queryTdbDay
  81. } from "@/api/evaluate/evaluate.js";
  82. import { queryChillerExecuteInfo } from "@/api/appeal/appeal.js";
  83. export default {
  84. data() {
  85. return {
  86. headText: "运行评价",
  87. num: 1, //tab @
  88. date: "", // 传过来的日期@
  89. type: "", //传过来的日期 @
  90. value2: true,
  91. current: {}, //本日概况 @
  92. similarDay: {}, //相似日概况 @
  93. samples: [], //相似日列表 @
  94. maxArr: [], // @
  95. dataList: [], //室内温度满足率@
  96. tindoorFillRate: "", //室内温度满足率@
  97. energySavingRate: "", //节能率
  98. cardList: [], //执行率@
  99. dateVal: "", //@
  100. stackArr: [], //@
  101. accuracy: "" //准确率
  102. };
  103. },
  104. components: {
  105. Head,
  106. EvTwoTable,
  107. EvStackedLine,
  108. EvEnergyTable,
  109. EvCard,
  110. EvRateTitle,
  111. EvHistory,
  112. DateTemp
  113. },
  114. mounted() {
  115. this.init();
  116. },
  117. methods: {
  118. init() {
  119. this.type = this.$route.query.type;
  120. this.date = this.$route.query.name;
  121. console.log(this.date);
  122. if (this.type) {
  123. this.num = this.type;
  124. }
  125. if (this.date) {
  126. this.date = this.formatterStr3(
  127. new Date().getFullYear() + this.formatterStr2(this.date)
  128. );
  129. this.querychillerMethods(this.date);
  130. }
  131. if (this.num && this.date) {
  132. this.changeNumMethod();
  133. }
  134. },
  135. querychillerMethods(date) {
  136. let params = {
  137. postParams: {
  138. criteria: {
  139. projectId: this.$store.state.projectId,
  140. date: date
  141. }
  142. }
  143. };
  144. querychiller(params).then(res => {
  145. console.log(res);
  146. this.accuracy = res.content[0].accuracy;
  147. });
  148. },
  149. // @
  150. formatterStr2(str) {
  151. if (str) {
  152. return str.substring(0, 2) + "" + str.substring(3, 5);
  153. }
  154. },
  155. // 室内温度table @
  156. queryTdbDayMethod(date) {
  157. this.dataList = [];
  158. let arr1 = [],
  159. arr2 = [];
  160. queryTdbDay(date, {}).then(res => {
  161. this.tindoorFillRate = res.tindoorFillRate;
  162. console.log("室内温度满足率", res);
  163. let content = res.content;
  164. if (content.length > 0) {
  165. content.forEach(item => {
  166. if (item.spaceDayRpt.isSatisfy == false) {
  167. let obj2 = {
  168. name: item.spaceDayRpt.spaceLocalName,
  169. data: item.tdbList.data
  170. };
  171. this.stackArr.push(obj2);
  172. }
  173. arr1.push(item.spaceDayRpt.floorLocalName);
  174. });
  175. arr1 = Array.from(new Set(arr1));
  176. arr1.forEach(el => {
  177. let obj = {
  178. floor: el,
  179. floorArr: []
  180. };
  181. arr2.push(obj);
  182. });
  183. content.forEach(item2 => {
  184. arr2.forEach(item => {
  185. if (item2.spaceDayRpt.floorLocalName == item.floor) {
  186. item.floorArr.push(item2.spaceDayRpt);
  187. }
  188. });
  189. });
  190. }
  191. this.dataList = arr2;
  192. });
  193. },
  194. // @
  195. formatterStr3(str) {
  196. if (str) {
  197. return str.substring(0, 4) + str.substring(4, 6) + str.substring(6, 8);
  198. }
  199. },
  200. // 执行率@
  201. queryimplement(date) {
  202. let params = {
  203. postParams: {
  204. criteria: {
  205. date: date
  206. }
  207. }
  208. };
  209. queryChillerExecuteInfo(params).then(res => {
  210. this.cardList = res.data ? res.data : [];
  211. console.log("执行率", res);
  212. });
  213. },
  214. // 根据tab @
  215. changeNumMethod() {
  216. if (this.num == 1) {
  217. this.queryTdbDayMethod(this.date);
  218. } else if (this.num == 2) {
  219. this.queryEnergyDayQuery(this.date);
  220. } else if (this.num == 3) {
  221. this.queryimplement(this.date);
  222. }
  223. },
  224. // 点击tab @
  225. changeNum(index) {
  226. this.num = index;
  227. this.changeNumMethod();
  228. },
  229. // @
  230. formatterStr(str) {
  231. if (str) {
  232. return str.substring(0, 4) + str.substring(5, 7) + str.substring(8, 10);
  233. }
  234. },
  235. // @
  236. pickerVal(val) {
  237. if (val) {
  238. this.date = this.formatterStr(val);
  239. this.changeNumMethod();
  240. }
  241. },
  242. // @
  243. jumpIndex() {
  244. this.$router.push("/evaluate");
  245. },
  246. // 节能率@
  247. queryEnergyDayQuery(date) {
  248. energyDayQuery(date, {}).then(res => {
  249. if (res.result == "success") {
  250. // 本日概况
  251. this.current = res.current ? res.current : {};
  252. // 相似日概况
  253. this.similarDay = res.similarDay ? res.similarDay : {};
  254. // 相似日列表
  255. this.samples = res.samples ? res.samples : [];
  256. if (this.samples.length > 0) {
  257. var outsiteTemp = [],
  258. indoorTemp = [],
  259. energy = [];
  260. for (var i in this.samples) {
  261. outsiteTemp.push(this.samples[i].outsiteTemp);
  262. indoorTemp.push(this.samples[i].indoorTemp);
  263. energy.push(this.samples[i].energy);
  264. }
  265. let maxOutsiteTemp = this.maxMethod(this.sortMethod(outsiteTemp)),
  266. maxIndoorTemp = this.maxMethod(this.sortMethod(indoorTemp)),
  267. maxEnergy = this.maxMethod(this.sortMethod(energy));
  268. this.maxArr.push(maxOutsiteTemp, maxIndoorTemp, maxEnergy);
  269. }
  270. } else {
  271. this.$message.error("申诉失败: " + res.message);
  272. }
  273. });
  274. },
  275. // @
  276. sortMethod(arr) {
  277. if (arr instanceof Array) {
  278. return arr.sort(function(num1, num2) {
  279. return num1 - num2;
  280. });
  281. } else {
  282. return 1;
  283. }
  284. },
  285. // @
  286. maxMethod(arr) {
  287. if (arr instanceof Array) {
  288. return eval(arr[arr.length - 1]);
  289. }
  290. }
  291. }
  292. };
  293. </script>
  294. <style lang="scss" scoped>
  295. .evTwoContainer {
  296. background: #fff;
  297. min-width: 1000px;
  298. .count-top {
  299. width: 100%;
  300. height: 100%;
  301. .count-top-left {
  302. width: 200px;
  303. display: flex;
  304. align-items: center;
  305. z-index: 1;
  306. position: fixed;
  307. left: 190px;
  308. top: 68px;
  309. span {
  310. display: inline-block;
  311. }
  312. span:nth-of-type(1) {
  313. height: 22px;
  314. font-size: 14px;
  315. color: #8d9399;
  316. line-height: 22px;
  317. cursor: pointer;
  318. }
  319. span:nth-of-type(2) {
  320. color: #c3c6cb;
  321. margin: 0 4px;
  322. margin-top: -3px;
  323. }
  324. span:nth-of-type(3) {
  325. height: 22px;
  326. font-size: 14px;
  327. color: #1f2429;
  328. line-height: 22px;
  329. }
  330. }
  331. ul {
  332. display: flex;
  333. padding: 0 16px;
  334. // width: 100%;
  335. justify-content: space-between;
  336. white-space: nowrap;
  337. align-items: center;
  338. margin: 0;
  339. text-align: center;
  340. position: fixed;
  341. left: 0;
  342. right: 0;
  343. top: 50px;
  344. z-index: 1;
  345. min-width: 810px;
  346. .count-top-right {
  347. width: 148px;
  348. }
  349. }
  350. ul li {
  351. cursor: pointer;
  352. height: 21px;
  353. float: left;
  354. font-size: 16px;
  355. color: rgba(31, 35, 41, 1);
  356. line-height: 21px;
  357. padding: 14px 16px;
  358. margin-right: 22px;
  359. }
  360. .count-bottom {
  361. padding: 0 16px;
  362. height: auto;
  363. background: #fff;
  364. margin-top: 16px;
  365. .count-bottom-switch {
  366. display: flex;
  367. justify-content: flex-end;
  368. align-items: center;
  369. margin-top: -14px;
  370. .switchSpan {
  371. height: 22px;
  372. font-size: 14px;
  373. font-family: PingFangSC-Regular, PingFang SC;
  374. font-weight: 400;
  375. color: rgba(31, 36, 41, 1);
  376. line-height: 20px;
  377. margin-right: 16px;
  378. }
  379. }
  380. .count-historical-data {
  381. .count-foot {
  382. .count-foot-title {
  383. display: flex;
  384. align-items: center;
  385. margin-bottom: 16px;
  386. span:nth-of-type(1) {
  387. height: 24px;
  388. font-size: 16px;
  389. color: rgba(31, 36, 41, 1);
  390. line-height: 21px;
  391. margin-right: 16px;
  392. }
  393. span:nth-of-type(2) {
  394. width: 72px;
  395. height: 22px;
  396. background: rgba(225, 242, 255, 1);
  397. border-radius: 2px;
  398. font-size: 14px;
  399. color: rgba(0, 101, 179, 1);
  400. line-height: 22px;
  401. text-align: center;
  402. }
  403. }
  404. }
  405. }
  406. .count-bottom-content {
  407. margin-top: 12px;
  408. }
  409. .count-bottom-foot {
  410. margin-top: 46px;
  411. height: 480px;
  412. background: rgba(255, 255, 255, 1);
  413. border: 1px solid rgba(228, 230, 231, 1);
  414. }
  415. }
  416. .current {
  417. font-size: 16px;
  418. font-family: MicrosoftYaHei;
  419. color: #0091ff;
  420. line-height: 21px;
  421. border-bottom: 2px solid#0091FF;
  422. }
  423. }
  424. }
  425. </style>
  426. <style lang="scss">
  427. .count-bottom-switch {
  428. .el-switch__core {
  429. width: 40px !important;
  430. height: 22px;
  431. border-radius: 12px;
  432. }
  433. .el-switch.is-checked .el-switch__core::after {
  434. left: 100%;
  435. margin-left: -19px;
  436. }
  437. .el-switch__core:after {
  438. content: "";
  439. position: absolute;
  440. border-radius: 100%;
  441. -webkit-transition: all 0.3s;
  442. transition: all 0.3s;
  443. width: 18px;
  444. height: 18px;
  445. background-color: #fff;
  446. top: 1px;
  447. }
  448. }
  449. </style>