education_compare.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. @extends('statistics.module.layouts.content')
  2. @push('meta')
  3. @endpush
  4. @push('css')
  5. @endpush
  6. @push('js')
  7. <script src="{{ theme_asset('app/js/echarts.common.min.js') }}"></script>
  8. @endpush
  9. @section('content')
  10. <div class="wide container demand_warp">
  11. @include('statistics.module.section.left_menu')
  12. <div class="cq_rt index_right">
  13. <div class="inside_timer">
  14. @include('statistics.module.section.compare_timer')
  15. </div>
  16. <div class="char-box">
  17. <div class="char-title no-icon">学历对比 <input type="button" class="export_excel" value="导出为excel"/></div>
  18. <div id="trend" style="width: 100%;height: 360px;"></div>
  19. </div>
  20. <div class="detail-info">
  21. <div class="table_title">详细数据</div>
  22. <table border="0" cellpadding="0" cellspacing="0">
  23. <tr>
  24. <th>学历</th>
  25. <th>需求人数</th>
  26. <th>求职人数</th>
  27. <th>求人倍率</th>
  28. </tr>
  29. @if($data)
  30. @foreach($data as $k=>$v)
  31. <tr>
  32. <td>{{$v['education_cn']}}</td>
  33. <td>{{$v['job_num']}}</td>
  34. <td>{{$v['resume_num']}}</td>
  35. <td>{{$v['rate']}}</td>
  36. </tr>
  37. @endforeach
  38. <tr>
  39. <td>合计</td>
  40. <td>{{$job_total}}</td>
  41. <td>{{$resume_total}}</td>
  42. <td>{{$resume_total>0?sprintf("%.2f", (int)$job_total/(int)$resume_total):'0'}}</td>
  43. </tr>
  44. @else
  45. <tr>
  46. <td colspan="4" text-align="center">暂无数据</td>
  47. </tr>
  48. @endif
  49. </table>
  50. </div>
  51. </div>
  52. <div class="clear"></div>
  53. </div>
  54. @endsection
  55. @section('script')
  56. <script type="text/javascript">
  57. var data_name = [];
  58. var data_jobs = [];
  59. var data_resumes = [];
  60. @if($data)
  61. @foreach($data as $k=>$v)
  62. data_name.push("{{$v['education_cn']}}");
  63. data_jobs.push("{{$v['job_num']}}");
  64. data_resumes.push("{{$v['resume_num']}}");
  65. @endforeach
  66. @endif
  67. var colors = ['#ff5b82','#2da1f9','#ff9b19','#0063ed'];
  68. option = {
  69. title: [{
  70. left: '5',
  71. top: '5',
  72. text: '趋势图',
  73. textStyle:{
  74. color:'#565656',
  75. fontSize:14,
  76. fontWeight:'normal'
  77. }
  78. }],
  79. color:colors,
  80. tooltip: {
  81. trigger: 'axis',
  82. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  83. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  84. }
  85. },
  86. legend: {
  87. data: ['需求人数', '求职人数','求人倍率'],
  88. align: 'right',
  89. top:10,
  90. right: 20,
  91. itemWidth:18,
  92. itemHeight:6
  93. },
  94. grid: {
  95. left: '8',
  96. right: '8',
  97. bottom: '10',
  98. containLabel: true
  99. },
  100. xAxis: [{
  101. type: 'category',
  102. boundaryGap:true,
  103. axisTick:{
  104. alignWithLabel:true
  105. },
  106. axisLabel:{
  107. interval: 0, //坐标轴刻度标签的显示间隔 , 0 强制显示所有标签。
  108. //rotate:-45, //刻度标签旋转的角度
  109. margin:15,
  110. textStyle: {
  111. color: '#333333',
  112. fontSize:10
  113. }
  114. },
  115. data: data_name
  116. }],
  117. yAxis: [{
  118. type: 'value',
  119. name: '',
  120. axisLabel: {
  121. formatter: '{value}'
  122. }
  123. }],
  124. series: [{
  125. name: '需求人数',
  126. type: 'bar',
  127. barGap: 0,
  128. data: data_jobs
  129. }, {
  130. name: '求职人数',
  131. type: 'bar',
  132. data: data_resumes
  133. }]
  134. };
  135. var myChart = echarts.init(document.getElementById('trend'));
  136. myChart.setOption(option);
  137. $('.export_excel').click(function(){
  138. window.location.href="{{route('statistics.demand.education',['isExcel'=>1])}}";
  139. });
  140. </script>
  141. @endsection