Browse Source

不使用es6; 添加css命名空间

wzl_h
wangzhonglu 2 years ago
parent
commit
a9c8d7cb49
7 changed files with 18 additions and 18 deletions
  1. 2
    2
      css/section_3.css
  2. 2
    2
      css/section_4.css
  3. 8
    8
      js/index.js
  4. 2
    2
      js/section_3.js
  5. 2
    2
      js/section_4.js
  6. 1
    1
      sections/section_3.html
  7. 1
    1
      sections/section_4.html

+ 2
- 2
css/section_3.css View File

1
-.echarts_result_content {
1
+.section_3 .echarts_result_content {
2
   margin-top: 3mm;
2
   margin-top: 3mm;
3
   padding: 3mm;
3
   padding: 3mm;
4
   background-color: #fff;
4
   background-color: #fff;
5
 }
5
 }
6
-.echarts_result_content span {
6
+.section_3 .echarts_result_content span {
7
   display: inline-block;
7
   display: inline-block;
8
   margin-right: 2mm;
8
   margin-right: 2mm;
9
   width: 2mm;
9
   width: 2mm;

+ 2
- 2
css/section_4.css View File

1
-.echarts_result_content {
1
+.section_4 .echarts_result_content {
2
   margin-top: 3mm;
2
   margin-top: 3mm;
3
   padding: 3mm;
3
   padding: 3mm;
4
   background-color: #fff;
4
   background-color: #fff;
5
 }
5
 }
6
-.echarts_result_content span {
6
+.section_4 .echarts_result_content span {
7
   display: inline-block;
7
   display: inline-block;
8
   margin-right: 2mm;
8
   margin-right: 2mm;
9
   width: 2mm;
9
   width: 2mm;

+ 8
- 8
js/index.js View File

8
     "section_3",
8
     "section_3",
9
     "section_4",
9
     "section_4",
10
   ];
10
   ];
11
-  $(".pdf_root").html(loadHtmlArr.map(htmlName => {
12
-    return `<div class="${htmlName}_html_root"></div>`;
11
+  $(".pdf_root").html(loadHtmlArr.map(function (htmlName) {
12
+    return "<div class='" + htmlName + "_html_root'></div>";
13
   }).join(""));
13
   }).join(""));
14
-  loadHtmlArr.forEach(htmlName => {
14
+  loadHtmlArr.forEach(function(htmlName) {
15
     if (htmlName === "preface") {
15
     if (htmlName === "preface") {
16
-      $(`.${htmlName}_html_root`).data("page-params", JSON.stringify({
17
-        htmlName,
16
+      $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
17
+        htmlName: htmlName,
18
         subjectname: "语文",
18
         subjectname: "语文",
19
         num: 12
19
         num: 12
20
       }));
20
       }));
21
     } else if (htmlName === "section_1") {
21
     } else if (htmlName === "section_1") {
22
-      $(`.${htmlName}_html_root`).data("page-params", JSON.stringify({
23
-        htmlName,
22
+      $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
23
+        htmlName: htmlName,
24
         subjectname: "数学",
24
         subjectname: "数学",
25
         num: 33
25
         num: 33
26
       }));
26
       }));
27
     }
27
     }
28
-    $(`.${htmlName}_html_root`).load(`../sections/${htmlName}.html`);
28
+    $("." + htmlName + "_html_root").load("../sections/" + htmlName + ".html");
29
   });
29
   });
30
 });
30
 });

+ 2
- 2
js/section_3.js View File

97
             verticalAlign: "bottom",
97
             verticalAlign: "bottom",
98
             position: "top",
98
             position: "top",
99
             distance: 0,
99
             distance: 0,
100
-            formatter: `{c}`,
100
+            formatter: "{c}",
101
           },
101
           },
102
         },
102
         },
103
         data: series_data,
103
         data: series_data,
104
       },
104
       },
105
     ],
105
     ],
106
   };
106
   };
107
-  let myEcharts = echarts.init(document.querySelector("#subjectBadEcharts"));
107
+  let myEcharts = echarts.init(document.querySelector(".section_3 #subjectBadEcharts"));
108
   myEcharts.clear();
108
   myEcharts.clear();
109
   myEcharts.setOption(option);
109
   myEcharts.setOption(option);
110
 }
110
 }

+ 2
- 2
js/section_4.js View File

97
             verticalAlign: "bottom",
97
             verticalAlign: "bottom",
98
             position: "top",
98
             position: "top",
99
             distance: 0,
99
             distance: 0,
100
-            formatter: `{c}`,
100
+            formatter: "{c}",
101
           },
101
           },
102
         },
102
         },
103
         data: series_data,
103
         data: series_data,
104
       },
104
       },
105
     ],
105
     ],
106
   };
106
   };
107
-  let myEcharts = echarts.init(document.querySelector("#subjectGoodEcharts"));
107
+  let myEcharts = echarts.init(document.querySelector(".section_4 #subjectGoodEcharts"));
108
   myEcharts.clear();
108
   myEcharts.clear();
109
   myEcharts.setOption(option);
109
   myEcharts.setOption(option);
110
 }
110
 }

+ 1
- 1
sections/section_3.html View File

8
   <link rel="stylesheet" href="../css/section_3.css">
8
   <link rel="stylesheet" href="../css/section_3.css">
9
 </head>
9
 </head>
10
 <body>
10
 <body>
11
-  <div class="page_root">
11
+  <div class="page_root section_3">
12
     <h1 class="section_title_1">第三章 违纪行为分析</h1>
12
     <h1 class="section_title_1">第三章 违纪行为分析</h1>
13
     <div class="abstract_box">
13
     <div class="abstract_box">
14
       <div class="abstract_left">
14
       <div class="abstract_left">

+ 1
- 1
sections/section_4.html View File

8
   <link rel="stylesheet" href="../css/section_4.css">
8
   <link rel="stylesheet" href="../css/section_4.css">
9
 </head>
9
 </head>
10
 <body>
10
 <body>
11
-  <div class="page_root">
11
+  <div class="page_root section_4">
12
     <h1 class="section_title_1">第四章 优秀试卷分析</h1>
12
     <h1 class="section_title_1">第四章 优秀试卷分析</h1>
13
     <div class="abstract_box">
13
     <div class="abstract_box">
14
       <div class="abstract_left">
14
       <div class="abstract_left">

Loading…
Cancel
Save