Kaynağa Gözat

分数等级多个科目显示

gzb
wangzhonglu 1 yıl önce
ebeveyn
işleme
32425477a1

+ 2
- 3
js/scoreAnalysis/section_2_excellent.js Dosyayı Görüntüle

@@ -131,8 +131,7 @@ $(function () {
131 131
   }
132 132
   var parameter = $(".section_2_html_root .section_2_excellent_html_root").data("page-params");
133 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 135
   var subjectInfo = [];
137 136
   for (var sid in parameter) {
138 137
     if (sid === "zf") {
@@ -154,7 +153,7 @@ $(function () {
154 153
   $(".section_2_excellent_root").html(singleRootHtml);
155 154
   $.each(subjectInfo, function (s_index, s_item) {
156 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 157
     $(".section_2_excellent_" + s_index + " .subjectname").text(
159 158
       r_data_item.subjectname
160 159
     );

+ 38
- 17
js/scoreAnalysis/section_2_level.js Dosyayı Görüntüle

@@ -1,6 +1,6 @@
1 1
 $(function () {
2 2
   //各班等级分析
3
-  function initclassLevelEcharts(list) {
3
+  function initclassLevelEcharts(s_index, list) {
4 4
     var xAxis_data = [],
5 5
       series_data = [],
6 6
       legend_data = [],
@@ -61,7 +61,7 @@ $(function () {
61 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 65
     var option = {
66 66
       color: ["#5C99FF", "#ff5f56", "#5EC5C8", "#f1982b", "#6e5eff"],
67 67
       animation: false,
@@ -131,12 +131,12 @@ $(function () {
131 131
       }, ],
132 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 135
     myEcharts.clear();
136 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 141
     var arr = JSON.parse(JSON.stringify(list));
142 142
     var goodTableHeadTr1Html = '<th rowspan="2">班级</th>';
@@ -161,9 +161,9 @@ $(function () {
161 161
       });
162 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 167
     var totalObj = {};
168 168
     var maxObj = {};
169 169
     var minObj = {};
@@ -207,32 +207,32 @@ $(function () {
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 212
       return classObj[classid];
213 213
     }).join('、') + ",A类上线率最低的班级:" + $.map(minObj['A'].classidArr, function (classid) {
214 214
       return classObj[classid];
215 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 218
       return classObj[classid];
219 219
     }).join('、') + ",B类上线率最低的班级:" + $.map(minObj['B'].classidArr, function (classid) {
220 220
       return classObj[classid];
221 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 224
       return classObj[classid];
225 225
     }).join('、') + ",C类上线率最低的班级:" + $.map(minObj['C'].classidArr, function (classid) {
226 226
       return classObj[classid];
227 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 230
       return classObj[classid];
231 231
     }).join('、') + ",D类上线率最低的班级:" + $.map(minObj['D'].classidArr, function (classid) {
232 232
       return classObj[classid];
233 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 236
       return classObj[classid];
237 237
     }).join('、') + ",E类上线率最低的班级:" + $.map(minObj['E'].classidArr, function (classid) {
238 238
       return classObj[classid];
@@ -240,8 +240,29 @@ $(function () {
240 240
   }
241 241
   var parameter = $(".section_2_html_root .section_2_level_html_root").data("page-params");
242 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 Dosyayı Görüntüle

@@ -296,7 +296,7 @@ $(function () {
296 296
     }
297 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 300
   var singleRootHtml = "";
301 301
   $.each(subjectInfo, function (s_index, s_item) {
302 302
     singleRootHtml +=
@@ -323,7 +323,7 @@ $(function () {
323 323
   $(".section_2_lin_root").html(singleRootHtml);
324 324
   $.each(subjectInfo, function (s_index, s_item) {
325 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 328
     $(".section_2_lin_" + s_index + " .subjectname").text(
329 329
       r_data_item.subjectname
@@ -365,7 +365,7 @@ $(function () {
365 365
     );
366 366
     // 按分数统计
367 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 369
     $(".section_2_lin_" + s_index + " .lin_score_num").text(
370 370
       s_data_item.linescore
371 371
     );

+ 1
- 4
js/section_2.js Dosyayı Görüntüle

@@ -57,10 +57,7 @@ $(function () {
57 57
     } else if (htmlName === "section_2_class_single") {
58 58
       $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify(class_single_arr));
59 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 61
     } else if (htmlName === "section_2_part") {
65 62
       $(".section_2.score_analysis_root ." + htmlName + "_html_root").data("page-params", JSON.stringify({
66 63
         cjfx: parameter.cjfx,

+ 3
- 2
sections/scoreAnalysis/section_2_level.html Dosyayı Görüntüle

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

Loading…
İptal
Kaydet