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 @@ > -
题号 | +题型 | +满分值 | +班最高分 | +班最低分 | +班平均分 | +班级得分率 | +答案 | +选项1 | +选项2 | +选项3 | +选项4 | +未答 | +
---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ index + 1 }} | +{{ setSubPro(tr.questionType) }} | +{{ tr.sortable }} | +{{ tr.highestScore }} | +{{ tr.lowestScore }} | +{{ tr.avgScore }} | +{{ tr.classScoringRate }}% | ++ {{ + tr.correctAnswer == 1 + ? "✓" + : tr.correctAnswer == 2 + ? "✗" + : tr.correctAnswer + }} + | +
+ + {{ + tr.questionType == "5" + ? "" + : tr["option" + index] + ? `${tr["option" + index]}(${tr["persent" + index]})` + : "" + }} + + |
+