Pārlūkot izejas kodu

临界生对比

wzl_h
wangzl pirms 2 gadiem
vecāks
revīzija
d331801181

+ 68
- 17
js/scoreAnalysis/section_2_lin.js Parādīt failu

@@ -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
 });

+ 17
- 47
sections/scoreAnalysis/section_2_lin.html Parādīt failu

@@ -9,20 +9,20 @@
9 9
 </head>
10 10
 <body>
11 11
   <!-- <div class="section_2_lin_root"></div> -->
12
-  <div class="page_root section_2_lin">
12
+  <div class="page_root section_2_lin section_2_lin_0">
13 13
     <h2 class="section_title_2">4.临界生对比</h2>
14
-    <h3 class="section_title_3">4.1 全科临界生对比</h3>
14
+    <h3 class="section_title_3">4.1 <span class="subjectname"></span>临界生对比</h3>
15 15
     <h4 class="section_title_4">4.1.1 各班临界生对比分析</h4>
16 16
     <div class="echarts_result">
17 17
       <div>按名次统计</div>
18 18
       <div class="echarts_result_content">
19
-        <div>临界名次:<span class="c_5699FF">90</span>名<span class="margin_left_6mm margin_right_6mm">浮动名次:<span
20
-              class="c_FF5F56">5</span>名</span>名次区间:<span class="c_5699FF">85 - 95</span>名</div>
19
+        <div>临界名次:<span class="lin_rank_num c_5699FF"></span>名<span class="margin_left_6mm margin_right_6mm">浮动名次:<span
20
+              class="lin_rank_float c_FF5F56"></span>名</span>名次区间:<span class="lin_rank_range c_5699FF"></span>名</div>
21 21
       </div>
22 22
     </div>
23 23
     <div id="classCriticalRankEcharts" style="margin: 0 4mm 4mm; height: 120mm"></div>
24 24
   </div>
25
-  <div class="page_root section_2_lin">
25
+  <div class="page_root section_2_lin section_2_lin_0">
26 26
     <h4 class="section_title_4">4.1.2 各班名次整体分析</h4>
27 27
     <table border="1" class="my_table">
28 28
       <thead>
@@ -32,47 +32,32 @@
32 32
           <th>占比</th>
33 33
         </tr>
34 34
       </thead>
35
-      <tbody>
36
-        <tr>
35
+      <tbody class="lin_rank_tbody">
36
+        <!-- <tr>
37 37
           <td><div class="my_cell">全年级</div></td>
38 38
           <td><div class="my_cell">5</div></td>
39 39
           <td><div class="my_cell">4%</div></td>
40
-        </tr>
41
-        <tr>
42
-          <td><div class="my_cell">八年级一班</div></td>
43
-          <td><div class="my_cell">5</div></td>
44
-          <td><div class="my_cell">4%</div></td>
45
-        </tr>
46
-        <tr>
47
-          <td><div class="my_cell">八年级一班</div></td>
48
-          <td><div class="my_cell">5</div></td>
49
-          <td><div class="my_cell">4%</div></td>
50
-        </tr>
51
-        <tr>
52
-          <td><div class="my_cell">八年级一班</div></td>
53
-          <td><div class="my_cell">5</div></td>
54
-          <td><div class="my_cell">4%</div></td>
55
-        </tr>
40
+        </tr> -->
56 41
       </tbody>
57 42
     </table>
58 43
     <div class="echarts_result">
59 44
       <div>上图统计结果表示:</div>
60 45
       <div class="echarts_result_content">
61
-        <div><span class="dot bg_FF5F56"></span>临界生最多的班级:八年级六班</div>
46
+        <div><span class="dot bg_FF5F56"></span>临界生最多的班级:<span class="lin_rank_max"></span></div>
62 47
       </div>
63 48
     </div>
64 49
   </div>
65
-  <div class="page_root section_2_lin">
50
+  <div class="page_root section_2_lin section_2_lin_0">
66 51
     <div class="echarts_result">
67 52
       <div>按分数统计</div>
68 53
       <div class="echarts_result_content">
69
-        <div>临界分:<span class="c_5699FF">90</span>分<span class="margin_left_6mm margin_right_6mm">浮动分:<span
70
-              class="c_FF5F56">5</span>分</span>分数区间:<span class="c_5699FF">85 - 95</span>分</div>
54
+        <div>临界分:<span class="lin_score_num c_5699FF"></span>分<span class="margin_left_6mm margin_right_6mm">浮动分:<span
55
+              class="lin_score_float c_FF5F56"></span>分</span>分数区间:<span class="lin_score_range c_5699FF"></span>分</div>
71 56
       </div>
72 57
     </div>
73 58
     <div id="classCriticalScoreEcharts" style="margin: 0 4mm 4mm; height: 120mm"></div>
74 59
   </div>
75
-  <div class="page_root section_2_lin">
60
+  <div class="page_root section_2_lin section_2_lin_0">
76 61
     <h4 class="section_title_4">4.1.3 各班分数整体分析</h4>
77 62
     <table border="1" class="my_table">
78 63
       <thead>
@@ -82,33 +67,18 @@
82 67
           <th>占比</th>
83 68
         </tr>
84 69
       </thead>
85
-      <tbody>
86
-        <tr>
70
+      <tbody class="lin_score_tbody">
71
+        <!-- <tr>
87 72
           <td><div class="my_cell">全年级</div></td>
88 73
           <td><div class="my_cell">5</div></td>
89 74
           <td><div class="my_cell">4%</div></td>
90
-        </tr>
91
-        <tr>
92
-          <td><div class="my_cell">八年级一班</div></td>
93
-          <td><div class="my_cell">5</div></td>
94
-          <td><div class="my_cell">4%</div></td>
95
-        </tr>
96
-        <tr>
97
-          <td><div class="my_cell">八年级一班</div></td>
98
-          <td><div class="my_cell">5</div></td>
99
-          <td><div class="my_cell">4%</div></td>
100
-        </tr>
101
-        <tr>
102
-          <td><div class="my_cell">八年级一班</div></td>
103
-          <td><div class="my_cell">5</div></td>
104
-          <td><div class="my_cell">4%</div></td>
105
-        </tr>
75
+        </tr> -->
106 76
       </tbody>
107 77
     </table>
108 78
     <div class="echarts_result">
109 79
       <div>上图统计结果表示:</div>
110 80
       <div class="echarts_result_content">
111
-        <div><span class="dot bg_FF5F56"></span>临界生最多的班级:八年级六班</div>
81
+        <div><span class="dot bg_FF5F56"></span>临界生最多的班级:<span class="lin_score_max"></span></div>
112 82
       </div>
113 83
     </div>
114 84
   </div>

Notiek ielāde…
Atcelt
Saglabāt