Нет описания

WorkPeriod.html 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>工单时间点分布分析</title>
  7. <!--[if lt IE 9]>
  8. <meta http-equiv="refresh" content="0;ie.html" />
  9. <![endif]-->
  10. <meta name="keywords" content="">
  11. <meta name="description" content="">
  12. <script src="../../Script/Common/huayi.load.js"></script>
  13. <script src="../../Script/Common/huayi.config.js"></script>
  14. <!--<link rel="stylesheet" href="../../css/huTotal.css" />-->
  15. <link rel="stylesheet" href="../../css/init.css" />
  16. <style>
  17. .clearfix:after {
  18. content: "";
  19. display: block;
  20. clear: both;
  21. }
  22. .kpi-top {
  23. background: #f3f3f4;
  24. height: 60px;
  25. padding: 10px 20px;
  26. }
  27. .topCon {
  28. float: right;
  29. margin-right: 45px;
  30. }
  31. .content h2 {
  32. font-size: 18px;
  33. margin-bottom: 20px;
  34. }
  35. .topCon input {
  36. width: 128px;
  37. padding: 2px 2PX 2PX 10PX;
  38. height: 28px;
  39. border: 1px solid #ebebeb;
  40. color: #1ab394;
  41. outline: none;
  42. vertical-align: middle;
  43. }
  44. .content {
  45. width: 90%;
  46. margin: 0 auto;
  47. }
  48. </style>
  49. </head>
  50. <body class="gray-bg" style="background: #fefefe;">
  51. <div class="hwkpi">
  52. <div class="daoHang clearfix">
  53. <div class="dhLeft">
  54. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表分析</a>&gt;<a href="javaScript:;">业务数据分析</a>&gt;<a href="" class="nowPosition">工单时间点分布分析</a></sapn>
  55. </div>
  56. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  57. </div>
  58. <div class="kpi-top clearfix">
  59. <div class="topCon">
  60. 开始时间:
  61. <input type="text" class="laydate-icon" id="startTime" /> 结束时间:
  62. <input type="text" class="laydate-icon" id="endTime" />
  63. <button class="btns sear">搜索</button>
  64. <!--<button class="btn daochu ">导出</button>-->
  65. </div>
  66. </div>
  67. <ul class="nav nav-tabs th-tab">
  68. <li role="presentation" class="active">
  69. <a href="javascript:;">折线图</a>
  70. </li>
  71. <li role="presentation">
  72. <a href="javascript:;">柱状图</a>
  73. </li>
  74. </ul>
  75. <div class="content">
  76. <div class="zhexian">
  77. <h2 style="text-align: center;">工单时间点分布情况</h2>
  78. <div id="zhe" style="width: 100%; height: 500px;margin: 0 auto;"></div>
  79. </div>
  80. <div class="zhutu" style="display: none;">
  81. <h2 style="text-align: center;">工单时间点分布情况</h2>
  82. <div id="zhu" style="width: 950px; height: 500px;margin: 0 auto;"></div>
  83. </div>
  84. </div>
  85. </div>
  86. <script src="../../css/laydate/laydate.js"></script>
  87. <script src="../../js/echarts.common.min.js"></script>
  88. <script>
  89. $(function () {
  90. laydate.skin('molv');
  91. laydate({
  92. elem: '#startTime',
  93. event: 'focus',
  94. format: 'YYYY-MM-DD'
  95. });
  96. laydate({
  97. elem: '#endTime',
  98. event: 'focus',
  99. format: 'YYYY-MM-DD'
  100. });
  101. //tab切换
  102. $('.th-tab li').click(function () {
  103. $(this).addClass('active')
  104. .siblings().removeClass('active');
  105. var index = $(this).index();
  106. $('.content >div').eq(index).show().siblings().hide();
  107. })
  108. bind();
  109. $(".sear").click(function () {
  110. bind();
  111. })
  112. })
  113. //折线图
  114. var zhe = echarts.init(document.getElementById('zhe'));
  115. var zheoption = {
  116. color: ['#1ab394'],
  117. tooltip: {
  118. trigger: 'axis',
  119. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  120. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  121. }
  122. },
  123. legend: {
  124. data: ['工单数量']
  125. },
  126. grid: {
  127. left: '3%',
  128. right: '4%',
  129. bottom: '3%',
  130. containLabel: true
  131. },
  132. xAxis: [{
  133. type: 'category',
  134. data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'],
  135. }],
  136. yAxis: [{
  137. type: 'value',
  138. name: '工单数量/个',
  139. nameLocation: 'middle',
  140. nameGap: 35
  141. }],
  142. series: [{
  143. name: '工单数量',
  144. type: 'line',
  145. barWidth: '60%',
  146. data: [10, 52, 200, 334, 390, 330, 220, 210, 200, 52]
  147. }]
  148. };
  149. //柱形图
  150. var zhu = echarts.init(document.getElementById('zhu'));
  151. var zhuoption = {
  152. color: ['#1ab394'],
  153. tooltip: {
  154. trigger: 'axis',
  155. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  156. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  157. }
  158. },
  159. legend: {
  160. data: ['工单数量']
  161. },
  162. grid: {
  163. left: '3%',
  164. right: '4%',
  165. bottom: '3%',
  166. containLabel: true
  167. },
  168. xAxis: [{
  169. type: 'category',
  170. data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00'],
  171. }],
  172. yAxis: [{
  173. type: 'value',
  174. name: '工单数量/个',
  175. nameLocation: 'middle',
  176. nameGap: 35
  177. }],
  178. series: [{
  179. name: '工单数量',
  180. type: 'bar',
  181. barWidth: '30%',
  182. data: [10, 52, 200, 334, 390, 330, 220, 210, 200, 52]
  183. }]
  184. };
  185. function bind() {
  186. $.getJSON(huayi.config.callcenter_url + 'Business/GetWorkPeriod', { starttime: $("#startTime").val(), endtime: $("#endTime").val(), "token": $.cookie("token") }, function (result) {
  187. if (result.state.toLowerCase() == "success") {
  188. zheoption.series[0].data = result.data.count;
  189. zheoption.xAxis[0].data = result.data.col;
  190. zhuoption.series[0].data = result.data.count;
  191. zhuoption.xAxis[0].data = result.data.col;
  192. zhe.setOption(zheoption);
  193. zhu.setOption(zhuoption);
  194. }
  195. })
  196. }
  197. </script>
  198. </body>
  199. </html>