|
@@ -1,10 +1,16 @@
|
1
|
1
|
$(function () {
|
2
|
2
|
// 按名次统计
|
3
|
|
- function initClassCriticalRankEcharts() {
|
4
|
|
- var legend_data = [">10名", "≤10名"];
|
5
|
|
- var xAxis_data = ["全部班级", "九年级一班", "九年级二班"];
|
6
|
|
- var series_data1 = [7, 4, 3];
|
7
|
|
- var series_data2 = [-4, -2, -2];
|
|
3
|
+ function initClassCriticalRankEcharts(r_data_item, s_index) {
|
|
4
|
+ var linescore = r_data_item.linescore;
|
|
5
|
+ var legend_data = [">" + linescore + "名", "≤" + linescore + "名"];
|
|
6
|
+ var xAxis_data = [];
|
|
7
|
+ var series_data1 = [];
|
|
8
|
+ var series_data2 = [];
|
|
9
|
+ $.each(r_data_item.ranks, function(index, r_item) {
|
|
10
|
+ xAxis_data.push(r_item.classname);
|
|
11
|
+ series_data1.push(r_item.dynum);
|
|
12
|
+ series_data2.push(-r_item.xynum);
|
|
13
|
+ });
|
8
|
14
|
var option = {
|
9
|
15
|
title: {
|
10
|
16
|
text: "人",
|
|
@@ -120,16 +126,22 @@ $(function () {
|
120
|
126
|
}
|
121
|
127
|
]
|
122
|
128
|
};
|
123
|
|
- var myEcharts = echarts.init(document.querySelector(".section_2_lin #classCriticalRankEcharts"));
|
|
129
|
+ var myEcharts = echarts.init(document.querySelector(".section_2_lin_" + s_index + " #classCriticalRankEcharts"));
|
124
|
130
|
myEcharts.clear();
|
125
|
131
|
myEcharts.setOption(option);
|
126
|
132
|
}
|
127
|
133
|
// 按分数统计
|
128
|
|
- function initClassCriticalScoreEcharts() {
|
129
|
|
- var legend_data = [">10分", "≤10分"];
|
130
|
|
- var xAxis_data = ["全部班级", "九年级一班", "九年级二班"];
|
131
|
|
- var series_data1 = [7, 4, 3];
|
132
|
|
- var series_data2 = [-4, -2, -2];
|
|
134
|
+ function initClassCriticalScoreEcharts(s_data_item, s_index) {
|
|
135
|
+ var linescore = s_data_item.linescore;
|
|
136
|
+ var legend_data = [">" + linescore + "分", "≤" + linescore + "分"];
|
|
137
|
+ var xAxis_data = [];
|
|
138
|
+ var series_data1 = [];
|
|
139
|
+ var series_data2 = [];
|
|
140
|
+ $.each(s_data_item.ranks, function(index, r_item) {
|
|
141
|
+ xAxis_data.push(r_item.classname);
|
|
142
|
+ series_data1.push(r_item.dynum);
|
|
143
|
+ series_data2.push(-r_item.xynum);
|
|
144
|
+ });
|
133
|
145
|
var option = {
|
134
|
146
|
title: {
|
135
|
147
|
text: "人",
|
|
@@ -282,13 +294,52 @@ $(function () {
|
282
|
294
|
if (s_index === 0) {
|
283
|
295
|
console.log("s_index", s_index);
|
284
|
296
|
console.log("s_item", s_item);
|
285
|
|
-
|
286
|
|
-
|
287
|
|
-
|
288
|
|
-
|
289
|
297
|
}
|
290
|
298
|
});
|
291
|
299
|
$(".section_2_lin_root").html(singleRootHtml);
|
292
|
|
- initClassCriticalRankEcharts();
|
293
|
|
- initClassCriticalScoreEcharts();
|
|
300
|
+ var s_index = 0;
|
|
301
|
+ var s_item = subjectInfo[s_index];
|
|
302
|
+ var r_data_item = subjectid_ranktype[s_item.subjectid][4];
|
|
303
|
+ console.log("r_data_item", r_data_item);
|
|
304
|
+ // 按名次统计
|
|
305
|
+ $(".section_2_lin_0 .subjectname").text(r_data_item.subjectname);
|
|
306
|
+ $(".section_2_lin_0 .lin_rank_num").text(r_data_item.linescore);
|
|
307
|
+ $(".section_2_lin_0 .lin_rank_float").text(r_data_item.floatscore);
|
|
308
|
+ $(".section_2_lin_0 .lin_rank_range").text(r_data_item.maxscore + " - " + r_data_item.minscore);
|
|
309
|
+ initClassCriticalRankEcharts(r_data_item, s_index);
|
|
310
|
+ var lin_rank_tbody_html = "";
|
|
311
|
+ var linRankMaxInfo = {
|
|
312
|
+ stunum: 0,
|
|
313
|
+ classname: ""
|
|
314
|
+ };
|
|
315
|
+ $.each(r_data_item.ranks, function(index, r_item) {
|
|
316
|
+ if (r_item.classid !== 0 && linRankMaxInfo.stunum < r_item.stunum) {
|
|
317
|
+ linRankMaxInfo.stunum = r_item.stunum;
|
|
318
|
+ linRankMaxInfo.classname = r_item.classname;
|
|
319
|
+ }
|
|
320
|
+ lin_rank_tbody_html += '<tr><td><div class="my_cell">' + r_item.classname + '</div></td><td><div class="my_cell">' + r_item.stunum + '</div></td><td><div class="my_cell">' + r_item.sturate + '%</div></td></tr>'
|
|
321
|
+ });
|
|
322
|
+ $(".section_2_lin_0 .lin_rank_tbody").html(lin_rank_tbody_html);
|
|
323
|
+ $(".section_2_lin_0 .lin_rank_max").html(linRankMaxInfo.classname);
|
|
324
|
+ // 按分数统计
|
|
325
|
+ var s_data_item = subjectid_ranktype[s_item.subjectid][3];
|
|
326
|
+ console.log("s_data_item", s_data_item);
|
|
327
|
+ $(".section_2_lin_0 .lin_score_num").text(s_data_item.linescore);
|
|
328
|
+ $(".section_2_lin_0 .lin_score_float").text(s_data_item.floatscore);
|
|
329
|
+ $(".section_2_lin_0 .lin_score_range").text(s_data_item.minscore + " - " + s_data_item.maxscore);
|
|
330
|
+ initClassCriticalScoreEcharts(s_data_item, s_index);
|
|
331
|
+ var lin_score_tbody_html = "";
|
|
332
|
+ var linScoreMaxInfo = {
|
|
333
|
+ stunum: 0,
|
|
334
|
+ classname: ""
|
|
335
|
+ };
|
|
336
|
+ $.each(s_data_item.ranks, function(index, r_item) {
|
|
337
|
+ if (r_item.classid !== 0 && linScoreMaxInfo.stunum < r_item.stunum) {
|
|
338
|
+ linScoreMaxInfo.stunum = r_item.stunum;
|
|
339
|
+ linScoreMaxInfo.classname = r_item.classname;
|
|
340
|
+ }
|
|
341
|
+ lin_score_tbody_html += '<tr><td><div class="my_cell">' + r_item.classname + '</div></td><td><div class="my_cell">' + r_item.stunum + '</div></td><td><div class="my_cell">' + r_item.sturate + '%</div></td></tr>'
|
|
342
|
+ });
|
|
343
|
+ $(".section_2_lin_0 .lin_score_tbody").html(lin_score_tbody_html);
|
|
344
|
+ $(".section_2_lin_0 .lin_score_max").html(linScoreMaxInfo.classname);
|
294
|
345
|
});
|