guozhongbo преди 1 година
родител
ревизия
43486c086b
променени са 4 файла, в които са добавени 412 реда и са изтрити 198 реда
  1. 2
    2
      js/index.js
  2. 184
    100
      js/scoreAnalysis/section_2_level.js
  3. 194
    0
      js/scoreAnalysis/section_2_part.js
  4. 32
    96
      sections/scoreAnalysis/section_2_part.html

+ 2
- 2
js/index.js Целия файл

@@ -5,10 +5,10 @@ $(function () {
5 5
       // "cover", //封面
6 6
       // "preface", //前言
7 7
       // "section_1",
8
-      // "section_2",
8
+      "section_2",
9 9
       // "section_3",
10 10
       // "section_4",
11
-      "section_5",
11
+      // "section_5",
12 12
     ];
13 13
     $(".pdf_root").html(loadHtmlArr.map(function (htmlName) {
14 14
       return "<div class='" + htmlName + "_html_root'></div>";

+ 184
- 100
js/scoreAnalysis/section_2_level.js Целия файл

@@ -9,24 +9,22 @@ $(function () {
9 9
       levelrangeObj = [];
10 10
     $.each(list, function (key, item) {
11 11
       if ($.inArray(item.classname, xAxis_data) == -1) {
12
-        xAxis_data.push(item.classname)
12
+        xAxis_data.push(item.classname);
13 13
       }
14 14
       if ($.inArray(item.rankname + "类", legend_data) == -1) {
15
-        legend_data.push(item.rankname + "类")
15
+        legend_data.push(item.rankname + "类");
16 16
       }
17 17
       if ($.inArray(item.rankrange, levelrangeObj) == -1) {
18
-        levelrangeObj.push(item.rankrange)
18
+        levelrangeObj.push(item.rankrange);
19 19
       }
20
-      if (!levelRateObj[item.rankname + '类']) {
21
-        levelRateObj[item.rankname + '类'] = [];
20
+      if (!levelRateObj[item.rankname + "类"]) {
21
+        levelRateObj[item.rankname + "类"] = [];
22 22
       }
23
-      levelRateObj[item.rankname + '类'].push(item.sturate);
24
-      if (!levelNumObj[item.rankname + '类']) {
25
-        levelNumObj[item.rankname + '类'] = [];
23
+      levelRateObj[item.rankname + "类"].push(item.sturate);
24
+      if (!levelNumObj[item.rankname + "类"]) {
25
+        levelNumObj[item.rankname + "类"] = [];
26 26
       }
27
-      levelNumObj[item.rankname + '类'].push(
28
-        item.stunum
29
-      );
27
+      levelNumObj[item.rankname + "类"].push(item.stunum);
30 28
     });
31 29
     $.each(legend_data, function (key, item) {
32 30
       series_data.push({
@@ -72,103 +70,127 @@ $(function () {
72 70
         textStyle: {
73 71
           color: "#5F6E82",
74 72
           fontSize: $.UnitUtil.mm2px(3),
75
-          fontWeight: 500,
76
-        },
73
+          fontWeight: 500
74
+        }
77 75
       },
78 76
       legend: {
79 77
         itemWidth: $.UnitUtil.mm2px(2),
80 78
         itemHeight: $.UnitUtil.mm2px(2),
81 79
         top: "bottom",
82
-        data: legend_data,
80
+        data: legend_data
83 81
       },
84 82
       grid: {
85 83
         top: $.UnitUtil.mm2px(10),
86 84
         left: 0,
87 85
         right: 0,
88 86
         bottom: $.UnitUtil.mm2px(8),
89
-        containLabel: true,
87
+        containLabel: true
90 88
       },
91
-      xAxis: [{
92
-        type: "category",
93
-        data: xAxis_data,
94
-        axisLabel: {
95
-          color: "#5F6E82", //更改坐标轴文字颜色
96
-          interval: 0
97
-        },
98
-        axisTick: {
99
-          alignWithLabel: true,
100
-        },
101
-        boundaryGap: true,
102
-        triggerEvent: true,
103
-        axisLine: {
104
-          show: true, //是否显示轴线
105
-          lineStyle: {
106
-            color: "#DADADA", //刻度线的颜色
89
+      xAxis: [
90
+        {
91
+          type: "category",
92
+          data: xAxis_data,
93
+          axisLabel: {
94
+            color: "#5F6E82", //更改坐标轴文字颜色
95
+            interval: 0
107 96
           },
108
-        },
109
-      }, ],
110
-      yAxis: [{
111
-        type: "value",
112
-        axisTick: {
113
-          show: false, //刻度
114
-        },
115
-        axisLine: {
116
-          show: false, //是否显示轴线
117
-          lineStyle: {
118
-            color: "#DADADA", //刻度线的颜色
97
+          axisTick: {
98
+            alignWithLabel: true
119 99
           },
120
-        },
121
-        splitLine: {
122
-          //网格线
123
-          lineStyle: {
124
-            type: "dotted", //设置网格线类型 dotted:虚线   solid:实线
100
+          boundaryGap: true,
101
+          triggerEvent: true,
102
+          axisLine: {
103
+            show: true, //是否显示轴线
104
+            lineStyle: {
105
+              color: "#DADADA" //刻度线的颜色
106
+            }
107
+          }
108
+        }
109
+      ],
110
+      yAxis: [
111
+        {
112
+          type: "value",
113
+          axisTick: {
114
+            show: false //刻度
125 115
           },
126
-          show: true, //隐藏或显示
127
-        },
128
-        axisLabel: {
129
-          color: "#5F6E82", //更改坐标轴文字颜色
130
-        },
131
-      }, ],
116
+          axisLine: {
117
+            show: false, //是否显示轴线
118
+            lineStyle: {
119
+              color: "#DADADA" //刻度线的颜色
120
+            }
121
+          },
122
+          splitLine: {
123
+            //网格线
124
+            lineStyle: {
125
+              type: "dotted" //设置网格线类型 dotted:虚线   solid:实线
126
+            },
127
+            show: true //隐藏或显示
128
+          },
129
+          axisLabel: {
130
+            color: "#5F6E82" //更改坐标轴文字颜色
131
+          }
132
+        }
133
+      ],
132 134
       series: series_data
133 135
     };
134
-    var myEcharts = echarts.init(document.querySelector(".section_2_level.level_" + s_index + " #classLevelEcharts"));
136
+    var myEcharts = echarts.init(
137
+      document.querySelector(
138
+        ".section_2_level.level_" + s_index + " #classLevelEcharts"
139
+      )
140
+    );
135 141
     myEcharts.clear();
136 142
     myEcharts.setOption(option);
137 143
   }
138 144
   //图表数据
139
-  function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, s_index, list) {
145
+  function showgraphicaldata(
146
+    xAxis_data,
147
+    legend_data,
148
+    levelrangeObj,
149
+    s_index,
150
+    list
151
+  ) {
140 152
     //图表数据
141 153
     var arr = JSON.parse(JSON.stringify(list));
142 154
     var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
143
-    var goodTableHeadTr2Html = '';
155
+    var goodTableHeadTr2Html = "";
144 156
     var goodTableTbodyHtml = "";
145 157
     $.each(legend_data, function (idx, item) {
146
-      goodTableHeadTr1Html += '<th colspan="2">' + item + levelrangeObj[idx] + '</th>';
147
-      goodTableHeadTr2Html += '<th>人数</th><th>比例</th>';
158
+      goodTableHeadTr1Html +=
159
+        '<th colspan="2">' + item + levelrangeObj[idx] + "</th>";
160
+      goodTableHeadTr2Html += "<th>人数</th><th>比例</th>";
148 161
     });
149 162
     $.each(xAxis_data, function (idx, item) {
150
-      var trHtml = '<td><div class="my_cell">' + item + '</div></td>'
163
+      var trHtml = '<td><div class="my_cell">' + item + "</div></td>";
151 164
       var classs = $.grep(arr, function (val) {
152 165
         return val.classname == item;
153 166
       });
154 167
       $.each(legend_data, function (idx, item) {
155 168
         var rank = $.grep(classs, function (val) {
156
-          return val.rankname + '类' == item;
169
+          return val.rankname + "类" == item;
157 170
         })[0];
158
-        trHtml += '<td><div class="my_cell">' + rank.stunum +
159
-          '</div></td><td><div class="my_cell">' + rank.sturate +
160
-          '%</div></td>'
171
+        trHtml +=
172
+          '<td><div class="my_cell">' +
173
+          rank.stunum +
174
+          '</div></td><td><div class="my_cell">' +
175
+          rank.sturate +
176
+          "%</div></td>";
161 177
       });
162
-      goodTableTbodyHtml += '<tr>' + trHtml + '</tr>';
178
+      goodTableTbodyHtml += "<tr>" + trHtml + "</tr>";
163 179
     });
164
-    $(".section_2_level.level_" + s_index + " .goodTableHeadTr1").html(goodTableHeadTr1Html);
165
-    $(".section_2_level.level_" + s_index + " .goodTableHeadTr2").html(goodTableHeadTr2Html);
166
-    $(".section_2_level.level_" + s_index + " .goodTableTbody").html(goodTableTbodyHtml);
180
+    $(".section_2_level.level_" + s_index + " .goodTableHeadTr1").html(
181
+      goodTableHeadTr1Html
182
+    );
183
+    $(".section_2_level.level_" + s_index + " .goodTableHeadTr2").html(
184
+      goodTableHeadTr2Html
185
+    );
186
+    $(".section_2_level.level_" + s_index + " .goodTableTbody").html(
187
+      goodTableTbodyHtml
188
+    );
167 189
     var totalObj = {};
168 190
     var maxObj = {};
169 191
     var minObj = {};
170 192
     var classObj = {};
171
-    $.each(list, function(index, listItem) {
193
+    $.each(list, function (index, listItem) {
172 194
       if (!totalObj[listItem.rankname]) {
173 195
         totalObj[listItem.rankname] = {};
174 196
       }
@@ -185,13 +207,13 @@ $(function () {
185 207
         classObj[listItem.classid] = listItem.classname;
186 208
         if (maxObj[listItem.rankname].stunum < listItem.stunum) {
187 209
           maxObj[listItem.rankname].stunum = listItem.stunum;
188
-          maxObj[listItem.rankname].classidArr = [ listItem.classid ];
210
+          maxObj[listItem.rankname].classidArr = [listItem.classid];
189 211
         } else if (maxObj[listItem.rankname].stunum === listItem.stunum) {
190 212
           maxObj[listItem.rankname].classidArr.push(listItem.classid);
191 213
         }
192 214
       }
193 215
     });
194
-    $.each(list, function(index, listItem) {
216
+    $.each(list, function (index, listItem) {
195 217
       if (!minObj[listItem.rankname]) {
196 218
         minObj[listItem.rankname] = {
197 219
           stunum: maxObj[listItem.rankname].stunum,
@@ -201,44 +223,93 @@ $(function () {
201 223
       if (listItem.classid !== 0) {
202 224
         if (minObj[listItem.rankname].stunum > listItem.stunum) {
203 225
           minObj[listItem.rankname].stunum = listItem.stunum;
204
-          minObj[listItem.rankname].classidArr = [ listItem.classid ];
226
+          minObj[listItem.rankname].classidArr = [listItem.classid];
205 227
         } else if (minObj[listItem.rankname].stunum === listItem.stunum) {
206 228
           minObj[listItem.rankname].classidArr.push(listItem.classid);
207 229
         }
208 230
       }
209 231
     });
210
-    $(".section_2_level.level_" + s_index + " .result_collect").text("A类" + totalObj['A'].stunum + "人(" + totalObj['A'].sturate + "%),B类" + totalObj['B'].stunum + "人(" + totalObj['B'].sturate + "%),C类" + totalObj['C'].stunum + "人(" + totalObj['C'].sturate + "%),D类" + totalObj['D'].stunum + "人(" + totalObj['D'].sturate + "%),E类" + totalObj['E'].stunum + "人(" + totalObj['E'].sturate + "%)");
211
-    $(".section_2_level.level_" + s_index + " .A_collect").text("A类上线率最高的班级:" + $.map(maxObj['A'].classidArr, function (classid) {
212
-      return classObj[classid];
213
-    }).join('、') + ",A类上线率最低的班级:" + $.map(minObj['A'].classidArr, function (classid) {
214
-      return classObj[classid];
215
-    }).join('、'));
232
+    $(".section_2_level.level_" + s_index + " .result_collect").text(
233
+      "A类" +
234
+        totalObj["A"].stunum +
235
+        "人(" +
236
+        totalObj["A"].sturate +
237
+        "%),B类" +
238
+        totalObj["B"].stunum +
239
+        "人(" +
240
+        totalObj["B"].sturate +
241
+        "%),C类" +
242
+        totalObj["C"].stunum +
243
+        "人(" +
244
+        totalObj["C"].sturate +
245
+        "%),D类" +
246
+        totalObj["D"].stunum +
247
+        "人(" +
248
+        totalObj["D"].sturate +
249
+        "%),E类" +
250
+        totalObj["E"].stunum +
251
+        "人(" +
252
+        totalObj["E"].sturate +
253
+        "%)"
254
+    );
255
+    $(".section_2_level.level_" + s_index + " .A_collect").text(
256
+      "A类上线率最高的班级:" +
257
+        $.map(maxObj["A"].classidArr, function (classid) {
258
+          return classObj[classid];
259
+        }).join("、") +
260
+        ",A类上线率最低的班级:" +
261
+        $.map(minObj["A"].classidArr, function (classid) {
262
+          return classObj[classid];
263
+        }).join("、")
264
+    );
216 265
 
217
-    $(".section_2_level.level_" + s_index + " .B_collect").text("B类上线率最高的班级:" + $.map(maxObj['B'].classidArr, function (classid) {
218
-      return classObj[classid];
219
-    }).join('、') + ",B类上线率最低的班级:" + $.map(minObj['B'].classidArr, function (classid) {
220
-      return classObj[classid];
221
-    }).join('、'));
266
+    $(".section_2_level.level_" + s_index + " .B_collect").text(
267
+      "B类上线率最高的班级:" +
268
+        $.map(maxObj["B"].classidArr, function (classid) {
269
+          return classObj[classid];
270
+        }).join("、") +
271
+        ",B类上线率最低的班级:" +
272
+        $.map(minObj["B"].classidArr, function (classid) {
273
+          return classObj[classid];
274
+        }).join("、")
275
+    );
222 276
 
223
-    $(".section_2_level.level_" + s_index + " .C_collect").text("C类上线率最高的班级:" + $.map(maxObj['C'].classidArr, function (classid) {
224
-      return classObj[classid];
225
-    }).join('、') + ",C类上线率最低的班级:" + $.map(minObj['C'].classidArr, function (classid) {
226
-      return classObj[classid];
227
-    }).join('、'));
277
+    $(".section_2_level.level_" + s_index + " .C_collect").text(
278
+      "C类上线率最高的班级:" +
279
+        $.map(maxObj["C"].classidArr, function (classid) {
280
+          return classObj[classid];
281
+        }).join("、") +
282
+        ",C类上线率最低的班级:" +
283
+        $.map(minObj["C"].classidArr, function (classid) {
284
+          return classObj[classid];
285
+        }).join("、")
286
+    );
228 287
 
229
-    $(".section_2_level.level_" + s_index + " .D_collect").text("D类上线率最高的班级:" + $.map(maxObj['D'].classidArr, function (classid) {
230
-      return classObj[classid];
231
-    }).join('、') + ",D类上线率最低的班级:" + $.map(minObj['D'].classidArr, function (classid) {
232
-      return classObj[classid];
233
-    }).join('、'));
288
+    $(".section_2_level.level_" + s_index + " .D_collect").text(
289
+      "D类上线率最高的班级:" +
290
+        $.map(maxObj["D"].classidArr, function (classid) {
291
+          return classObj[classid];
292
+        }).join("、") +
293
+        ",D类上线率最低的班级:" +
294
+        $.map(minObj["D"].classidArr, function (classid) {
295
+          return classObj[classid];
296
+        }).join("、")
297
+    );
234 298
 
235
-    $(".section_2_level.level_" + s_index + " .E_collect").text("E类上线率最高的班级:" + $.map(maxObj['E'].classidArr, function (classid) {
236
-      return classObj[classid];
237
-    }).join('、') + ",E类上线率最低的班级:" + $.map(minObj['E'].classidArr, function (classid) {
238
-      return classObj[classid];
239
-    }).join('、'));
299
+    $(".section_2_level.level_" + s_index + " .E_collect").text(
300
+      "E类上线率最高的班级:" +
301
+        $.map(maxObj["E"].classidArr, function (classid) {
302
+          return classObj[classid];
303
+        }).join("、") +
304
+        ",E类上线率最低的班级:" +
305
+        $.map(minObj["E"].classidArr, function (classid) {
306
+          return classObj[classid];
307
+        }).join("、")
308
+    );
240 309
   }
241
-  var parameter = $(".section_2_html_root .section_2_level_html_root").data("page-params");
310
+  var parameter = $(".section_2_html_root .section_2_level_html_root").data(
311
+    "page-params"
312
+  );
242 313
   parameter = JSON.parse(parameter);
243 314
   // console.log(parameter);
244 315
   var subjectInfo = [];
@@ -259,10 +330,23 @@ $(function () {
259 330
   }
260 331
   var singleRootHtml = "";
261 332
   $.each(subjectInfo, function (s_index, s_item) {
262
-    singleRootHtml += '<div class="page_root section_2_level level_' + s_index + '">' + (s_index === 0 ? '<h2 class="section_title_2">2.分数等级对比</h2>' : '') + '<h3 class="section_title_3">2.' + (s_index + 1) + ' ' + s_item.subjectname + '等级对比</h3><h4 class="section_title_4">2.' + (s_index + 1) + '.1 各班等级分析</h4><div id="classLevelEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div><h4 class="section_title_4">2.' + (s_index + 1) + '.2 各班等级比例分布</h4><table border="1" class="my_table"><thead><tr class="goodTableHeadTr1"></tr><tr class="goodTableHeadTr2"></tr></thead><tbody class="goodTableTbody"></tbody></table><div class="echarts_result"><div>上图各等级上线统计结果为:<span class="result_collect"></span>:</div><div class="echarts_result_content"><div><span class="bg_5699FF"></span><i class="A_collect"></i></div><div><span class="bg_FF5F56"></span><i class="B_collect"></i></div><div><span class="bg_5EC5C8"></span><i class="C_collect"></i></div><div><span class="bg_F1982B"></span><i class="D_collect"></i></div><div><span class="bg_F1982B"></span><i class="E_collect"></i></div></div></div></div>';
333
+    singleRootHtml +=
334
+      '<div class="page_root section_2_level level_' +
335
+      s_index +
336
+      '">' +
337
+      (s_index === 0 ? '<h2 class="section_title_2">2.分数等级对比</h2>' : "") +
338
+      '<h3 class="section_title_3">2.' +
339
+      (s_index + 1) +
340
+      " " +
341
+      s_item.subjectname +
342
+      '等级对比</h3><h4 class="section_title_4">2.' +
343
+      (s_index + 1) +
344
+      '.1 各班等级分析</h4><div id="classLevelEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div><h4 class="section_title_4">2.' +
345
+      (s_index + 1) +
346
+      '.2 各班等级比例分布</h4><table border="1" class="my_table"><thead><tr class="goodTableHeadTr1"></tr><tr class="goodTableHeadTr2"></tr></thead><tbody class="goodTableTbody"></tbody></table><div class="echarts_result"><div>上图各等级上线统计结果为:<span class="result_collect"></span>:</div><div class="echarts_result_content"><div><span class="bg_5699FF"></span><i class="A_collect"></i></div><div><span class="bg_FF5F56"></span><i class="B_collect"></i></div><div><span class="bg_5EC5C8"></span><i class="C_collect"></i></div><div><span class="bg_F1982B"></span><i class="D_collect"></i></div><div><span class="bg_F1982B"></span><i class="E_collect"></i></div></div></div></div>';
263 347
   });
264 348
   $(".section_2_level_root").html(singleRootHtml);
265 349
   $.each(subjectInfo, function (s_index, s_item) {
266 350
     initclassLevelEcharts(s_index, s_item.ranks);
267 351
   });
268
-});
352
+});

+ 194
- 0
js/scoreAnalysis/section_2_part.js Целия файл

@@ -0,0 +1,194 @@
1
+$(function () {
2
+  function classscorePartEcharts (s_index, obj) {
3
+    var legend_data = [];
4
+    legend_data.push(obj.subjectname);
5
+    var xAxis_data = [];
6
+    var dataArr = [];
7
+    var list = $.grep(obj.ranks, function (val) {
8
+      return val.classid == 0;
9
+    });
10
+    $.each(list, function (index, item) {
11
+      xAxis_data.push(item.rankname);
12
+      dataArr.push(item.stunum);
13
+    });
14
+    var series_data = [
15
+      {
16
+        name: obj.subjectname,
17
+        type: "line",
18
+        symbol: "circle",
19
+        stack: obj.subjectname,
20
+        label: {
21
+          normal: {
22
+            show: true,
23
+            align: "center",
24
+            verticalAlign: "bottom",
25
+            position: "top",
26
+            distance: 0,
27
+            formatter: `{c}`
28
+          }
29
+        },
30
+        data: dataArr
31
+      }
32
+    ];
33
+    var option = {
34
+      animation: false,
35
+      title: {
36
+        text: "人",
37
+        x: "left",
38
+        y: "top",
39
+        textStyle: {
40
+          color: "#5F6E82",
41
+          fontSize: $.UnitUtil.mm2px(3),
42
+          fontWeight: 500
43
+        }
44
+      },
45
+      color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
46
+      legend: {
47
+        icon: "roundRect",
48
+        itemWidth: $.UnitUtil.mm2px(2),
49
+        itemHeight: $.UnitUtil.mm2px(2),
50
+        top: "bottom",
51
+        data: legend_data
52
+      },
53
+      grid: {
54
+        top: $.UnitUtil.mm2px(10),
55
+        left: 0,
56
+        right: 0,
57
+        bottom: $.UnitUtil.mm2px(8),
58
+        containLabel: true
59
+      },
60
+      xAxis: {
61
+        type: "category",
62
+        axisLabel: {
63
+          textStyle: {
64
+            color: "#5F6E82"
65
+          },
66
+          interval: 2,
67
+          rotate: 0
68
+        },
69
+        axisTick: {
70
+          show: false
71
+        },
72
+        data: xAxis_data
73
+      },
74
+      yAxis: {
75
+        axisLabel: {
76
+          textStyle: {
77
+            color: "#9B9B9BFF"
78
+          },
79
+          interval: 0
80
+        },
81
+        minInterval: 1,
82
+        axisLine: {
83
+          show: false
84
+        },
85
+        axisTick: {
86
+          show: false
87
+        },
88
+        splitLine: {
89
+          //网格线
90
+          lineStyle: {
91
+            type: "dotted", //设置网格线类型 dotted:虚线   solid:实线
92
+            color: "#DADADA"
93
+          },
94
+          show: true //隐藏或显示
95
+        },
96
+        type: "value"
97
+      },
98
+      series: series_data
99
+    };
100
+    var myEcharts = echarts.init(
101
+      document.querySelector(".part_" + s_index + " #classPartEcharts")
102
+    );
103
+    myEcharts.clear();
104
+    myEcharts.setOption(option);
105
+    showgraphicaldata(obj, xAxis_data, s_index);
106
+  }
107
+  function showgraphicaldata (obj, xAxis_data, s_index) {
108
+    //图表数据
109
+    var data = JSON.parse(JSON.stringify(obj));
110
+    var calsslist = [];
111
+    var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
112
+    var goodTableHeadTr2Html = "";
113
+    var goodTableTbodyHtml = "";
114
+    $.each(xAxis_data, function (idx, item) {
115
+      goodTableHeadTr1Html += '<th colspan="2">' + item + "</th>";
116
+      goodTableHeadTr2Html += "<th>人数</th><th>比例</th>";
117
+    });
118
+    $.each(data.ranks, function (idx, item) {
119
+      if ($.inArray(item.classname, calsslist) == -1) {
120
+        calsslist.push(item.classname);
121
+      }
122
+    })
123
+    $.each(calsslist, function (idx, item) {
124
+      var trHtml = '<td><div class="my_cell">' + item + "</div></td>";
125
+      var classs = $.grep(data.ranks, function (val) {
126
+        return val.classname == item;
127
+      });
128
+      $.each(xAxis_data, function (idx, item) {
129
+        var rank = $.grep(classs, function (val) {
130
+          return val.rankname == item;
131
+        })[0];
132
+        trHtml +=
133
+          '<td><div class="my_cell">' +
134
+          rank.stunum +
135
+          '</div></td><td><div class="my_cell">' +
136
+          rank.sturate +
137
+          "%</div></td>";
138
+      });
139
+      goodTableTbodyHtml += "<tr>" + trHtml + "</tr>";
140
+       
141
+    })
142
+    var table = '  <table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
143
+      goodTableHeadTr1Html + '</tr><tr class="goodTableHeadTr2">' +
144
+      goodTableHeadTr2Html + '</tr></thead><tbody class="goodTableTbody">' +
145
+      goodTableTbodyHtml+'</tbody></table>'
146
+    $(".part_"+ s_index + " .table_"+s_index+" ").html(table);
147
+  }
148
+  var parameter = $(".section_2_html_root .section_2_part_html_root").data(
149
+    "page-params"
150
+  );
151
+  parameter = JSON.parse(parameter);
152
+  console.log(parameter);
153
+  var subjectInfo = [];
154
+  for (var sid in parameter) {
155
+    if (sid === "zf") {
156
+      subjectInfo.unshift({
157
+        subjectid: sid,
158
+        subjectname: "全部年级",
159
+        ranks: parameter[sid].ranks,
160
+        maxscore: parameter[sid].maxscore
161
+      });
162
+    } else {
163
+      subjectInfo.push({
164
+        subjectid: sid,
165
+        subjectname: parameter[sid].subjectname,
166
+        ranks: parameter[sid].ranks,
167
+        maxscore: parameter[sid].maxscore
168
+      });
169
+    }
170
+  }
171
+  var singleRootHtml = "";
172
+  $.each(subjectInfo, function (s_index, s_item) {
173
+    singleRootHtml +=
174
+      '<div class="page_root section_2_part part_' +
175
+      s_index +
176
+      '">' +
177
+      (s_index === 0 ? '<h2 class="section_title_2">3.分数分段对比</h2>' : "") +
178
+      '<h3 class="section_title_3">3.' +
179
+      (s_index + 1) +
180
+      " " +
181
+      s_item.subjectname +
182
+      '分数段统计</h3><h4 class="section_title_4">3.' +
183
+      (s_index + 1) +
184
+      '.1 各分数段分析</h4><div>当前设置分数段:<span class="curscorepart">10</span>分/段</div><div id="classPartEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div><h4 class="section_title_4">3.' +
185
+      (s_index + 1) +
186
+      '.2 各班等级比例分布</h4><div class="table_'+s_index+'"></div></div > ';
187
+    
188
+  });
189
+  $(".section_2_part_root").html(singleRootHtml);
190
+  $.each(subjectInfo, function (s_index, s_item) { 
191
+    $(".part_ " + s_index + " .curscorepart").text(s_item.maxscore);
192
+    classscorePartEcharts(s_index,s_item);
193
+  })
194
+});

+ 32
- 96
sections/scoreAnalysis/section_2_part.html Целия файл

@@ -1,98 +1,34 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="zh-cn">
3
-<head>
4
-  <meta charset="UTF-8">
5
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
-  <title>校本PDF报告-第二章 成绩分析</title>
8
-</head>
9
-<body>
10
-  <div class="page_root section_2_part">
11
-    <h2 class="section_title_2">3.分数分段级对比</h2>
12
-    <h3 class="section_title_3">3.1 全科分数段统计</h3>
13
-    <h4 class="section_title_4">3.1.1 全年级各分数段分析</h4>
14
-    <div>当前设置分数段:<span>10</span>分/段</div>
15
-    <div id="classscoreLevelEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div>
16
-    <h4 class="section_title_4">3.1.2 各班分数段比例分布</h4>
17
-    <table border="1" class="my_table">
18
-      <thead>
19
-        <tr>
20
-          <th rowspan="2">班级</th>
21
-          <th colspan="2">A类</th>
22
-          <th colspan="2">B类</th>
23
-          <th colspan="2">C类</th>
24
-          <th colspan="2">D类</th>
25
-          <th colspan="2">E类</th>
26
-        </tr>
27
-        <tr>
28
-          <th>人数</th>
29
-          <th>比例</th>
30
-          <th>人数</th>
31
-          <th>比例</th>
32
-          <th>人数</th>
33
-          <th>比例</th>
34
-          <th>人数</th>
35
-          <th>比例</th>
36
-          <th>人数</th>
37
-          <th>比例</th>
38
-        </tr>
39
-      </thead>
40
-      <tbody>
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
-          <td><div class="my_cell">5</div></td>
46
-          <td><div class="my_cell">4%</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
-          <td><div class="my_cell">5</div></td>
52
-          <td><div class="my_cell">4%</div></td>
53
-        </tr>
54
-        <tr>
55
-          <td><div class="my_cell">八年级一班</div></td>
56
-          <td><div class="my_cell">5</div></td>
57
-          <td><div class="my_cell">4%</div></td>
58
-          <td><div class="my_cell">5</div></td>
59
-          <td><div class="my_cell">4%</div></td>
60
-          <td><div class="my_cell">5</div></td>
61
-          <td><div class="my_cell">4%</div></td>
62
-          <td><div class="my_cell">5</div></td>
63
-          <td><div class="my_cell">4%</div></td>
64
-          <td><div class="my_cell">5</div></td>
65
-          <td><div class="my_cell">4%</div></td>
66
-        </tr>
67
-        <tr>
68
-          <td><div class="my_cell">八年级二班</div></td>
69
-          <td><div class="my_cell">5</div></td>
70
-          <td><div class="my_cell">4%</div></td>
71
-          <td><div class="my_cell">5</div></td>
72
-          <td><div class="my_cell">4%</div></td>
73
-          <td><div class="my_cell">5</div></td>
74
-          <td><div class="my_cell">4%</div></td>
75
-          <td><div class="my_cell">5</div></td>
76
-          <td><div class="my_cell">4%</div></td>
77
-          <td><div class="my_cell">5</div></td>
78
-          <td><div class="my_cell">4%</div></td>
79
-        </tr>
80
-        <tr>
81
-          <td><div class="my_cell">八年级三班</div></td>
82
-          <td><div class="my_cell">5</div></td>
83
-          <td><div class="my_cell">4%</div></td>
84
-          <td><div class="my_cell">5</div></td>
85
-          <td><div class="my_cell">4%</div></td>
86
-          <td><div class="my_cell">5</div></td>
87
-          <td><div class="my_cell">4%</div></td>
88
-          <td><div class="my_cell">5</div></td>
89
-          <td><div class="my_cell">4%</div></td>
90
-          <td><div class="my_cell">5</div></td>
91
-          <td><div class="my_cell">4%</div></td>
92
-        </tr>
93
-      </tbody>
94
-    </table>
95
-  </div>
96
-  <script src="../../js/scoreAnalysis/section_2_part.js"></script>
97
-</body>
98
-</html>
3
+  <head>
4
+    <meta charset="UTF-8" />
5
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+    <title>校本PDF报告-第二章 成绩分析</title>
8
+  </head>
9
+  <body>
10
+    <div class="section_2_part_root">
11
+      <!-- <div class="page_root section_2_part">
12
+        <h2 class="section_title_2">3.分数分段对比</h2>
13
+        <h3 class="section_title_3">3.1 全科分数段统计</h3>
14
+        <h4 class="section_title_4">3.1.1 全年级各分数段分析</h4>
15
+        <div>当前设置分数段:<span class="classPartEcharts">20</span>分/段</div>
16
+        <div
17
+          id="classscorePartEcharts"
18
+          style="margin: 0 4mm 4mm; height: 80mm"
19
+        ></div>
20
+        <h4 class="section_title_4">3.1.2 各班分数段比例分布</h4>
21
+        <div class="table">
22
+           <table border="1" class="my_table">
23
+           <thead>
24
+             <tr class="goodTableHeadTr1"></tr>
25
+             <tr class="goodTableHeadTr2"></tr>
26
+           </thead>
27
+           <tbody class="goodTableTbody"></tbody>
28
+          </table>
29
+        </div>
30
+      </div> -->
31
+    </div>
32
+    <script src="../../js/scoreAnalysis/section_2_part.js"></script>
33
+  </body>
34
+</html>

Loading…
Отказ
Запис