浏览代码

第三章完结

gzb
guozhongbo 1年前
父节点
当前提交
e4ae34098b
共有 2 个文件被更改,包括 67 次插入16 次删除
  1. 3
    0
      css/section_3.css
  2. 64
    16
      js/section_3.js

+ 3
- 0
css/section_3.css 查看文件

@@ -9,4 +9,7 @@
9 9
   width: 2mm;
10 10
   height: 2mm;
11 11
   border-radius: 50%;
12
+}
13
+.ChapterThree .points{
14
+  width: 50mm;
12 15
 }

+ 64
- 16
js/section_3.js 查看文件

@@ -52,7 +52,7 @@ $(function () {
52 52
       },
53 53
       radar: {
54 54
         radius: "60%",
55
-        center: ["50%", "55%"],
55
+        center: ["50%", "50%"],
56 56
         indicator: arrList
57 57
       },
58 58
       series: {
@@ -96,9 +96,20 @@ $(function () {
96 96
   function showlargeAnalysistable (list,legendlist,s_index) {
97 97
     var table = "",goodTableHeadTr1Html = '<th rowspan="2">题型</th><th rowspan="2">对应题号</th><th rowspan="2">分值</th><th rowspan="2">占比</th><th colspan="2">年级</th><th colspan="2">'+currentclass+'</th>',
98 98
       goodTableHeadTr2Html = "", trHtml = "";
99
+    var data = {
100
+      0:""
101
+    }, page = 0;
102
+    var pointnum = s_index == 0?11:16;//第一次是半页 显示十条 往后二十条每页
99 103
     $.each(list, function (idx, item) {
100
-      trHtml += "<tr>";
101
-      trHtml+= '<td><div class="my_cell">' +
104
+      if((idx + 1) % pointnum == 0){
105
+        page++;
106
+        if (page == 1) {
107
+          pointnum = 31;
108
+        }
109
+        data[page] = ""; 
110
+      }
111
+      data[page] += "<tr>";
112
+      data[page]+= '<td><div class="my_cell">' +
102 113
       item.qtypename +
103 114
       '</div></td><td><div class="my_cell">' +
104 115
       item.qns +
@@ -117,9 +128,11 @@ $(function () {
117 128
       "%" +
118 129
       '</div></td>';
119 130
     })
131
+    console.log(page,data);
120 132
     $.each(legendlist, function (idx, item) {
121 133
       goodTableHeadTr2Html+="<th>平均分</th><th>得分率</th>";
122 134
     })
135
+
123 136
       table ='  <table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
124 137
         goodTableHeadTr1Html  +
125 138
         '</tr><tr class="goodTableHeadTr2">' +
@@ -127,7 +140,24 @@ $(function () {
127 140
         '</tr></thead><tbody class="goodTableTbody">' +
128 141
         trHtml  +
129 142
       "</tbody></table>"
130
-    $(".section_3_"+s_index +" .largeAnalysistable").html(table)
143
+     for (var i = 0; i <= page; i++){
144
+      table ='<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
145
+        goodTableHeadTr1Html  +
146
+        '</tr><tr class="goodTableHeadTr2">' +
147
+        goodTableHeadTr2Html  +
148
+        '</tr></thead><tbody class="goodTableTbody">' +
149
+        data[i]  +
150
+        "</tbody></table>"
151
+      $(".section_3_" + s_index + ".large_"+ i+" .largeAnalysistable").html(table);
152
+      if (i != 0) {
153
+         //添加分页
154
+        $(".large_"+ (i-1)+".section_3_"+s_index).after(
155
+        '<div class="page_root section_3_'+s_index+' large_'+i+'"></div>'
156
+        );
157
+      $(".page_root.section_3_"+s_index+'.large_'+i).html(table); 
158
+      }
159
+    }
160
+    // $(".section_3_"+s_index +" .largeAnalysistable").html(table)
131 161
   }
132 162
 
133 163
   function initSmallAnalysisEcharts (s_index,list) {
@@ -449,11 +479,22 @@ $(function () {
449 479
   }
450 480
 
451 481
   function showpointsAnalysistable (list, legendlist, s_index) {
452
-     var table = "",goodTableHeadTr1Html = '<th rowspan="2">知识点</th><th rowspan="2">对应题号</th><th rowspan="2">分值</th><th rowspan="2">占比</th><th colspan="2">年级</th><th colspan="2">'+currentclass+'</th>',
482
+     var table = "",goodTableHeadTr1Html = '<th rowspan="2" class="points">知识点</th><th rowspan="2">对应题号</th><th rowspan="2">分值</th><th rowspan="2">占比</th><th colspan="2">年级</th><th colspan="2">'+currentclass+'</th>',
453 483
       goodTableHeadTr2Html = "", trHtml = "";
484
+    var data = {
485
+      0:""
486
+    }, page = 0;
487
+    var pointnum = 16;//第一次是半页 显示十条 往后二十条每页
454 488
     $.each(list, function (idx, item) {
455
-      trHtml += "<tr>";
456
-      trHtml+= '<td><div class="my_cell">' +
489
+      if((idx + 1) % pointnum == 0){
490
+        page++;
491
+        if (page == 1) {
492
+          pointnum = 31;
493
+        }
494
+        data[page] = ""; 
495
+      }
496
+      data[page] += "<tr>";
497
+      data[page]+= '<td><div class="my_cell">' +
457 498
       item.pointname +
458 499
       '</div></td><td><div class="my_cell">' +
459 500
       item.qns +
@@ -475,26 +516,33 @@ $(function () {
475 516
     $.each(legendlist, function (idx, item) {
476 517
       goodTableHeadTr2Html+="<th>平均分</th><th>得分率</th>";
477 518
     })
478
-      table ='  <table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
519
+    for (var i = 0; i <= page; i++){
520
+      table ='<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
479 521
         goodTableHeadTr1Html  +
480 522
         '</tr><tr class="goodTableHeadTr2">' +
481 523
         goodTableHeadTr2Html  +
482 524
         '</tr></thead><tbody class="goodTableTbody">' +
483
-        trHtml  +
484
-      "</tbody></table>"
485
-    $(".section_3_" + s_index + " .pointsAnalysistable").html(table);
486
-    console.log($(".section_3_" + s_index + " .pointsAnalysistable").height());
487
-    var 
525
+        data[i]  +
526
+        "</tbody></table>"
527
+      $(".section_3_" + s_index + ".page_"+ i+" .pointsAnalysistable").html(table);
528
+      if (i != 0) {
529
+         //添加分页
530
+        $(".page_"+ (i-1)+".section_3_"+s_index).after(
531
+        '<div class="page_root section_3_'+s_index+' page_'+i+'"></div>'
532
+        );
533
+      $(".page_root.section_3_"+s_index+'.page_'+i).html(table); 
534
+      }
535
+    }
488 536
   }
489 537
   var parameter = $(".section_3_html_root").data("page-params");
490 538
   parameter = JSON.parse(parameter);
491 539
   var html = "";
492 540
   $.each(parameter, function (s_index, item) {
493
-    html+='<div class="page_root section_3_'+s_index +'">'+
541
+    html+='<div class="page_root large_0 section_3_'+s_index +'">'+
494 542
      (s_index == 0?'<h1 class="section_title_1">第三章 试卷分析</h1><div class="abstract_box"><div class="abstract_left"><img src="/img/img2.png" /></div><div class="abstract_right"><div class="abstract_content">从学科试卷分析,帮我们从宏观的角度了解班级的水平和差异。系统从多个维度的数据进行学科对比分析,<strong>包括大题年级和班级的(平均分、得分率)、小题年级和班级的(平均分、得分率)。</strong></div></div></div>':"")+ 
495 543
       '<h1 class="subjectinfo">'+item.subjectname+'试卷分析</h1><h2 class="section_title_2">1. 大题分析</h2><h3 class="section_title_3">1.1 大题分析</h3><div id="largeAnalysisEcharts" style="margin: 0 4mm 4mm; height: 71mm"></div><h2 class="section_title_3">1.2 大题整体分析</h2><div class="largeAnalysistable"></div></div><div class="page_root section_3_'+
496 544
     s_index + '"><h2 class="section_title_2">2. 小题分析</h2><h3 class="section_title_3">2.1 小题分析</h3><div id="SmallAnalysisEcharts" style="margin: 0 4mm 4mm; height: 71mm"></div><h2 class="section_title_3_'+
497
-      s_index +'">2.2 小题整体分析</h2><div class="SmallAnalysistable"></div></div>'+(item.points.length>0?'<div class="page_root section_3_'+
545
+      s_index +'">2.2 小题整体分析</h2><div class="SmallAnalysistable"></div></div>'+(item.points.length>0?'<div class="page_root page_0 section_3_'+
498 546
     s_index +'"><h2 class="section_title_2">3. 知识点掌握整体概况</h2><h3 class="section_title_3">3.1 知识点得分率分析</h3><div id="pointsAnalysisEcharts" style="margin: 0 4mm 4mm; height: 90mm"></div><h2 class="section_title_3">3.2 知识点整体分析</h2><div class="pointsAnalysistable"></div></div></div>':"")
499 547
   })
500 548
   $(".ChapterThree").html(html);
@@ -505,5 +553,5 @@ $(function () {
505 553
     initpointsAnalysisEcharts(s_index, item.points);
506 554
   })
507 555
   
508
-   document.documentElement.scrollTop = 4000;
556
+  //  document.documentElement.scrollTop = 1000;
509 557
 });

正在加载...
取消
保存