Browse Source

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

wzl_h
wangzl 2 years ago
parent
commit
f916fd93a1
5 changed files with 116 additions and 46 deletions
  1. 4
    4
      js/index.js
  2. 6
    0
      js/preface.js
  3. 84
    26
      js/section_1.js
  4. 7
    1
      sections/preface.html
  5. 15
    15
      sections/section_1.html

+ 4
- 4
js/index.js View File

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

+ 6
- 0
js/preface.js View File

@@ -2,4 +2,10 @@ $(function() {
2 2
   // outerHeight(true) 高度为 height+margin+padding+border
3 3
   var parameter = $(".preface_html_root").data("page-params");
4 4
   console.log("preface:parameter", JSON.parse(parameter));
5
+  $(".gradename").text(4);
6
+  $(".examtype").text(4);
7
+  $(".classnum").text(4);
8
+  $(".subjectnum").text(4);
9
+  $(".allscore").text(4);
10
+
5 11
 });

+ 84
- 26
js/section_1.js View File

@@ -1,5 +1,5 @@
1 1
 $(function () {
2
-  function initAverageScoreEcharts() {
2
+  function initAverageScoreEcharts(list,xAxis_data) {
3 3
     var itemStyle = {
4 4
       normal: {
5 5
         label: {
@@ -8,8 +8,15 @@ $(function () {
8 8
         }
9 9
       }
10 10
     };
11
-    var xAxis_data = ["一般", "二班"]
11
+    var score=[],maxscore=[],minscore=[],avgscore=[];
12 12
     var curlegend = ["满分", "最高分", "最低分", "平均分"];
13
+    for(var i=0;i<list.length;i++){
14
+      var item = list[i];
15
+      score.push(item.score);
16
+      maxscore.push(item.maxscore);
17
+      minscore.push(item.minscore);
18
+      avgscore.push(item.avgscore);
19
+    }
13 20
     var curseries = [{
14 21
       name: "满分",
15 22
       type: "bar",
@@ -17,7 +24,7 @@ $(function () {
17 24
       // 柱状图最小高度
18 25
       barMinHeight: $.UnitUtil.mm2px(2),
19 26
       barGap: 0,
20
-      data: [60, 70],
27
+      data: score,
21 28
       itemStyle: itemStyle
22 29
     },
23 30
     {
@@ -27,7 +34,7 @@ $(function () {
27 34
       // 柱状图最小高度
28 35
       barMinHeight: $.UnitUtil.mm2px(2),
29 36
       barGap: 0,
30
-      data: [50, 60],
37
+      data: maxscore,
31 38
       itemStyle: itemStyle
32 39
     },
33 40
     {
@@ -37,7 +44,7 @@ $(function () {
37 44
       // 柱状图最小高度
38 45
       barMinHeight: $.UnitUtil.mm2px(2),
39 46
       barGap: 0,
40
-      data: [30, 40],
47
+      data: minscore,
41 48
       itemStyle: itemStyle
42 49
     },
43 50
     {
@@ -47,7 +54,7 @@ $(function () {
47 54
       // 柱状图最小高度
48 55
       barMinHeight: $.UnitUtil.mm2px(2),
49 56
       barGap: 0,
50
-      data: [40, 50],
57
+      data: avgscore,
51 58
       itemStyle: itemStyle
52 59
     }
53 60
     ];
@@ -124,7 +131,7 @@ $(function () {
124 131
     myEcharts.setOption(option);
125 132
   }
126 133
 
127
-  function initExcellenceRateEcharts() {
134
+  function initExcellenceRateEcharts(list,xAxis_data) {
128 135
     var itemStyle = {
129 136
       normal: {
130 137
         label: {
@@ -133,16 +140,24 @@ $(function () {
133 140
         }
134 141
       }
135 142
     };
136
-    var xAxis_data = ["一般", "二班"]
143
+    var yxrate=[],lhrate=[],jgrate=[],dfrate=[];
137 144
     var curlegend = ["优秀率", "良好率", "及格率", "低分率"];
138
-    var curseries = [{
145
+    for(var i=0;i<list.length;i++){
146
+      var item = list[i];
147
+      yxrate.push(item.yxrate);
148
+      lhrate.push(item.lhrate);
149
+      jgrate.push(item.jgrate);
150
+      dfrate.push(item.dfrate);
151
+    }
152
+    var curseries = [
153
+      {
139 154
       name: "优秀率",
140 155
       type: "bar",
141 156
       barWidth: $.UnitUtil.mm2px(5),
142 157
       // 柱状图最小高度
143 158
       barMinHeight: $.UnitUtil.mm2px(2),
144 159
       barGap: 0,
145
-      data: [60, 70],
160
+      data: yxrate,
146 161
       itemStyle: itemStyle
147 162
     },
148 163
     {
@@ -152,7 +167,7 @@ $(function () {
152 167
       // 柱状图最小高度
153 168
       barMinHeight: $.UnitUtil.mm2px(2),
154 169
       barGap: 0,
155
-      data: [50, 60],
170
+      data: lhrate,
156 171
       itemStyle: itemStyle
157 172
     },
158 173
     {
@@ -162,7 +177,7 @@ $(function () {
162 177
       // 柱状图最小高度
163 178
       barMinHeight: $.UnitUtil.mm2px(2),
164 179
       barGap: 0,
165
-      data: [30, 40],
180
+      data: jgrate,
166 181
       itemStyle: itemStyle
167 182
     },
168 183
     {
@@ -172,7 +187,7 @@ $(function () {
172 187
       // 柱状图最小高度
173 188
       barMinHeight: $.UnitUtil.mm2px(2),
174 189
       barGap: 0,
175
-      data: [40, 50],
190
+      data: dfrate,
176 191
       itemStyle: itemStyle
177 192
     }
178 193
     ];
@@ -249,7 +264,7 @@ $(function () {
249 264
     myEcharts.setOption(option);
250 265
   }
251 266
 
252
-  function initExamnumEcharts() {
267
+  function initExamnumEcharts(list,xAxis_data) {
253 268
     var itemStyle = {
254 269
       normal: {
255 270
         label: {
@@ -258,8 +273,13 @@ $(function () {
258 273
         }
259 274
       }
260 275
     };
261
-    var xAxis_data = ["一般", "二班"]
276
+    var stunum = [],missnum=[];
262 277
     var curlegend = ["实考人数", "缺考人数"];
278
+    for(var i=0;i<list.length;i++){
279
+      var item = list[i];
280
+      stunum.push(item.stunum);
281
+      missnum.push(item.missnum);
282
+    }
263 283
     var curseries = [{
264 284
       name: "实考人数",
265 285
       type: "bar",
@@ -267,7 +287,7 @@ $(function () {
267 287
       // 柱状图最小高度
268 288
       barMinHeight: $.UnitUtil.mm2px(2),
269 289
       barGap: 0,
270
-      data: [60, 70],
290
+      data: stunum,
271 291
       itemStyle: itemStyle
272 292
     },
273 293
     {
@@ -277,7 +297,7 @@ $(function () {
277 297
       // 柱状图最小高度
278 298
       barMinHeight: $.UnitUtil.mm2px(2),
279 299
       barGap: 0,
280
-      data: [50, 60],
300
+      data: missnum,
281 301
       itemStyle: itemStyle
282 302
     }
283 303
     ];
@@ -354,7 +374,7 @@ $(function () {
354 374
     myEcharts.setOption(option);
355 375
   }
356 376
 
357
-  function initbzcEcharts() {
377
+  function initbzcEcharts(list,xAxis_data) {
358 378
     var itemStyle = {
359 379
       normal: {
360 380
         label: {
@@ -363,8 +383,12 @@ $(function () {
363 383
         }
364 384
       }
365 385
     };
366
-    var xAxis_data = ["一般", "二班"]
386
+    var bzc = [];
367 387
     var curlegend = ["标准差"];
388
+    for(var i=0;i<list.length;i++){
389
+      var item = list[i];
390
+      bzc.push(item.bzc);
391
+    }
368 392
     var curseries = [{
369 393
       name: "标准差",
370 394
       type: "bar",
@@ -372,7 +396,7 @@ $(function () {
372 396
       // 柱状图最小高度
373 397
       barMinHeight: $.UnitUtil.mm2px(2),
374 398
       barGap: 0,
375
-      data: [60, 70],
399
+      data: bzc,
376 400
       itemStyle: itemStyle
377 401
     }];
378 402
     var option = {
@@ -447,10 +471,44 @@ $(function () {
447 471
     myEcharts.clear();
448 472
     myEcharts.setOption(option);
449 473
   }
450
-  var parameter = $(".section_1_html_root").data("page-params");
451
-  console.log("section_1:parameter", JSON.parse(parameter));
452
-  initAverageScoreEcharts();
453
-  initExcellenceRateEcharts();
454
-  initExamnumEcharts();
455
-  initbzcEcharts();
474
+  var parameter = JSON.parse($(".section_1_html_root").data("page-params"));
475
+  $(".section1 .classnum").text(parameter.classnum);
476
+  $(".section1 .stunum").text(parameter.stunum);
477
+  $(".section1 .missnum").text(parameter.missnum);
478
+  $(".section1 .subjectnum").text(parameter.subjectnum);
479
+  $(".section1 .maxscore").text(parameter.maxscore);
480
+  $(".section1 .avgscore").text(parameter.avgscore);
481
+  $(".section1 .mixscore").text(parameter.mixscore);
482
+  var xAxis_data = [];
483
+  for(var i=0;i<parameter.subjects.length;i++){
484
+    var item = parameter.subjects[i];
485
+    var str = "";
486
+    if(item.subjectname == "总分"){
487
+      item.subjectname = "全部班级";
488
+    }else{
489
+      str += `<tr>
490
+      <td><div class="my_cell">${item.subjectname}</div></td>
491
+      <td><div class="my_cell">${item.stunum}</div></td>
492
+      <td><div class="my_cell">${item.missnum}</div></td>
493
+      <td><div class="my_cell">${item.score}</div></td>
494
+      <td><div class="my_cell">${item.maxscore}</div></td>
495
+      <td><div class="my_cell">${item.minscore}</div></td>
496
+      <td><div class="my_cell">${item.avgscore}</div></td>
497
+      <td><div class="my_cell">${item.yxrate}</div></td>
498
+      <td><div class="my_cell">${item.lhrate}</div></td>
499
+      <td><div class="my_cell">${item.jgrate}</div></td>
500
+      <td><div class="my_cell">${item.dfrate}</div></td>
501
+      <td><div class="my_cell">${item.bzc}</div></td>
502
+      </tr>`
503
+    }
504
+    $(".section1 .tbody").html(str);
505
+    xAxis_data.push(item.subjectname);
506
+  }
507
+  console.log(parameter.subjects);
508
+  $(".section1 .mfnummax").text(123);
509
+  initAverageScoreEcharts(parameter.subjects,xAxis_data);
510
+  initExcellenceRateEcharts(parameter.subjects,xAxis_data);
511
+  initExamnumEcharts(parameter.subjects,xAxis_data);
512
+  initbzcEcharts(parameter.subjects,xAxis_data);
513
+  console.log($(".section1 .tbody"));
456 514
 });

+ 7
- 1
sections/preface.html View File

@@ -1,5 +1,6 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="zh-cn">
3
+
3 4
 <head>
4 5
   <meta charset="UTF-8">
5 6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -7,11 +8,15 @@
7 8
   <title>校本PDF报告-前言</title>
8 9
   <link rel="stylesheet" href="../css/preface.css">
9 10
 </head>
11
+
10 12
 <body>
11 13
   <div class="page_root">
12 14
     <h1 class="preface_title_1">前言</h1>
13 15
     <div class="preface_title_2">INTRODUCTION</div>
14
-    <div class="preface_content_line">本次考试为高一年级期中考试,共4个班级、8个学科,总分值为750分。</div>
16
+    <div class="preface_content_line">本次考试为<span class="gradename">高一年级</span>
17
+      <span class="examtype">期中考试</span>,共<span class="classnum"></span>个班级、<span
18
+        class="subjectnum"></span>个学科,总分值为<span class="allscore"></span>分。
19
+    </div>
15 20
     <div class="preface_content_line">计划240名考生,缺考20人,实际考生50人,最高分749分,平均分569.03分;</div>
16 21
     <div class="preface_content_line">本次考试A类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
17 22
     <div class="preface_content_line">本次考试B类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
@@ -62,4 +67,5 @@
62 67
   </div>
63 68
   <script src="./js/preface.js"></script>
64 69
 </body>
70
+
65 71
 </html>

+ 15
- 15
sections/section_1.html View File

@@ -25,31 +25,31 @@
25 25
       <h2 class="section_title_2">1.总览</h2>
26 26
       <div class="section_list">
27 27
         <div class="section_item">
28
-          <div class="item_num"><span>6</span>个</div>
28
+          <div class="item_num"><span class="classnum"></span>个</div>
29 29
           <div class="item_title">班级数量</div>
30 30
         </div>
31 31
         <div class="section_item">
32
-          <div class="item_num"><span>456</span>人</div>
32
+          <div class="item_num"><span class="stunum"></span>人</div>
33 33
           <div class="item_title">学生数量</div>
34 34
         </div>
35 35
         <div class="section_item">
36
-          <div class="item_num"><span>6</span>人</div>
36
+          <div class="item_num"><span class="missnum"></span>人</div>
37 37
           <div class="item_title">缺考人数</div>
38 38
         </div>
39 39
         <div class="section_item">
40
-          <div class="item_num"><span>6</span>科</div>
40
+          <div class="item_num"><span class="subjectnum"></span>科</div>
41 41
           <div class="item_title">科目数量</div>
42 42
         </div>
43 43
         <div class="section_item">
44
-          <div class="item_num"><span>600</span>分</div>
44
+          <div class="item_num"><span class="maxscore"></span>分</div>
45 45
           <div class="item_title">最高分</div>
46 46
         </div>
47 47
         <div class="section_item">
48
-          <div class="item_num"><span>512</span>分</div>
48
+          <div class="item_num"><span class="avgscore"></span>分</div>
49 49
           <div class="item_title">平均分</div>
50 50
         </div>
51 51
         <div class="section_item" style="margin-right: 0">
52
-          <div class="item_num"><span>456</span>分</div>
52
+          <div class="item_num"><span class="mixscore"></span>分</div>
53 53
           <div class="item_title">最低分</div>
54 54
         </div>
55 55
       </div>
@@ -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>满分人数最多科目:英语
67
+          <span style="background-color: #ff5d41"></span>满分人数最多科目:<span class="mfnummax"></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>优秀率最高的科目:英语
82
+          <span style="background-color: #5c99ff"></span>优秀率最高的科目:<span class="yx"></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>优秀率最高的科目:英语
88
+          <span style="background-color: #ff5f56"></span>及格率最低的科目:<span class="jg"></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
-          >实考人数最多的科目:英语
97
+          >实考人数最多的科目:<span class="sk"></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
-          >缺考人数最多的科目:英语
104
+          >缺考人数最多的科目:<span class="qk"></span>
105 105
         </div>
106 106
       </div>
107 107
     </div>
@@ -126,8 +126,8 @@
126 126
             <th class="w12mm">标准差</th>
127 127
           </tr>
128 128
         </thead>
129
-        <tbody>
130
-          <tr>
129
+        <tbody class="tbody">
130
+          <!-- <tr>
131 131
             <td><div class="my_cell">语文</div></td>
132 132
             <td><div class="my_cell">5</div></td>
133 133
             <td><div class="my_cell">4%</div></td>
@@ -182,7 +182,7 @@
182 182
             <td><div class="my_cell">5</div></td>
183 183
             <td><div class="my_cell">4%</div></td>
184 184
             <td><div class="my_cell">4%</div></td>
185
-          </tr>
185
+          </tr> -->
186 186
         </tbody>
187 187
       </table>
188 188
     </div>

Loading…
Cancel
Save