| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372 |
- <!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;
- }
- #bottom_container {
- height: 400px;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <div class="page-container">
- <form class="form form-horizontal" id="form-add" th:action="@{/statistics/toIntelligentStatistics}" th:method="get">
- <div>
- <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>
- <div style="margin-top: 20px;">
- <input type="text" class="input-text" style="width:200px" readonly placeholder="请输入开始年份"
- id="startYear" name="startYear"/>
- <label>-</label><input type="text" class="input-text" style="width:200px" readonly placeholder="请输入结束年份"
- id="endYear" name="endYear"/>
- <span><a onclick="search2()" class="btn btn-info radius"><i
- class="Hui-iconfont"></i> 搜索</a></span>
- </div>
- <div class="chart_data">
- <div id="bottom_container"></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")
- })
- applyType();
- applyResult();
- applyTrend();
- });
- function search1() {
- applyType();
- applyResult();
- }
- function search2() {
- applyTrend();
- }
- //初始化左饼图
- 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: ''
- }]
- };
- //初始化折线图
- var initLine = {
- chart: {
- renderTo: 'bottom_container',
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: '增长趋势图'
- },
- xAxis: {
- title: {
- text: '申报时间'
- },
- },
- yAxis: {
- title: {
- text: '申报量'
- }
- },
- plotOptions: {
- series: {
- animation: {
- duration: 2000
- }
- }
- },
- series: []
- };
- //申请单据占比
- function applyType() {
- $.ajax({
- type: "post",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath + "/statistics/getIntelligentAnalysisType",
- 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 applyResult() {
- $.ajax({
- type: "post",
- dataType: "json",
- data: {
- begin_date: $("#begin_date").val(),
- end_date: $("#end_date").val()
- },
- url: pagePath + "/statistics/getIntelligentAnalysisResult",
- success: function (result) {
- if (result.success) {
- var data = result.obj;
- var chart = new Highcharts.Chart(initRightPie);
- chart.series[0].setData(data);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function applyTrend() {
- $.ajax({
- type: "post",
- dataType: "json",
- data: {
- startYear: $("#startYear").val(),
- endYear: $("#endYear").val()
- },
- url: pagePath + "/statistics/getIntelligentAnalysisTrend",
- success: function (result) {
- if (result.success) {
- var data = result.obj;
- var chart = new Highcharts.Chart(initLine);
- chart.xAxis[0].setCategories(data.categories);
- //chart.series[0].setData(data.statisticView.data);
- chart.addSeries(data.statisticView);
- } 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';
- }
- }
- });
- var startYear = laydate.render({
- elem: '#startYear' //指定元素
- ,type: 'year'
- , done: function (value, date) {
- if (value !== '') {
- endYear.config.min.year = date.year;
- endYear.config.min.month = date.month - 1;
- endYear.config.min.date = date.date;
- endYear.config.min.hours = date.hours;
- endYear.config.min.minutes = date.minutes;
- endYear.config.min.seconds = date.seconds;
- } else {
- endYear.config.min.year = '1900';
- endYear.config.min.month = '0';
- endYear.config.min.date = '1';
- endYear.config.min.hours = '0';
- endYear.config.min.minutes = '0';
- endYear.config.min.seconds = '0';
- }
- }
- });
- var endYear = laydate.render({
- elem: '#endYear' //指定元素
- ,type: 'year'
- , done: function (value, date) {
- if (value !== '') {
- startYear.config.max.year = date.year;
- startYear.config.max.month = date.month - 1;
- startYear.config.max.date = date.date;
- startYear.config.max.hours = date.hours;
- startYear.config.max.minutes = date.minutes;
- startYear.config.max.seconds = date.seconds;
- } else {
- startYear.config.max.year = '2100';
- startYear.config.max.month = '0';
- startYear.config.max.date = '1';
- startYear.config.max.hours = '0';
- startYear.config.max.minutes = '0';
- startYear.config.max.seconds = '0';
- }
- }
- });
- </script>
- </body>
- </html>
|