evIndoorTemperature.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <div class="p-echarts">
  3. <div class="pLegend">
  4. <i class="icon1"></i>按照策略执行
  5. <i class="icon2"></i>未按照策略执行
  6. <i class="icon3"></i>未按照策略执行,申诉通过
  7. <i class="icon4"></i>室内温度满足率
  8. <i class="icon5"></i>节能率
  9. </div>
  10. <div id="pCharts2" style="width: 100%;height: 100%;margin-top:20px;"></div>
  11. </div>
  12. </template>
  13. <script>
  14. var echarts = require("echarts");
  15. export default {
  16. data() {
  17. return {};
  18. },
  19. props: ["energyDataList"],
  20. mounted() {
  21. this.drawIt();
  22. },
  23. methods: {
  24. drawIt() {
  25. let myCharts = echarts.init(document.getElementById("pCharts2"));
  26. var colors = ["#34C724", "#8D9399", "#F54E45", "#00D6B9", "#0091FF"];
  27. var option = {
  28. color: colors,
  29. tooltip: {
  30. trigger: "axis",
  31. axisPointer: {
  32. type: "cross"
  33. }
  34. },
  35. grid: {
  36. right: "5%",
  37. left: "5%"
  38. },
  39. xAxis: [
  40. {
  41. type: "category",
  42. axisTick: {
  43. alignWithLabel: true
  44. },
  45. splitLine: {
  46. show: false
  47. },
  48. axisLine: {
  49. lineStyle: {
  50. color: "#8D9399"
  51. }
  52. },
  53. axisLabel: {
  54. interval: 0 //代表显示所有x轴标签显示
  55. },
  56. data: [
  57. "11.01",
  58. "11.02",
  59. "11.03",
  60. "11.04",
  61. "11.05",
  62. "11.06",
  63. "11.07",
  64. "11.08",
  65. "11.09",
  66. "11.10",
  67. "11.12",
  68. "11.13",
  69. "11.14",
  70. "11.15",
  71. "11.16",
  72. "11.17",
  73. "11.18",
  74. "11.19",
  75. "11.20",
  76. "11.21",
  77. "11.22",
  78. "11.23",
  79. "11.24",
  80. "11.25",
  81. "11.26",
  82. "11.27",
  83. "11.28",
  84. "11.29",
  85. "11.30",
  86. "11.31"
  87. ]
  88. }
  89. ],
  90. yAxis: [
  91. {
  92. type: "value",
  93. name: "节能率",
  94. axisLine: {
  95. lineStyle: {
  96. color: "#8D9399"
  97. }
  98. },
  99. splitLine: {
  100. show: false
  101. },
  102. min: 0,
  103. max: 25,
  104. position: "right",
  105. axisLabel: {
  106. formatter: "{value} ml"
  107. }
  108. },
  109. {
  110. type: "value",
  111. show: false,
  112. name: "",
  113. min: 0,
  114. max: 1,
  115. position: "right",
  116. offset: 80,
  117. axisLine: {
  118. show: false
  119. },
  120. axisLabel: {
  121. formatter: function() {
  122. return "";
  123. }
  124. }
  125. },
  126. {
  127. type: "value",
  128. name: "室内温度满足率",
  129. axisLine: {
  130. lineStyle: {
  131. color: "#8D9399"
  132. }
  133. },
  134. splitLine: {
  135. show: false
  136. },
  137. min: 0,
  138. max: 25,
  139. position: "left",
  140. axisLabel: {
  141. formatter: "{value} °C"
  142. }
  143. }
  144. ],
  145. series: [
  146. {
  147. name: "按照策略执行",
  148. type: "bar",
  149. barWidth: 30,
  150. data: [
  151. 1,
  152. null,
  153. null,
  154. 1,
  155. null,
  156. null,
  157. 1,
  158. null,
  159. null,
  160. 1,
  161. null,
  162. null,
  163. 1,
  164. null,
  165. null,
  166. 1,
  167. null,
  168. null,
  169. 1,
  170. null,
  171. null,
  172. 1,
  173. null,
  174. null,
  175. 1,
  176. null,
  177. null,
  178. 1,
  179. null,
  180. null,
  181. null
  182. ]
  183. },
  184. {
  185. name: "未按照策略执行",
  186. type: "bar",
  187. barWidth: 30,
  188. data: [
  189. null,
  190. 1,
  191. 1,
  192. null,
  193. 1,
  194. null,
  195. null,
  196. 1,
  197. null,
  198. null,
  199. 1,
  200. null,
  201. null,
  202. 1,
  203. null,
  204. null,
  205. 1,
  206. null,
  207. null,
  208. 1,
  209. null,
  210. null,
  211. 1,
  212. null,
  213. null,
  214. 1,
  215. null,
  216. null,
  217. 1,
  218. null,
  219. null
  220. ]
  221. },
  222. {
  223. name: "未按照策略执行,申诉通过",
  224. type: "bar",
  225. barWidth: 30,
  226. data: [
  227. null,
  228. null,
  229. null,
  230. null,
  231. null,
  232. 1,
  233. null,
  234. null,
  235. 1,
  236. null,
  237. null,
  238. 1,
  239. null,
  240. null,
  241. 1,
  242. null,
  243. null,
  244. 1,
  245. null,
  246. null,
  247. 1,
  248. null,
  249. null,
  250. 1,
  251. null,
  252. null,
  253. 1,
  254. null,
  255. null,
  256. 1,
  257. 1
  258. ]
  259. },
  260. {
  261. name: "室内温度满足率",
  262. type: "line",
  263. yAxisIndex: 2,
  264. data: [
  265. 2.0,
  266. 2.2,
  267. 3.3,
  268. 4.5,
  269. 6.3,
  270. 10.2,
  271. 20.3,
  272. 23.4,
  273. 23.0,
  274. 16.5,
  275. 12.0,
  276. 6.2,
  277. 2.0,
  278. 2.2,
  279. 3.3,
  280. 4.5,
  281. 6.3,
  282. 10.2,
  283. 20.3,
  284. 23.4,
  285. 23.0,
  286. 16.5,
  287. 12.0,
  288. 6.2,
  289. 2.0,
  290. 2.2,
  291. 3.3,
  292. 4.5,
  293. 6.3,
  294. 10.2,
  295. 20.3
  296. ]
  297. },
  298. {
  299. name: "节能率",
  300. type: "line",
  301. yAxisIndex: 2,
  302. data: [
  303. 2.2,
  304. 3.0,
  305. 4.5,
  306. 6.3,
  307. 10.2,
  308. 20.3,
  309. 23.4,
  310. 23.0,
  311. 16.5,
  312. 12.0,
  313. 6.2,
  314. 14.0,
  315. 2.2,
  316. 3.0,
  317. 4.5,
  318. 6.3,
  319. 10.2,
  320. 20.3,
  321. 23.4,
  322. 23.0,
  323. 16.5,
  324. 12.0,
  325. 6.2,
  326. 14.0,
  327. 2.2,
  328. 3.0,
  329. 4.5,
  330. 6.3,
  331. 10.2,
  332. 20.3,
  333. 23.4
  334. ]
  335. }
  336. ]
  337. };
  338. myCharts.setOption(option);
  339. myCharts.on("click", param => {
  340. this.$router.push("/evaluate/evTwoLevelMenu");
  341. if (param.seriesName == "室内温度满足率") {
  342. this.$router.push({
  343. path: "/evaluate/evTwoLevelMenu",
  344. query: { type: 1 }
  345. });
  346. } else if (param.seriesName == "节能率") {
  347. this.$router.push({
  348. path: "/evaluate/evTwoLevelMenu",
  349. query: { type: 2 }
  350. });
  351. } else {
  352. this.$router.push({
  353. path: "/evaluate/evTwoLevelMenu",
  354. query: { type: 3 }
  355. });
  356. }
  357. });
  358. }
  359. }
  360. };
  361. </script>
  362. <style lang="scss" scoped>
  363. .p-echarts {
  364. width: 100%;
  365. height: 100%;
  366. #pCharts2 {
  367. width: 100%;
  368. height: 100%;
  369. }
  370. .pLegend {
  371. font-size: 12px;
  372. color: #000000;
  373. text-align: center;
  374. margin-top: 20px;
  375. .icon1 {
  376. display: inline-block;
  377. width: 12px;
  378. height: 12px;
  379. background: rgba(52, 199, 36, 1);
  380. vertical-align: middle;
  381. margin-right: 3px;
  382. }
  383. .icon2 {
  384. display: inline-block;
  385. width: 12px;
  386. height: 12px;
  387. background: #f54e45;
  388. vertical-align: middle;
  389. margin-right: 3px;
  390. margin-left: 20px;
  391. }
  392. .icon3 {
  393. display: inline-block;
  394. width: 12px;
  395. height: 12px;
  396. background: #8d9399;
  397. vertical-align: middle;
  398. margin-right: 3px;
  399. margin-left: 20px;
  400. }
  401. .icon4 {
  402. display: inline-block;
  403. height: 6px;
  404. width: 16px;
  405. background: rgba(0, 145, 255, 1);
  406. border-radius: 3px;
  407. vertical-align: middle;
  408. margin-right: 3px;
  409. margin-left: 20px;
  410. }
  411. .icon5 {
  412. display: inline-block;
  413. height: 6px;
  414. width: 16px;
  415. background: #00d6b9;
  416. border-radius: 3px;
  417. vertical-align: middle;
  418. margin-right: 3px;
  419. margin-left: 20px;
  420. }
  421. }
  422. }
  423. </style>