From 24f4b2483df746ac21777fd7b50224d0355e65ab Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Thu, 27 Apr 2023 10:18:32 +0800 Subject: [PATCH] 单卷试题分析打印样式 --- src/utils/index.js | 18 +++++++++++------- src/views/standard/test/analysis.vue | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------ 2 files changed, 118 insertions(+), 49 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 0e160f6..2d6e653 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -746,7 +746,7 @@ export function formatGradeNameClass(data) { return gradeNameArr; } -export function tablePrint(id, title) { +export function tablePrint(id, title, type = null) { let divs = document.getElementById(id); let awin = window.open("", "_blank"); awin.document.getElementsByTagName( @@ -773,8 +773,7 @@ export function tablePrint(id, title) { .el-table__cell.gutter{display:none} ul,li{margin:0;padding:0;list-style:none} .hui-box{display: flex;text-align: center;} - .hui-box .s-txt{width: 60px;line-height: 144px;background: #ccc;font-size: 16px;color: #fff;font-weight: 700;border:1px solid #ccc;box-sizing:border-box} - .hui-ul{border-top: 1px solid #ccc;} + .hui-box .s-txt{width: 61px;line-height: 144px;background: #ccc;font-size: 16px;color: #fff;font-weight: 700;border:1px solid #ccc;box-sizing:border-box} .hui-li{display: flex;} .hui-s{height: 48px;line-height: 48px;border-right: 1px solid #ccc;border-bottom: 1px solid #ccc;box-sizing: border-box;} .hui-s.s1{width: 100px;} @@ -783,12 +782,17 @@ export function tablePrint(id, title) { .info { display: flex;flex-wrap: wrap;border-left: 1px solid #ccc;border-top: 1px solid #ccc;margin-bottom: 12px;} .info-item {width: 25%;height: 50px;box-sizing: border-box;flex-shrink: 0;background: #f8f8f8;border-right: 1px solid #ccc;border-bottom: 1px solid #ccc;line-height: 50px;text-align: center;} .el-table__header,.el-table__body{width:100%!important;} + #print-table{max-width:1400px;margin: 0 auto;width: 100%;} + .hide{max-width:1400px;margin: 0 auto;width: 100%;border-left: 1px solid #ccc;border-spacing:0;box-sizing:border-box} + .hide thead th{background:#ccc;line-height: 48px;border-right: 1px solid #ccc;box-sizing:border-box} + .hide tbody tr td{line-height: 48px;border-right: 1px solid #ccc;text-align:center;box-sizing:border-box} + .hide td{border-bottom: 1px solid #ccc;} `; let aDom = divs.cloneNode(true); - let aTbody = aDom - .getElementsByClassName("el-table__body")[0] - .getElementsByTagName("tbody")[0]; - aDom.getElementsByClassName("el-table__header")[0].append(aTbody); + if (!type) { + let aTbody = aDom.getElementsByClassName("el-table__body")[0]?.getElementsByTagName("tbody")[0]; + aDom.getElementsByClassName("el-table__header")[0].append(aTbody); + } if (title) { let pTit = awin.document.createElement('p') pTit.className = "tit" diff --git a/src/views/standard/test/analysis.vue b/src/views/standard/test/analysis.vue index f977653..a8ff20d 100644 --- a/src/views/standard/test/analysis.vue +++ b/src/views/standard/test/analysis.vue @@ -5,7 +5,7 @@ 单卷分析 -
+

{{ @@ -131,46 +131,104 @@ > -

- 汇总 -
    -
  • - 主观题 - {{ examReport.subjectiveScore }} - {{ - examReport.subjectiveHighestScore - }} - {{ - examReport.subjectiveLowestScore - }} - {{ examReport.subjectiveAvgScore }} - {{ examReport.subjectiveClassScoringRate }}% -
  • -
  • - 客观题 - {{ examReport.objectiveScore }} - {{ - examReport.objectiveHighestScore - }} - {{ - examReport.objectiveLowestScore - }} - {{ examReport.objectiveAvgScore }} - {{ examReport.objectiveClassScoringRate }}% -
  • -
  • - 整卷 - {{ examReport.examPaperScore }} - {{ examReport.highestScore }} - {{ examReport.lowestScore }} - {{ examReport.avgScore }} - {{ examReport.classScoringRate }}% -
  • -
+