Browse Source

分数等级多个科目显示

gzb
wangzhonglu 1 year ago
parent
commit
32425477a1

+ 2
- 3
js/scoreAnalysis/section_2_excellent.js View File

131
   }
131
   }
132
   var parameter = $(".section_2_html_root .section_2_excellent_html_root").data("page-params");
132
   var parameter = $(".section_2_html_root .section_2_excellent_html_root").data("page-params");
133
   parameter = JSON.parse(parameter);
133
   parameter = JSON.parse(parameter);
134
-  console.log(".section_2_excellent_html_root:parameter", parameter);
135
-  
134
+  // console.log(".section_2_excellent_html_root:parameter", parameter);
136
   var subjectInfo = [];
135
   var subjectInfo = [];
137
   for (var sid in parameter) {
136
   for (var sid in parameter) {
138
     if (sid === "zf") {
137
     if (sid === "zf") {
154
   $(".section_2_excellent_root").html(singleRootHtml);
153
   $(".section_2_excellent_root").html(singleRootHtml);
155
   $.each(subjectInfo, function (s_index, s_item) {
154
   $.each(subjectInfo, function (s_index, s_item) {
156
     var r_data_item = parameter[s_item.subjectid];
155
     var r_data_item = parameter[s_item.subjectid];
157
-    console.log("r_data_item", r_data_item);
156
+    // console.log("r_data_item", r_data_item);
158
     $(".section_2_excellent_" + s_index + " .subjectname").text(
157
     $(".section_2_excellent_" + s_index + " .subjectname").text(
159
       r_data_item.subjectname
158
       r_data_item.subjectname
160
     );
159
     );

+ 38
- 17
js/scoreAnalysis/section_2_level.js View File

1
 $(function () {
1
 $(function () {
2
   //各班等级分析
2
   //各班等级分析
3
-  function initclassLevelEcharts(list) {
3
+  function initclassLevelEcharts(s_index, list) {
4
     var xAxis_data = [],
4
     var xAxis_data = [],
5
       series_data = [],
5
       series_data = [],
6
       legend_data = [],
6
       legend_data = [],
61
         data: levelNumObj[item]
61
         data: levelNumObj[item]
62
       });
62
       });
63
     });
63
     });
64
-    showgraphicaldata(xAxis_data, legend_data, levelrangeObj, list);
64
+    showgraphicaldata(xAxis_data, legend_data, levelrangeObj, s_index, list);
65
     var option = {
65
     var option = {
66
       color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
66
       color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
67
       animation: false,
67
       animation: false,
131
       }, ],
131
       }, ],
132
       series: series_data
132
       series: series_data
133
     };
133
     };
134
-    var myEcharts = echarts.init(document.querySelector(".section_2_level #classLevelEcharts"));
134
+    var myEcharts = echarts.init(document.querySelector(".section_2_level.level_" + s_index + " #classLevelEcharts"));
135
     myEcharts.clear();
135
     myEcharts.clear();
136
     myEcharts.setOption(option);
136
     myEcharts.setOption(option);
137
   }
137
   }
138
   //图表数据
138
   //图表数据
139
-  function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, list) {
139
+  function showgraphicaldata(xAxis_data, legend_data, levelrangeObj, s_index, list) {
140
     //图表数据
140
     //图表数据
141
     var arr = JSON.parse(JSON.stringify(list));
141
     var arr = JSON.parse(JSON.stringify(list));
142
     var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
142
     var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
161
       });
161
       });
162
       goodTableTbodyHtml += '<tr>' + trHtml + '</tr>';
162
       goodTableTbodyHtml += '<tr>' + trHtml + '</tr>';
163
     });
163
     });
164
-    $(".section_2_level .goodTableHeadTr1").html(goodTableHeadTr1Html);
165
-    $(".section_2_level .goodTableHeadTr2").html(goodTableHeadTr2Html);
166
-    $(".section_2_level .goodTableTbody").html(goodTableTbodyHtml);
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);
167
     var totalObj = {};
167
     var totalObj = {};
168
     var maxObj = {};
168
     var maxObj = {};
169
     var minObj = {};
169
     var minObj = {};
207
         }
207
         }
208
       }
208
       }
209
     });
209
     });
210
-    $(".section_2_level.level_0 .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_0 .A_collect").text("A类上线率最高的班级:" + $.map(maxObj['A'].classidArr, function (classid) {
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];
212
       return classObj[classid];
213
     }).join('、') + ",A类上线率最低的班级:" + $.map(minObj['A'].classidArr, function (classid) {
213
     }).join('、') + ",A类上线率最低的班级:" + $.map(minObj['A'].classidArr, function (classid) {
214
       return classObj[classid];
214
       return classObj[classid];
215
     }).join('、'));
