|
@@ -1,5 +1,290 @@
|
1
|
1
|
$(function () {
|
|
2
|
+ function initaveragescoreEcharts (list) {
|
|
3
|
+ var itemStyle = {
|
|
4
|
+ normal: {
|
|
5
|
+ label: {
|
|
6
|
+ show: true, //开启显示数值
|
|
7
|
+ position: "top" //数值在上方显示
|
|
8
|
+ }
|
|
9
|
+ }
|
|
10
|
+ };
|
|
11
|
+ var avgscore = [],xAxis_data=[],totalScore = 0;
|
|
12
|
+ var curlegend = [ "平均分"];
|
|
13
|
+ $.each(list.pjf, function (idx, item) {
|
|
14
|
+ totalScore += item.classavgscore;
|
|
15
|
+ avgscore.push(item.classavgscore);
|
|
16
|
+ xAxis_data.push(item.classname)
|
|
17
|
+ })
|
|
18
|
+ var gradeAvgScore = Math.floor(totalScore / xAxis_data.length);
|
|
19
|
+ var curseries = [
|
|
20
|
+ {
|
|
21
|
+ name: "平均分",
|
|
22
|
+ type: "bar",
|
|
23
|
+ barWidth: $.UnitUtil.mm2px(5),
|
|
24
|
+ // 柱状图最小高度
|
|
25
|
+ barMinHeight: $.UnitUtil.mm2px(2),
|
|
26
|
+ barGap: 0,
|
|
27
|
+ data: avgscore,
|
|
28
|
+ itemStyle: itemStyle,
|
|
29
|
+ markLine: {
|
|
30
|
+ precision: 0,
|
|
31
|
+ data: [{ type: "average", name: "平均值" }],
|
|
32
|
+ itemStyle: {
|
|
33
|
+ normal: {
|
|
34
|
+ lineStyle: {
|
|
35
|
+ color: "#ff001e",
|
|
36
|
+ type: "dotted"
|
|
37
|
+ },
|
|
38
|
+ label: {
|
|
39
|
+ show: true,
|
|
40
|
+ color: "#ff001e",
|
|
41
|
+ position: "insideEndTop",
|
|
42
|
+ formatter: function () {
|
|
43
|
+ return "年级平均分:" + gradeAvgScore;
|
|
44
|
+ }
|
|
45
|
+ }
|
|
46
|
+ }
|
|
47
|
+ },
|
|
48
|
+ large: true
|
|
49
|
+ },
|
|
50
|
+ z: 10
|
|
51
|
+ }
|
|
52
|
+ ];
|
|
53
|
+ var option = {
|
|
54
|
+ animation: false,
|
|
55
|
+ color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
|
|
56
|
+ title: {
|
|
57
|
+ text: "分",
|
|
58
|
+ x: "left",
|
|
59
|
+ y: "top",
|
|
60
|
+ textStyle: {
|
|
61
|
+ color: "#5F6E82",
|
|
62
|
+ fontSize: $.UnitUtil.mm2px(3),
|
|
63
|
+ fontWeight: 500
|
|
64
|
+ }
|
|
65
|
+ },
|
|
66
|
+ legend: {
|
|
67
|
+ itemWidth: $.UnitUtil.mm2px(2),
|
|
68
|
+ itemHeight: $.UnitUtil.mm2px(2),
|
|
69
|
+ top: "bottom",
|
|
70
|
+ data: curlegend
|
|
71
|
+ },
|
|
72
|
+ grid: {
|
|
73
|
+ top: $.UnitUtil.mm2px(10),
|
|
74
|
+ left: 0,
|
|
75
|
+ right: 0,
|
|
76
|
+ bottom: $.UnitUtil.mm2px(8),
|
|
77
|
+ containLabel: true
|
|
78
|
+ },
|
|
79
|
+ xAxis: [
|
|
80
|
+ {
|
|
81
|
+ type: "category",
|
|
82
|
+ data: xAxis_data,
|
|
83
|
+ axisLabel: {
|
|
84
|
+ color: "#5F6E82" //更改坐标轴文字颜色
|
|
85
|
+ },
|
|
86
|
+ axisTick: {
|
|
87
|
+ alignWithLabel: true
|
|
88
|
+ },
|
|
89
|
+ boundaryGap: true,
|
|
90
|
+ triggerEvent: true,
|
|
91
|
+ axisLine: {
|
|
92
|
+ show: true, //是否显示轴线
|
|
93
|
+ lineStyle: {
|
|
94
|
+ color: "#DADADA" //刻度线的颜色
|
|
95
|
+ }
|
|
96
|
+ }
|
|
97
|
+ }
|
|
98
|
+ ],
|
|
99
|
+ yAxis: [
|
|
100
|
+ {
|
|
101
|
+ type: "value",
|
|
102
|
+ axisTick: {
|
|
103
|
+ show: false //刻度
|
|
104
|
+ },
|
|
105
|
+ axisLine: {
|
|
106
|
+ show: false, //是否显示轴线
|
|
107
|
+ lineStyle: {
|
|
108
|
+ color: "#DADADA" //刻度线的颜色
|
|
109
|
+ }
|
|
110
|
+ },
|
|
111
|
+ splitLine: {
|
|
112
|
+ //网格线
|
|
113
|
+ lineStyle: {
|
|
114
|
+ type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
|
|
115
|
+ },
|
|
116
|
+ show: true //隐藏或显示
|
|
117
|
+ },
|
|
118
|
+ axisLabel: {
|
|
119
|
+ color: "#5F6E82" //更改坐标轴文字颜色
|
|
120
|
+ }
|
|
121
|
+ }
|
|
122
|
+ ],
|
|
123
|
+ series: curseries
|
|
124
|
+ };
|
|
125
|
+ var myEcharts = echarts.init(
|
|
126
|
+ document.querySelector(".section2 #averagescoreEcharts")
|
|
127
|
+ );
|
|
128
|
+ myEcharts.clear();
|
|
129
|
+ myEcharts.setOption(option);
|
|
130
|
+ }
|
|
131
|
+ function achievementdistributiontable (list) {
|
|
132
|
+ var table = "", goodTableHeadTr1Html = '<th class="dj">等级</th><th class="pm">排名(年级/名)</th><th class="dj">人数</th><th class="comm">详情</th>',
|
|
133
|
+ trHtml = "";
|
|
134
|
+ $.each(list.djtj, function (idx, item) {
|
|
135
|
+ var stujson = JSON.parse(item.stujson),stuarr = "";
|
|
136
|
+ $.each(stujson, function (index, items) {
|
|
137
|
+ stuarr+=items.studentname+"("+items.schoolrank+"名)、"
|
|
138
|
+ })
|
|
139
|
+ stuarr = stuarr.substr(0, stuarr.length - 1);
|
|
140
|
+ trHtml += '<tr><td>' + item.rankname + "类</td><td>" + item.rankrange + "</td><td>" +
|
|
141
|
+ item.stunum+"</td><td>"+stuarr+"</td></tr>";
|
|
142
|
+ })
|
|
143
|
+
|
|
144
|
+ table = '<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
|
|
145
|
+ goodTableHeadTr1Html + '</tr></thead><tbody class="goodTableTbody">' +
|
|
146
|
+ trHtml + '</tbody></table>'
|
|
147
|
+ $(".section2 .achievementdistribution").html(table)
|
|
148
|
+ }
|
|
149
|
+ function progresstable (list) {
|
|
150
|
+ var table = "", trHtml={1:"",2:""};
|
|
151
|
+ var cjdjheight = $(".section2_1 .cjdjheight").height() - 454;
|
|
152
|
+ var surplus = pageheight - cjdjheight; //本页剩余高度
|
|
153
|
+ var height = 0,page = {1:"",2:""},ispage = false;
|
|
154
|
+ $.each(list.dfjb, function (idx, item) {
|
|
155
|
+ if (idx % 2 == 0) {
|
|
156
|
+ height += 27.5;
|
|
157
|
+ if (height > surplus && surplus - height < 27.5) {
|
|
158
|
+ ispage = true;
|
|
159
|
+ }
|
|
160
|
+ if (ispage) {
|
|
161
|
+ trHtml[2] += '<tr><td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
162
|
+ item.classrank + '名</td><td class="green">进步' + item.classrankpre + '名</td>';
|
|
163
|
+ } else {
|
|
164
|
+ trHtml[1] += '<tr><td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
165
|
+ item.classrank + '名</td><td class="green">进步' + item.classrankpre + '名</td>';
|
|
166
|
+ }
|
|
167
|
+ } else {
|
|
168
|
+ if (ispage) {
|
|
169
|
+ trHtml[2]+= '<td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
170
|
+ item.classrank + '名</td><td class="green">进步' + item.classrankpre + '名</td>';
|
|
171
|
+ } else {
|
|
172
|
+ trHtml[1] += '<td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
173
|
+ item.classrank + '名</td><td class="green">进步' + item.classrankpre + '名</td>';
|
|
174
|
+ }
|
|
175
|
+
|
|
176
|
+ }
|
|
177
|
+ })
|
|
178
|
+ for (var i = 1; i < 3; i++){
|
|
179
|
+ page[i]='<table border="1" class="my_table"><tbody class="goodTableTbody">' +
|
|
180
|
+ trHtml[i] + '</tbody></table>'
|
|
181
|
+ }
|
|
182
|
+ $(".section2_1 .progress").html(page[1])
|
|
183
|
+ if (ispage) {
|
|
184
|
+ //添加第二页
|
|
185
|
+ $(".section2_1").after(
|
|
186
|
+ '<div class="page_root section2 section2_2"></div>'
|
|
187
|
+ );
|
|
188
|
+ $(".section2_2").html(page[2]);
|
|
189
|
+ }
|
|
190
|
+ }
|
|
191
|
+
|
|
192
|
+ function retrogression (list) {
|
|
193
|
+ var trHtml = "", table = "";
|
|
194
|
+ $.each(list.dftb, function (idx, item) {
|
|
195
|
+ item.classrankpre = Math.abs(item.classrankpre)
|
|
196
|
+ if (idx % 2 == 0) {
|
|
197
|
+ trHtml += '<tr><td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
198
|
+ item.classrank + '名</td><td class="red">退步' + item.classrankpre + '名</td>';
|
|
199
|
+
|
|
200
|
+ } else {
|
|
201
|
+ trHtml += '<td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
202
|
+ item.classrank + '名</td><td class="red">退步' + item.classrankpre + '名</td>';
|
|
203
|
+ }
|
|
204
|
+ })
|
|
205
|
+ var table ='<table border="1" class="my_table"><tbody class="goodTableTbody">' +
|
|
206
|
+ trHtml + '</tbody></table>'
|
|
207
|
+ $(".section2 .retrogression").html(table)
|
|
208
|
+ }
|
|
209
|
+
|
|
210
|
+ function critical (list) {
|
|
211
|
+ var trHtml = "", table = "";
|
|
212
|
+ $.each(list.ljs, function (idx, item) {
|
|
213
|
+ if (idx % 2 == 0) {
|
|
214
|
+ trHtml += '<tr><td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
215
|
+ item.classrank + '分</td><td class="red">' + item.classrankpre + '分</td>';
|
|
216
|
+
|
|
217
|
+ } else {
|
|
218
|
+ trHtml += '<td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>第' +
|
|
219
|
+ item.classrank + '分</td><td class="red">' + item.classrankpre + '分</td>';
|
|
220
|
+ }
|
|
221
|
+ })
|
|
222
|
+ var table ='<table border="1" class="my_table"><tbody class="goodTableTbody">' +
|
|
223
|
+ trHtml + '</tbody></table>'
|
|
224
|
+ $(".section2 .critical").html(table)
|
|
225
|
+ }
|
|
226
|
+
|
|
227
|
+ function wave (list) {
|
|
228
|
+ var trHtml = "", table = "";
|
|
229
|
+ $.each(list.bds, function (idx, item) {
|
|
230
|
+ var curdata = {
|
|
231
|
+ class: "red",
|
|
232
|
+ name :"退步"
|
|
233
|
+ }
|
|
234
|
+ if (item.classrankpre > 0) {
|
|
235
|
+ curdata = {
|
|
236
|
+ class: "green",
|
|
237
|
+ name :"进步"
|
|
238
|
+ }
|
|
239
|
+ }
|
|
240
|
+ item.classrankpre = Math.abs(item.classrankpre)
|
|
241
|
+ if (idx % 2 == 0) {
|
|
242
|
+ trHtml += '<tr><td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>' +
|
|
243
|
+ item.classrank + '分</td><td class="'+curdata.class+'">'+curdata.name + item.classrankpre + '名</td>';
|
|
244
|
+
|
|
245
|
+ } else {
|
|
246
|
+ trHtml += '<td>' + (idx+1) + '</td><td>' + item.username + '</td><td>' + item.score + '分</td><td>' +
|
|
247
|
+ item.classrank + '分</td><td class="'+curdata.class+'">'+curdata.name + item.classrankpre + '名</td>';
|
|
248
|
+ }
|
|
249
|
+ })
|
|
250
|
+ var table ='<table border="1" class="my_table"><tbody class="goodTableTbody">' +
|
|
251
|
+ trHtml + '</tbody></table>'
|
|
252
|
+ $(".section2 .wave").html(table)
|
|
253
|
+ }
|
|
254
|
+
|
|
255
|
+ function errquestion (list) {
|
|
256
|
+ console.log(list.gpctList);
|
|
257
|
+ var table = "", goodTableHeadTr1Html = '<th>题号</th><th>题型</th><th>知识点</th><th>班级得分率</th><th>与年级差值</th><th>高频错误项</th>',
|
|
258
|
+ trHtml = "";
|
|
259
|
+ $.each(list.gpctList, function (idx, item) {
|
|
260
|
+ item.answer = JSON.parse(item.answer);
|
|
261
|
+ trHtml += '<tr><td>第' + item.qn + "题</td><td>" + item.eptname + "</td><td>" +
|
|
262
|
+ item.pointnames+"</td><td>"+item.classsrate+'%</td><td>'+item.gradesrate+'%</td><td>'+item.answer[0]+"</td></tr>";
|
|
263
|
+ })
|
|
264
|
+
|
|
265
|
+ table = '<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
|
|
266
|
+ goodTableHeadTr1Html + '</tr></thead><tbody class="goodTableTbody">' +
|
|
267
|
+ trHtml + '</tbody></table>'
|
|
268
|
+ $(".section2 .errquestion").html(table)
|
|
269
|
+ }
|
2
|
270
|
var parameter = $(".section_2_html_root").data("page-params");
|
3
|
271
|
parameter = JSON.parse(parameter);
|
4
|
|
-
|
|
272
|
+ console.log(parameter[0]);
|
|
273
|
+ var curdata = parameter[0];
|
|
274
|
+ $(".section2 .subjectinfo").text(curdata.subjectname + "概况");
|
|
275
|
+ $(".section2 .classavgscore").text(curdata.classavgscore);
|
|
276
|
+ $(".section2 .classavgscorerank").text(curdata.classavgscorerank);
|
|
277
|
+ $(".section2 .yxrate").text(curdata.yxrate);
|
|
278
|
+ $(".section2 .jgrate").text(curdata.jgrate);
|
|
279
|
+ $(".section2 .classmaxscore").text(curdata.classmaxscore);
|
|
280
|
+ $(".section2 .schoolavgscore").text(curdata.schoolavgscore);
|
|
281
|
+ $(".section2 .schoolmaxscore").text(curdata.schoolmaxscore);
|
|
282
|
+ initaveragescoreEcharts(curdata);
|
|
283
|
+ achievementdistributiontable(curdata);
|
|
284
|
+ progresstable(curdata);
|
|
285
|
+ retrogression(curdata);
|
|
286
|
+ critical(curdata);
|
|
287
|
+ wave(curdata);
|
|
288
|
+ errquestion(curdata)
|
|
289
|
+ document.documentElement.scrollTop = 6000;
|
5
|
290
|
});
|