已考试卷信息
@@ -552,7 +550,12 @@ >
@@ -681,6 +684,7 @@ export default { total: 0, multipleSelection: [], //选中的试卷ID classTable: [], //多班级数据 + classAll: false, //搜索条件多班全选 }; }, computed: { @@ -731,6 +735,17 @@ export default { }); }, methods: { + //搜索条件多班全选 + selectAll(val) { + this.query.classIds = []; + if (val) { + this.classList.forEach((item) => { + this.query.classIds.push(item.value); + }); + } else { + this.query.classIds.push(this.classList[0].value); + } + }, // 多班级选择同一试卷 checkboxDisabled(obj) { let id = this.multipleSelection[0] || ""; @@ -943,7 +958,12 @@ export default { this._QueryData(); }, //切换班级 - async changeclass() { + async changeclass(list) { + if (list.length == this.classList.length) { + this.classAll = true; + } else { + this.classAll = false; + } if (this.query.classIds.length == 0) { this.$message.warning("请至少选择一个班级!"); } @@ -1078,11 +1098,11 @@ export default { if (!query.classId) { //多班级 this.classTable = []; - let classIds = [] + let classIds = []; let tableData = []; data?.list?.map((item) => { - if(!classIds.includes(item.classId)){ - classIds.push(item.classId) + if (!classIds.includes(item.classId)) { + classIds.push(item.classId); } let idx = classIds.indexOf(item.classId); if (tableData[idx]) { @@ -1377,4 +1397,7 @@ div::-webkit-scrollbar-thumb { background: transparent; } } +.select-all { + padding-left: 16px; +} \ No newline at end of file