瀏覽代碼

优秀生、学困生对比全科、单科

gzb
wangzhonglu 1 年之前
父節點
當前提交
712b5bb67b

css/scoreAnalysis/section_2_excellent_all.css → css/scoreAnalysis/section_2_excellent.css 查看文件

@@ -1,10 +1,10 @@
1
-.section_2_excellent_all .echarts_result_content {
1
+.section_2_excellent .echarts_result_content {
2 2
     margin-top: 3mm;
3 3
     padding: 2mm 3mm;
4 4
     line-height: 7mm;
5 5
     background-color: #fff;
6 6
 }
7
-.section_2_excellent_all .echarts_result_content .dot {
7
+.section_2_excellent .echarts_result_content .dot {
8 8
     display: inline-block;
9 9
     margin-right: 2mm;
10 10
     width: 2mm;

+ 213
- 0
js/scoreAnalysis/section_2_excellent.js 查看文件

@@ -0,0 +1,213 @@
1
+$(function () {
2
+  // 优秀生、学困生统计
3
+  function initClassExcellenceEcharts(r_data_item, s_index) {
4
+    var legend_data = ["优秀生", "学困生"];
5
+    var xAxis_data = [];
6
+    var series_data1 = [];
7
+    var series_data2 = [];
8
+    $.each(r_data_item.ranks, function (index, r_item) {
9
+      xAxis_data.push(r_item.classname);
10
+      series_data1.push(r_item.stujson[0].stunum);
11
+      series_data2.push(-r_item.stujson[1].stunum);
12
+    });
13
+    var option = {
14
+      title: {
15
+        text: "人",
16
+        x: "left",
17
+        y: "top",
18
+        textStyle: {
19
+          color: "#5F6E82",
20
+          fontSize: 12,
21
+          fontWeight: 500
22
+        }
23
+      },
24
+      color: ["#5C99FF", "#F39A2C"],
25
+      legend: {
26
+        itemWidth: 6,
27
+        itemHeight: 6,
28
+        bottom: 30,
29
+        data: legend_data
30
+      },
31
+      grid: {
32
+        top: 30,
33
+        left: 5,
34
+        right: 0,
35
+        bottom: 65,
36
+        containLabel: true
37
+      },
38
+      xAxis: [
39
+        {
40
+          type: "category",
41
+          offset: 10,
42
+          position: "bottom",
43
+          data: xAxis_data,
44
+          axisLabel: {
45
+            color: "#5F6E82" //更改坐标轴文字颜色
46
+          },
47
+          axisTick: {
48
+            alignWithLabel: true
49
+          },
50
+          boundaryGap: true,
51
+          triggerEvent: true,
52
+          axisLine: {
53
+            show: true, //是否显示轴线
54
+            lineStyle: {
55
+              color: "#DADADA" //刻度线的颜色
56
+            }
57
+          }
58
+        }
59
+      ],
60
+      yAxis: [
61
+        {
62
+          type: "value",
63
+          axisTick: {
64
+            show: false //刻度
65
+          },
66
+          axisLine: {
67
+            show: false, //是否显示轴线
68
+            lineStyle: {
69
+              color: "#DADADA" //刻度线的颜色
70
+            }
71
+          },
72
+          splitLine: {
73
+            //网格线
74
+            lineStyle: {
75
+              type: "dotted" //设置网格线类型 dotted:虚线   solid:实线
76
+            },
77
+            show: true //隐藏或显示
78
+          },
79
+          axisLabel: {
80
+            color: "#5F6E82" //更改坐标轴文字颜色
81
+          }
82
+        }
83
+      ],
84
+      series: [
85
+        {
86
+          name: legend_data[0],
87
+          type: "bar",
88
+          stack: "one",
89
+          barWidth: 32,
90
+          // 柱状图最小高度
91
+          barMinHeight: 0,
92
+          barGap: 0,
93
+          label: {
94
+            normal: {
95
+              show: true,
96
+              align: "center",
97
+              verticalAlign: "bottom",
98
+              position: "top",
99
+              distance: 0
100
+            }
101
+          },
102
+          data: series_data1
103
+        },
104
+        {
105
+          name: legend_data[1],
106
+          type: "bar",
107
+          stack: "one",
108
+          barWidth: 32,
109
+          // 柱状图最小高度
110
+          barMinHeight: 0,
111
+          barGap: 0,
112
+          label: {
113
+            normal: {
114
+              show: true,
115
+              align: "center",
116
+              verticalAlign: "top",
117
+              position: "bottom",
118
+              distance: 0,
119
+              formatter: function (params) {
120
+                return Math.abs(params.value);
121
+              }
122
+            }
123
+          },
124
+          data: series_data2
125
+        }
126
+      ]
127
+    };
128
+    var myEcharts = echarts.init(document.querySelector(".section_2_excellent.section_2_excellent_" + s_index + " #classExcellenceEcharts"));
129
+    myEcharts.clear();
130
+    myEcharts.setOption(option);
131
+  }
132
+  var parameter = $(".section_2_html_root .section_2_excellent_html_root").data("page-params");
133
+  parameter = JSON.parse(parameter);
134
+  console.log(".section_2_excellent_html_root:parameter", parameter);
135
+  
136
+  var subjectInfo = [];
137
+  for (var sid in parameter) {
138
+    if (sid === "zf") {
139
+      subjectInfo.unshift({
140
+        subjectid: sid,
141
+        subjectname: "全科",
142
+      });
143
+    } else {
144
+      subjectInfo.push({
145
+        subjectid: sid,
146
+        subjectname: parameter[sid].subjectname,
147
+      });
148
+    }
149
+  }
150
+  var singleRootHtml = "";
151
+  $.each(subjectInfo, function (s_index, s_item) {
152
+    singleRootHtml += '<div class="page_root section_2_excellent section_2_excellent_' + s_index + '">' + (s_index === 0 ? '<h2 class="section_title_2">5. 优秀生、学困生对比</h2>' : "") + '<h3 class="section_title_3">5.' + (s_index + 1) + ' <span class="subjectname"></span>优秀生、学困生对比</h3><h4 class="section_title_4">5.' + (s_index + 1) + '.1 各班的优秀生、学困生对比</h4><div class="echarts_result">优秀生:年级前<span class="c_5699FF excellent_linescore"></span>名<span class="margin_left_6mm">学困生:年级后<span class="c_5699FF excellent_floatscore"></span>名</span></div><div id="classExcellenceEcharts" style="margin: 0 4mm 4mm;height: 120mm;"></div></div><div class="page_root section_2_excellent section_2_excellent_' + s_index + '"><h4 class="section_title_4">5.' + (s_index + 1) + '.2 各班优秀生、学困生占比分布</h4><table border="1" class="my_table"><thead><tr><th>班级</th><th class="linescore_num"></th><th>占比</th><th class="floatscore_num">后10名</th><th>占比</th></tr></thead><tbody class="excellent_rank_tbody"></tbody></table><div class="echarts_result"><div>上图统计结果表示:</div><div class="echarts_result_content"><div><span class="dot bg_5699FF"></span>年级<span class="linescore_num"></span>优秀生最多的班级:<span class="excellent_rank_good"></span></div><div><span class="dot bg_FF5F56"></span>年级<span class="floatscore_num"></span>学困生最多的班级:<span class="excellent_rank_bad"></span></div></div></div></div>';
153
+  });
154
+  $(".section_2_excellent_root").html(singleRootHtml);
155
+  $.each(subjectInfo, function (s_index, s_item) {
156
+    var r_data_item = parameter[s_item.subjectid];
157
+    console.log("r_data_item", r_data_item);
158
+    $(".section_2_excellent_" + s_index + " .subjectname").text(
159
+      r_data_item.subjectname
160
+    );
161
+    $(".section_2_excellent_" + s_index + " .excellent_linescore").text(
162
+      r_data_item.linescore
163
+    );
164
+    $(".section_2_excellent_" + s_index + " .excellent_floatscore").text(
165
+      r_data_item.floatscore
166
+    );
167
+    initClassExcellenceEcharts(r_data_item, s_index);
168
+    var excellent_rank_tbody_html = "";
169
+    // 优秀生最多的班级
170
+    var goodClassInfo = {
171
+      stunum: 0,
172
+      classname: "",
173
+    };
174
+    // 学困生最多的班级
175
+    var badClassInfo = {
176
+      stunum: 0,
177
+      classname: "",
178
+    };
179
+    $(".section_2_excellent_" + s_index + " .linescore_num").text("前" + r_data_item.linescore + "名");
180
+    $(".section_2_excellent_" + s_index + " .floatscore_num").text("后" + r_data_item.floatscore + "名");
181
+    $.each(r_data_item.ranks, function (index, r_item) {
182
+      if (r_item.classid !== 0 && goodClassInfo.stunum < r_item.stujson[0].stunum) {
183
+        goodClassInfo.stunum = r_item.stujson[0].stunum;
184
+        goodClassInfo.classname = r_item.classname;
185
+      }
186
+      if (r_item.classid !== 0 && badClassInfo.stunum < r_item.stujson[0].stunum) {
187
+        badClassInfo.stunum = r_item.stujson[0].stunum;
188
+        badClassInfo.classname = r_item.classname;
189
+      }
190
+      excellent_rank_tbody_html +=
191
+        '<tr><td><div class="my_cell">' +
192
+        r_item.classname +
193
+        '</div></td><td><div class="my_cell">' +
194
+        r_item.stujson[0].stunum +
195
+        '</div></td><td><div class="my_cell">' +
196
+        r_item.stujson[0].sturate +
197
+        '%</div></td><td><div class="my_cell">' +
198
+        r_item.stujson[1].stunum +
199
+        '</div></td><td><div class="my_cell">' +
200
+        r_item.stujson[1].sturate +
201
+        '%</div></td></tr>';
202
+    });
203
+    $(".section_2_excellent_" + s_index + " .excellent_rank_tbody").html(
204
+      excellent_rank_tbody_html
205
+    );
206
+    $(".section_2_excellent_" + s_index + " .excellent_rank_good").html(
207
+      goodClassInfo.classname
208
+    );
209
+    $(".section_2_excellent_" + s_index + " .excellent_rank_bad").html(
210
+      badClassInfo.classname
211
+    );
212
+  });
213
+});

+ 0
- 131
js/scoreAnalysis/section_2_excellent_all.js 查看文件

@@ -1,131 +0,0 @@
1
-$(function () {
2
-  // 优秀生、学困生统计
3
-  function initClassExcellenceEcharts() {
4
-    var legend_data = ["优秀生", "学困生"];
5
-    var xAxis_data = ["全部班级", "九年级一班", "九年级二班"];
6
-    var series_data1 = [10, 6, 4];
7
-    var series_data2 = [-11, -11, -11];
8
-    var option = {
9
-      title: {
10
-        text: "人",
11
-        x: "left",
12
-        y: "top",
13
-        textStyle: {
14
-          color: "#5F6E82",
15
-          fontSize: 12,
16
-          fontWeight: 500
17
-        }
18
-      },
19
-      color: ["#5C99FF", "#F39A2C"],
20
-      legend: {
21
-        itemWidth: 6,
22
-        itemHeight: 6,
23
-        bottom: 30,
24
-        data: legend_data
25
-      },
26
-      grid: {
27
-        top: 30,
28
-        left: 5,
29
-        right: 0,
30
-        bottom: 65,
31
-        containLabel: true
32
-      },
33
-      xAxis: [
34
-        {
35
-          type: "category",
36
-          offset: 10,
37
-          position: "bottom",
38
-          data: xAxis_data,
39
-          axisLabel: {
40
-            color: "#5F6E82" //更改坐标轴文字颜色
41
-          },
42
-          axisTick: {
43
-            alignWithLabel: true
44
-          },
45
-          boundaryGap: true,
46
-          triggerEvent: true,
47
-          axisLine: {
48
-            show: true, //是否显示轴线
49
-            lineStyle: {
50
-              color: "#DADADA" //刻度线的颜色
51
-            }
52
-          }
53
-        }
54
-      ],
55
-      yAxis: [
56
-        {
57
-          type: "value",
58
-          axisTick: {
59
-            show: false //刻度
60
-          },
61
-          axisLine: {
62
-            show: false, //是否显示轴线
63
-            lineStyle: {
64
-              color: "#DADADA" //刻度线的颜色
65
-            }
66
-          },
67
-          splitLine: {
68
-            //网格线
69
-            lineStyle: {
70
-              type: "dotted" //设置网格线类型 dotted:虚线   solid:实线
71
-            },
72
-            show: true //隐藏或显示
73
-          },
74
-          axisLabel: {
75
-            color: "#5F6E82" //更改坐标轴文字颜色
76
-          }
77
-        }
78
-      ],
79
-      series: [
80
-        {
81
-          name: legend_data[0],
82
-          type: "bar",
83
-          stack: "one",
84
-          barWidth: 32,
85
-          // 柱状图最小高度
86
-          barMinHeight: 0,
87
-          barGap: 0,
88
-          label: {
89
-            normal: {
90
-              show: true,
91
-              align: "center",
92
-              verticalAlign: "bottom",
93
-              position: "top",
94
-              distance: 0
95
-            }
96
-          },
97
-          data: series_data1
98
-        },
99
-        {
100
-          name: legend_data[1],
101
-          type: "bar",
102
-          stack: "one",
103
-          barWidth: 32,
104
-          // 柱状图最小高度
105
-          barMinHeight: 0,
106
-          barGap: 0,
107
-          label: {
108
-            normal: {
109
-              show: true,
110
-              align: "center",
111
-              verticalAlign: "top",
112
-              position: "bottom",
113
-              distance: 0,
114
-              formatter: function (params) {
115
-                return Math.abs(params.value);
116
-              }
117
-            }
118
-          },
119
-          data: series_data2
120
-        }
121
-      ]
122
-    };
123
-    var myEcharts = echarts.init(document.querySelector(".section_2_excellent_all #classExcellenceEcharts"));
124
-    myEcharts.clear();
125
-    myEcharts.setOption(option);
126
-  }
127
-  var parameter = $(".section_2_html_root .section_2_excellent_all_html_root").data("page-params");
128
-  parameter = JSON.parse(parameter);
129
-  // console.log(".section_2_excellent_all_html_root:parameter", parameter);
130
-  initClassExcellenceEcharts();
131
-});

+ 14
- 9
js/section_2.js 查看文件

@@ -2,12 +2,12 @@ $(function () {
2 2
   var parameter = $(".section_2_html_root").data("page-params");
3 3
   parameter = JSON.parse(parameter);
4 4
   var sectionsHtmlArr = [
5
-    // "section_2_class_all", //全科成绩对比
6
-    // "section_2_class_single", //单科成绩对比
5
+    "section_2_class_all", //全科成绩对比
6
+    "section_2_class_single", //单科成绩对比
7 7
     "section_2_level", //分数等级
8 8
     "section_2_part",
9
-    // "section_2_lin",
10
-    // "section_2_excellent_all"
9
+    "section_2_lin",
10
+    "section_2_excellent"
11 11
   ];
12 12
   $(".section_2.score_analysis_root").html(sectionsHtmlArr.map(function (htmlName) {
13 13
     return "<div class='" + htmlName + "_html_root'></div>";
@@ -38,6 +38,14 @@ $(function () {
38 38
     if (!djfx_data[djfx_item.ranktype]) {
39 39
       djfx_data[djfx_item.ranktype] = {};
40 40
     }
41
+    if (djfx_item.ranktype === 5) {
42
+      djfx_item.ranks.forEach(rankItem => {
43
+        rankItem.stujson = JSON.parse(rankItem.stujson);
44
+      });
45
+    }
46
+    if (djfx_item.subjectid === "zf") {
47
+      djfx_item.subjectname = "全科";
48
+    }
41 49
     djfx_data[djfx_item.ranktype][djfx_item.subjectid] = djfx_item;
42 50
   }
43 51
   sectionsHtmlArr.forEach(function (htmlName) {
@@ -63,11 +71,8 @@ $(function () {
63 71
         3: djfx_data[3],
64 72
         4: djfx_data[4]
65 73
       }));
66
-    } else if (htmlName === "section_2_excellent_all") {
67
-      $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify({
68
-        cjfx: parameter.cjfx,
69
-        djfx: parameter.djfx
70
-      }));
74
+    } else if (htmlName === "section_2_excellent") {
75
+      $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify(djfx_data[5]));
71 76
     }
72 77
     $(".section_2.score_analysis_root ." + htmlName + "_html_root").load("./sections/scoreAnalysis/" + htmlName + ".html");
73 78
   });

+ 6
- 3
notes.txt 查看文件

@@ -9,8 +9,7 @@ section_2.html 第二部分
9 9
         分数等级对比-全科(分数等级对比-单科)section_2_level
10 10
         分数分段对比-全科(分数分段对比-单科)section_2_part
11 11
         临界生对比-全科 (按名次)临界生对比-全科 (按分数)section_2_lin
12
-        优秀生、学困生对比-全科 section_2_excellent_all
13
-        优秀生、学困生对比-单科 section_2_excellent_single
12
+        优秀生、学困生对比-全科、单科 section_2_excellent
14 13
 section_3.html 第三部分
15 14
 section_4.html 第四部分
16 15
 
@@ -20,4 +19,8 @@ section_4.html 第四部分
20 19
   不支持vw和vh
21 20
   Echarts也要取消动画效果 animation: false
22 21
   不支持css3
23
-  不支持ES6
22
+  不支持ES6
23
+
24
+未完成:
25
+分数等级对比-全科(分数等级对比-单科)section_2_level
26
+分数分段对比-全科(分数分段对比-单科)section_2_part

sections/scoreAnalysis/section_2_excellent_all.html → sections/scoreAnalysis/section_2_excellent.html 查看文件

@@ -5,29 +5,30 @@
5 5
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 6
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 7
   <title>校本PDF报告-第二章 成绩分析</title>
8
-  <link rel="stylesheet" href="../../css/scoreAnalysis/section_2_excellent_all.css">
8
+  <link rel="stylesheet" href="../../css/scoreAnalysis/section_2_excellent.css">
9 9
 </head>
10 10
 <body>
11
-  <div class="page_root section_2_excellent_all">
11
+  <div class="section_2_excellent_root"></div>
12
+  <!-- <div class="page_root section_2_excellent section_2_excellent_0">
12 13
     <h2 class="section_title_2">5. 优秀生、学困生对比</h2>
13
-    <h3 class="section_title_3">5.1 全科优秀生、学困生对比</h3>
14
+    <h3 class="section_title_3">5.1 <span class="subjectname"></span>优秀生、学困生对比</h3>
14 15
     <h4 class="section_title_4">5.1.1 各班的优秀生、学困生对比</h4>
15
-    <div class="echarts_result">优秀生:年级前<span class="c_5699FF">10</span>名<span class="margin_left_6mm">学困生:年级后<span class="c_5699FF">10</span>名</span></div>
16
+    <div class="echarts_result">优秀生:年级前<span class="c_5699FF excellent_linescore"></span>名<span class="margin_left_6mm">学困生:年级后<span class="c_5699FF excellent_floatscore"></span>名</span></div>
16 17
     <div id="classExcellenceEcharts" style="margin: 0 4mm 4mm;height: 120mm;"></div>
17 18
   </div>
18
-  <div class="page_root section_2_excellent_all">
19
+  <div class="page_root section_2_excellent section_2_excellent_0">
19 20
     <h4 class="section_title_4">5.1.2 各班优秀生、学困生占比分布</h4>
20 21
     <table border="1" class="my_table">
21 22
       <thead>
22 23
         <tr>
23 24
           <th>班级</th>
24
-          <th>前10名</th>
25
+          <th class="linescore_num"></th>
25 26
           <th>占比</th>
26
-          <th>后10名</th>
27
+          <th class="floatscore_num">后10名</th>
27 28
           <th>占比</th>
28 29
         </tr>
29 30
       </thead>
30
-      <tbody>
31
+      <tbody class="excellent_rank_tbody">
31 32
         <tr>
32 33
           <td><div class="my_cell">全年级</div></td>
33 34
           <td><div class="my_cell">5</div></td>
@@ -35,37 +36,18 @@
35 36
           <td><div class="my_cell">5</div></td>
36 37
           <td><div class="my_cell">4%</div></td>
37 38
         </tr>
38
-        <tr>
39
-          <td><div class="my_cell">八年级一班</div></td>
40
-          <td><div class="my_cell">5</div></td>
41
-          <td><div class="my_cell">4%</div></td>
42
-          <td><div class="my_cell">5</div></td>
43
-          <td><div class="my_cell">4%</div></td>
44
-        </tr>
45
-        <tr>
46
-          <td><div class="my_cell">八年级一班</div></td>
47
-          <td><div class="my_cell">5</div></td>
48
-          <td><div class="my_cell">4%</div></td>
49
-          <td><div class="my_cell">5</div></td>
50
-          <td><div class="my_cell">4%</div></td>
51
-        </tr>
52
-        <tr>
53
-          <td><div class="my_cell">八年级一班</div></td>
54
-          <td><div class="my_cell">5</div></td>
55
-          <td><div class="my_cell">4%</div></td>
56
-          <td><div class="my_cell">5</div></td>
57
-          <td><div class="my_cell">4%</div></td>
58
-        </tr>
59 39
       </tbody>
60 40
     </table>
61 41
     <div class="echarts_result">
62 42
       <div>上图统计结果表示:</div>
63 43
       <div class="echarts_result_content">
64
-        <div><span class="dot bg_5699FF"></span>年级前10名优秀生最多的班级:八年级一班</div>
65
-        <div><span class="dot bg_FF5F56"></span>年级后10名学困生最多的班级:八年级六班</div>
44
+        <div><span class="dot bg_5699FF"></span>年级前10名优秀生最多的班级:<span class="excellent_rank_good"></span></div>
45
+        <div><span class="dot bg_FF5F56"></span>年级后10名学困生最多的班级:<span class="excellent_rank_bad"></span></div>
66 46
       </div>
67 47
     </div>
68
-  </div>
69
-  <script src="../../js/scoreAnalysis/section_2_excellent_all.js"></script>
48
+  </div> -->
49
+  <span class="linescore_num"></span>
50
+  <span class="floatscore_num"></span>
51
+  <script src="../../js/scoreAnalysis/section_2_excellent.js"></script>
70 52
 </body>
71 53
 </html>

+ 1
- 1
sections/scoreAnalysis/section_2_level.html 查看文件

@@ -10,7 +10,7 @@
10 10
   <body>
11 11
     <div class="page_root section_2_level">
12 12
       <h2 class="section_title_2">2.分数等级对比</h2>
13
-      <h3 class="section_title_3">2.1 总分等级对比</h3>
13
+      <h3 class="section_title_3">2.1 全科等级对比</h3>
14 14
       <h4 class="section_title_4">2.1.1 各班等级分析</h4>
15 15
       <div id="classLevelEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div>
16 16
       <h4 class="section_title_4">2.1.2 各班等级比例分布</h4>

Loading…
取消
儲存