Parcourir la source

前言修改

wzl_h
guozhongbo il y a 2 ans
Parent
révision
e6373e8b13
6 fichiers modifiés avec 53 ajouts et 59 suppressions
  1. 1
    1
      css/section_1.css
  2. 4
    3
      js/index.js
  3. 26
    32
      js/preface.js
  4. 13
    14
      js/section_1.js
  5. 4
    4
      sections/preface.html
  6. 5
    5
      sections/section_1.html

+ 1
- 1
css/section_1.css Voir le fichier

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

+ 4
- 3
js/index.js Voir le fichier

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

+ 26
- 32
js/preface.js Voir le fichier

@@ -1,6 +1,6 @@
1 1
 $(function() {
2 2
   function getGradeName (gradeid) {
3
-    let gradename = "";
3
+    var gradename = "";
4 4
     if (gradeid == 1) {
5 5
       gradename = "一年级";
6 6
     } else if (gradeid == 2) {
@@ -29,38 +29,32 @@ $(function() {
29 29
     return gradename;
30 30
   };
31 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
32
+function getExamTypeName (examtype) {
33
+  var examname = "";
34
+  if (examtype == 10) {
35
+    examname = "期末";
36
+  } else if (examtype == 20) {
37
+    examname = "期中";
38
+  } else if (examtype == 30) {
39
+    examname = "月考";
40
+  } else if (examtype == 40) {
41
+    examname = "周考";
48 42
   }
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 "";
43
+  return examname;
56 44
 };
57 45
   // outerHeight(true) 高度为 height+margin+padding+border
58
-  var parameter = $(".preface_html_root").data("page-params");
59
-  console.log("preface:parameter", JSON.parse(parameter));
60
-  $(".gradename").text(4);
61
-  $(".examtype").text(4);
62
-  $(".classnum").text(4);
63
-  $(".subjectnum").text(4);
64
-  $(".allscore").text(4);
65
-
46
+  var parameter =JSON.parse($(".preface_html_root").data("page-params"));
47
+  console.log("preface:parameter", parameter);
48
+  var gradename = getGradeName(parameter.ksgk.gradeid);
49
+  var examname = getExamTypeName(parameter.ksgk.examtype);
50
+  $(".preface .gradename").text(gradename);
51
+  $(".preface .examtype").text(examname);
52
+  $(".preface .classnum").text(parameter.ksgk.classnum);
53
+  $(".preface .subjectnum").text(parameter.ksgk.subjectnum);
54
+  $(".preface .allscore").text(parameter.ksgk.allscore);
55
+  $(".preface .stunum").text(parameter.ksgk.stunum);
56
+  $(".preface .qkunum").text(parameter.ksgk.missnum);
57
+  $(".preface .sjnum").text(parameter.ksgk.stunum);
58
+  $(".preface .maxscore").text(parameter.ksgk.maxscore);
59
+  $(".preface .avgscore").text(parameter.ksgk.avgscore);
66 60
 });

+ 13
- 14
js/section_1.js Voir le fichier

@@ -531,20 +531,19 @@ $(function () {
531 531
           classname: item.subjectname
532 532
         };
533 533
       }
534
-      html += `<tr>
535
-      <td><div class="my_cell">${item.subjectname}</div></td>
536
-      <td><div class="my_cell">${item.stunum}</div></td>
537
-      <td><div class="my_cell">${item.missnum}</div></td>
538
-      <td><div class="my_cell">${item.score}</div></td>
539
-      <td><div class="my_cell">${item.maxscore}</div></td>
540
-      <td><div class="my_cell">${item.minscore}</div></td>
541
-      <td><div class="my_cell">${item.avgscore}</div></td>
542
-      <td><div class="my_cell">${item.yxrate}</div></td>
543
-      <td><div class="my_cell">${item.lhrate}</div></td>
544
-      <td><div class="my_cell">${item.jgrate}</div></td>
545
-      <td><div class="my_cell">${item.dfrate}</div></td>
546
-      <td><div class="my_cell">${item.bzc}</div></td>
547
-      </tr>`
534
+      html += '<tr><td><div class="my_cell">'+(item.subjectname ||0)+
535
+      '</div></td><td><div class="my_cell">'+(item.stunum ||0)+
536
+      '</div></td><td><div class="my_cell">'+(item.missnum ||0)+
537
+      '</div></td><td><div class="my_cell">'+(item.score ||0)+
538
+      '</div></td><td><div class="my_cell">'+(item.maxscore ||0)+
539
+      '</div></td><td><div class="my_cell">'+(item.minscore ||0)+
540
+      '</div></td><td><div class="my_cell">'+(item.avgscore ||0)+
541
+      '</div></td><td><div class="my_cell">'+(item.yxrate ||0)+'%'+
542
+      '</div></td><td><div class="my_cell">'+(item.lhrate ||0)+'%'+
543
+      '</div></td><td><div class="my_cell">'+(item.jgrate ||0)+'%'+
544
+      '</div></td><td><div class="my_cell">'+(item.dfrate ||0)+'%'+
545
+      '</div></td><td><div class="my_cell">'+(item.bzc ||0)+
546
+      '</div></td></tr>'
548 547
     }
549 548
     xAxis_data.push(item.subjectname);
550 549
   }

+ 4
- 4
sections/preface.html Voir le fichier

@@ -10,14 +10,14 @@
10 10
 </head>
11 11
 
12 12
 <body>
13
-  <div class="page_root">
13
+  <div class="page_root preface">
14 14
     <h1 class="preface_title_1">前言</h1>
15 15
     <div class="preface_title_2">INTRODUCTION</div>
16
-    <div class="preface_content_line">本次考试为<span class="gradename">高一年级</span>
17
-      <span class="examtype">期中考试</span>,共<span class="classnum"></span>个班级、<span
16
+    <div class="preface_content_line">本次考试为<span class="gradename"></span><span class="examtype"></span>,共<span class="classnum"></span>个班级、<span
18 17
         class="subjectnum"></span>个学科,总分值为<span class="allscore"></span>分。
19 18
     </div>
20
-    <div class="preface_content_line">计划240名考生,缺考20人,实际考生50人,最高分749分,平均分569.03分;</div>
19
+    <div class="preface_content_line">计划<span class="stunum"></span>名考生,缺考<span class="qkunum"></span>人,
20
+      实际考生<span class="sjnum"></span>人,最高分<span class="maxscore"></span>分,平均分<span class="avgscore"></span>分;</div>
21 21
     <div class="preface_content_line">本次考试A类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
22 22
     <div class="preface_content_line">本次考试B类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
23 23
     <div class="preface_content_line">本次考试C类上线分值[650,750],上线率19.93%,上线人数 10人;</div>

+ 5
- 5
sections/section_1.html Voir le fichier

@@ -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="mfclass"></span>
67
+          <span class="yj" 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="yxclass"></span>
82
+          <span class="yj" 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="jgclass"></span>
88
+          <span class="yj" 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>
@@ -93,14 +93,14 @@
93 93
       <div class="echarts_result">
94 94
         <div>上图统计结果表示:</div>
95 95
         <div class="echarts_result_content">
96
-          <span style="background-color: #5c99ff"></span
96
+          <span class="yj" style="background-color: #5c99ff"></span
97 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
-          <span style="background-color: #ff5d41"></span
103
+          <span class="yj" style="background-color: #ff5d41"></span
104 104
           >缺考人数最多的科目:<span class="qkclass"></span>
105 105
         </div>
106 106
       </div>

Chargement…
Annuler
Enregistrer