stockland_statistics.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>总体统计</title>
  7. <style>
  8. #apply_container {
  9. height: 400px;
  10. }
  11. #result_container {
  12. height: 400px;
  13. }
  14. #street_container {
  15. height: 500px;
  16. }
  17. </style>
  18. </head>
  19. <body layout:fragment="content">
  20. <div class="page-container">
  21. <form class="form form-horizontal" id="form-add" th:action="@{/statistics/getOverallAnalysis}" th:method="get">
  22. <input type="hidden" id="chartType" name="chartType"/>
  23. <div>
  24. <label>开始日期:</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入开始日期" id="begin_date" name="begin_date" />
  25. <label>结束日期:</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入结束日期" id="end_date" name="end_date" />
  26. <span><a onclick="streetDeclaer()" class="btn btn-info radius"><i class="Hui-iconfont">&#xe665;</i> 搜索</a></span>
  27. </div>
  28. <div class="clearfix width-row">
  29. <div class="width-half">
  30. <div class="chart_data">
  31. <div id="apply_container"></div>
  32. </div>
  33. </div>
  34. <div class="width-half">
  35. <div class="chart_data">
  36. <div class="sel-box sel-box-recove">
  37. <select class="select" onChange="changeType()"
  38. th:name="stocklandType" id="stocklandType">
  39. <option value="">--请选择--</option>
  40. <option value="" th:each="item : ${stocklandTypeList}" th:value="${item.value}" th:text="${item.name}">
  41. </option>
  42. </select>
  43. </div>
  44. <div id="result_container"></div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="chart_data">
  49. <div id="street_container"></div>
  50. </div>
  51. </form>
  52. </div>
  53. <script type="text/javascript" th:src="@{/js/lib/highcharts/highcharts.js}"></script>
  54. <script type="text/javascript" th:src="@{/js/lib/highcharts/exporting.js}"></script>
  55. <script type="text/javascript" th:src="@{/js/lib/highcharts/highcharts-zh_CN.js}"></script>
  56. <style>
  57. a.cur{
  58. background: #0a6999;color:#fff;
  59. }
  60. </style>
  61. <script th:inline="javascript">
  62. $(function () {
  63. $(".highlight a").click(function(){
  64. $(this).addClass("cur").parent().siblings().find("a").removeClass("cur")
  65. });
  66. applyRate();
  67. applyResultRate();
  68. streetCompare();
  69. });
  70. //初始化堆叠柱形图
  71. var initColumn = {
  72. chart: {
  73. type: 'column'
  74. },
  75. title: {
  76. text: '各单位单据对比'
  77. },
  78. xAxis: {
  79. categories: ['股权', '不动产权', '使用用途', '出租']
  80. },
  81. yAxis: {
  82. min: 0,
  83. title: {
  84. text: '单据数量'
  85. },
  86. stackLabels: { // 堆叠数据标签
  87. enabled: true,
  88. style: {
  89. fontWeight: 'bold',
  90. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
  91. }
  92. }
  93. },
  94. legend: {
  95. align: 'right',
  96. x: -30,
  97. verticalAlign: 'top',
  98. y: 25,
  99. floating: true,
  100. backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
  101. borderColor: '#CCC',
  102. borderWidth: 1,
  103. shadow: false
  104. },
  105. tooltip: {
  106. formatter: function () {
  107. return '<b>' + this.x + '</b><br/>' +
  108. this.series.name + ': ' + this.y + '<br/>' +
  109. '总量: ' + this.point.stackTotal;
  110. }
  111. },
  112. plotOptions: {
  113. column: {
  114. stacking: 'normal',
  115. dataLabels: {
  116. enabled: true,
  117. color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
  118. style: {
  119. // 如果不需要数据标签阴影,可以将 textOutline 设置为 'none'
  120. textOutline: '1px 1px black'
  121. }
  122. }
  123. }
  124. },
  125. series: []
  126. };
  127. //初始化饼图
  128. var initPie ={
  129. chart: {
  130. plotBackgroundColor: null,
  131. plotBorderWidth: null,
  132. plotShadow: false
  133. },
  134. // title: {
  135. // text: '存量工业用地变更申请单据占比'
  136. // },
  137. tooltip: {
  138. headerFormat: '',
  139. pointFormat: '{point.name}: <b>{point.y}</b> '
  140. },
  141. plotOptions: {
  142. pie: {
  143. allowPointSelect: true,
  144. cursor: 'pointer',
  145. dataLabels: {
  146. enabled: true,
  147. // 通过 format 或 formatter 来格式化数据标签显示
  148. //format: '值: {point.y} 占比 {point.percentage} %',
  149. formatter: function () {
  150. //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息
  151. return '<span"> ' + this.point.name + ':' + this.y + '</span>';
  152. }
  153. },
  154. showInLegend: true // 显示在图例中
  155. }
  156. },
  157. series: [{
  158. type: 'pie',
  159. name: ''
  160. }]
  161. };
  162. //存量工业用地变更申请单据占比
  163. function applyRate() {
  164. $.ajax({
  165. type: "get",
  166. dataType: "json",
  167. data: {
  168. begin_date: $("#begin_date").val(),
  169. end_date: $("#end_date").val()
  170. },
  171. url: pagePath+ "/statistics/getApplyRate",
  172. success: function (result) {
  173. console.log(result);
  174. if (result.success) {
  175. var value = result.obj;
  176. var data = [];
  177. for(var j=0;j<value.length;j++){
  178. data.push({"name":value[j].type,"y":value[j].overallNum});
  179. }
  180. console.log(data);
  181. var chart = new Highcharts.Chart("apply_container", initPie);
  182. var title = {
  183. text:"存量工业用地变更申请单据占比"
  184. };
  185. chart.setTitle(title);
  186. chart.series[0].setData(data);
  187. } else {
  188. errorMessage(result.message);
  189. }
  190. },
  191. error: function () {
  192. errorMessage('系统错误!');
  193. }
  194. });
  195. }
  196. //存量工业用地变更申请结果占比
  197. function applyResultRate() {
  198. //初始化饼图
  199. var initPie ={
  200. chart: {
  201. plotBackgroundColor: null,
  202. plotBorderWidth: null,
  203. plotShadow: false
  204. },
  205. tooltip: {
  206. headerFormat: '',
  207. pointFormat: '{point.name}: <b>{point.y}</b> '
  208. },
  209. plotOptions: {
  210. pie: {
  211. allowPointSelect: true,
  212. cursor: 'pointer',
  213. dataLabels: {
  214. enabled: true,
  215. // 通过 format 或 formatter 来格式化数据标签显示
  216. //format: '值: {point.y} 占比 {point.percentage} %',
  217. formatter: function () {
  218. //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息
  219. return '<span"> ' + this.point.name + ':' + this.y + '</span>';
  220. }
  221. },
  222. showInLegend: true // 显示在图例中
  223. }
  224. },
  225. series: [{
  226. type: 'pie',
  227. name: ''
  228. }]
  229. };
  230. $.ajax({
  231. type: "get",
  232. dataType: "json",
  233. data: {
  234. begin_date: $("#begin_date").val(),
  235. end_date: $("#end_date").val(),
  236. stocklandType: $("#stocklandType").val()
  237. },
  238. url: pagePath+ "/statistics/getApplyResult",
  239. success: function (result) {
  240. console.log(result);
  241. if (result.success) {
  242. var value = result.obj;
  243. var data = [];
  244. for(var j=0;j<value.length;j++){
  245. data.push({"name":value[j].type,"y":value[j].overallNum});
  246. }
  247. var chart = new Highcharts.Chart("result_container", initPie);
  248. var title = {
  249. text:"存量工业用地变更申请结果占比"
  250. };
  251. var subtitle = {
  252. text: "<div style='height: 24px'></div>",
  253. useHTML: true
  254. };
  255. chart.setTitle(title);
  256. chart.setSubtitle(subtitle);
  257. chart.series[0].setData(data);
  258. } else {
  259. errorMessage(result.message);
  260. }
  261. },
  262. error: function () {
  263. errorMessage('系统错误!');
  264. }
  265. });
  266. }
  267. //各单位处理单据对比
  268. function streetCompare(){
  269. // var chart = Highcharts.chart('street_container', initColumn);
  270. $.ajax({
  271. type: "get",
  272. dataType: "json",
  273. data: {
  274. begin_date: $("#begin_date").val(),
  275. end_date: $("#end_date").val()
  276. },
  277. url: pagePath + "/statistics/getStreetHandleCompare",
  278. success: function (result) {
  279. console.log(result);
  280. if (result.success) {
  281. var chart = Highcharts.chart('street_container', initColumn);
  282. var value = result.obj;
  283. for(var j=0;j < value.length;j++){
  284. var data = [];
  285. data.push(value[j].equity);
  286. data.push(value[j].property);
  287. data.push(value[j].use);
  288. data.push(value[j].rent);
  289. console.log(data);
  290. chart.addSeries({
  291. name: value[j].streetName,
  292. data: data
  293. });
  294. }
  295. } else {
  296. errorMessage(result.message);
  297. }
  298. },
  299. error: function () {
  300. errorMessage('系统错误!');
  301. }
  302. });
  303. }
  304. function changeType(){
  305. applyResultRate();
  306. }
  307. function streetDeclaer(){
  308. applyRate();
  309. applyResultRate();
  310. streetCompare();
  311. }
  312. laydate.render({
  313. elem: '#begin_date', //指定元素
  314. // min: 0
  315. });
  316. laydate.render({
  317. elem: '#end_date', //指定元素
  318. // min: 0
  319. });
  320. </script>
  321. </body>
  322. </html>