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

+ 6
- 0
js/preface.js View File

2
   // outerHeight(true) 高度为 height+margin+padding+border
2
   // outerHeight(true) 高度为 height+margin+padding+border
3
   var parameter = $(".preface_html_root").data("page-params");
3
   var parameter = $(".preface_html_root").data("page-params");
4
   console.log("preface:parameter", JSON.parse(parameter));
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
 $(function () {
1
 $(function () {
2
-  function initAverageScoreEcharts() {
2
+  function initAverageScoreEcharts(list,xAxis_data) {
3
     var itemStyle = {
3
     var itemStyle = {
4
       normal: {
4
       normal: {
5
         label: {
5
         label: {
8
         }
8
         }
9
       }
9
       }
10
     };
10
     };
11
-    var xAxis_data = ["一般", "二班"]
11
+    var score=[],maxscore=[],minscore=[],avgscore=[];
12
     var curlegend = ["满分", "最高分", "最低分", "平均分"];
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
     var curseries = [{
20
     var curseries = [{
14
       name: "满分",
21
       name: "满分",
15
       type: "bar",
22
       type: "bar",
17
       // 柱状图最小高度
24
       // 柱状图最小高度
18
       barMinHeight: $.UnitUtil.mm2px(2),
25
       barMinHeight: $.UnitUtil.mm2px(2),
19
       barGap: 0,
26
       barGap: 0,
20
-      data: [60, 70],
27
+      data: score,
21
       itemStyle: itemStyle
28
       itemStyle: itemStyle
22
     },
29
     },
23
     {
30
     {
27
       // 柱状图最小高度
34
       // 柱状图最小高度
28
       barMinHeight: $.UnitUtil.mm2px(2),
35
       barMinHeight: $.UnitUtil.mm2px(2),
29
       barGap: 0,
36
       barGap: 0,
30
-      data: [50, 60],
37
+      data: maxscore,
31
       itemStyle: itemStyle
38
       itemStyle: itemStyle
32
     },
39
     },
33
     {
40
     {
37
       // 柱状图最小高度
44
       // 柱状图最小高度
38
       barMinHeight: $.UnitUtil.mm2px(2),
45
       barMinHeight: $.UnitUtil.mm2px(2),
39
       barGap: 0,
46
       barGap: 0,
40
-      data: [30, 40],
47
+      data: minscore,
41
       itemStyle: itemStyle
48
       itemStyle: itemStyle
42
     },
49
     },
43
     {
50
     {
47
       // 柱状图最小高度
54
       // 柱状图最小高度
48
       barMinHeight: $.UnitUtil.mm2px(2),
55
       barMinHeight: $.UnitUtil.mm2px(2),
49
       barGap: 0,
56
       barGap: 0,
50
-      data: [40, 50],
57
+      data: avgscore,
51
       itemStyle: itemStyle
58
       itemStyle: itemStyle
52
     }
59
     }
53
     ];
60
     ];
124
     myEcharts.setOption(option);
131
     myEcharts.setOption(option);
125
   }
132
   }
126
 
133
 
127
-  function initExcellenceRateEcharts() {
134
+  function initExcellenceRateEcharts(list,xAxis_data) {
128
     var itemStyle = {
135
     var itemStyle = {
129
       normal: {
136
       normal: {
130
         label: {
137
         label: {
133
         }
140
         }
134
       }
141
       }
135
     };
142
     };
136
-    var xAxis_data = ["一般", "二班"]
143
+    var yxrate=[],lhrate=[],jgrate=[],dfrate=[];
137
     var curlegend = ["优秀率", "良好率", "及格率", "低分率"];
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
       name: "优秀率",
154
       name: "优秀率",
140
       type: "bar",
155
       type: "bar",
141
       barWidth: $.UnitUtil.mm2px(5),
156
       barWidth: $.UnitUtil.mm2px(5),
142
       // 柱状图最小高度
157
       // 柱状图最小高度
143
       barMinHeight: $.UnitUtil.mm2px(2),
158
       barMinHeight: $.UnitUtil.mm2px(2),
144
       barGap: 0,
159
       barGap: 0,
145
-      data: [60, 70],
160
+      data: yxrate,
146
       itemStyle: itemStyle
161
       itemStyle: itemStyle
147
     },
162
     },
148
     {
163
     {
152
       // 柱状图最小高度
167
       // 柱状图最小高度
153
       barMinHeight: $.UnitUtil.mm2px(2),
168
       barMinHeight: $.UnitUtil.mm2px(2),
154
       barGap: 0,
169
       barGap: 0,
155
-      data: [50, 60],
170
+      data: lhrate,
156
       itemStyle: itemStyle
171
       itemStyle: itemStyle
157
     },
172
     },
158
     {
173
     {
162
       // 柱状图最小高度
177
       // 柱状图最小高度
163
       barMinHeight: $.UnitUtil.mm2px(2),
178
       barMinHeight: $.UnitUtil.mm2px(2),
164
       barGap: 0,
179
       barGap: 0,
165
-      data: [30, 40],
180
+      data: jgrate,
166
       itemStyle: itemStyle
181
       itemStyle: itemStyle
167
     },
182
     },
168
     {
183
     {
172
       // 柱状图最小高度
187
       // 柱状图最小高度
173
       barMinHeight: $.UnitUtil.mm2px(2),
188
       barMinHeight: $.UnitUtil.mm2px(2),
174
       barGap: 0,
189
       barGap: 0,
175
-      data: [40, 50],
190
+      data: dfrate,
176
       itemStyle: itemStyle
191
       itemStyle: itemStyle
177
     }
192
     }
178
     ];
193
     ];
249
     myEcharts.setOption(option);
264
     myEcharts.setOption(option);
250
   }
265
   }
