From 3ac930bd4754ff163e40570720aecff95fc3818b Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Fri, 15 Dec 2023 16:10:40 +0800 Subject: [PATCH] 低分设置 --- src/views/basic/test/analysis.vue | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 148 insertions(+), 12 deletions(-) diff --git a/src/views/basic/test/analysis.vue b/src/views/basic/test/analysis.vue index bc84cc3..1f471d1 100644 --- a/src/views/basic/test/analysis.vue +++ b/src/views/basic/test/analysis.vue @@ -27,14 +27,24 @@
-
- {{ item }} +
+ {{ item }} +
+ 设置低分值
- + @@ -468,18 +532,20 @@ export default { data() { return { role: "", - status: 0, + status: 0,// 1:已归档试卷 tableMaxHeight: 600, loading: false, exportLoading: false, diaUp: false, url: "/api_html/teaching/importSubjectiveScore", id: "", + classId: "", + subjectName: "", title: "", score: "", tabList: ["试题分析", "成绩排名", "小题分报表", "作答明细表"], type: 0, - paperModifyLog: { + paperModifyLog: { //修改信息 realName: "", modifiedTime: "", }, @@ -507,6 +573,17 @@ export default { page: 1, size: 20, total: 0, + // 设置低分值 + loadingTange: false, + diaMinScore: false, + lowRange: { + type: 0, + range: [60, 0], + }, + defaultLowRange: { + type: 0, + range: [], + }, }; }, created() { @@ -516,6 +593,8 @@ export default { this.id = this.$route.query.id; this.status = this.$route.query.status ? this.$route.query.status : 0; this.title = this.$route.query.title || ""; + this.classId = this.$route.query.classId || ""; + this.subjectName = this.$route.query.subjectName || ""; this._QueryData(); }, methods: { @@ -569,6 +648,42 @@ export default { this.page = page; this.examQuestionReport(); }, + // 切换低分设置类型设置默认分值 + changeScore() { + this.lowRange.range = [...this.defaultLowRange.range]; + }, + // 禁止输入负数 + keydownRange(event) { + if (event.key == "-" || event.key == "e") { + event.returnValue = ""; + } + }, + // 关闭低分设置 + closeDiaMinScore() { + this.lowRange.type = this.defaultLowRange.type; + this.lowRange.range = [...this.defaultLowRange.range]; + }, + // 保存低分设置 + async _SavelowRange() { + if(this.lowRange.range[0].trim() == "" || this.lowRange.range[1].trim() == ""){ + this.$message.warning("请补全低分设置!"); + return + } + this.loadingTange = true; + let { data, status, info } = await this.$request.setLowRange({ + classId: this.classId, + subjectName: this.subjectName, + ...this.lowRange, + }); + this.loadingTange = false; + if (status === 0) { + this.$message.success(info); + this.diaMinScore = false; + this.examDetail(); + } else { + this.$message.error(info); + } + }, async _QueryData() { this.examDetail(); this.examStudentReport(); @@ -586,6 +701,12 @@ export default { this.paperModifyLog = { ...data?.paperModifyLog }; } this.examReport = { ...data?.examReport }; + this.defaultLowRange = data.lowRange || { + type: 1, + range: [60, 0], + }; + this.lowRange.type = this.defaultLowRange.type; + this.lowRange.range = [...this.defaultLowRange.range]; } else { this.$message.error(info); } @@ -625,7 +746,7 @@ export default { detail.map((items, index) => { params["que" + items.id] = items.id; params["score" + items.id] = String(items.score).includes(".") - ? Number(items.score).toFixed(2) + ? Number(items.score) : items.score; params["answer" + items.id] = items.answer == 1 ? "✓" : items.answer == 2 ? "✗" : items.answer; @@ -875,4 +996,19 @@ div::-webkit-scrollbar-thumb { } } } + +// 设置低分值 +.content-header { + width: 100%; + position: relative; + .setMinScore { + position: absolute; + bottom: 0; + right: 0px; + } +} +.score-ipt { + width: 80px; + margin: 0 5px; +} \ No newline at end of file -- libgit2 0.21.4