Commit 109a6161ea4a0b81f08f94bf0db66756c07c8c5b
1 parent
f2143fa8
班主任汇总选择问题
Showing
4 changed files
with
67 additions
and
38 deletions
src/views/basic/ask/analysis.vue
@@ -134,9 +134,9 @@ export default { | @@ -134,9 +134,9 @@ export default { | ||
134 | this.$store.getters.info.showRole || | 134 | this.$store.getters.info.showRole || |
135 | this.$store.getters.info.permissions[0].role; | 135 | this.$store.getters.info.permissions[0].role; |
136 | this.types = Number(this.$route.query.types); | 136 | this.types = Number(this.$route.query.types); |
137 | - this.className = this.$route.query.className; | 137 | + // this.className = this.$route.query.className; |
138 | const queryData = JSON.parse(this.$route.query.params); | 138 | const queryData = JSON.parse(this.$route.query.params); |
139 | - this.classId = queryData.classId; | 139 | + this.classId = this.$route.query.classId; |
140 | console.log(this.$route.query); | 140 | console.log(this.$route.query); |
141 | this.subjectNames = this.$route.query.subjectNames.split(","); | 141 | this.subjectNames = this.$route.query.subjectNames.split(","); |
142 | if (this.types == 1) { | 142 | if (this.types == 1) { |
@@ -163,7 +163,8 @@ export default { | @@ -163,7 +163,8 @@ export default { | ||
163 | this.status = this.$route.query.status ? this.$route.query.status : 0; | 163 | this.status = this.$route.query.status ? this.$route.query.status : 0; |
164 | this._QueryData(); | 164 | this._QueryData(); |
165 | this.types != 1 ? this._QueryDataQuestionRank() : ""; | 165 | this.types != 1 ? this._QueryDataQuestionRank() : ""; |
166 | - this.types != 3 ? this.periodDetail() : ""; | 166 | + // this.types != 3 ? this.periodDetail() : ""; |
167 | + this.periodDetail(); | ||
167 | }, | 168 | }, |
168 | methods: { | 169 | methods: { |
169 | print() { | 170 | print() { |
@@ -215,6 +216,7 @@ export default { | @@ -215,6 +216,7 @@ export default { | ||
215 | periodIds: this.id, | 216 | periodIds: this.id, |
216 | }); | 217 | }); |
217 | if (status == 0) { | 218 | if (status == 0) { |
219 | + this.className = data.className || ""; | ||
218 | this.detail = { ...data }; | 220 | this.detail = { ...data }; |
219 | this.detail.duration = this.detail.duration | 221 | this.detail.duration = this.detail.duration |
220 | ? (this.detail.duration / 60).toFixed(2) | 222 | ? (this.detail.duration / 60).toFixed(2) |
src/views/basic/ask/components/detail.vue
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | 已答总正确率:{{ detail.answerCorrectRate }}% | 38 | 已答总正确率:{{ detail.answerCorrectRate }}% |
39 | </li> | 39 | </li> |
40 | <li class="info-item"> | 40 | <li class="info-item"> |
41 | - 总参与度::{{ detail.participationRate }}% | 41 | + 总参与度:{{ detail.participationRate }}% |
42 | </li> | 42 | </li> |
43 | 43 | ||
44 | </ul> | 44 | </ul> |
src/views/basic/ask/list.vue
@@ -174,6 +174,7 @@ export default { | @@ -174,6 +174,7 @@ export default { | ||
174 | }, | 174 | }, |
175 | tableData: [], | 175 | tableData: [], |
176 | multipleSelection: [], | 176 | multipleSelection: [], |
177 | + multipleSelectionObj: {}, | ||
177 | page: 1, | 178 | page: 1, |
178 | size: 20, | 179 | size: 20, |
179 | total: 0, | 180 | total: 0, |
@@ -196,6 +197,14 @@ export default { | @@ -196,6 +197,14 @@ export default { | ||
196 | this.init(); | 197 | this.init(); |
197 | } | 198 | } |
198 | }, | 199 | }, |
200 | + multipleSelection: { | ||
201 | + handler: function (nVal) { | ||
202 | + this.multipleSelectionObj[this.page] = this.tableData.filter((item) => | ||
203 | + nVal.includes(item.id) | ||
204 | + ); | ||
205 | + }, | ||
206 | + deep: true, | ||
207 | + }, | ||
199 | }, | 208 | }, |
200 | methods: { | 209 | methods: { |
201 | //初始化 | 210 | //初始化 |
@@ -225,19 +234,17 @@ export default { | @@ -225,19 +234,17 @@ export default { | ||
225 | // 班主任教学班不能与行政班汇总 | 234 | // 班主任教学班不能与行政班汇总 |
226 | checkboxDisabled(obj) { | 235 | checkboxDisabled(obj) { |
227 | if (this.role == "ROLE_BANZHUREN") { | 236 | if (this.role == "ROLE_BANZHUREN") { |
228 | - let id = this.multipleSelection[0] || ""; | ||
229 | - if (id) { | ||
230 | - let classId; | ||
231 | - for (let i = 0; i < this.tableData.length; i++) { | ||
232 | - if (this.tableData[i].id == id) { | ||
233 | - classId = this.tableData[i].classId; | ||
234 | - break; | ||
235 | - } | ||
236 | - } | 237 | + let classId = |
238 | + (this.multipleSelectionObj[1] && | ||
239 | + this.multipleSelectionObj[1][0]?.classId) || | ||
240 | + ""; | ||
241 | + if (classId) { | ||
237 | return obj.classId == classId ? false : true; | 242 | return obj.classId == classId ? false : true; |
238 | } else { | 243 | } else { |
239 | return false; | 244 | return false; |
240 | } | 245 | } |
246 | + } else { | ||
247 | + return false; | ||
241 | } | 248 | } |
242 | }, | 249 | }, |
243 | //去详情 | 250 | //去详情 |
@@ -260,28 +267,51 @@ export default { | @@ -260,28 +267,51 @@ export default { | ||
260 | return; | 267 | return; |
261 | } | 268 | } |
262 | let subjectArr = []; | 269 | let subjectArr = []; |
263 | - this.tableData.map((item) => { | 270 | + let classId = ""; |
271 | + let multipleData = []; | ||
272 | + let multipleSelectionData = []; | ||
273 | + Object.keys(this.multipleSelectionObj).map((keys) => { | ||
274 | + multipleSelectionData = multipleSelectionData.concat( | ||
275 | + this.multipleSelectionObj[keys] | ||
276 | + ); | ||
277 | + }); | ||
278 | + multipleSelectionData.map((item) => { | ||
264 | if (this.multipleSelection.includes(item.id)) { | 279 | if (this.multipleSelection.includes(item.id)) { |
265 | subjectArr.push(item.subjectName); | 280 | subjectArr.push(item.subjectName); |
281 | + multipleData.push(item); | ||
282 | + classId = item.classId; | ||
266 | } | 283 | } |
267 | }); | 284 | }); |
268 | subjectArr = [...new Set(subjectArr)]; | 285 | subjectArr = [...new Set(subjectArr)]; |
269 | - this.$router.push({ | ||
270 | - path: "/askAnalysis", | ||
271 | - query: { | ||
272 | - id: JSON.stringify(this.multipleSelection), | ||
273 | - types: | ||
274 | - this.multipleSelection.length == 1 | ||
275 | - ? 1 | ||
276 | - : subjectArr.length == 1 | ||
277 | - ? 2 | ||
278 | - : 3, | ||
279 | - subjectNames: subjectArr.join(","), | ||
280 | - params: this.$route.query.params, | ||
281 | - className: this.$route.query.className, | ||
282 | - }, | ||
283 | - }); | 286 | + if (this.multipleSelection.length == 1) { |
287 | + this.$router.push({ | ||
288 | + path: "/askAnalysis", | ||
289 | + query: { | ||
290 | + id: JSON.stringify(this.multipleSelection), | ||
291 | + types: 1, | ||
292 | + subjectNames: subjectArr[0], | ||
293 | + params: this.$route.query.params, | ||
294 | + }, | ||
295 | + }); | ||
296 | + } else { | ||
297 | + this.$router.push({ | ||
298 | + path: "/askAnalysis", | ||
299 | + query: { | ||
300 | + id: JSON.stringify(this.multipleSelection), | ||
301 | + types: | ||
302 | + this.multipleSelection.length == 1 | ||
303 | + ? 1 | ||
304 | + : subjectArr.length == 1 | ||
305 | + ? 2 | ||
306 | + : 3, | ||
307 | + subjectNames: subjectArr.join(","), | ||
308 | + params: this.$route.query.params, | ||
309 | + classId: classId, | ||
310 | + }, | ||
311 | + }); | ||
312 | + } | ||
284 | }, | 313 | }, |
314 | + | ||
285 | //删除 | 315 | //删除 |
286 | async remove(obj) { | 316 | async remove(obj) { |
287 | const { data, status, info } = await this.$request.deletePaperReport({ | 317 | const { data, status, info } = await this.$request.deletePaperReport({ |
src/views/basic/test/list.vue
@@ -391,15 +391,11 @@ export default { | @@ -391,15 +391,11 @@ export default { | ||
391 | checkboxDisabled(obj) { | 391 | checkboxDisabled(obj) { |
392 | if (obj.examStartTime) { | 392 | if (obj.examStartTime) { |
393 | if (this.role == "ROLE_BANZHUREN") { | 393 | if (this.role == "ROLE_BANZHUREN") { |
394 | - let id = this.multipleSelection[0] || ""; | ||
395 | - if (id) { | ||
396 | - let classId; | ||
397 | - for (let i = 0; i < this.tableData.length; i++) { | ||
398 | - if (this.tableData[i].id == id) { | ||
399 | - classId = this.tableData[i].classId; | ||
400 | - break; | ||
401 | - } | ||
402 | - } | 394 | + let classId = |
395 | + (this.multipleSelectionObj[1] && | ||
396 | + this.multipleSelectionObj[1][0]?.classId) || | ||
397 | + ""; | ||
398 | + if (classId) { | ||
403 | return obj.classId == classId ? false : true; | 399 | return obj.classId == classId ? false : true; |
404 | } else { | 400 | } else { |
405 | return false; | 401 | return false; |
@@ -493,6 +489,7 @@ export default { | @@ -493,6 +489,7 @@ export default { | ||
493 | if (this.query.classId?.length > 1) { | 489 | if (this.query.classId?.length > 1) { |
494 | pageSize = 9999; | 490 | pageSize = 9999; |
495 | } | 491 | } |
492 | + this.tableData = []; | ||
496 | const examReportList = | 493 | const examReportList = |
497 | this.role == "ROLE_PERSONAL" | 494 | this.role == "ROLE_PERSONAL" |
498 | ? this.$request.pExamReportList | 495 | ? this.$request.pExamReportList |