daily_view.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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/dailyView')}" 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" data-date-format="yyyy-mm" 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: 'month',
  58. });
  59. });
  60. function printer(){
  61. $('#printer').jqprint();
  62. }
  63. function empty_search(){
  64. window.location.href = "{:url('energyStatistics/dailyView')}";
  65. }
  66. var colors = [ '#d14a61','#5793f3', '#91c7ae'];
  67. var option = {
  68. // dataZoom: [{
  69. // type: 'slider',
  70. // start: 0,
  71. // end: 100
  72. // }, {
  73. // type: 'inside',
  74. // start: 0,
  75. // end: 100
  76. // }],
  77. tooltip: {
  78. trigger: 'axis',
  79. axisPointer: {
  80. type: 'cross',
  81. crossStyle: {
  82. color: '#999'
  83. }
  84. }
  85. },
  86. legend: {
  87. data: ['{$year-1}用电量', '{$year}用电量', '{$year}最高温度','{$year}最低温度','{$year-1}最高温度','{$year-1}最低温度','床位数量']
  88. },
  89. xAxis: [
  90. {
  91. type: 'category',
  92. data: {:json_encode($date['md'])},
  93. axisPointer: {
  94. type: 'shadow'
  95. }
  96. }
  97. ],
  98. yAxis: [
  99. {
  100. type: 'value',
  101. name: '使用量',
  102. offset: 5,
  103. splitLine:{
  104. show:false
  105. },
  106. axisLine: {
  107. show: true,
  108. lineStyle: {
  109. color: colors[0],
  110. }
  111. },
  112. axisLabel: {
  113. formatter: '{value} kWh'
  114. }
  115. },
  116. {
  117. type: 'value',
  118. name: '温度',
  119. splitLine:{
  120. show:false
  121. },
  122. axisLine: {
  123. show: true,
  124. lineStyle: {
  125. color: colors[1],
  126. }
  127. },
  128. axisLabel: {
  129. formatter: '{value} ℃'
  130. }
  131. },
  132. {
  133. type: 'value',
  134. name: '床位数量',
  135. position: 'right',
  136. alignTicks: true,
  137. offset: 60,
  138. splitLine:{
  139. show:false
  140. },
  141. axisLine: {
  142. show: true,
  143. lineStyle: {
  144. color: colors[2],
  145. }
  146. },
  147. axisLabel: {
  148. formatter: '{value} 个'
  149. }
  150. }
  151. ],
  152. series: [
  153. {
  154. name: '{$year-1}用电量',
  155. type: 'bar',
  156. barWidth: 12,
  157. data: {:json_encode($data['lastElectricity'])},
  158. },
  159. {
  160. name: '{$year}用电量',
  161. type: 'bar',
  162. barWidth: 12,
  163. data: {:json_encode($data['electricity'])},
  164. },
  165. {
  166. name: '{$year}最高温度',
  167. type: 'line',
  168. yAxisIndex: 1,
  169. data: {:json_encode($data['electricityTempMax'])},
  170. },
  171. {
  172. name: '{$year}最低温度',
  173. type: 'line',
  174. yAxisIndex: 1,
  175. data: {:json_encode($data['electricityTempMin'])},
  176. },
  177. {
  178. name: '{$year-1}最高温度',
  179. type: 'line',
  180. yAxisIndex: 1,
  181. data: {:json_encode($data['LastElectricityTempMax'])},
  182. lineStyle: {
  183. type: 'dashed'
  184. },
  185. },
  186. {
  187. name: '{$year-1}最低温度',
  188. type: 'line',
  189. yAxisIndex: 1,
  190. data: {:json_encode($data['LastElectricityTempMin'])},
  191. lineStyle: {
  192. type: 'dashed'
  193. },
  194. itemStyle: {
  195. color: '#5470C6' // 绿色
  196. }
  197. },
  198. {
  199. name: '床位数量',
  200. type: 'line',
  201. yAxisIndex: 2,
  202. data: {:json_encode($data['electricityBeds'])},
  203. itemStyle: {
  204. color: '#ee6666' // 绿色
  205. }
  206. },
  207. ]
  208. };
  209. var myChart = echarts.init(document.getElementById('echarts1'));
  210. myChart.setOption(option);
  211. var option2 = {
  212. tooltip: {
  213. trigger: 'axis',
  214. axisPointer: {
  215. type: 'cross',
  216. crossStyle: {
  217. color: '#999'
  218. }
  219. }
  220. },
  221. legend: {
  222. data: ['{$year-1}用水量', '{$year}用水量', '最高温度','最低温度','床位数量']
  223. },
  224. xAxis: [
  225. {
  226. type: 'category',
  227. data: {:json_encode($date['md'])},
  228. axisPointer: {
  229. type: 'shadow'
  230. }
  231. }
  232. ],
  233. yAxis: [
  234. {
  235. type: 'value',
  236. name: '使用量',
  237. offset: 5,
  238. splitLine:{
  239. show:false
  240. },
  241. axisLine: {
  242. show: true,
  243. lineStyle: {
  244. color: colors[0],
  245. }
  246. },
  247. axisLabel: {
  248. formatter: '{value} m³'
  249. }
  250. },
  251. {
  252. type: 'value',
  253. name: '温度',
  254. splitLine:{
  255. show:false
  256. },
  257. axisLine: {
  258. show: true,
  259. lineStyle: {
  260. color: colors[1],
  261. }
  262. },
  263. axisLabel: {
  264. formatter: '{value} ℃'
  265. }
  266. },
  267. {
  268. type: 'value',
  269. name: '床位数量',
  270. position: 'right',
  271. alignTicks: true,
  272. offset: 60,
  273. splitLine:{
  274. show:false
  275. },
  276. axisLine: {
  277. show: true,
  278. lineStyle: {
  279. color: colors[2],
  280. }
  281. },
  282. axisLabel: {
  283. formatter: '{value} 个'
  284. }
  285. }
  286. ],
  287. series: [
  288. {
  289. name: '{$year-1}用水量',
  290. type: 'bar',
  291. barWidth: 12,
  292. data: {:json_encode($data['lastWater'])},
  293. },
  294. {
  295. name: '{$year}用水量',
  296. type: 'bar',
  297. barWidth: 12,
  298. data: {:json_encode($data['water'])},
  299. },
  300. {
  301. name: '最高温度',
  302. type: 'line',
  303. yAxisIndex: 1,
  304. data: {:json_encode($data['waterTempMax'])}
  305. },
  306. {
  307. name: '最低温度',
  308. type: 'line',
  309. yAxisIndex: 1,
  310. data: {:json_encode($data['waterTempMin'])}
  311. },
  312. {
  313. name: '床位数量',
  314. type: 'line',
  315. yAxisIndex: 2,
  316. data: {:json_encode($data['waterBeds'])}
  317. },
  318. ]
  319. };
  320. var myChart2 = echarts.init(document.getElementById('echarts2'));
  321. myChart2.setOption(option2);
  322. var option3 = {
  323. tooltip: {
  324. trigger: 'axis',
  325. axisPointer: {
  326. type: 'cross',
  327. crossStyle: {
  328. color: '#999'
  329. }
  330. }
  331. },
  332. legend: {
  333. data: ['{$year-1}燃气用量', '{$year}燃气用量', '最高温度','最低温度','床位数量']
  334. },
  335. xAxis: [
  336. {
  337. type: 'category',
  338. data: {:json_encode($date['md'])},
  339. axisPointer: {
  340. type: 'shadow'
  341. }
  342. }
  343. ],
  344. yAxis: [
  345. {
  346. type: 'value',
  347. name: '使用量 ',
  348. offset: 5,
  349. splitLine:{
  350. show:false
  351. },
  352. axisLine: {
  353. show: true,
  354. lineStyle: {
  355. color: colors[0],
  356. }
  357. },
  358. axisLabel: {
  359. formatter: '{value} m³'
  360. }
  361. },
  362. {
  363. type: 'value',
  364. name: '温度',
  365. splitLine:{
  366. show:false
  367. },
  368. axisLine: {
  369. show: true,
  370. lineStyle: {
  371. color: colors[1],
  372. }
  373. },
  374. axisLabel: {
  375. formatter: '{value} ℃'
  376. }
  377. },
  378. {
  379. type: 'value',
  380. name: '床位数量',
  381. position: 'right',
  382. alignTicks: true,
  383. offset: 60,
  384. splitLine:{
  385. show:false
  386. },
  387. axisLine: {
  388. show: true,
  389. lineStyle: {
  390. color: colors[2],
  391. }
  392. },
  393. axisLabel: {
  394. formatter: '{value} 个'
  395. }
  396. }
  397. ],
  398. series: [
  399. {
  400. name: '{$year-1}燃气用量',
  401. type: 'bar',
  402. barWidth: 12,
  403. data: {:json_encode($data['lastGas'])},
  404. },
  405. {
  406. name: '{$year}燃气用量',
  407. type: 'bar',
  408. barWidth: 12,
  409. data: {:json_encode($data['gas'])},
  410. },
  411. {
  412. name: '最高温度',
  413. type: 'line',
  414. yAxisIndex: 1,
  415. data: {:json_encode($data['gasTempMax'])},
  416. },
  417. {
  418. name: '最低温度',
  419. type: 'line',
  420. yAxisIndex: 1,
  421. data: {:json_encode($data['gasTempMin'])},
  422. },
  423. {
  424. name: '床位数量',
  425. type: 'line',
  426. yAxisIndex: 2,
  427. data: {:json_encode($data['gasBeds'])},
  428. },
  429. ]
  430. };
  431. var myChart3 = echarts.init(document.getElementById('echarts3'));
  432. myChart3.setOption(option3);
  433. </script>
  434. {/block}