From 82235092cdc57396bf242d9b2122588083a3268e Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Tue, 27 Feb 2024 16:50:26 +0800 Subject: [PATCH] 导入或者修改答案没有答案报错,修改答案题目类型调整 --- src/views/basic/ask/index.vue | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------- src/views/basic/test/index.vue | 2 +- src/views/examinationPaper/addQs.vue | 13 +++++++------ src/views/examinationPaper/edit.vue | 275 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------- 4 files changed, 256 insertions(+), 179 deletions(-) diff --git a/src/views/basic/ask/index.vue b/src/views/basic/ask/index.vue index 6c3ba87..2f1545c 100644 --- a/src/views/basic/ask/index.vue +++ b/src/views/basic/ask/index.vue @@ -8,41 +8,93 @@
班级: - - + +
-
+
科目:

- 全选 + 全选

- - {{ item - }} + + {{ item }}

+
+ 科目: +
+

+ + {{ item }} + +

+
+
日期:
- + ~ - +

- 本周 - 本月 - 本季度 + 本周 + 本月 + 本季度

@@ -72,8 +124,8 @@ export default { classList: [], //班级 subjectList: [], //科目 - isIndeterminate: true,//全选样式 - allSubject: false,//全选状态 + isIndeterminate: true, //全选样式 + allSubject: false, //全选状态 }; }, async created() { @@ -101,10 +153,11 @@ export default { this.query.subjectNames = val ? this.subjectList : []; }, handleChecked(value) { - console.log(value) + console.log(value); let checkedCount = value.length; this.allSubject = checkedCount === this.subjectList.length; - this.isIndeterminate = checkedCount > 0 && checkedCount < this.subjectList.length; + this.isIndeterminate = + checkedCount > 0 && checkedCount < this.subjectList.length; }, setDate(index) { const that = this; @@ -168,18 +221,18 @@ export default { }, async changeclass() { - this.allSubject = false - this.query.subjectNames = [] + this.allSubject = false; + this.query.subjectNames = []; await this._QuerySubjectList(); }, async _QueryClassList() { const fetchClassList = this.role == "ROLE_BANZHUREN" - ? this.$request.cTClassList : - this.role == "ROLE_PERSONAL" - ? this.$request.pClassList - : this.$request.tClassList; + ? this.$request.cTClassList + : this.role == "ROLE_PERSONAL" + ? this.$request.pClassList + : this.$request.tClassList; const { data, status, info } = await fetchClassList(); if (status === 0) { this.classList = data.list.map((item) => { @@ -196,10 +249,10 @@ export default { async _QuerySubjectList() { const fetchSubjectList = this.role == "ROLE_BANZHUREN" - ? this.$request.cTSubjectList : - this.role == "ROLE_PERSONAL" - ? this.$request.pSubjectList - : this.$request.tSubjectList; + ? this.$request.cTSubjectList + : this.role == "ROLE_PERSONAL" + ? this.$request.pSubjectList + : this.$request.tSubjectList; const { data, status, info } = await fetchSubjectList({ classId: this.query.classId, @@ -207,9 +260,11 @@ export default { if (status === 0) { this.subjectList = data.subjectNames || []; if (this.role == "ROLE_BANZHUREN") { - this.query.subjectNames = this.subjectList + this.query.subjectNames = this.subjectList; } else { - this.subjectList.length ? this.query.subjectNames.push(this.subjectList[0]) : ""; + this.subjectList.length + ? (this.query.subjectNames = this.subjectList[0]) + : ""; } } else { this.$message.error(info); @@ -219,29 +274,29 @@ export default { //回主页 goHome() { this.$router.push({ - path: '/index' - }) + path: "/index", + }); }, //去列表 goList() { let className; - this.classList.map(item => { + this.classList.map((item) => { if (item.value == this.query.classId) { - className = item.label + className = item.label; } - }) - if(this.query.subjectNames.length == 0){ - this.$message.warning("请选择科目!") - return + }); + if (this.query.subjectNames.length == 0) { + this.$message.warning("请选择科目!"); + return; } this.$router.push({ - path: '/askList', + path: "/askList", query: { className: className, - params: JSON.stringify(this.query) - } - }) - } + params: JSON.stringify(this.query), + }, + }); + }, }, }; @@ -259,7 +314,7 @@ div::-webkit-scrollbar-thumb {