251
 
266
 
252
-  function initExamnumEcharts() {
267
+  function initExamnumEcharts(list,xAxis_data) {
253
     var itemStyle = {
268
     var itemStyle = {
254
       normal: {
269
       normal: {
255
         label: {
270
         label: {
258
         }
273
         }
259
       }
274
       }
260
     };
275
     };
261
-    var xAxis_data = ["一般", "二班"]
276
+    var stunum = [],missnum=[];
262
     var curlegend = ["实考人数", "缺考人数"];
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
     var curseries = [{
283
     var curseries = [{
264
       name: "实考人数",
284
       name: "实考人数",
265
       type: "bar",
285
       type: "bar",
267
       // 柱状图最小高度
287
       // 柱状图最小高度
268
       barMinHeight: $.UnitUtil.mm2px(2),
288
       barMinHeight: $.UnitUtil.mm2px(2),
269
       barGap: 0,
289
       barGap: 0,
270
-      data: [60, 70],
290
+      data: stunum,
271
       itemStyle: itemStyle
291
       itemStyle: itemStyle
272
     },
292
     },
273
     {
293
     {
277
       // 柱状图最小高度
297
       // 柱状图最小高度
278
       barMinHeight: $.UnitUtil.mm2px(2),
298
       barMinHeight: $.UnitUtil.mm2px(2),
279
       barGap: 0,
299
       barGap: 0,
280
-      data: [50, 60],
300
+      data: missnum,
281
       itemStyle: itemStyle
301
       itemStyle: itemStyle
282
     }
302
     }
283
     ];
303
     ];
354
     myEcharts.setOption(option);
374
     myEcharts.setOption(option);
355
   }
375
   }
356
 
376
 
