daily_view2.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox-content">
  4. <div class="row">
  5. <div class="col-xs-12" >
  6. <form action="{:url('energyStatistics/dailyView2')}" method="POST" id='search_form' class="form-inline">
  7. <div class="input-group" style="width: 200px">
  8. <span class="input-group-addon">年份</span>
  9. <input class="form-control dialog-datetime" id="start" name="month" type="text" value="{$month}" placeholder="" readonly/>
  10. </div>
  11. <div class="input-group">
  12. <span class="input-group-btn">
  13. <button class="btn-sm btn-danger" type="submit" ><i class="fa fa-search"></i></button>
  14. </span>&nbsp;
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  17. </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. <br>
  23. <div class="ibox">
  24. <div class="panel-group">
  25. <div class="panel panel-default">
  26. <div class="panel-heading clearfix">
  27. <div class="btn-group pull-left">
  28. 医院每月能耗数据分析
  29. </div>
  30. <div class="btn-group pull-right">
  31. <!-- <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>-->
  32. </div>
  33. </div>
  34. <div class="panel-body" id="printer">
  35. <div id="echarts1" style="width: 100%;height: 350px">
  36. </div>
  37. <div id="echarts2" style="width: 100%;height: 350px">
  38. </div>
  39. <div id="echarts3" style="width: 100%;height: 350px">
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. {/block}
  47. {block name="script"}
  48. <script src="/static/browser.js"></script>
  49. <script src="/static/jquery.jqprint-0.3.js"></script>
  50. <script src="/static/data/js/echarts.js"></script>
  51. <script>
  52. $(function () {
  53. laydate.render({
  54. elem: '#start',
  55. trigger: 'click',
  56. theme: '#1d519c',
  57. type: 'year',
  58. });
  59. });
  60. function printer(){
  61. $('#printer').jqprint();
  62. }
  63. function empty_search(){
  64. window.location.href = "{:url('energyStatistics/dailyView2')}";
  65. }
  66. var colors = [ '#d14a61','#5793f3', '#91c7ae'];
  67. var option = {
  68. tooltip: {
  69. trigger: 'axis',
  70. axisPointer: {
  71. type: 'cross',
  72. crossStyle: {
  73. color: '#999'
  74. }
  75. }
  76. },
  77. legend: {
  78. data: ['{$year-3}用电量','{$year-2}用电量','{$year-1}用电量', '{$year}用电量', '月度平均最高温度','月度平均最低温度','床位数量']
  79. },
  80. xAxis: [
  81. {
  82. type: 'category',
  83. data: {:json_encode($date)},
  84. axisPointer: {
  85. type: 'shadow'
  86. }
  87. }
  88. ],
  89. yAxis: [
  90. {
  91. type: 'value',
  92. name: '使用量',
  93. offset: 5,
  94. splitLine:{
  95. show:false
  96. },
  97. axisLine: {
  98. show: true,
  99. lineStyle: {
  100. color: colors[0],
  101. }
  102. },
  103. axisLabel: {
  104. formatter: '{value} kWh'
  105. }
  106. },
  107. {
  108. type: 'value',
  109. name: '温度',
  110. splitLine:{
  111. show:false
  112. },
  113. axisLine: {
  114. show: true,
  115. lineStyle: {
  116. color: colors[1],
  117. }
  118. },
  119. axisLabel: {
  120. formatter: '{value} ℃'
  121. }
  122. },
  123. {
  124. type: 'value',
  125. name: '床位数量',
  126. position: 'right',
  127. alignTicks: true,
  128. offset: 60,
  129. splitLine:{
  130. show:false
  131. },
  132. axisLine: {
  133. show: true,
  134. lineStyle: {
  135. color: colors[2],
  136. }
  137. },
  138. axisLabel: {
  139. formatter: '{value} 个'
  140. }
  141. }
  142. ],
  143. series: [
  144. {
  145. name: '{$year-3}用电量',
  146. type: 'bar',
  147. barWidth: 12,
  148. data: {:json_encode($data['lastElectricity3'])},
  149. },
  150. {
  151. name: '{$year-2}用电量',
  152. type: 'bar',
  153. barWidth: 12,
  154. data: {:json_encode($data['lastElectricity2'])},
  155. },
  156. {
  157. name: '{$year-1}用电量',
  158. type: 'bar',
  159. barWidth: 12,
  160. data: {:json_encode($data['lastElectricity'])},
  161. },
  162. {
  163. name: '{$year}用电量',
  164. type: 'bar',
  165. barWidth: 12,
  166. data: {:json_encode($data['electricity'])},
  167. },
  168. {
  169. name: '月度平均最高温度',
  170. type: 'line',
  171. yAxisIndex: 1,
  172. data: {:json_encode($data['electricityTempMax'])},
  173. },
  174. {
  175. name: '月度平均最低温度',
  176. type: 'line',
  177. yAxisIndex: 1,
  178. data: {:json_encode($data['electricityTempMin'])},
  179. },
  180. {
  181. name: '床位数量',
  182. type: 'line',
  183. yAxisIndex: 2,
  184. data: {:json_encode($data['electricityBeds'])},
  185. },
  186. ]
  187. };
  188. var myChart = echarts.init(document.getElementById('echarts1'));
  189. myChart.setOption(option);
  190. var option2 = {
  191. tooltip: {
  192. trigger: 'axis',
  193. axisPointer: {
  194. type: 'cross',
  195. crossStyle: {
  196. color: '#999'
  197. }
  198. }
  199. },
  200. legend: {
  201. data: ['{$year-3}用水量','{$year-2}用水量','{$year-1}用水量', '{$year}用水量', '月度平均最高温度','月度平均最低温度','床位数量']
  202. },
  203. xAxis: [
  204. {
  205. type: 'category',
  206. data: {:json_encode($date)},
  207. axisPointer: {
  208. type: 'shadow'
  209. }
  210. }
  211. ],
  212. yAxis: [
  213. {
  214. type: 'value',
  215. name: '使用量',
  216. offset: 5,
  217. splitLine:{
  218. show:false
  219. },
  220. axisLine: {
  221. show: true,
  222. lineStyle: {
  223. color: colors[0],
  224. }
  225. },
  226. axisLabel: {
  227. formatter: '{value} m³'
  228. }
  229. },
  230. {
  231. type: 'value',
  232. name: '温度',
  233. splitLine:{
  234. show:false
  235. },
  236. axisLine: {
  237. show: true,
  238. lineStyle: {
  239. color: colors[1],
  240. }
  241. },
  242. axisLabel: {
  243. formatter: '{value} ℃'
  244. }
  245. },
  246. {
  247. type: 'value',
  248. name: '床位数量',
  249. position: 'right',
  250. alignTicks: true,
  251. offset: 60,
  252. splitLine:{
  253. show:false
  254. },
  255. axisLine: {
  256. show: true,
  257. lineStyle: {
  258. color: colors[2],
  259. }
  260. },
  261. axisLabel: {
  262. formatter: '{value} 个'
  263. }
  264. }
  265. ],
  266. series: [
  267. {
  268. name: '{$year-3}用水量',
  269. type: 'bar',
  270. barWidth: 12,
  271. data: {:json_encode($data['lastWater3'])},
  272. },
  273. {
  274. name: '{$year-2}用水量',
  275. type: 'bar',
  276. barWidth: 12,
  277. data: {:json_encode($data['lastWater2'])},
  278. },
  279. {
  280. name: '{$year-1}用水量',
  281. type: 'bar',
  282. barWidth: 12,
  283. data: {:json_encode($data['lastWater'])},
  284. },
  285. {
  286. name: '{$year}用水量',
  287. type: 'bar',
  288. barWidth: 12,
  289. data: {:json_encode($data['water'])},
  290. },
  291. {
  292. name: '月度平均最高温度',
  293. type: 'line',
  294. yAxisIndex: 1,
  295. data: {:json_encode($data['waterTempMax'])}
  296. },
  297. {
  298. name: '月度平均最低温度',
  299. type: 'line',
  300. yAxisIndex: 1,
  301. data: {:json_encode($data['waterTempMin'])}
  302. },
  303. {
  304. name: '床位数量',
  305. type: 'line',
  306. yAxisIndex: 2,
  307. data: {:json_encode($data['waterBeds'])}
  308. },
  309. ]
  310. };
  311. var myChart2 = echarts.init(document.getElementById('echarts2'));
  312. myChart2.setOption(option2);
  313. var option3 = {
  314. tooltip: {
  315. trigger: 'axis',
  316. axisPointer: {
  317. type: 'cross',
  318. crossStyle: {
  319. color: '#999'
  320. }
  321. }
  322. },
  323. legend: {
  324. data: ['{$year-3}燃气用量', '{$year-2}燃气用量','{$year-1}燃气用量', '{$year}燃气用量', '月度平均最高温度','月度平均最低温度','床位数量']
  325. },
  326. xAxis: [
  327. {
  328. type: 'category',
  329. data: {:json_encode($date)},
  330. axisPointer: {
  331. type: 'shadow'
  332. }
  333. }
  334. ],
  335. yAxis: [
  336. {
  337. type: 'value',
  338. name: '使用量 ',
  339. offset: 5,
  340. splitLine:{
  341. show:false
  342. },
  343. axisLine: {
  344. show: true,
  345. lineStyle: {
  346. color: colors[0],
  347. }
  348. },
  349. axisLabel: {
  350. formatter: '{value} m³'
  351. }
  352. },
  353. {
  354. type: 'value',
  355. name: '温度',
  356. splitLine:{
  357. show:false
  358. },
  359. axisLine: {
  360. show: true,
  361. lineStyle: {
  362. color: colors[1],
  363. }
  364. },
  365. axisLabel: {
  366. formatter: '{value} ℃'
  367. }
  368. },
  369. {
  370. type: 'value',
  371. name: '床位数量',
  372. position: 'right',
  373. alignTicks: true,
  374. offset: 60,
  375. splitLine:{
  376. show:false
  377. },
  378. axisLine: {
  379. show: true,
  380. lineStyle: {
  381. color: colors[2],
  382. }
  383. },
  384. axisLabel: {
  385. formatter: '{value} 个'
  386. }
  387. }
  388. ],
  389. series: [
  390. {
  391. name: '{$year-3}燃气用量',
  392. type: 'bar',
  393. barWidth: 12,
  394. data: {:json_encode($data['lastGas3'])},
  395. },
  396. {
  397. name: '{$year-2}燃气用量',
  398. type: 'bar',
  399. barWidth: 12,
  400. data: {:json_encode($data['lastGas2'])},
  401. },
  402. {
  403. name: '{$year-1}燃气用量',
  404. type: 'bar',
  405. barWidth: 12,
  406. data: {:json_encode($data['lastGas'])},
  407. },
  408. {
  409. name: '{$year}燃气用量',
  410. type: 'bar',
  411. barWidth: 12,
  412. data: {:json_encode($data['gas'])},
  413. },
  414. {
  415. name: '月度平均最高温度',
  416. type: 'line',
  417. yAxisIndex: 1,
  418. data: {:json_encode($data['gasTempMax'])},
  419. },
  420. {
  421. name: '月度平均最低温度',
  422. type: 'line',
  423. yAxisIndex: 1,
  424. data: {:json_encode($data['gasTempMin'])},
  425. },
  426. {
  427. name: '床位数量',
  428. type: 'line',
  429. yAxisIndex: 2,
  430. data: {:json_encode($data['gasBeds'])},
  431. },
  432. ]
  433. };
  434. var myChart3 = echarts.init(document.getElementById('echarts3'));
  435. myChart3.setOption(option3);
  436. </script>
  437. {/block}