teacherStatistics.jsp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <html>
  3. <head>
  4. <%@ include file="../header.jspf"%>
  5. <title>教师统计详情</title>
  6. </head>
  7. <body>
  8. <div class="container-fluid">
  9. <div class="row">
  10. <%@ include file="../head.jsp"%>
  11. </div>
  12. <div class="row " >
  13. <div class="col-sm-2">
  14. <%@ include file="../left.jsp"%>
  15. </div>
  16. <div class="col-sm-10 ">
  17. <input type="hidden" name="tid" id="tid" value="${teacher.id}">
  18. <div class="bs-callout bs-callout-danger">
  19. <ol class="breadcrumb">
  20. <li><a href="${pageContext.request.contextPath}/admin/teacher">教师列表</a></li>
  21. <li><a href="${pageContext.request.contextPath}/admin/teacher/show?tid=${teacher.id}">教师详情</a></li>
  22. <li class="active">教师统计信息</li>
  23. </ol>
  24. <jsp:include page="teacher-info-table.jsp"/>
  25. </div>
  26. <div class="bs-callout bs-callout-info">
  27. <row>
  28. <div id="tea-score-trend-chart" style="height: 400px">
  29. </div>
  30. </row>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <%@ include file="../buttom.jsp"%>
  36. <script type="text/javascript" src="${pageContext.request.contextPath}/js/tqe/course/eval-process-bar.js"></script>
  37. <script type="text/javascript">
  38. function fillTeaScoreTrendChart(teaVO) {
  39. var batchScoreList = teaVO.batchScoreList;
  40. if(batchScoreList){
  41. var teaScoreTrendChart = echarts.init(document.getElementById('tea-score-trend-chart'),echartTheme);
  42. var batchNames = [];
  43. var stuScores = [];
  44. var teaScores = [];
  45. var stuAvg = []; //全局学生平均得分
  46. var teaAvg = []; //全局教师平均得分
  47. var bs ;
  48. $.each(batchScoreList,function(i){
  49. batchNames.push(this.batchName);
  50. stuScores.push(this.stuAvgScore);
  51. teaScores.push(this.teaAvgScore);
  52. stuAvg.push(this.stuAvg);
  53. teaAvg.push(this.teaAvg);
  54. });
  55. /*debug
  56. batchNames=['2015','2016','2017','2018'];
  57. stuScores = [65,50,90,86];
  58. teaScores = [78,95,83,78];
  59. */
  60. var option = {
  61. title: {
  62. text: '教师评分趋势图',
  63. left: 'center'
  64. },
  65. tooltip : {
  66. trigger: 'axis'
  67. },
  68. legend: {
  69. data:['学生评分','学生平均','教师评分','教师平均'],
  70. left: 'right'
  71. },
  72. grid: {
  73. left: '3%',
  74. right: '4%',
  75. bottom: '3%',
  76. containLabel: true
  77. },
  78. xAxis : [
  79. {
  80. type : 'category',
  81. boundaryGap : false,
  82. data : batchNames
  83. }
  84. ],
  85. yAxis : [
  86. {
  87. type : 'value',
  88. min : 'dataMin',
  89. max : 100
  90. }
  91. ],
  92. series : [
  93. {
  94. name:'学生评分',
  95. type:'line',
  96. label: {
  97. normal: {
  98. show: true,
  99. position: 'top'
  100. }
  101. },
  102. lineStyle:{
  103. normal:{
  104. color:"red",
  105. width:3,
  106. }
  107. },
  108. data:stuScores
  109. },
  110. {
  111. name:'学生平均',
  112. type:'line',
  113. lineStyle:{
  114. normal:{
  115. color:"red",
  116. width:1,
  117. type:"dashed"
  118. }
  119. },
  120. data:stuAvg
  121. },
  122. {
  123. name:'教师评分',
  124. type:'line',
  125. label: {
  126. normal: {
  127. show: true,
  128. position: 'top'
  129. }
  130. },
  131. lineStyle:{
  132. normal:{
  133. color:"blue",
  134. width:3,
  135. }
  136. },
  137. data:teaScores
  138. },
  139. {
  140. name:'教师平均',
  141. type:'line',
  142. lineStyle:{
  143. normal:{
  144. color:"blue",
  145. type:"dashed",
  146. width:1,
  147. }
  148. },
  149. data:teaAvg
  150. }
  151. ]
  152. };
  153. teaScoreTrendChart.setOption(option);
  154. }else{
  155. showGlobalNotification("没有信息需要展示");
  156. }
  157. }
  158. $(function(){
  159. var tid= $("#tid").val();
  160. $.get("../teacher/vo-info",{tid:tid},function(data){
  161. if(data.success){
  162. var teaVO = data.item;
  163. fillTeaScoreTrendChart(teaVO);
  164. }else{
  165. showGlobalNotification(data.msg);
  166. }
  167. });
  168. $('[data-toggle="tooltip"]').tooltip();
  169. });
  170. </script>
  171. <script src="${pageContext.request.contextPath}/js/echarts/echarts.common.min.js"></script>
  172. <script src="${pageContext.request.contextPath}/js/echarts/macarons.js"></script>
  173. </body>
  174. </html>