stationStatistics.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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 pageSize =10;
  45. var totalpage;//总页数
  46. $(document).ready(function(){
  47. fLoadTable();
  48. selectCountry();
  49. selectstation();
  50. //fLoadData(1,10);
  51. });
  52. function fLoadTable(){
  53. $('#tt').datagrid({
  54. fit: true,//自动大小
  55. title: '',
  56. width: '100%',
  57. height: 580,
  58. toolbar: '#toolbar',
  59. fitColumns: true,
  60. singleSelect:false,
  61. loadMsg:'正在加载, 请稍等 …',
  62. nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
  63. striped : true,//设置为true将交替显示行背景
  64. collapsible : false,//显示可折叠按钮
  65. singleSelect:true,//为true时只能选择单行
  66. fitColumns:true//允许表格自动缩放,以适应父容器
  67. });
  68. }
  69. function fLoadData(page,rows){
  70. $.messager.progress({
  71. title: '请等待',
  72. msg: '正在加载数据...',
  73. text: '查询中.......'
  74. });
  75. $.ajax({
  76. type:"POST",
  77. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  78. data:$('#fillingDataStatistform').serialize(),
  79. url:"ajax/getStation2",
  80. success:function (data){
  81. //$("#infoaddstreetwindows").panel({title:rowData.seriesName});
  82. //document.getElementById("titleContent").innerHTML=checkText;
  83. //document.getElementById("cylinderImg").innerHTML='<img src='+cylinderpName+' height="auto" width="auto" />';
  84. //document.getElementById("cylinderImg").innerHTML='<img src='+cylinderpName+' height="70%;" width="90%"/>';
  85. //document.getElementById("cylinderImg").innerHTML='<img src='+inputpName+'height="auto" width="100%" />';
  86. $.messager.progress('close');
  87. var vData = $.parseJSON(data);
  88. var content = '<div id="container1" width="100%" height="100%"></div>'
  89. $("#container").append(content);
  90. // 构建图表
  91. var chart = Highcharts.chart('container1',{
  92. title: {
  93. text: '加气站统计('+vData.stationTotal+')'
  94. },
  95. tooltip: {
  96. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>',
  97. formatter: function () {
  98. return ' <b> ' + this .point.name + ' </b>: ' + Highcharts.numberFormat( this .percentage, 1 ) + ' % ( ' +
  99. Highcharts.numberFormat( this .y, 0 , ' , ' ) + ' 个) ' ;
  100. }
  101. },
  102. credits: {
  103. enabled:false
  104. },//去掉地址
  105. plotOptions: {
  106. pie: {
  107. allowPointSelect: true,
  108. cursor: 'pointer',
  109. dataLabels: {
  110. enabled: true,
  111. format: '<b>{point.name}</b>: {point.percentage:.1f} % ( {point.y}个 )',
  112. style: {
  113. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
  114. },
  115. connectorColor: 'silver'
  116. }
  117. }
  118. },
  119. series: [{
  120. type: 'pie',
  121. name: '浏览器占比',
  122. data:vData.pieList1
  123. }]
  124. });
  125. var content2 = '<div id="container2" width="100%" height="100%"></div>'
  126. $("#container").append(content2);
  127. // 构建图表
  128. var chart2 = Highcharts.chart('container2',{
  129. title: {
  130. text: '加气机统计('+vData.machineTotal+')'
  131. },
  132. tooltip: {
  133. pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>',
  134. formatter: function () {
  135. return ' <b> ' + this .point.name + ' </b>: ' + Highcharts.numberFormat( this .percentage, 1 ) + ' % ( ' +
  136. Highcharts.numberFormat( this .y, 0 , ' , ' ) + ' 个) ' ;
  137. }
  138. },
  139. credits: {
  140. enabled:false
  141. },//去掉地址
  142. plotOptions: {
  143. pie: {
  144. allowPointSelect: true,
  145. cursor: 'pointer',
  146. dataLabels: {
  147. enabled: true,
  148. format: '<b>{point.name}</b>: {point.percentage:.1f} % ( {point.y}个 )',
  149. style: {
  150. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
  151. },
  152. connectorColor: 'silver'
  153. }
  154. }
  155. },
  156. series: [{
  157. type: 'pie',
  158. name: '浏览器占比',
  159. data:vData.pieList2
  160. }]
  161. });
  162. }
  163. });
  164. }
  165. function selectCountry(){
  166. var id=document.getElementById("city").value;
  167. var select = document.getElementById("country");
  168. for(var i=select.options.length-1;i>=0;i--) {
  169. select.options.remove(i);
  170. }
  171. $.ajax({
  172. type:"POST",
  173. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  174. url:"ajax/hiddenCity?cityId="+id,
  175. success:function (data){
  176. var obj=eval("(" + data + ")");
  177. $.each(obj.rows, function(i,item){
  178. select.options.add(new Option(item.name, item.id));
  179. });
  180. }
  181. });
  182. }
  183. function selectCountry1(){
  184. selectCountry();
  185. changeType(1);
  186. selectstation();
  187. }
  188. function selectstation(){
  189. var id=document.getElementById("country").value;
  190. var select = document.getElementById("station");
  191. for(var i=select.options.length-1;i>=0;i--) {
  192. select.options.remove(i);
  193. }
  194. $.ajax({
  195. type:"POST",
  196. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  197. data:$('#fillingDataStatistform').serialize(),
  198. url:"ajax/hiddenspeStation?type=2",
  199. success:function (data){
  200. var obj=eval("(" + data + ")");
  201. var ii=1;
  202. select.options.add(new Option("全部", ""));
  203. $.each(obj.rows, function(i,item){
  204. if(ii==1){
  205. clearType();
  206. var select11 = document.getElementById("searchType");
  207. select11.options.add(new Option("按充装设备统计", "0"));
  208. select11.options.add(new Option("按工作人员统计", "1"));
  209. select11.options.add(new Option("按应用类型统计", "3"));
  210. ii++;
  211. }
  212. select.options.add(new Option(item.name, item.id));
  213. });
  214. }
  215. });
  216. changeType(1);
  217. }
  218. /**
  219. 明天(11.12)修改充装数据统计的action部分,判断是否为充装站登陆?
  220. **/
  221. function changeType(type){
  222. var select = document.getElementById("searchType");
  223. if(type==1){
  224. clearType();
  225. select.options.add(new Option("按加气站统计", "2"));
  226. select.options.add(new Option("按应用类型统计", "3"));
  227. }else if(type==2){
  228. clearType();
  229. select.options.add(new Option("按充装设备统计", "0"));
  230. select.options.add(new Option("按工作人员统计", "1"));
  231. select.options.add(new Option("按应用类型统计", "3"));
  232. }
  233. }
  234. function clearType(){
  235. var select = document.getElementById("searchType");
  236. for(var i=select.options.length-1;i>=0;i--) {
  237. select.options.remove(i);
  238. }
  239. }
  240. function select(){
  241. var stationid=document.getElementById("station").value;
  242. if(stationid==null||stationid==""){
  243. changeType(1);
  244. }else{
  245. changeType(2);
  246. }
  247. //fLoadData(1,10);
  248. }
  249. </script>
  250. </head>
  251. <body>
  252. <!-- 查询结果:数据表格 -->
  253. <!-- <table id="tt" cellspacing="0" cellpadding="0" >
  254. </table> -->
  255. <div id="toolbar" style="padding-top: 0px;height: auto;overflow: hidden;">
  256. <form id="fillingDataStatistform" action="" method="post">
  257. <table>
  258. <tr>
  259. <td>
  260. <span class="hzbspan">省:</span>
  261. </td>
  262. <td>
  263. <select name="province" id="province" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select">
  264. <%for(AuthorityRegionPlace arp:arplist){
  265. cplist = arp.getCityPlace();
  266. %>
  267. <option value="<%=arp.getId() %>">
  268. <%=arp.getName() %>
  269. </option>
  270. <%} %>
  271. </select>
  272. </td>
  273. <td>
  274. <span class="hzbspan">市:</span>
  275. </td>
  276. <td>
  277. <select name="city" id="city" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectCountry1()">
  278. <%
  279. for(CityPlace cp:cplist){
  280. cyplist = cp.getSubPlaceList();
  281. %>
  282. <option value="<%=cp.getId() %>">
  283. <%=cp.getName() %>
  284. </option>
  285. <%} %>
  286. </select>
  287. </td>
  288. <td>
  289. <span class="hzbspan">县:</span>
  290. </td>
  291. <td>
  292. <select name="country" id = "country" style="width: 150px;height: 34px;min-width: 100px;" class="hzbspan select" onchange="selectstation();" >
  293. </select>
  294. </td>
  295. <td>
  296. <span style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" >类型:</span></span>
  297. </td>
  298. <td>
  299. <select name="type" style="width: 150px;height: 34px;" class="hzbspan select" >
  300. <option value="2" selected="selected">加气站</option>
  301. </select>
  302. </td>
  303. <td><a id="btninfosearch" class="easyui-linkbutton" icon="icon-search" onclick="fLoadData(1,10);" style="width: 150px;height: 34px;" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">查询</span></a>
  304. </td></tr></table></form>
  305. </div>
  306. <center>
  307. </center>
  308. <div id="container" style="position: absolute;width: 100%; height: auto;text-align: center;overflow:auto; ">
  309. </div>
  310. </body>
  311. </html>