CylinderdataStatistics.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page import="com.runzhixing.tool.Util" %>
  3. <%@ page import="com.runzhixing.bean.CityPlace" %>
  4. <%@ page import="com.runzhixing.bean.CountryPlace" %>
  5. <%@ page import="com.runzhixing.bean.Station" %>
  6. <%@ page import="com.runzhixing.bean.AuthorityRegionPlace" %>
  7. <%@ page import="com.runzhixing.bean.User" %>
  8. <%@ page import="com.runzhixing.constant.Constant" %>
  9. <%
  10. String path = request.getContextPath();
  11. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  12. User user = (User)session.getAttribute(Constant.userMark);
  13. List<AuthorityRegionPlace> arplist = user.getPrivilegePlaces1();
  14. List<CityPlace> cplist = new ArrayList<CityPlace>();
  15. List<CountryPlace> cyplist = new ArrayList<CountryPlace>();
  16. List<Station> slist = new ArrayList<Station>();
  17. %>
  18. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  19. <html>
  20. <head>
  21. <base href="<%=basePath%>">
  22. <title>气瓶数据统计</title>
  23. <meta http-equiv="pragma" content="no-cache">
  24. <meta http-equiv="cache-control" content="no-cache">
  25. <meta http-equiv="expires" content="0">
  26. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  27. <meta http-equiv="description" content="This is my page">
  28. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  29. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  30. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  31. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  32. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  33. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  34. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
  35. <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
  36. <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
  37. <script type="text/javascript" src="js/common/area.js"></script>
  38. <script src="js/highcharts.js"></script>
  39. <script src="js/exporting.js"></script>
  40. <script src="http://cdn.hcharts.cn/highcharts/modules/offline-exporting.js"></script>
  41. <script type="text/javascript">
  42. var i = 1;//第几页
  43. var sum;//总条数
  44. var totalpage;//总页数
  45. $(document).ready(function(){
  46. fLoadTable();
  47. //fLoadData(1,10);
  48. selectCountry();
  49. });
  50. function fLoadTable(){
  51. $('#tt').datagrid({
  52. fit: true,//自动大小
  53. title: '',
  54. width: '100%',
  55. height: 580,
  56. toolbar: '#toolbar',
  57. fitColumns: true,
  58. singleSelect:false,
  59. loadMsg:'正在加载, 请稍等 …',
  60. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  61. striped : true,//设置为true将交替显示行背景
  62. collapsible : false,//显示可折叠按钮
  63. singleSelect:true,//为true时只能选择单行
  64. fitColumns:true//允许表格自动缩放,以适应父容器
  65. });
  66. }
  67. function fLoadData(page,rows){
  68. var cylinderpName = $('#cylinderpName').val();
  69. var myDate = new Date();
  70. var cylinderTime = myDate.getTime();
  71. cylinderpName = "images/createImg/"+cylinderTime+".png";
  72. var checkText="";
  73. var checkText1=$("#province").find("option:selected").text();
  74. var checkText2=$("#city").find("option:selected").text();
  75. checkText2 = checkText2.replace("无", "");
  76. checkText2 = checkText2.replace("全部", "");
  77. var checkText3=$("#country").find("option:selected").text();
  78. checkText3 = checkText3.replace("无", "");
  79. checkText3 = checkText3.replace("全部", "");
  80. checkText = checkText1+checkText2+checkText3;
  81. if (!checkText ){
  82. checkText = "气瓶数据统计";
  83. } 
  84. $.messager.progress({
  85. title: '请等待',
  86. msg: '正在加载数据...',
  87. text: '查询中.......'
  88. });
  89. var myselect=document.getElementById("searchType")
  90. var CountArray=[];
  91. $.ajax({
  92. type:"POST",
  93. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  94. data:$('#cylinderDateStatistform').serialize(),
  95. url:"ajax/CylinderDataStatistics?cylinderpName="+cylinderTime,
  96. success:function (data){
  97. //$("#infoaddstreetwindows").panel({title:rowData.seriesName});
  98. var vData = $.parseJSON(data);
  99. //document.getElementById("sumContent").innerHTML="<span style='font-size:24px;font: bold;'>总 数 : "+vData.status+"</span>";
  100. //document.getElementById("titleContent").innerHTML=checkText;
  101. //document.getElementById("cylinderImg").innerHTML='<img src='+cylinderpName+' height="70%;" width="90%" />';
  102. //document.getElementById("cylinderImg").innerHTML='<img src='+inputpName+'height="auto" width="100%" />';
  103. $.messager.progress('close');
  104. if(myselect.value==1){
  105. document.getElementById("container").innerHTML="";
  106. $.each(vData.statisticList, function(i,item){
  107. var content = '<div id="container'+i+'" width="100%" height="100%"></div>'
  108. $("#container").append(content);
  109. // 构建图表
  110. var chart = Highcharts.chart('container'+i,{
  111. title: {
  112. text: item.name+'('+item.total+')'
  113. },
  114. tooltip: {
  115. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>',
  116. formatter: function () {
  117. return ' <b> ' + this .point.name + ' </b>: ' + Highcharts.numberFormat( this .percentage, 1 ) + ' % ( ' +
  118. Highcharts.numberFormat( this .y, 0 , ' , ' ) + ' 个) ' ;
  119. }
  120. },
  121. credits: {
  122. enabled:false
  123. },//去掉地址
  124. plotOptions: {
  125. pie: {
  126. allowPointSelect: true,
  127. cursor: 'pointer',
  128. dataLabels: {
  129. enabled: true,
  130. format: '<b>{point.name}</b>: {point.percentage:.1f} % ( {point.y}个 )',
  131. style: {
  132. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
  133. },
  134. connectorColor: 'silver'
  135. }
  136. }
  137. },
  138. series: [{
  139. type: 'pie',
  140. name: '浏览器占比',
  141. data:item.data2
  142. }]
  143. });
  144. });
  145. }else{
  146. console.log(vData.statisticList)
  147. var xText = "";
  148. if(vData.searchType==0){
  149. xText = "车辆应用类型";
  150. }else if(vData.searchType==1){
  151. xText = "工作人员";
  152. }
  153. var chart = Highcharts.chart('container',{
  154. chart: {
  155. type: 'column'
  156. },
  157. title: {
  158. text: '气瓶数据统计('+vData.sum+')'
  159. },
  160. subtitle: {
  161. text: ''
  162. },
  163. credits: {
  164. enabled:false
  165. },//去掉地址
  166. xAxis: {
  167. categories:vData.x,
  168. crosshair: true
  169. },
  170. yAxis: {
  171. min: 0,
  172. title: {
  173. text: '数量'
  174. }
  175. },
  176. plotOptions: {
  177. column: {
  178. borderWidth: 0,
  179. dataLabels:{
  180. enabled:true, // dataLabels设为true
  181. style:{
  182. color:'#000000'
  183. }
  184. }
  185. }
  186. },
  187. series: vData.statisticList
  188. });
  189. }
  190. }
  191. });
  192. }
  193. function selectCountry(){
  194. var id=document.getElementById("city").value;
  195. var select = document.getElementById("country");
  196. for(var i=select.options.length-1;i>=0;i--) {
  197. select.options.remove(i);
  198. }
  199. $.ajax({
  200. type:"POST",
  201. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  202. url:"ajax/hiddenCity?cityId="+id,
  203. success:function (data){
  204. var obj=eval("(" + data + ")");
  205. $.each(obj.rows, function(i,item){
  206. select.options.add(new Option(item.name, item.id));
  207. });
  208. }
  209. });
  210. }
  211. function selectCountry1(){
  212. selectCountry();
  213. //fLoadData(1,10);
  214. }
  215. </script>
  216. </head>
  217. <body>
  218. <!-- 查询结果:数据表格 -->
  219. <!-- <table id="tt" cellspacing="0" cellpadding="0" >
  220. </table> -->
  221. <div id="toolbar" style="padding-top: 2px;height: auto;">
  222. <form id="cylinderDateStatistform" action="ajax/cylinderDateStatist" method="post">
  223. <table>
  224. <tr>
  225. <td>
  226. <span class="hzbspan">省:</span>
  227. </td>
  228. <td>
  229. <select name="province" id="province" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select">
  230. <%for(AuthorityRegionPlace arp:arplist){
  231. cplist = arp.getCityPlace();
  232. %>
  233. <option value="<%=arp.getId() %>">
  234. <%=arp.getName() %>
  235. </option>
  236. <%} %>
  237. </select>
  238. </td>
  239. <td>
  240. <span class="hzbspan">市:</span>
  241. </td>
  242. <td>
  243. <select name="city" id="city" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectCountry1()">
  244. <%
  245. for(CityPlace cp:cplist){
  246. cyplist = cp.getSubPlaceList();
  247. %>
  248. <option value="<%=cp.getId() %>">
  249. <%=cp.getName() %>
  250. </option>
  251. <%} %>
  252. </select>
  253. </td>
  254. <td>
  255. <span class="hzbspan">县:</span>
  256. </td>
  257. <td>
  258. <select name="country" id = "country" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select">
  259. </select>
  260. </td>
  261. <td>
  262. <span class="hzbspan">充装介质:</span>
  263. </td>
  264. <td>
  265. <select name="media" id="media" style="width: 150px;height: 34px;" class="hzbspan1 select">
  266. <option value="-1">全部</option>
  267. <option value="0">CNG-高压气体</option>
  268. <option value="1">LNG-低温液化天然气</option>
  269. </select>
  270. </td>
  271. </tr>
  272. <tr><td>
  273. <span class="hzbspan" >注册时间:从</span>
  274. </td>
  275. <td><input type="text" class="easyui-datebox" id="startTime" name="startTime" style="width: 150px;height: 34px;" class="hzbspan" data-options="prompt:'- - - - - - -'">
  276. </td>
  277. <td><span class="hzbspan">到:</span>
  278. </td>
  279. <td><input type="text" class="easyui-datebox" id="endTime" name="endTime" style="width: 150px;height: 34px;" class="hzbspan" data-options="prompt:'- - - - - - -'">
  280. </td>
  281. <td><span class="hzbspan">统计类型:</span>
  282. </td>
  283. <td><select name="searchType" id = "searchType" style="width: 150px;height: 34px;" class="hzbspan select" >
  284. <option value="0">按所选地区用应用类型统计</option>
  285. <option value="1">按下属分地区应用类型统计</option>
  286. <option value="2" selected="selected">按下属分地区车辆总数统计</option>
  287. </select></td>
  288. <td><span class="hzbspan">包含注销气瓶:</span>
  289. </td>
  290. <td><select name="CancelFlag" style="width: 150px;height: 34px;" class="hzbspan select" >
  291. <option value="1" selected="selected">是</option>
  292. <option value="0">否</option>
  293. </select></td>
  294. <td>
  295. <a id="btninfosearch" class="easyui-linkbutton" icon="icon-search" style="width: 150px;height: 34px;" onclick="fLoadData(1,10);" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">查询</span></a>
  296. </td></tr>
  297. </table>
  298. </form>
  299. </div>
  300. <!--
  301. <center>
  302. <div id="cylinderImg" style="position: absolute;top:112px;left: 10%;width: 80%;height: 600px;text-align: center;overflow: auto;">
  303. </div>
  304. <div id="titleContent" style="position: absolute;top:80px;left: 10%;width: 80%; text-align: center;font-size: 18px;" class="hzbspan">
  305. </div>
  306. <div id="sumContent" style="position: absolute;top:112px;right:2%; text-align: center;font-size: 18px;" class="hzbspan">
  307. </div>
  308. </center>
  309. -->
  310. <div id="container" style="position: absolute;width: 100%; height: auto;text-align: center;overflow: scroll; ">
  311. </div>
  312. </body>
  313. </html>