357
-  function initbzcEcharts() {
377
+  function initbzcEcharts(list,xAxis_data) {
358
     var itemStyle = {
378
     var itemStyle = {
359
       normal: {
379
       normal: {
360
         label: {
380
         label: {
363
         }
383
         }
364
       }
384
       }
365
     };
385
     };
366
-    var xAxis_data = ["一般", "二班"]
386
+    var bzc = [];
367
     var curlegend = ["标准差"];
387
     var curlegend = ["标准差"];
388
+    for(var i=0;i<list.length;i++){
389
+      var item = list[i];
390
+      bzc.push(item.bzc);
391
+    }
368
     var curseries = [{
392
     var curseries = [{
369
       name: "标准差",
393
       name: "标准差",
370
       type: "bar",
394
       type: "bar",
372
       // 柱状图最小高度
396
       // 柱状图最小高度
373
       barMinHeight: $.UnitUtil.mm2px(2),
397
       barMinHeight: $.UnitUtil.mm2px(2),
374
       barGap: 0,
398
       barGap: 0,
375
-      data: [60, 70],
399
+      data: bzc,
376
       itemStyle: itemStyle
400
       itemStyle: itemStyle
377
     }];
401
     }];
378
     var option = {
402
     var option = {
447
     myEcharts.clear();
471
     myEcharts.clear();
448
     myEcharts.setOption(option);
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
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html lang="zh-cn">
2
 <html lang="zh-cn">
3
+
3
 <head>
4
 <head>
4
   <meta charset="UTF-8">
5
   <meta charset="UTF-8">
5
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
   <title>校本PDF报告-前言</title>
8
   <title>校本PDF报告-前言</title>
8
   <link rel="stylesheet" href="../css/preface.css">
9
   <link rel="stylesheet" href="../css/preface.css">
9
 </head>
10
 </head>
11
+
10
 <body>
12
 <body>
11
   <div class="page_root">
13
   <div class="page_root">
12
     <h1 class="preface_title_1">前言</h1>
14
     <h1 class="preface_title_1">前言</h1>
13
     <div class="preface_title_2">INTRODUCTION</div>
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
     <div class="preface_content_line">计划240名考生,缺考20人,实际考生50人,最高分749分,平均分569.03分;</div>
20
     <div class="preface_content_line">计划240名考生,缺考20人,实际考生50人,最高分749分,平均分569.03分;</div>
16
     <div class="preface_content_line">本次考试A类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
21
     <div class="preface_content_line">本次考试A类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
17
     <div class="preface_content_line">本次考试B类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
22
     <div class="preface_content_line">本次考试B类上线分值[650,750],上线率19.93%,上线人数 10人;</div>
62
   </div>
67
   </div>
63
   <script src="./js/preface.js"></script>
68
   <script src="./js/preface.js"></script>
64
 </body>
69
 </body>
70
+
65
 </html>
71
 </html>

+ 15
- 15
sections/section_1.html View File

25
       <h2 class="section_title_2">1.总览</h2>
25
       <h2 class="section_title_2">1.总览</h2>
26
       <div class="section_list">
26
       <div class="section_list">
27
         <div class="section_item">
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
           <div class="item_title">班级数量</div>
29
           <div class="item_title">班级数量</div>
30
         </div>
30
         </div>
31
         <div class="section_item">
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
           <div class="item_title">学生数量</div>
33
           <div class="item_title">学生数量</div>
34
         </div>
34
         </div>
35
         <div class="section_item">
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
           <div class="item_title">缺考人数</div>
37
           <div class="item_title">缺考人数</div>
38
         </div>
38
         </div>
39
         <div class="section_item">
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
           <div class="item_title">科目数量</div>
41
           <div class="item_title">科目数量</div>
42
         </div>
42
         </div>
43
         <div class="section_item">
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
           <div class="item_title">最高分</div>
45
           <div class="item_title">最高分</div>
46
         </div>
46
         </div>
47
         <div class="section_item">
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
           <div class="item_title">平均分</div>
49
           <div class="item_title">平均分</div>
50
         </div>
50
         </div>
51
         <div class="section_item" style="margin-right: 0">
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
           <div class="item_title">最低分</div>
53
           <div class="item_title">最低分</div>
54
         </div>
54
         </div>
55
       </div>
55
       </div>
64
       <div class="echarts_result">
64
       <div class="echarts_result">
65
         <div>上图统计结果表示:</div>
65
         <div>上图统计结果表示:</div>
66
         <div class="echarts_result_content">
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
         </div>
68
         </div>
69
       </div>
69
       </div>
70
     </div>
70
     </div>
79
       <div class="echarts_result">
79
       <div class="echarts_result">
80
         <div>上图统计结果表示:</div>
80
         <div>上图统计结果表示:</div>
81
         <div class="echarts_result_content">
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
         </div>
83
         </div>
84
         <div
84
         <div
85
           class="echarts_result_content"
85
           class="echarts_result_content"
86
           style="margin-top: 0; padding-top: 0"
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
         </div>
89
         </div>
90
       </div>
90
       </div>
91
       <h3 class="section_title_3">2.3 各科实考人数、缺考人数分析</h3>
91
       <h3 class="section_title_3">2.3 各科实考人数、缺考人数分析</h3>
94
         <div>上图统计结果表示:</div>
94
         <div>上图统计结果表示:</div>
95
         <div class="echarts_result_content">
95
         <div class="echarts_result_content">
96
           <span style="background-color: #5c99ff"></span
96
           <span style="background-color: #5c99ff"></span
97
-          >实考人数最多的科目:英语
97
+          >实考人数最多的科目:<span class="sk"></span>
98
         </div>
98
         </div>
99
         <div
99
         <div
100
           class="echarts_result_content"
100
           class="echarts_result_content"
101
           style="margin-top: 0; padding-top: 0"
101
           style="margin-top: 0; padding-top: 0"
102
         >
102
         >
103
           <span style="background-color: #ff5d41"></span
103
           <span style="background-color: #ff5d41"></span
104
-          >缺考人数最多的科目:英语
104
+          >缺考人数最多的科目:<span class="qk"></span>
105
         </div>
105
         </div>
106
       </div>
106
       </div>
107
     </div>
107
     </div>
126
             <th class="w12mm">标准差</th>
126
             <th class="w12mm">标准差</th>
127
           </tr>
127
           </tr>
128
         </thead>
128
         </thead>
129
-        <tbody>
130
-          <tr>
129
+        <tbody class="tbody">
130
+          <!-- <tr>
131
             <td><div class="my_cell">语文</div></td>
131
             <td><div class="my_cell">语文</div></td>
132
             <td><div class="my_cell">5</div></td>
132
             <td><div class="my_cell">5</div></td>
133
             <td><div class="my_cell">4%</div></td>
133
             <td><div class="my_cell">4%</div></td>
182
             <td><div class="my_cell">5</div></td>
182
             <td><div class="my_cell">5</div></td>
183
             <td><div class="my_cell">4%</div></td>
183
             <td><div class="my_cell">4%</div></td>
184
             <td><div class="my_cell">4%</div></td>
184
             <td><div class="my_cell">4%</div></td>
185
-          </tr>
185
+          </tr> -->
186
         </tbody>
186
         </tbody>
187
       </table>
187
       </table>
188
     </div>
188
     </div>

Loading…
Cancel
Save