4d39642d
孙向锦
添加学生报表
|
1
2
3
4
5
6
7
8
9
10
11
|
var data0=[],data1=[],data2=[],data3=[];
var startDate,endDate;
var studentid;
var data_temp,_index=0;
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
function getData(startDate,endDate){
|
066f7673
孙向锦
修复bug
|
12
13
14
15
|
var attend = "" ;
if(startDate != null && endDate != null){
attend = "&start_Date="+startDate+"&end_Date="+endDate;
}
|
4d39642d
孙向锦
添加学生报表
|
16
|
$.ajax({
|
066f7673
孙向锦
修复bug
|
17
|
url:URL+ attend,
|
4d39642d
孙向锦
添加学生报表
|
18
|
type:"get",
|
4d39642d
孙向锦
添加学生报表
|
19
20
21
22
23
24
|
dataType:"json",
success:function(data){
data_temp=data;
console.log(data);
var _html='';
for(var i=0;i<data.data.studentList.length;i++){
|
0865f9c7
孙向锦
修改页面一些bug
|
25
|
_html+='<li style="cursor:pointer"><p>'+data.data.studentList[i].NAME+'</p></li>';
|
4d39642d
孙向锦
添加学生报表
|
26
27
28
29
30
|
if(studentid==data.data.studentList[i].ID)
_index=i;
}
$(".content_l ul").html(_html);
console.log(_index);
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
31
32
33
|
dataMethod(_index,data_temp);
$(".content_l li").eq(_index).siblings().removeClass("on");
$(".content_l li").eq(_index).addClass("on");
|
a7551346
孙向锦
报表显示时间
|
34
|
window.top.loading.remove();
|
4d39642d
孙向锦
添加学生报表
|
35
36
37
|
}
});
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
38
|
|
4d39642d
孙向锦
添加学生报表
|
39
40
41
42
43
44
|
}
$( document ).ready(function() {
//alert($("input[type=radio][checked]").val());
studentid=getQueryString("studentid");
|
ffe4d02a
孙向锦
修改报表时间传递
|
45
46
47
|
startDate = $("#starDate").val();
endDate = $("#endDate").val();
getData(startDate,endDate);
|
4d39642d
孙向锦
添加学生报表
|
48
49
50
51
52
53
54
|
//$('#myStathalf').circliful();
//$('#myStathalf1').circliful();
$(document).on("click",".content_l li",function(){
$(this).siblings().removeClass("on");
$(this).addClass("on");
_index=$(this).index();
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
55
|
dataMethod(_index,data_temp);
|
4d39642d
孙向锦
添加学生报表
|
56
57
58
59
|
studentid = 0;
})
$("input[type=radio]").change(function(){
//alert($("input[type='radio']:checked").val());
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
60
|
dataMethod(_index,data_temp);
|
4d39642d
孙向锦
添加学生报表
|
61
62
63
|
})
$("#search").click(function(){
|
8942b440
孙向锦
提交code
|
64
65
66
67
|
// var date_string=$("#test6").val();
// var date_arry=date_string.split(' - ');
// startDate=date_arry[0];
// endDate=date_arry[1];
|
a7551346
孙向锦
报表显示时间
|
68
|
window.top.loading.show();
|
8942b440
孙向锦
提交code
|
69
70
|
startDate = $("#starDate").val();
endDate = $("#endDate").val();
|
4d39642d
孙向锦
添加学生报表
|
71
|
getData(startDate,endDate);
|
a7551346
孙向锦
报表显示时间
|
72
|
|
4d39642d
孙向锦
添加学生报表
|
73
|
})
|
a7c57a42
孙向锦
成绩添加上一个下一个学生功能
|
74
75
76
77
78
79
80
81
|
$(".prev").click(function(){
_index-=1;
if(_index<0){
_index=data_temp.data.studentList.length-1;
}
$(".content_l li").eq(_index).siblings().removeClass("on");
$(".content_l li").eq(_index).addClass("on");
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
82
|
dataMethod(_index,data_temp);
|
a7c57a42
孙向锦
成绩添加上一个下一个学生功能
|
83
84
85
86
87
88
89
90
|
})
$(".next").click(function(){
_index+=1;
if(_index>(data_temp.data.studentList.length-1)){
_index=0;
}
$(".content_l li").eq(_index).siblings().removeClass("on");
$(".content_l li").eq(_index).addClass("on");
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
91
|
dataMethod(_index,data_temp);
|
a7c57a42
孙向锦
成绩添加上一个下一个学生功能
|
92
|
})
|
4d39642d
孙向锦
添加学生报表
|
93
94
95
|
});
|
90d4858f
孙向锦
修改管理员界面搜素功能
|
96
|
function dataMethod(index,data){
|
ffe4d02a
孙向锦
修改报表时间传递
|
97
98
|
console.log(data);
//data0=[];data1=[];data2=[];data3=[];
|
e9f47f90
孙向锦
优化个人成绩报表
|
99
100
|
var GETSCORE = parseFloat(data.data.studentList[index].GETSCORE);
var TOTALSCORE = parseFloat(data.data.TOTAL_SCORE);
|
4d39642d
孙向锦
添加学生报表
|
101
|
var ratio=(GETSCORE/TOTALSCORE*100).toFixed(2);
|
e9f47f90
孙向锦
优化个人成绩报表
|
102
103
|
var class_avg= (parseFloat(data.data.AVG_SCORE)/ parseFloat(data.data.TOTAL_SCORE)*100).toFixed(2);
var class_max=(parseFloat(data.data.MAX_SCORE)/ parseFloat(data.data.TOTAL_SCORE)*100).toFixed(2);
|
4d39642d
孙向锦
添加学生报表
|
104
105
106
|
var test_num=data.data.studentList[index].testList.length;
var part_num=test_num;
|
ffe4d02a
孙向锦
修改报表时间传递
|
107
108
109
110
111
112
|
data0=[];
data1=[];
data2=[];
data3=[];
|
4d39642d
孙向锦
添加学生报表
|
113
114
115
116
|
//console.log(data.data.studentList[index].testList[2].SCORE);
if($("input[type='radio']:checked").val()==1){
for(var i=0;i<test_num;i++){
if(data.data.studentList[index].testList[i].TOTAL_SCORE>0){
|
a7551346
孙向锦
报表显示时间
|
117
|
data0[i]=data.data.studentList[index].testList[i].NAME + "\n" + data.data.studentList[index].testList[i].CREATE_DATE;
|
4d39642d
孙向锦
添加学生报表
|
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
data1[i]=(data.data.studentList[index].testList[i].AVG_SCORE/data.data.studentList[index].testList[i].TOTAL_SCORE*100).toFixed(2);
data2[i]=(data.data.studentList[index].testList[i].SCORE/data.data.studentList[index].testList[i].TOTAL_SCORE*100).toFixed(2);
data3[i]=(data.data.studentList[index].testList[i].MAX_SCORE/data.data.studentList[index].testList[i].TOTAL_SCORE*100).toFixed(2);
}else{
data1[i]=0;
data2[i]=0;
data3[i]=0;
}
if(data.data.studentList[index].testList[i].SCORE=="0")
part_num--;
}
}else if($("input[type='radio']:checked").val()==2){
for(var i=0;i<test_num;i++){
data0[i]=data.data.studentList[index].testList[i].NAME;
data1[i]=data.data.studentList[index].testList[i].AVG_SCORE;
data2[i]=data.data.studentList[index].testList[i].SCORE;
data3[i]=data.data.studentList[index].testList[i].MAX_SCORE;
if(data.data.studentList[index].testList[i].SCORE=="0")
part_num--;
}
}
console.log(data0);
console.log(data1);
console.log(data2);
console.log(data2);
var partake=(part_num/test_num*100).toFixed(2);
$("#class_avg").html(class_avg);
$("#class_max").html(class_max);
$(".name h1").html(data.data.studentList[index].NAME);
$(".circle .col-md-6").eq(1).html('<div id="myStathalf1" data-dimension="350" data-text="'+ratio+"%"+'" data-info="个人平均得分率" data-width="10" data-fontsize="38" data-percent="'+ratio+'" data-fgcolor="#8ad254" data-bgcolor="#a9f9ff" data-type="half" data-fill="#50b5c9"></div>');
$(".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>');
$('#myStathalf1').circliful();
$('#myStathalf').circliful();
|
ffe4d02a
孙向锦
修改报表时间传递
|
155
|
myChart.setOption({
|
d3d7b2ca
孙向锦
修改表格固定
|
156
157
158
|
tooltip:{
trigger: 'axis'
},
|
ffe4d02a
孙向锦
修改报表时间传递
|
159
160
161
|
xAxis: {
type: 'category',
data: data0
|
a7551346
孙向锦
报表显示时间
|
162
163
|
/*,
axisLabel:{interval: 0}*/
|
ffe4d02a
孙向锦
修改报表时间传递
|
164
165
|
},
yAxis: {
|
a7551346
孙向锦
报表显示时间
|
166
167
|
type: 'value',
splitArea: {show: true}
|
ffe4d02a
孙向锦
修改报表时间传递
|
168
169
|
},
series: [{
|
d3d7b2ca
孙向锦
修改表格固定
|
170
|
name:"班级平均分",
|
ffe4d02a
孙向锦
修改报表时间传递
|
171
172
173
174
175
176
|
data: data1,
type: 'line',
symbol: 'circle',
symbolSize: 5,
lineStyle: {
normal: {
|
a0ec879e
孙向锦
修改部分bug
|
177
|
color: '#93D150',
|
ffe4d02a
孙向锦
修改报表时间传递
|
178
179
180
181
182
183
184
|
width: 2,
type: 'dashed'
}
},
itemStyle: {
normal: {
borderWidth: 2,
|
a0ec879e
孙向锦
修改部分bug
|
185
186
|
borderColor: '#93D150',
color: '#93D150'
|
ffe4d02a
孙向锦
修改报表时间传递
|
187
188
189
|
}
}
},{
|
d3d7b2ca
孙向锦
修改表格固定
|
190
|
name:"班级最高分",
|
ffe4d02a
孙向锦
修改报表时间传递
|
191
192
193
194
195
196
|
data: data3,
type: 'line',
symbol: 'circle',
symbolSize: 5,
lineStyle: {
normal: {
|
a0ec879e
孙向锦
修改部分bug
|
197
|
color: '#FFC004',
|
ffe4d02a
孙向锦
修改报表时间传递
|
198
199
200
201
202
203
204
|
width: 2,
type: 'dashed',
}
},
itemStyle: {
normal: {
borderWidth: 2,
|
a0ec879e
孙向锦
修改部分bug
|
205
206
|
borderColor: '#FFC004',
color: '#FFC004'
|
ffe4d02a
孙向锦
修改报表时间传递
|
207
208
209
|
}
}
},{
|
d3d7b2ca
孙向锦
修改表格固定
|
210
|
name:"个人成绩",
|
ffe4d02a
孙向锦
修改报表时间传递
|
211
212
213
214
215
216
|
data: data2,
type: 'line',
symbol: 'circle',
symbolSize: 10,
lineStyle: {
normal: {
|
a0ec879e
孙向锦
修改部分bug
|
217
|
color: '#45a6f3',
|
ffe4d02a
孙向锦
修改报表时间传递
|
218
219
220
221
222
223
224
|
width: 4,
type: 'solid'
}
},
itemStyle: {
normal: {
borderWidth: 3,
|
a0ec879e
孙向锦
修改部分bug
|
225
226
227
|
borderColor: '#45a6f3',
color: '#45a6f3',
label : {show: true,color:'#000'}
|
ffe4d02a
孙向锦
修改报表时间传递
|
228
229
230
231
|
}
}
}]
});
|
4d39642d
孙向锦
添加学生报表
|
232
233
234
235
|
}
var myChart = echarts.init(document.getElementById('main'));
|