Browse Source

临界生对比

wzl_h
wangzl 2 years ago
parent
commit
d331801181
2 changed files with 85 additions and 64 deletions
  1. 68
    17
      js/scoreAnalysis/section_2_lin.js
  2. 17
    47
      sections/scoreAnalysis/section_2_lin.html

+ 68
- 17
js/scoreAnalysis/section_2_lin.js View File

1
 $(function () {
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
     var option = {
14
     var option = {
9
       title: {
15
       title: {
10
         text: "人",
16
         text: "人",
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
     myEcharts.clear();
130
     myEcharts.clear();
125
     myEcharts.setOption(option);
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
     var option = {
145
     var option = {
134
       title: {
146
       title: {
135
         text: "人",
147
         text: "人",
282
     if (s_index === 0) {
294
     if (s_index === 0) {
283
       console.log("s_index", s_index);
295
       console.log("s_index", s_index);
284
       console.log("s_item", s_item);
296
       console.log("s_item", s_item);
285
-
286
-
287
-
288
-
289
     }
297
     }
290
   });
298
   });
291
   $(".section_2_lin_root").html(singleRootHtml);
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 View File

9
 </head>
9
 </head>
10
 <body>
10
 <body>
11
   <!-- <div class="section_2_lin_root"></div> -->
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
     <h2 class="section_title_2">4.临界生对比</h2>
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
     <h4 class="section_title_4">4.1.1 各班临界生对比分析</h4>
15
     <h4 class="section_title_4">4.1.1 各班临界生对比分析</h4>
16
     <div class="echarts_result">
16
     <div class="echarts_result">
17
       <div>按名次统计</div>
17
       <div>按名次统计</div>
18
       <div class="echarts_result_content">
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
       </div>
21
       </div>
22
     </div>
22
     </div>
23
     <div id="classCriticalRankEcharts" style="margin: 0 4mm 4mm; height: 120mm"></div>
23
     <div id="classCriticalRankEcharts" style="margin: 0 4mm 4mm; height: 120mm"></div>
24
   </div>
24
   </div>
25
-  <div class="page_root section_2_lin">
25
+  <div class="page_root section_2_lin section_2_lin_0">
26
     <h4 class="section_title_4">4.1.2 各班名次整体分析</h4>
26
     <h4 class="section_title_4">4.1.2 各班名次整体分析</h4>
27
     <table border="1" class="my_table">
27
     <table border="1" class="my_table">
28
       <thead>
28
       <thead>
32
           <th>占比</th>
32
           <th>占比</th>
33
         </tr>
33
         </tr>
34
       </thead>
34
       </thead>
35
-      <tbody>
36
-        <tr>
35
+      <tbody class="lin_rank_tbody">
36
+        <!-- <tr>
37
           <td><div class="my_cell">全年级</div></td>
37
           <td><div class="my_cell">全年级</div></td>
38
           <td><div class="my_cell">5</div></td>
38
           <td><div class="my_cell">5</div></td>
39
           <td><div class="my_cell">4%</div></td>
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
       </tbody>
41
       </tbody>
57
     </table>
42
     </table>
58
     <div class="echarts_result">
43
     <div class="echarts_result">
59
       <div>上图统计结果表示:</div>
44
       <div>上图统计结果表示:</div>
60
       <div class="echarts_result_content">
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
       </div>
47
       </div>
63
     </div>
48
     </div>
64
   </div>
49
   </div>
65
-  <div class="page_root section_2_lin">
50
+  <div class="page_root section_2_lin section_2_lin_0">
66
     <div class="echarts_result">
51
     <div class="echarts_result">
67
       <div>按分数统计</div>
52
       <div>按分数统计</div>
68
       <div class="echarts_result_content">
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
       </div>
56
       </div>
72
     </div>
57
     </div>
73
     <div id="classCriticalScoreEcharts" style="margin: 0 4mm 4mm; height: 120mm"></div>
58
     <div id="classCriticalScoreEcharts" style="margin: 0 4mm 4mm; height: 120mm"></div>
74
   </div>
59
   </div>
75
-  <div class="page_root section_2_lin">
60
+  <div class="page_root section_2_lin section_2_lin_0">
76
     <h4 class="section_title_4">4.1.3 各班分数整体分析</h4>
61
     <h4 class="section_title_4">4.1.3 各班分数整体分析</h4>
77
     <table border="1" class="my_table">
62
     <table border="1" class="my_table">
78
       <thead>
63
       <thead>
82
           <th>占比</th>
67
           <th>占比</th>
83
         </tr>
68
         </tr>
84
       </thead>
69
       </thead>
85
-      <tbody>
86
-        <tr>
70
+      <tbody class="lin_score_tbody">
71
+        <!-- <tr>
87
           <td><div class="my_cell">全年级</div></td>
72
           <td><div class="my_cell">全年级</div></td>
88
           <td><div class="my_cell">5</div></td>
73
           <td><div class="my_cell">5</div></td>
89
           <td><div class="my_cell">4%</div></td>
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
       </tbody>
76
       </tbody>
107
     </table>
77
     </table>
108
     <div class="echarts_result">
78
     <div class="echarts_result">
109
       <div>上图统计结果表示:</div>
79
       <div>上图统计结果表示:</div>
110
       <div class="echarts_result_content">
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
       </div>
82
       </div>
113
     </div>
83
     </div>
114
   </div>
84
   </div>

Loading…
Cancel
Save