| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>总体统计</title>
- <style>
- #left_container {
- height: 400px;
- }
- #right_container {
- height: 400px;
- }
- .sel-box {
- top: 40px;
- width: 200px;
- position: absolute;
- z-index: 999;
- left: 50%;
- margin-left: -88px;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <div class="page-container">
- <form class="form form-horizontal" id="form-add" th:action="@{/statistics/toMattersStatistics}" th:method="get"
- style="padding-left: 13px">
- <div class="row cl">
- <label>开始日期:</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入开始日期"
- id="begin_date" name="begin_date"/>
- <label>结束日期:</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入结束日期"
- id="end_date" name="end_date"/>
- <span><a onclick="search1()" class="btn btn-info radius"><i
- class="Hui-iconfont"></i> 搜索</a></span>
- </div>
- <div class="clearfix width-row">
- <div class="width-half">
- <div class="chart_data">
- <div id="left_container"></div>
- </div>
- </div>
- <div class="width-half">
- <div class="chart_data">
- <div id="right_container"></div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <script type="text/javascript" th:src="@{/js/lib/highcharts/highcharts.js}"></script>
- <script type="text/javascript" th:src="@{/js/lib/highcharts/exporting.js}"></script>
- <script type="text/javascript" th:src="@{/js/lib/highcharts/highcharts-zh_CN.js}"></script>
- <style>
- a.cur {
- background: #0a6999;
- color: #fff;
- }
- </style>
- <script th:inline="javascript">
- $(function () {
- $(".highlight a").click(function () {
- $(this).addClass("cur").parent().siblings().find("a").removeClass("cur")
- })
- usage();
- satisfaction();
- });
- function search1() {
- usage();
- satisfaction();
- }
- //初始化左饼图
- var initLeftPie = {
- chart: {
- renderTo: 'left_container',
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: '创新能力体检使用情况占比'
- },
- tooltip: {
- headerFormat: '',
- pointFormat: '{point.name}: <b>{point.y}</b> '
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- dataLabels: {
- enabled: true,
- // 通过 format 或 formatter 来格式化数据标签显示
- //format: '值: {point.y} 占比 {point.percentage} %',
- formatter: function () {
- //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息
- return '<span"> ' + this.point.name + ':' + this.y + '</span>';
- }
- },
- showInLegend: true // 显示在图例中
- },
- series: {
- animation: {
- duration: 2000
- }
- }
- },
- series: [{
- type: 'pie',
- name: ''
- }]
- };
- //初始化右饼图
- var initRightPie = {
- chart: {
- renderTo: 'right_container',
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: '企业诊断报告满意度占比'
- },
- tooltip: {
- headerFormat: '',
- pointFormat: '{point.name}: <b>{point.y}</b> '
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- dataLabels: {
- enabled: true,
- // 通过 format 或 formatter 来格式化数据标签显示
- //format: '值: {point.y} 占比 {point.percentage} %',
- formatter: function () {
- //this 为当前的点(扇区)对象,可以通过 console.log(this) 来查看详细信息
- return '<span"> ' + this.point.name + ':' + this.y + '</span>';
- }
- },
- showInLegend: true // 显示在图例中
- },
- series: {
- animation: {
- duration: 2000
- }
- }
- },
- series: [{
- type: 'pie',
- name: ''
- }]
- };
- //申请单据占比
- function usage() {
- $.ajax({
- type: "post",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath + "/policy/diagnostic/usage",
- success: function (result) {
- if (result.success) {
- var data = result.obj;
- var chart = new Highcharts.Chart(initLeftPie);
- chart.series[0].setData(data);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function satisfaction() {
- $.ajax({
- type: "post",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val(),
- projectType: $("#projectType").val()
- },
- url: pagePath + "/policy/diagnostic/satisfaction",
- success: function (result) {
- if (result.success) {
- var data = result.obj;
- var chart = new Highcharts.Chart(initRightPie);
- chart.series[0].setData(data);
- var subtitle = {
- text: "<div style='height: 24px'></div>",
- useHTML: true
- };
- chart.setSubtitle(subtitle);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- var startDate = laydate.render({
- elem: '#begin_date', //指定元素
- done: function (value, date) {
- if (value !== '') {
- endDate.config.min.year = date.year;
- endDate.config.min.month = date.month - 1;
- endDate.config.min.date = date.date;
- endDate.config.min.hours = date.hours;
- endDate.config.min.minutes = date.minutes;
- endDate.config.min.seconds = date.seconds;
- } else {
- endDate.config.min.year = '1900';
- endDate.config.min.month = '0';
- endDate.config.min.date = '1';
- endDate.config.min.hours = '0';
- endDate.config.min.minutes = '0';
- endDate.config.min.seconds = '0';
- }
- }
- });
- var endDate = laydate.render({
- elem: '#end_date', //指定元素
- done: function (value, date) {
- if (value !== '') {
- startDate.config.max.year = date.year;
- startDate.config.max.month = date.month - 1;
- startDate.config.max.date = date.date;
- startDate.config.max.hours = date.hours;
- startDate.config.max.minutes = date.minutes;
- startDate.config.max.seconds = date.seconds;
- } else {
- startDate.config.max.year = '2100';
- startDate.config.max.month = '0';
- startDate.config.max.date = '1';
- startDate.config.max.hours = '0';
- startDate.config.max.minutes = '0';
- startDate.config.max.seconds = '0';
- }
- }
- });
- </script>
- </body>
- </html>
|