Commit ffe4d02aeef10ec29abc88647851d6bb0e985063
1 parent
90ac05a1
修改报表时间传递
Showing
4 changed files
with
115 additions
and
81 deletions
WebRoot/WEB-INF/jsp/sunvote/teacher/stduent_report.jsp
@@ -46,8 +46,8 @@ li { | @@ -46,8 +46,8 @@ li { | ||
46 | <div class="header"> | 46 | <div class="header"> |
47 | <nav class="navbar navbar-default navbar-fixed-top"> | 47 | <nav class="navbar navbar-default navbar-fixed-top"> |
48 | <div class="container"> | 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 | <input type="button" value="查询" id="search" /> | 51 | <input type="button" value="查询" id="search" /> |
52 | </div> | 52 | </div> |
53 | </nav> | 53 | </nav> |
@@ -116,7 +116,7 @@ li { | @@ -116,7 +116,7 @@ li { | ||
116 | <script type=""> | 116 | <script type=""> |
117 | var URL = '<%=basePath%>${URL}'; | 117 | var URL = '<%=basePath%>${URL}'; |
118 | </script> | 118 | </script> |
119 | - <script src="../static/js/control1.js"></script> | 119 | + <script src="../static/js/control1.js?a=1"></script> |
120 | <!-- 日期框 --> | 120 | <!-- 日期框 --> |
121 | <script> | 121 | <script> |
122 | //lay('#version').html('-v'+ laydate.v); | 122 | //lay('#version').html('-v'+ laydate.v); |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
@@ -39,13 +39,15 @@ | @@ -39,13 +39,15 @@ | ||
39 | 39 | ||
40 | <td><div style="width:150px;text-align:center;"><span>学生人数: ${info.STUDENT_NUM}</span></div></td> | 40 | <td><div style="width:150px;text-align:center;"><span>学生人数: ${info.STUDENT_NUM}</span></div></td> |
41 | <td></td> | 41 | <td></td> |
42 | - <td style="padding-left:2px;"><input | 42 | + <td style="padding-left:2px;"> |
43 | + <input | ||
43 | class="span10 date-picker" name="lastStart" id="lastStart" | 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 | readonly="readonly" style="width:88px;" placeholder="开始日期" | 46 | readonly="readonly" style="width:88px;" placeholder="开始日期" |
46 | - title="开始日期" /></td> | 47 | + title="开始日期" /> |
48 | + </td> | ||
47 | <td style="padding-left:2px;"><input | 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 | type="text" data-date-format="yyyy-mm-dd" readonly="readonly" | 51 | type="text" data-date-format="yyyy-mm-dd" readonly="readonly" |
50 | style="width:88px;" placeholder="结束日期" title="结束日期" /></td> | 52 | style="width:88px;" placeholder="结束日期" title="结束日期" /></td> |
51 | <td style="vertical-align:top;padding-left:2px"><a | 53 | <td style="vertical-align:top;padding-left:2px"><a |
@@ -64,7 +66,7 @@ | @@ -64,7 +66,7 @@ | ||
64 | <th class="center"><div style="width:80px;">课程总分</div></th> | 66 | <th class="center"><div style="width:80px;">课程总分</div></th> |
65 | <c:forEach items="${testpaperList}" var="var" varStatus="vs"> | 67 | <c:forEach items="${testpaperList}" var="var" varStatus="vs"> |
66 | <th class="center"><a | 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 | </c:forEach> | 70 | </c:forEach> |
69 | </tr> | 71 | </tr> |
70 | </thead> | 72 | </thead> |
@@ -104,7 +106,7 @@ | @@ -104,7 +106,7 @@ | ||
104 | href="report/student_report?studentid=${var.ID}&class_id=${info.CLASS_ID}">${var.NAME}</a> | 106 | href="report/student_report?studentid=${var.ID}&class_id=${info.CLASS_ID}">${var.NAME}</a> |
105 | </td> --%> | 107 | </td> --%> |
106 | <td class="center"><a | 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 | </td> | 110 | </td> |
109 | <td class="center"><fmt:formatNumber type="number" | 111 | <td class="center"><fmt:formatNumber type="number" |
110 | value="${var.TOTALSCORE == 0 ? 0: (var.GETSCORE / var.TOTALSCORE * 100)}" | 112 | value="${var.TOTALSCORE == 0 ? 0: (var.GETSCORE / var.TOTALSCORE * 100)}" |
@@ -219,6 +221,24 @@ | @@ -219,6 +221,24 @@ | ||
219 | /* $("#Form").sumbit(); */ | 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 | $(document).ready(function(){ | 242 | $(document).ready(function(){ |
223 | window.top.loading.remove(); | 243 | window.top.loading.remove(); |
224 | }); | 244 | }); |
WebRoot/static/js/control1.js
@@ -42,8 +42,9 @@ | @@ -42,8 +42,9 @@ | ||
42 | 42 | ||
43 | studentid=getQueryString("studentid"); | 43 | studentid=getQueryString("studentid"); |
44 | 44 | ||
45 | - getData(); | ||
46 | - | 45 | + startDate = $("#starDate").val(); |
46 | + endDate = $("#endDate").val(); | ||
47 | + getData(startDate,endDate); | ||
47 | 48 | ||
48 | //$('#myStathalf').circliful(); | 49 | //$('#myStathalf').circliful(); |
49 | //$('#myStathalf1').circliful(); | 50 | //$('#myStathalf1').circliful(); |
@@ -91,7 +92,8 @@ | @@ -91,7 +92,8 @@ | ||
91 | 92 | ||
92 | 93 | ||
93 | function data(index,data){ | 94 | function data(index,data){ |
94 | - console.log(data); | 95 | + console.log(data); |
96 | + //data0=[];data1=[];data2=[];data3=[]; | ||
95 | var GETSCORE = parseInt(data.data.studentList[index].GETSCORE); | 97 | var GETSCORE = parseInt(data.data.studentList[index].GETSCORE); |
96 | var TOTALSCORE = parseInt(data.data.TOTAL_SCORE); | 98 | var TOTALSCORE = parseInt(data.data.TOTAL_SCORE); |
97 | var ratio=(GETSCORE/TOTALSCORE*100).toFixed(2); | 99 | var ratio=(GETSCORE/TOTALSCORE*100).toFixed(2); |
@@ -100,6 +102,12 @@ | @@ -100,6 +102,12 @@ | ||
100 | 102 | ||
101 | var test_num=data.data.studentList[index].testList.length; | 103 | var test_num=data.data.studentList[index].testList.length; |
102 | var part_num=test_num; | 104 | var part_num=test_num; |
105 | + | ||
106 | + data0=[]; | ||
107 | + data1=[]; | ||
108 | + data2=[]; | ||
109 | + data3=[]; | ||
110 | + | ||
103 | //console.log(data.data.studentList[index].testList[2].SCORE); | 111 | //console.log(data.data.studentList[index].testList[2].SCORE); |
104 | if($("input[type='radio']:checked").val()==1){ | 112 | if($("input[type='radio']:checked").val()==1){ |
105 | for(var i=0;i<test_num;i++){ | 113 | for(var i=0;i<test_num;i++){ |
@@ -142,76 +150,75 @@ | @@ -142,76 +150,75 @@ | ||
142 | $(".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>'); | 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 | $('#myStathalf1').circliful(); | 151 | $('#myStathalf1').circliful(); |
144 | $('#myStathalf').circliful(); | 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 | var myChart = echarts.init(document.getElementById('main')); | 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 | \ No newline at end of file | 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,6 +100,8 @@ public class ReportController extends BaseController { | ||
100 | mv.addObject("studentList", studentList); | 100 | mv.addObject("studentList", studentList); |
101 | info.put("STUDENT_NUM", studentList != null ? studentList.size() : 0); | 101 | info.put("STUDENT_NUM", studentList != null ? studentList.size() : 0); |
102 | mv.addObject("info", info); | 102 | mv.addObject("info", info); |
103 | + mv.addObject("start_date", pd.get("START_DATE")); | ||
104 | + mv.addObject("end_date", pd.get("END_DATE")); | ||
103 | mv.setViewName("sunvote/teacher/teacher_report_1"); | 105 | mv.setViewName("sunvote/teacher/teacher_report_1"); |
104 | return mv; | 106 | return mv; |
105 | } | 107 | } |
@@ -108,6 +110,9 @@ public class ReportController extends BaseController { | @@ -108,6 +110,9 @@ public class ReportController extends BaseController { | ||
108 | public ModelAndView teacher_report() throws Exception{ | 110 | public ModelAndView teacher_report() throws Exception{ |
109 | logBefore(logger, Jurisdiction.getUsername()+"教师报表"); | 111 | logBefore(logger, Jurisdiction.getUsername()+"教师报表"); |
110 | ModelAndView mv = this.getModelAndView(); | 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 | return mv; | 116 | return mv; |
112 | } | 117 | } |
113 | 118 | ||
@@ -119,6 +124,8 @@ public class ReportController extends BaseController { | @@ -119,6 +124,8 @@ public class ReportController extends BaseController { | ||
119 | PageData pd = getPageData(); | 124 | PageData pd = getPageData(); |
120 | mv.addObject("URL", "report/student_report_data?class_id=" +pd.getString("CLASS_ID")); | 125 | mv.addObject("URL", "report/student_report_data?class_id=" +pd.getString("CLASS_ID")); |
121 | mv.setViewName("sunvote/teacher/stduent_report"); | 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 | return mv; | 129 | return mv; |
123 | } | 130 | } |
124 | 131 |