215
     }).join('、'));
216
 
216
 
217
-    $(".section_2_level.level_0 .B_collect").text("B类上线率最高的班级:" + $.map(maxObj['B'].classidArr, function (classid) {
217
+    $(".section_2_level.level_" + s_index + " .B_collect").text("B类上线率最高的班级:" + $.map(maxObj['B'].classidArr, function (classid) {
218
       return classObj[classid];
218
       return classObj[classid];
219
     }).join('、') + ",B类上线率最低的班级:" + $.map(minObj['B'].classidArr, function (classid) {
219
     }).join('、') + ",B类上线率最低的班级:" + $.map(minObj['B'].classidArr, function (classid) {
220
       return classObj[classid];
220
       return classObj[classid];
221
     }).join('、'));
221
     }).join('、'));
222
 
222
 
223
-    $(".section_2_level.level_0 .C_collect").text("C类上线率最高的班级:" + $.map(maxObj['C'].classidArr, function (classid) {
223
+    $(".section_2_level.level_" + s_index + " .C_collect").text("C类上线率最高的班级:" + $.map(maxObj['C'].classidArr, function (classid) {
224
       return classObj[classid];
224
       return classObj[classid];
225
     }).join('、') + ",C类上线率最低的班级:" + $.map(minObj['C'].classidArr, function (classid) {
225
     }).join('、') + ",C类上线率最低的班级:" + $.map(minObj['C'].classidArr, function (classid) {
226
       return classObj[classid];
226
       return classObj[classid];
227
     }).join('、'));
227
     }).join('、'));
228
 
228
 
229
-    $(".section_2_level.level_0 .D_collect").text("D类上线率最高的班级:" + $.map(maxObj['D'].classidArr, function (classid) {
229
+    $(".section_2_level.level_" + s_index + " .D_collect").text("D类上线率最高的班级:" + $.map(maxObj['D'].classidArr, function (classid) {
230
       return classObj[classid];
230
       return classObj[classid];
231
     }).join('、') + ",D类上线率最低的班级:" + $.map(minObj['D'].classidArr, function (classid) {
231
     }).join('、') + ",D类上线率最低的班级:" + $.map(minObj['D'].classidArr, function (classid) {
232
       return classObj[classid];
232
       return classObj[classid];
233
     }).join('、'));
233
     }).join('、'));
234
 
234
 
235
-    $(".section_2_level.level_0 .E_collect").text("E类上线率最高的班级:" + $.map(maxObj['E'].classidArr, function (classid) {
235
+    $(".section_2_level.level_" + s_index + " .E_collect").text("E类上线率最高的班级:" + $.map(maxObj['E'].classidArr, function (classid) {
236
       return classObj[classid];
236
       return classObj[classid];
237
     }).join('、') + ",E类上线率最低的班级:" + $.map(minObj['E'].classidArr, function (classid) {
237
     }).join('、') + ",E类上线率最低的班级:" + $.map(minObj['E'].classidArr, function (classid) {
238
       return classObj[classid];
238
       return classObj[classid];
240
   }
240
   }
241
   var parameter = $(".section_2_html_root .section_2_level_html_root").data("page-params");
241
   var parameter = $(".section_2_html_root .section_2_level_html_root").data("page-params");
242
   parameter = JSON.parse(parameter);
242
   parameter = JSON.parse(parameter);
243
-  var list = $.grep(parameter.djfx, function (item) {
244
-    return item.ranktype == 1 && item.subjectid == 'zf';
245
-  })[0].ranks;
246
-  initclassLevelEcharts(list);
243
+  // console.log(parameter);
244
+  var subjectInfo = [];
245
+  for (var sid in parameter) {
246
+    if (sid === "zf") {
247
+      subjectInfo.unshift({
248
+        subjectid: sid,
249
+        subjectname: "全科",
250
+        ranks: parameter[sid].ranks
251
+      });
252
+    } else {
253
+      subjectInfo.push({
254
+        subjectid: sid,
255
+        subjectname: parameter[sid].subjectname,
256
+        ranks: parameter[sid].ranks
257
+      });
258
+    }
259
+  }
260
+  var singleRootHtml = "";
261
+  $.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>';
263
+  });
264
+  $(".section_2_level_root").html(singleRootHtml);
265
+  $.each(subjectInfo, function (s_index, s_item) {
266
+    initclassLevelEcharts(s_index, s_item.ranks);
267
+  });
247
 });
