diff --git a/src/views/basic/ask/analysis.vue b/src/views/basic/ask/analysis.vue index a743ec9..dd2bc86 100644 --- a/src/views/basic/ask/analysis.vue +++ b/src/views/basic/ask/analysis.vue @@ -44,7 +44,7 @@ 导出 -
+

选择要导出的学生

导出全部 @@ -53,10 +53,18 @@
@@ -91,7 +99,8 @@ export default { diaDown: false, downType: 1, exportType: 1, - exportStudent: [] + exportStudent: [], + multipleSelection: [], }; }, created() { @@ -116,6 +125,7 @@ export default { this.id = JSON.parse(this.$route.query.id) this.status = this.$route.query.status ? this.$route.query.status : 0; this._QueryData(); + this._QueryDataQuestionRank(); this.types != 3 ? this.periodDetail() : ''; }, methods: { @@ -188,9 +198,7 @@ export default { ? this.$request.pPeriodQuestionReport : this.type == 2 ? this.$request.phaseAnswerReport : this.$request.phaseInteractiveReport; } else if (this.types == 3) { - this.type == 1 - ? this.$request.pPeriodQuestionReport - : this.type == 2 ? this.$request.pPhaseAnswerReport : this.$request.pPhaseInteractiveReport; + queryData = this.type == 2 ? this.$request.pPhaseAnswerReport : this.$request.pPhaseInteractiveReport; } } else { if (this.types == 1) { @@ -204,13 +212,9 @@ export default { ? this.$request.periodQuestionReport : this.type == 2 ? this.$request.phaseAnswerReport : this.$request.phaseInteractiveReport; } else if (this.types == 3) { - queryData = this.type == 1 - ? this.$request.periodQuestionReport - : this.type == 2 ? this.$request.cTPhaseAnswerReport : this.$request.cTPhaseInteractiveReport; + queryData = this.type == 2 ? this.$request.cTPhaseAnswerReport : this.$request.cTPhaseInteractiveReport; } } - - if (this.types == 1) { query.type = this.type } @@ -238,32 +242,24 @@ export default { let queryData; if (this.role == "ROLE_PERSONAL") { if (this.types == 1) { - queryData = this.type == 1 - ? this.$request.pPeriodQuestionReport - : this.$request.pPeriodStudentReport + queryData = this.$request.pPeriodStudentReport } else if (this.types == 2) { queryData = this.type == 1 - ? this.$request.pPeriodQuestionReport + ? this.$request.pPeriodStudentReport : this.type == 2 ? this.$request.phaseAnswerReport : this.$request.phaseInteractiveReport; } else if (this.types == 3) { - this.type == 1 - ? this.$request.pPeriodQuestionReport - : this.type == 2 ? this.$request.pPhaseAnswerReport : this.$request.pPhaseInteractiveReport; + this.type == 2 ? this.$request.pPhaseAnswerReport : this.$request.pPhaseInteractiveReport; } } else { if (this.types == 1) { - queryData = this.type == 1 - ? this.$request.periodQuestionReport - : this.$request.periodStudentReport + queryData = this.$request.periodStudentReport } else if (this.types == 2) { queryData = this.type == 1 - ? this.$request.periodQuestionReport + ? this.$request.periodStudentReport : this.type == 2 ? this.$request.phaseAnswerReport : this.$request.phaseInteractiveReport; } else if (this.types == 3) { - queryData = this.type == 1 - ? this.$request.periodQuestionReport - : this.type == 2 ? this.$request.cTPhaseAnswerReport : this.$request.cTPhaseInteractiveReport; + queryData = this.type == 2 ? this.$request.cTPhaseAnswerReport : this.$request.cTPhaseInteractiveReport; } } @@ -301,15 +297,33 @@ export default { changeDownType() { this.exportType = 1 }, - - //导出 - async exportData() { + handleSelectionChange(val) { + this.multipleSelection = val + }, + //导出 + async exportData(length) { if (this.exportLoading == true) return; this.exportLoading = true; let studentIds = [] + if (length) { + studentIds = this.exportStudent.slice(0, 10).map(item => { + return item.studentId + }) + } else { + studentIds = this.multipleSelection.map(item => { + return item.studentId + }) + } + let query = {}; + if (studentIds.length == this.exportStudent.length) { + query.studentIds = [] + } else if (studentIds.length > 0) { + query.studentIds = studentIds + } const data = await this.$request.exportPeriodReport({ // periodId: this.id, periodId: this.id[0], + ...query }); this.exportLoading = false; if (data) { @@ -377,7 +391,12 @@ div::-webkit-scrollbar-thumb { } } +:deep(.el-dialog__body) { + padding-top: 0; +} + .el-dialog { + .down-item { font-size: 15px; margin-bottom: 10px; @@ -387,6 +406,12 @@ div::-webkit-scrollbar-thumb { padding: 10px 0; } } + + .export-tit { + text-align: center; + font-size: 16px; + padding-bottom: 10px; + } } .dialog-footer { diff --git a/src/views/basic/ask/components/answerQustion.vue b/src/views/basic/ask/components/answerQustion.vue index 1bfd795..9e2792f 100644 --- a/src/views/basic/ask/components/answerQustion.vue +++ b/src/views/basic/ask/components/answerQustion.vue @@ -77,7 +77,7 @@ export default { let params = {}; if (this.types == 1) { - const detail = JSON.parse(item.detail); + const detail = item.detail ? JSON.parse(item.detail) : []; if (detail.length > optionsList.length) { optionsList = [...detail]; } diff --git a/src/views/basic/ask/list.vue b/src/views/basic/ask/list.vue index 7674135..9b706ff 100644 --- a/src/views/basic/ask/list.vue +++ b/src/views/basic/ask/list.vue @@ -16,7 +16,7 @@

查看汇总报表

-