فهرست منبع

fix: 报告表格字段溢出问题

zhangjie 11 ماه پیش
والد
کامیت
51548ecf88

+ 33 - 82
src/assets/styles/report.css

@@ -22,27 +22,22 @@ span {
   padding: 0;
   box-sizing: border-box;
 }
-
 .font-normal {
   font-family: "PingFang SC Regular", "Microsoft YaHei", Tahoma, Helvetica,
     Arial, sans-serif;
 }
-
 .font-bold {
   font-family: "PingFang SC Semibold", "Microsoft YaHei", Tahoma, Helvetica,
     Arial, sans-serif;
 }
-
 li {
   list-style: none;
 }
-
 em,
 i,
 u {
   font-style: normal;
 }
-
 h1,
 h2,
 h3,
@@ -52,24 +47,19 @@ h6 {
   font-size: 100%;
   font-weight: normal;
 }
-
 fieldset,
 img {
   border: 0;
 }
-
 .page-error {
   color: #975ee5;
   font-size: 25px;
   text-align: center;
   padding: 150px 30px;
 }
-
 .mb-15 {
   margin-bottom: 15px;
 }
-
-/* report-page */
 .report-page {
   width: 793px;
   height: 1122px;
@@ -81,18 +71,15 @@ img {
   color: #666;
   font-family: "PingFang SC", Tahoma, Helvetica, Arial, sans-serif;
 }
-
 .report-page .page-body {
   background: #fff;
   height: 1023px;
   overflow: hidden;
 }
-
 .report-page .page-content {
   margin-top: 20px;
   position: relative;
 }
-
 .report-page .page-foot {
   position: absolute;
   width: 100%;
@@ -102,24 +89,20 @@ img {
   padding: 27px 40px;
   color: #999;
 }
-
 .report-page .page-foot .foot-left {
   float: left;
 }
-
 .report-page .page-foot .foot-right {
   float: right;
   height: 18px;
   padding-right: 120px;
   position: relative;
 }
-
 .report-page .page-foot .page-num {
   display: block;
   line-height: 18px;
   font-size: 14px;
 }
-
 .report-page .page-foot .foot-num-bg {
   position: absolute;
   width: 110px;
@@ -130,67 +113,54 @@ img {
   background-size: 100% 100%;
   background-repeat: no-repeat;
 }
-
 .report-page .page-chart {
   min-height: 200px;
   max-height: 100%;
 }
-
 .report-page .page-title-1 {
   font-size: 27px;
   font-weight: 600;
   color: #435088;
   line-height: 48px;
 }
-
 .report-page .page-title-2 {
   font-size: 19px;
   font-weight: 600;
   color: #435088;
   line-height: 27px;
 }
-
-/* table */
 .report-table {
   width: 100%;
   border-spacing: 0;
   border-collapse: collapse;
   text-align: center;
 }
-
 .report-table th {
   padding: 5px 3px;
   background-color: #3da0ff;
   color: #fff;
   line-height: 19px;
 }
-
 .report-table td {
   padding: 5px 3px;
   color: #555;
   line-height: 19px;
 }
-
 .report-table-border th {
   border: 1px solid #3589d8;
 }
-
 .report-table-border td {
   border: 1px solid #e9e9e9;
 }
-
 .report-summary .summary-chart {
   height: 260px;
 }
-
 .report-summary .page-title-1 {
   display: none;
 }
-
 .report-summary .page-content {
   margin: 0;
 }
-
 .report-summary .report-title {
   font-size: 27px;
   font-weight: 600;
@@ -198,7 +168,6 @@ img {
   line-height: 48px;
   text-align: center;
 }
-
 .report-summary .report-sub-title {
   text-align: center;
   margin-bottom: 30px;
@@ -207,69 +176,51 @@ img {
   color: #435088;
   line-height: 27px;
 }
-
 .college-chart {
   height: 234px;
 }
-
-.classes-table td.td-class-name {
-  width: 240px;
+.report-college td.td-college {
+  width: 170px;
 }
-
-.classes-table .class-name {
+.report-college td.td-college > div {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  margin: 0 auto;
-  max-width: 230px;
+  max-width: 160px;
+}
+.report-class td.td-class {
+  width: 170px;
+}
+.report-class td.td-class > div {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 160px;
+}
+.report-teacher td.td-teacher {
+  width: 90px;
+}
+.report-teacher td.td-teacher > div {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 80px;
+}
+.report-teacher td.td-class {
+  width: 140px;
 }
-
-.teacher-class-table td.td-class-name {
+.report-teacher td.td-class > div {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: 130px;
+}
+.report-question td.td-question {
   width: 200px;
 }
-
-.teacher-class-table .class-name {
+.report-question td.td-question > div {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
-  margin: 0 auto;
   max-width: 190px;
 }
-
-.table-level th,
-.table-level td {
-  font-size: 16px;
-  line-height: 16px;
-  padding: 7px 2px;
-}
-
-.table-ave-5 th,
-.table-ave-5 td {
-  font-size: 18px;
-  width: 20%;
-  padding: 6px 3px;
-}
-
-.table-range-long th,
-.table-range-long td {
-  font-size: 18px;
-  padding: 4px 3px;
-}
-
-.table-ave-6 th,
-.table-ave-6 td {
-  font-size: 18px;
-  width: 177px;
-  padding: 6px 3px;
-}
-
-.table-ave-6 td[rowspan] {
-  padding: 13px;
-  background: #fafafa;
-  width: auto !important;
-  word-break: break-all;
-}
-
-.table-ave-6 .th-empty {
-  width: auto;
-}

+ 48 - 56
src/assets/styles/report.scss

@@ -221,69 +221,61 @@ img {
   height: 234px;
 }
 
-.classes-table {
-  td.td-class-name {
-    width: 240px;
-  }
-  .class-name {
-    white-space: nowrap;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    margin: 0 auto;
-    max-width: 230px;
-  }
-}
-.teacher-class-table {
-  td.td-class-name {
-    width: 200px;
-  }
-  .class-name {
-    white-space: nowrap;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    margin: 0 auto;
-    max-width: 190px;
+// report-college
+.report-college {
+  td.td-college {
+    width: 170px;
+    > div {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      max-width: 160px;
+    }
   }
 }
-.table-level {
-  th,
-  td {
-    font-size: 16px;
-    line-height: 16px;
-    padding: 7px 2px;
+// report-class
+.report-class {
+  td.td-class {
+    width: 170px;
+    > div {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      max-width: 160px;
+    }
   }
 }
 
-.table-ave-5 {
-  th,
-  td {
-    font-size: 18px;
-    width: 20%;
-    padding: 6px 3px;
+// report-teacher
+.report-teacher {
+  td.td-teacher {
+    width: 90px;
+    > div {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      max-width: 80px;
+    }
   }
-}
-.table-range-long {
-  th,
-  td {
-    font-size: 18px;
-    padding: 4px 3px;
+  td.td-class {
+    width: 140px;
+    > div {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      max-width: 130px;
+    }
   }
 }
-
-.table-ave-6 {
-  th,
-  td {
-    font-size: 18px;
-    width: 177px;
-    padding: 6px 3px;
-  }
-  td[rowspan] {
-    padding: 13px;
-    background: $lightBackground;
-    width: auto !important;
-    word-break: break-all;
-  }
-  .th-empty {
-    width: auto;
+// report-question
+.report-question {
+  td.td-question {
+    width: 200px;
+    > div {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      max-width: 190px;
+    }
   }
 }

+ 3 - 1
src/modules/mark/components/report/ReportClass.vue

@@ -24,7 +24,9 @@
           <th>优秀率(%)</th>
         </tr>
         <tr v-for="(item, ind) in page.tables" :key="ind">
-          <td>{{ item.name }}</td>
+          <td class="td-class">
+            <div>{{ item.name }}</div>
+          </td>
           <td>{{ item.avgScore }}</td>
           <td>{{ item.maxScore }}</td>
           <td>{{ item.minScore }}</td>

+ 3 - 1
src/modules/mark/components/report/ReportCollege.vue

@@ -24,7 +24,9 @@
           <th>优秀率(%)</th>
         </tr>
         <tr v-for="(item, ind) in page.tables" :key="ind">
-          <td>{{ item.name }}</td>
+          <td class="td-college">
+            <div>{{ item.name }}</div>
+          </td>
           <td>{{ item.avgScore }}</td>
           <td>{{ item.maxScore }}</td>
           <td>{{ item.minScore }}</td>

+ 3 - 1
src/modules/mark/components/report/ReportQuestion.vue

@@ -18,7 +18,9 @@
           <th>满分率(%)</th>
         </tr>
         <tr v-for="(item, ind) in page.tables" :key="ind">
-          <td>{{ item.title }}</td>
+          <td class="td-question">
+            <div>{{ item.title }}</div>
+          </td>
           <td>{{ item.mainNumber }}</td>
           <td>{{ item.subNumber }}</td>
           <td>{{ item.score }}</td>

+ 6 - 2
src/modules/mark/components/report/ReportTeacher.vue

@@ -25,8 +25,12 @@
           <th>平均分</th>
         </tr>
         <tr v-for="(item, ind) in page.tables" :key="ind">
-          <td>{{ item.teacher }}</td>
-          <td>{{ item.className }}</td>
+          <td class="td-teacher">
+            <div>{{ item.teacher }}</div>
+          </td>
+          <td class="td-class">
+            <div>{{ item.className }}</div>
+          </td>
           <td>{{ item.maxScore }}</td>
           <td>{{ item.minScore }}</td>
           <td>{{ item.passCount }}</td>

+ 5 - 13
src/modules/mark/components/report/chart.js

@@ -90,11 +90,6 @@ export function getScoreBarOptions(dataObj) {
         axisLabel: {
           fontSize: 14,
           margin: 10,
-          formatter: function (value) {
-            let str = value.split("#");
-            if (str[0].length > 10) str[0] = str[0].substr(0, 10) + "...";
-            return [str[0], str[1]].join(" ");
-          },
         },
       },
     ],
@@ -209,9 +204,11 @@ export function getBarsOptions(dataObj) {
   };
 }
 export function getBarPointTopicOptions(dataObj) {
-  let yAxisLabels = dataObj.map(
-    (item) => `${item.title} ${item.mainNumber}-${item.subNumber}`
-  );
+  let yAxisLabels = dataObj.map((item) => {
+    const title =
+      item.title.length > 5 ? item.title.substr(0, 5) + "..." : item.title;
+    return `${title} ${item.mainNumber}-${item.subNumber}`;
+  });
   let avgDatas = dataObj.map((item) => item.avgScore);
   let scoreRateDatas = dataObj.map((item) => item.scoreRate / 100);
   let fullRateDatas = dataObj.map((item) => item.fullScoreRate / 100);
@@ -363,11 +360,6 @@ export function getBarPointTopicOptions(dataObj) {
         axisLabel: {
           fontSize: 14,
           margin: 10,
-          formatter: function (value) {
-            let str = value.split("#");
-            if (str[0].length > 8) str[0] = str[0].substr(0, 8) + "...";
-            return [str[0], str[1]].join(" ");
-          },
         },
       },
     ],

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/modules/mark/components/report/previewTemp.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است