268
 });

+ 3
- 3
js/scoreAnalysis/section_2_lin.js View File

296
     }
296
     }
297
     subjectid_ranktype[sid_4][4] = parameter[4][sid_4];
297
     subjectid_ranktype[sid_4][4] = parameter[4][sid_4];
298
   }
298
   }
299
-  console.log("subjectid_ranktype", subjectid_ranktype);
299
+  // console.log("subjectid_ranktype", subjectid_ranktype);
300
   var singleRootHtml = "";
300
   var singleRootHtml = "";
301
   $.each(subjectInfo, function (s_index, s_item) {
301
   $.each(subjectInfo, function (s_index, s_item) {
302
     singleRootHtml +=
302
     singleRootHtml +=
323
   $(".section_2_lin_root").html(singleRootHtml);
323
   $(".section_2_lin_root").html(singleRootHtml);
324
   $.each(subjectInfo, function (s_index, s_item) {
324
   $.each(subjectInfo, function (s_index, s_item) {
325
     var r_data_item = subjectid_ranktype[s_item.subjectid][4];
325
     var r_data_item = subjectid_ranktype[s_item.subjectid][4];
326
-    console.log("r_data_item", r_data_item);
326
+    // console.log("r_data_item", r_data_item);
327
     // 按名次统计
327
     // 按名次统计
328
     $(".section_2_lin_" + s_index + " .subjectname").text(
328
     $(".section_2_lin_" + s_index + " .subjectname").text(
329
       r_data_item.subjectname
329
       r_data_item.subjectname
365
     );
365
     );
366
     // 按分数统计
366
     // 按分数统计
367
     var s_data_item = subjectid_ranktype[s_item.subjectid][3];
367
     var s_data_item = subjectid_ranktype[s_item.subjectid][3];
368
-    console.log("s_data_item", s_data_item);
368
+    // console.log("s_data_item", s_data_item);
369
     $(".section_2_lin_" + s_index + " .lin_score_num").text(
369
     $(".section_2_lin_" + s_index + " .lin_score_num").text(
370
       s_data_item.linescore
370
       s_data_item.linescore
371
     );
371
     );

+ 1
- 4
js/section_2.js View File

57
     } else if (htmlName === "section_2_class_single") {
57
     } else if (htmlName === "section_2_class_single") {
58
       $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify(class_single_arr));
58
       $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify(class_single_arr));
59
     } else if (htmlName === "section_2_level") {
59
     } else if (htmlName === "section_2_level") {
60
-      $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify({
61
-        cjfx: parameter.cjfx,
62
-        djfx: parameter.djfx
63
-      }));
60
+      $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify(djfx_data[1]));
64
     } else if (htmlName === "section_2_part") {
61
     } else if (htmlName === "section_2_part") {
65
       $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify({
62
       $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify({
66
         cjfx: parameter.cjfx,
63
         cjfx: parameter.cjfx,

+ 3
- 2
sections/scoreAnalysis/section_2_level.html View File

8
     <link rel="stylesheet" href="../../css/scoreAnalysis/section_2_level.css" />
8
     <link rel="stylesheet" href="../../css/scoreAnalysis/section_2_level.css" />
9
   </head>
9
   </head>
10
   <body>
10
   <body>
11
-    <div class="page_root section_2_level level_0">
11
+    <div class="section_2_level_root"></div>
12
+    <!-- <div class="page_root section_2_level level_0">
12
       <h2 class="section_title_2">2.分数等级对比</h2>
13
       <h2 class="section_title_2">2.分数等级对比</h2>
13
       <h3 class="section_title_3">2.1 全科等级对比</h3>
14
       <h3 class="section_title_3">2.1 全科等级对比</h3>
14
       <h4 class="section_title_4">2.1.1 各班等级分析</h4>
15
       <h4 class="section_title_4">2.1.1 各班等级分析</h4>
43
           </div>
44
           </div>
44
         </div>
45
         </div>
45
       </div>
46
       </div>
46
-    </div>
47
+    </div> -->
47
     <script src="../../js/scoreAnalysis/section_2_level.js"></script>
48
     <script src="../../js/scoreAnalysis/section_2_level.js"></script>
48
   </body>
49
   </body>
49
 </html>
50
 </html>

Loading…
Cancel
Save