Commit ffe4d02aeef10ec29abc88647851d6bb0e985063

Authored by 孙向锦
1 parent 90ac05a1

修改报表时间传递

WebRoot/WEB-INF/jsp/sunvote/teacher/stduent_report.jsp
... ... @@ -46,8 +46,8 @@ li {
46 46 <div class="header">
47 47 <nav class="navbar navbar-default navbar-fixed-top">
48 48 <div class="container">
49   - <input type="text" class="date-picker" placeholder="开始日期" name="starDate" id="starDate" data-date-format="yyyy-mm-dd" readonly="readonly"/>
50   - <input type="text" class="date-picker" placeholder="结束日期" name="endDate" id="endDate" data-date-format="yyyy-mm-dd" readonly="readonly"/>
  49 + <input type="text" class="date-picker" placeholder="开始日期" name="starDate" id="starDate" data-date-format="yyyy-mm-dd" readonly="readonly" value="${start_date}"/>
  50 + <input type="text" class="date-picker" placeholder="结束日期" name="endDate" id="endDate" data-date-format="yyyy-mm-dd" readonly="readonly" value="${end_date}"/>
51 51 <input type="button" value="查询" id="search" />
52 52 </div>
53 53 </nav>
... ... @@ -116,7 +116,7 @@ li {
116 116 <script type="">
117 117 var URL = '<%=basePath%>${URL}';
118 118 </script>
119   - <script src="../static/js/control1.js"></script>
  119 + <script src="../static/js/control1.js?a=1"></script>
120 120 <!-- 日期框 -->
121 121 <script>
122 122 //lay('#version').html('-v'+ laydate.v);
... ...
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
... ... @@ -39,13 +39,15 @@
39 39  
40 40 <td><div style="width:150px;text-align:center;"><span>学生人数: ${info.STUDENT_NUM}</span></div></td>
41 41 <td></td>
42   - <td style="padding-left:2px;"><input
  42 + <td style="padding-left:2px;">
  43 + <input
43 44 class="span10 date-picker" name="lastStart" id="lastStart"
44   - value="" type="text" data-date-format="yyyy-mm-dd"
  45 + value="${start_date}" type="text" data-date-format="yyyy-mm-dd"
45 46 readonly="readonly" style="width:88px;" placeholder="开始日期"
46   - title="开始日期" /></td>
  47 + title="开始日期" />
  48 + </td>
47 49 <td style="padding-left:2px;"><input
48   - class="span10 date-picker" name="lastEnd" id="lastEnd" value=""
  50 + class="span10 date-picker" name="lastEnd" id="lastEnd" value="${end_date}"
49 51 type="text" data-date-format="yyyy-mm-dd" readonly="readonly"
50 52 style="width:88px;" placeholder="结束日期" title="结束日期" /></td>
51 53 <td style="vertical-align:top;padding-left:2px"><a
... ... @@ -64,7 +66,7 @@
64 66 <th class="center"><div style="width:80px;">课程总分</div></th>
65 67 <c:forEach items="${testpaperList}" var="var" varStatus="vs">
66 68 <th class="center"><a
67   - href="report/test_report?TestID=${var.TESTPAPER_ID}&class_id=${info.CLASS_ID}" onclick="window.top.loading.show();"><div style="width:180px;" class="font">${var.NAME}</br><span>${var.CREATE_DATE}</span></div></a></th>
  69 + onclick="paper('${info.CLASS_ID}','${var.TESTPAPER_ID}');"><div style="width:180px;" class="font">${var.NAME}</br><span>${var.CREATE_DATE}</span></div></a></th>
68 70 </c:forEach>
69 71 </tr>
70 72 </thead>
... ... @@ -104,7 +106,7 @@
104 106 href="report/student_report?studentid=${var.ID}&class_id=${info.CLASS_ID}">${var.NAME}</a>
105 107 </td> --%>
106 108 <td class="center"><a
107   - href="report/student_report?studentid=${var.ID}&class_id=${info.CLASS_ID}" onclick="window.top.loading.show();">${var.NAME}</a>
  109 + onclick="student('${info.CLASS_ID}','${var.ID}')">${var.NAME}</a>
108 110 </td>
109 111 <td class="center"><fmt:formatNumber type="number"
110 112 value="${var.TOTALSCORE == 0 ? 0: (var.GETSCORE / var.TOTALSCORE * 100)}"
... ... @@ -219,6 +221,24 @@
219 221 /* $("#Form").sumbit(); */
220 222 }
221 223  
  224 + function student(classid,studentid){
  225 + var url = "<%=basePath%>report/student_report?studentid=" + studentid + "&class_id=" + classid ;
  226 + var startDate = $("#lastStart").val();
  227 + var endDate = $("#lastEnd").val();
  228 + url = url + "&start_date=" + startDate + "&end_date=" + endDate ;
  229 + window.self.location.href = url;
  230 + window.top.loading.show();
  231 + }
  232 +
  233 + function paper(class_id,testpaper_id){
  234 + var url = "<%=basePath%>report/test_report?TestID=" + testpaper_id + "&class_id=" + class_id;
  235 + var startDate = $("#lastStart").val();
  236 + var endDate = $("#lastEnd").val();
  237 + url = url + "&start_date=" + startDate + "&end_date=" + endDate ;
  238 + window.self.location.href = url;
  239 + window.top.loading.show();
  240 + }
  241 +
222 242 $(document).ready(function(){
223 243 window.top.loading.remove();
224 244 });
... ...
WebRoot/static/js/control1.js
... ... @@ -42,8 +42,9 @@
42 42  
43 43 studentid=getQueryString("studentid");
44 44  
45   - getData();
46   -
  45 + startDate = $("#starDate").val();
  46 + endDate = $("#endDate").val();
  47 + getData(startDate,endDate);
47 48  
48 49 //$('#myStathalf').circliful();
49 50 //$('#myStathalf1').circliful();
... ... @@ -91,7 +92,8 @@
91 92  
92 93  
93 94 function data(index,data){
94   - console.log(data);
  95 + console.log(data);
  96 + //data0=[];data1=[];data2=[];data3=[];
95 97 var GETSCORE = parseInt(data.data.studentList[index].GETSCORE);
96 98 var TOTALSCORE = parseInt(data.data.TOTAL_SCORE);
97 99 var ratio=(GETSCORE/TOTALSCORE*100).toFixed(2);
... ... @@ -100,6 +102,12 @@
100 102  
101 103 var test_num=data.data.studentList[index].testList.length;
102 104 var part_num=test_num;
  105 +
  106 + data0=[];
  107 + data1=[];
  108 + data2=[];
  109 + data3=[];
  110 +
103 111 //console.log(data.data.studentList[index].testList[2].SCORE);
104 112 if($("input[type='radio']:checked").val()==1){
105 113 for(var i=0;i<test_num;i++){
... ... @@ -142,76 +150,75 @@
142 150 $(".circle .col-md-6").eq(0).html('<div id="myStathalf" data-dimension="350" data-text="'+part_num+'/'+test_num+'" data-info="参与测试" data-width="10" data-fontsize="38" data-percent="'+partake+'" data-fgcolor="#8ad254" data-bgcolor="#a9f9ff" data-type="half" data-fill="#50b5c9"></div>');
143 151 $('#myStathalf1').circliful();
144 152 $('#myStathalf').circliful();
145   - myChart.setOption(option);
  153 + myChart.setOption({
  154 + xAxis: {
  155 + type: 'category',
  156 + data: data0
  157 + },
  158 + yAxis: {
  159 + type: 'value'
  160 + },
  161 + series: [{
  162 + data: data1,
  163 + type: 'line',
  164 + symbol: 'circle',
  165 + symbolSize: 5,
  166 + lineStyle: {
  167 + normal: {
  168 + color: 'green',
  169 + width: 2,
  170 + type: 'dashed'
  171 + }
  172 + },
  173 + itemStyle: {
  174 + normal: {
  175 + borderWidth: 2,
  176 + borderColor: 'green',
  177 + color: 'green'
  178 + }
  179 + }
  180 + },{
  181 + data: data3,
  182 + type: 'line',
  183 + symbol: 'circle',
  184 + symbolSize: 5,
  185 + lineStyle: {
  186 + normal: {
  187 + color: 'yellow',
  188 + width: 2,
  189 + type: 'dashed',
  190 + }
  191 + },
  192 + itemStyle: {
  193 + normal: {
  194 + borderWidth: 2,
  195 + borderColor: 'yellow',
  196 + color: 'yellow'
  197 + }
  198 + }
  199 + },{
  200 + data: data2,
  201 + type: 'line',
  202 + symbol: 'circle',
  203 + symbolSize: 10,
  204 + lineStyle: {
  205 + normal: {
  206 + color: 'blue',
  207 + width: 4,
  208 + type: 'solid'
  209 + }
  210 + },
  211 + itemStyle: {
  212 + normal: {
  213 + borderWidth: 3,
  214 + borderColor: 'blue',
  215 + color: 'blue',
  216 + label : {show: true}
  217 + }
  218 + }
  219 + }]
  220 + });
146 221 }
147 222  
148 223  
149 224 var myChart = echarts.init(document.getElementById('main'));
150   - var option = {
151   - xAxis: {
152   - type: 'category',
153   - data: data0
154   - },
155   - yAxis: {
156   - type: 'value'
157   - },
158   - series: [{
159   - data: data1,
160   - type: 'line',
161   - symbol: 'circle',
162   - symbolSize: 5,
163   - lineStyle: {
164   - normal: {
165   - color: 'green',
166   - width: 2,
167   - type: 'dashed'
168   - }
169   - },
170   - itemStyle: {
171   - normal: {
172   - borderWidth: 2,
173   - borderColor: 'green',
174   - color: 'green'
175   - }
176   - }
177   - },{
178   - data: data3,
179   - type: 'line',
180   - symbol: 'circle',
181   - symbolSize: 5,
182   - lineStyle: {
183   - normal: {
184   - color: 'yellow',
185   - width: 2,
186   - type: 'dashed',
187   - }
188   - },
189   - itemStyle: {
190   - normal: {
191   - borderWidth: 2,
192   - borderColor: 'yellow',
193   - color: 'yellow'
194   - }
195   - }
196   - },{
197   - data: data2,
198   - type: 'line',
199   - symbol: 'circle',
200   - symbolSize: 10,
201   - lineStyle: {
202   - normal: {
203   - color: 'blue',
204   - width: 4,
205   - type: 'solid'
206   - }
207   - },
208   - itemStyle: {
209   - normal: {
210   - borderWidth: 3,
211   - borderColor: 'blue',
212   - color: 'blue',
213   - label : {show: true}
214   - }
215   - }
216   - }]
217   -};
218 225 \ No newline at end of file
... ...
src/com/fh/controller/sunvote/report/ReportController.java
... ... @@ -100,6 +100,8 @@ public class ReportController extends BaseController {
100 100 mv.addObject("studentList", studentList);
101 101 info.put("STUDENT_NUM", studentList != null ? studentList.size() : 0);
102 102 mv.addObject("info", info);
  103 + mv.addObject("start_date", pd.get("START_DATE"));
  104 + mv.addObject("end_date", pd.get("END_DATE"));
103 105 mv.setViewName("sunvote/teacher/teacher_report_1");
104 106 return mv;
105 107 }
... ... @@ -108,6 +110,9 @@ public class ReportController extends BaseController {
108 110 public ModelAndView teacher_report() throws Exception{
109 111 logBefore(logger, Jurisdiction.getUsername()+"教师报表");
110 112 ModelAndView mv = this.getModelAndView();
  113 + PageData pd = this.getPageData();
  114 + mv.addObject("start_date", pd.get("START_DATE"));
  115 + mv.addObject("end_date", pd.get("END_DATE"));
111 116 return mv;
112 117 }
113 118  
... ... @@ -119,6 +124,8 @@ public class ReportController extends BaseController {
119 124 PageData pd = getPageData();
120 125 mv.addObject("URL", "report/student_report_data?class_id=" +pd.getString("CLASS_ID"));
121 126 mv.setViewName("sunvote/teacher/stduent_report");
  127 + mv.addObject("start_date", pd.get("START_DATE"));
  128 + mv.addObject("end_date", pd.get("END_DATE"));
122 129 return mv;
123 130 }
124 131  
... ...