Ver código fonte

Merge remote-tracking branch 'origin/gzb' into wzl_h

wzl_h
wangzl 2 anos atrás
pai
commit
a86cc02550
5 arquivos alterados com 117 adições e 71 exclusões
  1. 1
    1
      css/section_1.css
  2. 1
    1
      js/index.js
  3. 55
    0
      js/preface.js
  4. 55
    8
      js/section_1.js
  5. 5
    61
      sections/section_1.html

+ 1
- 1
css/section_1.css Ver arquivo

@@ -35,7 +35,7 @@
35 35
     padding: 3mm;
36 36
     background-color: #F5F7F9;
37 37
 }
38
-.echarts_result_content>span {
38
+.echarts_result_content:nth-child(1) {
39 39
     display: inline-block;
40 40
     margin-right: 2mm;
41 41
     width: 2mm;

+ 1
- 1
js/index.js Ver arquivo

@@ -2,7 +2,7 @@ $(function () {
2 2
   function loadSectionHtml(sectionsData) {
3 3
     var loadHtmlArr = [
4 4
       // "cover",  //封面
5
-      // "preface",  //前言
5
+      "preface",  //前言
6 6
       "section_1",
7 7
       // "section_2",
8 8
       // "section_3",

+ 55
- 0
js/preface.js Ver arquivo

@@ -1,4 +1,59 @@
1 1
 $(function() {
2
+  function getGradeName (gradeid) {
3
+    let gradename = "";
4
+    if (gradeid == 1) {
5
+      gradename = "一年级";
6
+    } else if (gradeid == 2) {
7
+      gradename = "二年级";
8
+    } else if (gradeid == 3) {
9
+      gradename = "三年级";
10
+    } else if (gradeid == 4) {
11
+      gradename = "四年级";
12
+    } else if (gradeid == 5) {
13
+      gradename = "五年级";
14
+    } else if (gradeid == 6) {
15
+      gradename = "六年级";
16
+    } else if (gradeid == 7) {
17
+      gradename = "七年级";
18
+    } else if (gradeid == 8) {
19
+      gradename = "八年级";
20
+    } else if (gradeid == 9) {
21
+      gradename = "九年级";
22
+    } else if (gradeid == 10) {
23
+      gradename = "高一";
24
+    } else if (gradeid == 11) {
25
+      gradename = "高二";
26
+    } else if (gradeid == 12) {
27
+      gradename = "高三";
28
+    }
29
+    return gradename;
30
+  };
31
+  // 考试类型 10期末20期中30月考40周考
32
+  var examTypeInfo = [
33
+  {
34
+    label: "期末",
35
+    value: 10
36
+  },
37
+  {
38
+    label: "期中",
39
+    value: 20
40
+  },
41
+  {
42
+    label: "月考",
43
+    value: 30
44
+  },
45
+  {
46
+    label: "周考",
47
+    value: 40
48
+  }
49
+];
50
+function getExamTypeName (type) {
51
+  let info = examTypeInfo.filter((v) => v.value === type);
52
+  if (info.length > 0) {
53
+    return info[0].label;
54
+  }
55
+  return "";
56
+};
2 57
   // outerHeight(true) 高度为 height+margin+padding+border
3 58
   var parameter = $(".preface_html_root").data("page-params");
4 59
   console.log("preface:parameter", JSON.parse(parameter));

+ 55
- 8
js/section_1.js Ver arquivo

@@ -16,7 +16,7 @@ $(function () {
16 16
       maxscore.push(item.maxscore);
17 17
       minscore.push(item.minscore);
18 18
       avgscore.push(item.avgscore);
19
-    }
19
+    } 
20 20
     var curseries = [{
21 21
       name: "满分",
22 22
       type: "bar",
@@ -479,14 +479,59 @@ $(function () {
479 479
   $(".section1 .maxscore").text(parameter.maxscore);
480 480
   $(".section1 .avgscore").text(parameter.avgscore);
481 481
   $(".section1 .mixscore").text(parameter.mixscore);
482
-  var xAxis_data = [];
482
+  var xAxis_data = [],html = "";
483
+  var mfclass = {
484
+    num: 0,
485
+    classname: ""
486
+  },yxclass = {
487
+    num: 0,
488
+    classname: ""
489
+  },jgclass = {
490
+    num: 100,
491
+    classname: ""
492
+  },skclass = {
493
+    num: 0,
494
+    classname: ""
495
+  },qkclass = {
496
+    num: 0,
497
+    classname: ""
498
+  };
483 499
   for(var i=0;i<parameter.subjects.length;i++){
484 500
     var item = parameter.subjects[i];
485
-    var str = "";
486 501
     if(item.subjectname == "总分"){
487 502
       item.subjectname = "全部班级";
488 503
     }else{
489
-      str += `<tr>
504
+      if (mfclass.num < item.score) {
505
+        mfclass = {
506
+          num: item.score,
507
+          classname: item.subjectname
508
+        };
509
+      }
510
+      if (yxclass.num < item.yxrate) {
511
+        yxclass = {
512
+          num: item.yxrate,
513
+          classname: item.subjectname
514
+        };
515
+      }
516
+      if (jgclass.num > item.jgrate) {
517
+        jgclass = {
518
+          num: item.jgrate,
519
+          classname: item.subjectname
520
+        };
521
+      }
522
+      if (skclass.num < item.stunum) {
523
+        skclass = {
524
+          num: item.stunum,
525
+          classname: item.subjectname
526
+        };
527
+      }
528
+      if (qkclass.num < item.missnum) {
529
+        qkclass = {
530
+          num: item.missnum,
531
+          classname: item.subjectname
532
+        };
533
+      }
534
+      html += `<tr>
490 535
       <td><div class="my_cell">${item.subjectname}</div></td>
491 536
       <td><div class="my_cell">${item.stunum}</div></td>
492 537
       <td><div class="my_cell">${item.missnum}</div></td>
@@ -501,14 +546,16 @@ $(function () {
501 546
       <td><div class="my_cell">${item.bzc}</div></td>
502 547
       </tr>`
503 548
     }
504
-    $(".section1 .tbody").html(str);
505 549
     xAxis_data.push(item.subjectname);
506 550
   }
507
-  console.log(parameter.subjects);
508
-  $(".section1 .mfnummax").text(123);
551
+  $(".section1 .mfclass").text(mfclass.classname);
552
+  $(".section1 .yxclass").text(yxclass.classname);
553
+  $(".section1 .jgclass").text(jgclass.classname);
554
+  $(".section1 .skclass").text(skclass.classname);
555
+  $(".section1 .qkclass").text(qkclass.classname);
556
+  $(".section1 .tbody").html(html);
509 557
   initAverageScoreEcharts(parameter.subjects,xAxis_data);
510 558
   initExcellenceRateEcharts(parameter.subjects,xAxis_data);
511 559
   initExamnumEcharts(parameter.subjects,xAxis_data);
512 560
   initbzcEcharts(parameter.subjects,xAxis_data);
513
-  console.log($(".section1 .tbody"));
514 561
 });

+ 5
- 61
sections/section_1.html Ver arquivo

@@ -64,7 +64,7 @@
64 64
       <div class="echarts_result">
65 65
         <div>上图统计结果表示:</div>
66 66
         <div class="echarts_result_content">
67
-          <span style="background-color: #ff5d41"></span>满分人数最多科目:<span class="mfnummax"></span>
67
+          <span style="background-color: #ff5d41"></span>满分人数最多科目:<span class="mfclass"></span>
68 68
         </div>
69 69
       </div>
70 70
     </div>
@@ -79,13 +79,13 @@
79 79
       <div class="echarts_result">
80 80
         <div>上图统计结果表示:</div>
81 81
         <div class="echarts_result_content">
82
-          <span style="background-color: #5c99ff"></span>优秀率最高的科目:<span class="yx"></span>
82
+          <span style="background-color: #5c99ff"></span>优秀率最高的科目:<span class="yxclass"></span>
83 83
         </div>
84 84
         <div
85 85
           class="echarts_result_content"
86 86
           style="margin-top: 0; padding-top: 0"
87 87
         >
88
-          <span style="background-color: #ff5f56"></span>及格率最低的科目:<span class="jg"></span>
88
+          <span style="background-color: #ff5f56"></span>及格率最低的科目:<span class="jgclass"></span>
89 89
         </div>
90 90
       </div>
91 91
       <h3 class="section_title_3">2.3 各科实考人数、缺考人数分析</h3>
@@ -94,14 +94,14 @@
94 94
         <div>上图统计结果表示:</div>
95 95
         <div class="echarts_result_content">
96 96
           <span style="background-color: #5c99ff"></span
97
-          >实考人数最多的科目:<span class="sk"></span>
97
+          >实考人数最多的科目:<span class="skclass"></span>
98 98
         </div>
99 99
         <div
100 100
           class="echarts_result_content"
101 101
           style="margin-top: 0; padding-top: 0"
102 102
         >
103 103
           <span style="background-color: #ff5d41"></span
104
-          >缺考人数最多的科目:<span class="qk"></span>
104
+          >缺考人数最多的科目:<span class="qkclass"></span>
105 105
         </div>
106 106
       </div>
107 107
     </div>
@@ -127,62 +127,6 @@
127 127
           </tr>
128 128
         </thead>
129 129
         <tbody class="tbody">
130
-          <!-- <tr>
131
-            <td><div class="my_cell">语文</div></td>
132
-            <td><div class="my_cell">5</div></td>
133
-            <td><div class="my_cell">4%</div></td>
134
-            <td><div class="my_cell">5</div></td>
135
-            <td><div class="my_cell">4%</div></td>
136
-            <td><div class="my_cell">5</div></td>
137
-            <td><div class="my_cell">4%</div></td>
138
-            <td><div class="my_cell">5</div></td>
139
-            <td><div class="my_cell">4%</div></td>
140
-            <td><div class="my_cell">5</div></td>
141
-            <td><div class="my_cell">4%</div></td>
142
-            <td><div class="my_cell">4%</div></td>
143
-          </tr>
144
-          <tr>
145
-            <td><div class="my_cell">英语</div></td>
146
-            <td><div class="my_cell">5</div></td>
147
-            <td><div class="my_cell">4%</div></td>
148
-            <td><div class="my_cell">5</div></td>
149
-            <td><div class="my_cell">4%</div></td>
150
-            <td><div class="my_cell">5</div></td>
151
-            <td><div class="my_cell">4%</div></td>
152
-            <td><div class="my_cell">5</div></td>
153
-            <td><div class="my_cell">4%</div></td>
154
-            <td><div class="my_cell">5</div></td>
155
-            <td><div class="my_cell">4%</div></td>
156
-            <td><div class="my_cell">4%</div></td>
157
-          </tr>
158
-          <tr>
159
-            <td><div class="my_cell">数学</div></td>
160
-            <td><div class="my_cell">5</div></td>
161
-            <td><div class="my_cell">4%</div></td>
162
-            <td><div class="my_cell">5</div></td>
163
-            <td><div class="my_cell">4%</div></td>
164
-            <td><div class="my_cell">5</div></td>
165
-            <td><div class="my_cell">4%</div></td>
166
-            <td><div class="my_cell">5</div></td>
167
-            <td><div class="my_cell">4%</div></td>
168
-            <td><div class="my_cell">5</div></td>
169
-            <td><div class="my_cell">4%</div></td>
170
-            <td><div class="my_cell">4%</div></td>
171
-          </tr>
172
-          <tr>
173
-            <td><div class="my_cell">政治</div></td>
174
-            <td><div class="my_cell">5</div></td>
175
-            <td><div class="my_cell">4%</div></td>
176
-            <td><div class="my_cell">5</div></td>
177
-            <td><div class="my_cell">4%</div></td>
178
-            <td><div class="my_cell">5</div></td>
179
-            <td><div class="my_cell">4%</div></td>
180
-            <td><div class="my_cell">5</div></td>
181
-            <td><div class="my_cell">4%</div></td>
182
-            <td><div class="my_cell">5</div></td>
183
-            <td><div class="my_cell">4%</div></td>
184
-            <td><div class="my_cell">4%</div></td>
185
-          </tr> -->
186 130
         </tbody>
187 131
       </table>
188 132
     </div>

Carregando…
Cancelar
Salvar