Commit 503b606383864d69ad7d131c3b0fa348e655eb73
1 parent
236b1f0e
判断题答案选项
Showing
9 changed files
with
162 additions
and
62 deletions
src/api/apis/apis.js
| @@ -74,6 +74,33 @@ export default { | @@ -74,6 +74,33 @@ export default { | ||
| 74 | data, | 74 | data, |
| 75 | }); | 75 | }); |
| 76 | }, | 76 | }, |
| 77 | + //班主任-导出阶段问答报表 | ||
| 78 | + cTExportPhaseAnswerReport(data) { | ||
| 79 | + return service({ | ||
| 80 | + url: setUpUrls.cTExportPhaseAnswerReport, | ||
| 81 | + method: "POST", | ||
| 82 | + data, | ||
| 83 | + responseType: 'arraybuffer', | ||
| 84 | + }); | ||
| 85 | + }, | ||
| 86 | + //班主任-导出阶段互动报表 | ||
| 87 | + cTExportPhaseInteractiveReport(data) { | ||
| 88 | + return service({ | ||
| 89 | + url: setUpUrls.cTExportPhaseInteractiveReport, | ||
| 90 | + method: "POST", | ||
| 91 | + data, | ||
| 92 | + responseType: 'arraybuffer', | ||
| 93 | + }); | ||
| 94 | + }, | ||
| 95 | + //班主任-导出阶段测练报表 | ||
| 96 | + cTExportPhaseExamReport(data) { | ||
| 97 | + return service({ | ||
| 98 | + url: setUpUrls.cTExportPhaseExamReport, | ||
| 99 | + method: "POST", | ||
| 100 | + data, | ||
| 101 | + responseType: 'arraybuffer', | ||
| 102 | + }); | ||
| 103 | + }, | ||
| 77 | 104 | ||
| 78 | //任课老师-查询管理的班级 | 105 | //任课老师-查询管理的班级 |
| 79 | tClassList(data) { | 106 | tClassList(data) { |
src/api/urls/apis.js
| @@ -18,6 +18,12 @@ export default { | @@ -18,6 +18,12 @@ export default { | ||
| 18 | cTPhaseInteractiveReport: "/api_html/class/manager/phaseInteractiveReport", | 18 | cTPhaseInteractiveReport: "/api_html/class/manager/phaseInteractiveReport", |
| 19 | //班主任-查询阶段测练报表 | 19 | //班主任-查询阶段测练报表 |
| 20 | cTPhaseExamReport: "/api_html/class/manager/phaseExamReport", | 20 | cTPhaseExamReport: "/api_html/class/manager/phaseExamReport", |
| 21 | + //班主任-导出阶段问答报表 | ||
| 22 | + cTExportPhaseAnswerReport: "/api_html/class/manager/exportPhaseAnswerReport", | ||
| 23 | + //班主任- 导出阶段互动报表 | ||
| 24 | + cTExportPhaseInteractiveReport: "/api_html/class/manager/exportPhaseInteractiveReport", | ||
| 25 | + //班主任- 导出阶段测练报表 | ||
| 26 | + cTExportPhaseExamReport: "/api_html/class/manager/exportPhaseExamReport", | ||
| 21 | 27 | ||
| 22 | //任课老师-查询管理班级 | 28 | //任课老师-查询管理班级 |
| 23 | tClassList: "/api_html/teaching/classList", | 29 | tClassList: "/api_html/teaching/classList", |
src/views/ask/analysis.vue
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | 已答总正确率:{{ detail.answerCorrectRate }}% | 50 | 已答总正确率:{{ detail.answerCorrectRate }}% |
| 51 | </li> | 51 | </li> |
| 52 | <li class="info-item"> | 52 | <li class="info-item"> |
| 53 | - 反馈时长:{{ detail.consumingDuration }}分钟 | 53 | + 反馈时长:{{ setDuration(detail.consumingDuration) }} |
| 54 | </li> | 54 | </li> |
| 55 | </ul> | 55 | </ul> |
| 56 | <el-table v-if="type == 1" :data="tableData" border style="width: 100%"> | 56 | <el-table v-if="type == 1" :data="tableData" border style="width: 100%"> |
| @@ -333,9 +333,22 @@ export default { | @@ -333,9 +333,22 @@ export default { | ||
| 333 | this._QueryData(); | 333 | this._QueryData(); |
| 334 | }, | 334 | }, |
| 335 | setDuration(times){ | 335 | setDuration(times){ |
| 336 | - let m = parseInt(times/60) | ||
| 337 | - let s = times%60 | ||
| 338 | - return `${m}分${s}秒` | 336 | + let m = parseInt(times/1000 / 60) |
| 337 | + let s = parseInt((times/1000)%60) | ||
| 338 | + let ms = times | ||
| 339 | + let aTime; | ||
| 340 | + if(times==0){ | ||
| 341 | + aTime = `0分钟` | ||
| 342 | + }else{ | ||
| 343 | + if(m==0&&s==0){ | ||
| 344 | + aTime = `${ms}毫秒` | ||
| 345 | + }else if(m==0&&s!=0){ | ||
| 346 | + aTime = `${s}秒` | ||
| 347 | + }else if(m!=0&&s!=0){ | ||
| 348 | + aTime = `${m}分${s}秒` | ||
| 349 | + } | ||
| 350 | + } | ||
| 351 | + return aTime | ||
| 339 | }, | 352 | }, |
| 340 | setSubPro(type) { | 353 | setSubPro(type) { |
| 341 | let tit; | 354 | let tit; |
src/views/ask/index.vue
| @@ -93,9 +93,7 @@ | @@ -93,9 +93,7 @@ | ||
| 93 | @change="tabChange" | 93 | @change="tabChange" |
| 94 | style="margin-bottom: 20px" | 94 | style="margin-bottom: 20px" |
| 95 | > | 95 | > |
| 96 | - <el-radio-button :label="1" | ||
| 97 | - >单课时报表</el-radio-button | ||
| 98 | - > | 96 | + <el-radio-button :label="1">单课时报表</el-radio-button> |
| 99 | <!-- <el-radio-button :label="2" v-if="this.role != 'ROLE_BANZHUREN'" | 97 | <!-- <el-radio-button :label="2" v-if="this.role != 'ROLE_BANZHUREN'" |
| 100 | >阶段问答报表</el-radio-button | 98 | >阶段问答报表</el-radio-button |
| 101 | > --> | 99 | > --> |
| @@ -439,7 +437,10 @@ | @@ -439,7 +437,10 @@ | ||
| 439 | > | 437 | > |
| 440 | </el-pagination> | 438 | </el-pagination> |
| 441 | </div> | 439 | </div> |
| 442 | - <p class="down" v-if="(tabIndex == 3 || tabIndex == 2) && tableData.length"> | 440 | + <p |
| 441 | + class="down" | ||
| 442 | + v-if="(tabIndex == 3 || tabIndex == 2) && tableData.length" | ||
| 443 | + > | ||
| 443 | <el-button | 444 | <el-button |
| 444 | @click="exportData" | 445 | @click="exportData" |
| 445 | type="primary" | 446 | type="primary" |
| @@ -544,7 +545,7 @@ export default { | @@ -544,7 +545,7 @@ export default { | ||
| 544 | that.query.day = formatDate(new Date(), "yyyy-MM-dd"); | 545 | that.query.day = formatDate(new Date(), "yyyy-MM-dd"); |
| 545 | that.query.startDay = that.query.day; | 546 | that.query.startDay = that.query.day; |
| 546 | that.query.endDay = that.query.day; | 547 | that.query.endDay = that.query.day; |
| 547 | - that.tabIndex = 1 | 548 | + that.tabIndex = 1; |
| 548 | break; | 549 | break; |
| 549 | case 2: | 550 | case 2: |
| 550 | let day = new Date().getDay(); | 551 | let day = new Date().getDay(); |
| @@ -644,10 +645,10 @@ export default { | @@ -644,10 +645,10 @@ export default { | ||
| 644 | this.page = page; | 645 | this.page = page; |
| 645 | this._QueryData(); | 646 | this._QueryData(); |
| 646 | }, | 647 | }, |
| 647 | - async changeclass(){ | ||
| 648 | - await this._QuerySubjectList() | ||
| 649 | - this.page = 1 | ||
| 650 | - this._QueryData() | 648 | + async changeclass() { |
| 649 | + await this._QuerySubjectList(); | ||
| 650 | + this.page = 1; | ||
| 651 | + this._QueryData(); | ||
| 651 | }, | 652 | }, |
| 652 | async changClazz() { | 653 | async changClazz() { |
| 653 | await this._QuerySubjectList(); | 654 | await this._QuerySubjectList(); |
| @@ -936,10 +937,18 @@ export default { | @@ -936,10 +937,18 @@ export default { | ||
| 936 | } | 937 | } |
| 937 | } | 938 | } |
| 938 | this.exportLoading = true; | 939 | this.exportLoading = true; |
| 939 | - const exportData = | ||
| 940 | - this.tabIndex == 2 | ||
| 941 | - ? this.$request.exportPhaseAnswerReport | ||
| 942 | - : this.$request.exportPhaseInteractiveReport; | 940 | + let exportData; |
| 941 | + if (this.role == "ROLE_BANZHUREN") { | ||
| 942 | + exportData = | ||
| 943 | + this.tabIndex == 2 | ||
| 944 | + ? this.$request.cTExportPhaseAnswerReport | ||
| 945 | + : this.$request.cTExportPhaseInteractiveReport; | ||
| 946 | + } else { | ||
| 947 | + exportData = | ||
| 948 | + this.tabIndex == 2 | ||
| 949 | + ? this.$request.exportPhaseAnswerReport | ||
| 950 | + : this.$request.exportPhaseInteractiveReport; | ||
| 951 | + } | ||
| 943 | const data = await exportData({ ...query }); | 952 | const data = await exportData({ ...query }); |
| 944 | this.exportLoading = false; | 953 | this.exportLoading = false; |
| 945 | if (data) { | 954 | if (data) { |
src/views/dataSync/index.vue
| @@ -31,9 +31,7 @@ | @@ -31,9 +31,7 @@ | ||
| 31 | 31 | ||
| 32 | <div class="down-item"> | 32 | <div class="down-item"> |
| 33 | <p class="h-title">数据导出至U盘</p> | 33 | <p class="h-title">数据导出至U盘</p> |
| 34 | - <p class="txt"> | ||
| 35 | - 本功能将云平台的数据导出到U盘。 | ||
| 36 | - </p> | 34 | + <p class="txt">本功能将云平台的数据导出到U盘。</p> |
| 37 | <div class="btn-box btn-box2" v-loading="downLoading"> | 35 | <div class="btn-box btn-box2" v-loading="downLoading"> |
| 38 | <i class="fa fa-cloud-download" @click="downloadFile"></i> | 36 | <i class="fa fa-cloud-download" @click="downloadFile"></i> |
| 39 | <el-button type="primary" round @click="downloadFile" | 37 | <el-button type="primary" round @click="downloadFile" |
| @@ -42,6 +40,19 @@ | @@ -42,6 +40,19 @@ | ||
| 42 | </div> | 40 | </div> |
| 43 | </div> | 41 | </div> |
| 44 | </div> | 42 | </div> |
| 43 | + <el-dialog title="" :visible.sync="dialogVisible" width="300" center> | ||
| 44 | + <el-result icon="success" title="上传成功"> </el-result> | ||
| 45 | + <el-descriptions title="" :column="1"> | ||
| 46 | + <el-descriptions-item label="导入答题卡数量">{{tipData.paperNum}}</el-descriptions-item> | ||
| 47 | + <el-descriptions-item label="导入随堂问报表数量">{{tipData.periodNum}}</el-descriptions-item> | ||
| 48 | + <el-descriptions-item label="导入即时测报表数量">{{tipData.examNum}}</el-descriptions-item> | ||
| 49 | + </el-descriptions> | ||
| 50 | + <span slot="footer" class="dialog-footer"> | ||
| 51 | + <el-button type="primary" @click="dialogVisible = false" | ||
| 52 | + >确 定</el-button | ||
| 53 | + > | ||
| 54 | + </span> | ||
| 55 | + </el-dialog> | ||
| 45 | </div> | 56 | </div> |
| 46 | </template> | 57 | </template> |
| 47 | 58 | ||
| @@ -53,6 +64,12 @@ export default { | @@ -53,6 +64,12 @@ export default { | ||
| 53 | downLoading: false, | 64 | downLoading: false, |
| 54 | url: "/api_html/teaching/importData", | 65 | url: "/api_html/teaching/importData", |
| 55 | file: {}, | 66 | file: {}, |
| 67 | + dialogVisible: false, | ||
| 68 | + tipData: { | ||
| 69 | + paperNum: 0, | ||
| 70 | + periodNum: 0, | ||
| 71 | + examNum: 0, | ||
| 72 | + }, | ||
| 56 | }; | 73 | }; |
| 57 | }, | 74 | }, |
| 58 | methods: { | 75 | methods: { |
| @@ -61,13 +78,16 @@ export default { | @@ -61,13 +78,16 @@ export default { | ||
| 61 | this.downLoading = true; | 78 | this.downLoading = true; |
| 62 | const data = await this.$request.exportData(); | 79 | const data = await this.$request.exportData(); |
| 63 | this.downLoading = false; | 80 | this.downLoading = false; |
| 64 | - console.log(data) | 81 | + console.log(data); |
| 65 | if (data) { | 82 | if (data) { |
| 66 | - let blob = new Blob([data], {type: 'application/octet-stream'}) | 83 | + let blob = new Blob([data], { type: "application/octet-stream" }); |
| 67 | const url = URL.createObjectURL(blob); | 84 | const url = URL.createObjectURL(blob); |
| 68 | const link = document.createElement("a"); | 85 | const link = document.createElement("a"); |
| 69 | document.body.appendChild(link); | 86 | document.body.appendChild(link); |
| 70 | - link.download = this.$store.getters.info.name+formatDate(new Date,'yyyy_MM_dd_hh_mm_ss')+"文件.json"; | 87 | + link.download = |
| 88 | + this.$store.getters.info.name + | ||
| 89 | + formatDate(new Date(), "yyyy_MM_dd_hh_mm_ss") + | ||
| 90 | + "文件.json"; | ||
| 71 | link.href = url; | 91 | link.href = url; |
| 72 | link.click(); | 92 | link.click(); |
| 73 | document.body.removeChild(link); | 93 | document.body.removeChild(link); |
| @@ -91,16 +111,15 @@ export default { | @@ -91,16 +111,15 @@ export default { | ||
| 91 | // } | 111 | // } |
| 92 | }, | 112 | }, |
| 93 | upSuccess(res) { | 113 | upSuccess(res) { |
| 94 | - debugger | ||
| 95 | - if (res && res.status == 0 ) { | ||
| 96 | - this.$message.success("上传成功"); | ||
| 97 | - this.$emit("upSuccess"); | 114 | + if (res && res.status == 0) { |
| 115 | + this.tipData = res.data | ||
| 116 | + this.dialogVisible = true | ||
| 98 | } else { | 117 | } else { |
| 99 | this.$message.error(res.info); | 118 | this.$message.error(res.info); |
| 100 | } | 119 | } |
| 101 | }, | 120 | }, |
| 102 | upError(res) { | 121 | upError(res) { |
| 103 | - debugger | 122 | + debugger; |
| 104 | if (res && res.status == 0) { | 123 | if (res && res.status == 0) { |
| 105 | this.$message.error("上传失败"); | 124 | this.$message.error("上传失败"); |
| 106 | } else { | 125 | } else { |
| @@ -121,6 +140,7 @@ export default { | @@ -121,6 +140,7 @@ export default { | ||
| 121 | justify-content: center; | 140 | justify-content: center; |
| 122 | .down-item { | 141 | .down-item { |
| 123 | width: 400px; | 142 | width: 400px; |
| 143 | + height:330px; | ||
| 124 | border-radius: 20px; | 144 | border-radius: 20px; |
| 125 | margin: 20px; | 145 | margin: 20px; |
| 126 | background: #f8f8f8; | 146 | background: #f8f8f8; |
| @@ -140,8 +160,10 @@ export default { | @@ -140,8 +160,10 @@ export default { | ||
| 140 | } | 160 | } |
| 141 | } | 161 | } |
| 142 | .upload-demo { | 162 | .upload-demo { |
| 143 | - display: flex; | ||
| 144 | - justify-content: center; | 163 | + padding:0 20px 20px; |
| 164 | + :deep(.el-upload--text){ | ||
| 165 | + display: block; | ||
| 166 | + } | ||
| 145 | } | 167 | } |
| 146 | :deep(.el-upload) { | 168 | :deep(.el-upload) { |
| 147 | margin: 0 auto; | 169 | margin: 0 auto; |
| @@ -151,7 +173,7 @@ export default { | @@ -151,7 +173,7 @@ export default { | ||
| 151 | flex-direction: column; | 173 | flex-direction: column; |
| 152 | justify-content: center; | 174 | justify-content: center; |
| 153 | align-items: center; | 175 | align-items: center; |
| 154 | - padding-bottom: 40px; | 176 | + padding-bottom: 10px; |
| 155 | .fa { | 177 | .fa { |
| 156 | font-size: 80px; | 178 | font-size: 80px; |
| 157 | color: #aeaeae; | 179 | color: #aeaeae; |
src/views/examinationPaper/add.vue
| @@ -308,7 +308,7 @@ | @@ -308,7 +308,7 @@ | ||
| 308 | > | 308 | > |
| 309 | <div class="dia-content"> | 309 | <div class="dia-content"> |
| 310 | <el-form | 310 | <el-form |
| 311 | - ref="form" | 311 | + ref="form" |
| 312 | :model="questionForm" | 312 | :model="questionForm" |
| 313 | :rules="questionFormRules" | 313 | :rules="questionFormRules" |
| 314 | label-width="100px" | 314 | label-width="100px" |
| @@ -843,7 +843,12 @@ export default { | @@ -843,7 +843,12 @@ export default { | ||
| 843 | 843 | ||
| 844 | console.log(this.formAns.answerList.split(",")[subNum - i]); | 844 | console.log(this.formAns.answerList.split(",")[subNum - i]); |
| 845 | } else if (this.formAns.qusType == 4) { | 845 | } else if (this.formAns.qusType == 4) { |
| 846 | - correctAnswer = this.formAns.answerList[subNum - i] == "✓" ? 1 :this.formAns.answerList[subNum - i] == "✗" ? 2:""; | 846 | + correctAnswer = |
| 847 | + this.formAns.answerList[subNum - i] == "✓" | ||
| 848 | + ? 1 | ||
| 849 | + : this.formAns.answerList[subNum - i] == "✗" | ||
| 850 | + ? 2 | ||
| 851 | + : ""; | ||
| 847 | } | 852 | } |
| 848 | this.form.questionList[this.formAns.listIndex].subQuestions[ | 853 | this.form.questionList[this.formAns.listIndex].subQuestions[ |
| 849 | EndIndex - i | 854 | EndIndex - i |
| @@ -959,7 +964,7 @@ export default { | @@ -959,7 +964,7 @@ export default { | ||
| 959 | types[addndex].qusType = sub.questionType; | 964 | types[addndex].qusType = sub.questionType; |
| 960 | types[addndex].subNum = 1; | 965 | types[addndex].subNum = 1; |
| 961 | types[addndex].answerOptions = sub.answerOptions; | 966 | types[addndex].answerOptions = sub.answerOptions; |
| 962 | - types[addndex].answerList = "" | 967 | + types[addndex].answerList = ""; |
| 963 | } | 968 | } |
| 964 | } | 969 | } |
| 965 | }); | 970 | }); |
| @@ -1023,6 +1028,9 @@ export default { | @@ -1023,6 +1028,9 @@ export default { | ||
| 1023 | .join(","); | 1028 | .join(","); |
| 1024 | break; | 1029 | break; |
| 1025 | case 4: | 1030 | case 4: |
| 1031 | + questionsOptions.selectNum = 0; | ||
| 1032 | + questionsOptions.answerOptions = "1,2"; | ||
| 1033 | + break; | ||
| 1026 | case 5: | 1034 | case 5: |
| 1027 | questionsOptions.selectNum = 0; | 1035 | questionsOptions.selectNum = 0; |
| 1028 | break; | 1036 | break; |
| @@ -1069,6 +1077,9 @@ export default { | @@ -1069,6 +1077,9 @@ export default { | ||
| 1069 | questionsOptions.partScore = 0; | 1077 | questionsOptions.partScore = 0; |
| 1070 | break; | 1078 | break; |
| 1071 | case 4: | 1079 | case 4: |
| 1080 | + questionsOptions.selectNum = 0; | ||
| 1081 | + questionsOptions.answerOptions = "1,2"; | ||
| 1082 | + break; | ||
| 1072 | case 5: | 1083 | case 5: |
| 1073 | questionsOptions.selectNum = 0; | 1084 | questionsOptions.selectNum = 0; |
| 1074 | break; | 1085 | break; |
| @@ -1096,6 +1107,9 @@ export default { | @@ -1096,6 +1107,9 @@ export default { | ||
| 1096 | .join(","); | 1107 | .join(","); |
| 1097 | break; | 1108 | break; |
| 1098 | case 4: | 1109 | case 4: |
| 1110 | + subQuestions.selectNum = 0; | ||
| 1111 | + subQuestions.answerOptions = "1,2"; | ||
| 1112 | + break; | ||
| 1099 | case 5: | 1113 | case 5: |
| 1100 | subQuestions.selectNum = 0; | 1114 | subQuestions.selectNum = 0; |
| 1101 | break; | 1115 | break; |
| @@ -1384,8 +1398,8 @@ export default { | @@ -1384,8 +1398,8 @@ export default { | ||
| 1384 | } | 1398 | } |
| 1385 | .question-title { | 1399 | .question-title { |
| 1386 | line-height: 40px; | 1400 | line-height: 40px; |
| 1387 | - .m20{ | ||
| 1388 | - margin-right:20px; | 1401 | + .m20 { |
| 1402 | + margin-right: 20px; | ||
| 1389 | } | 1403 | } |
| 1390 | .ipt { | 1404 | .ipt { |
| 1391 | width: 300px; | 1405 | width: 300px; |
src/views/examinationPaper/edit.vue
| @@ -238,18 +238,18 @@ export default { | @@ -238,18 +238,18 @@ export default { | ||
| 238 | } | 238 | } |
| 239 | }, | 239 | }, |
| 240 | async save() { | 240 | async save() { |
| 241 | - let valid = ""; | ||
| 242 | - this.form.questionList.map((item, index) => { | ||
| 243 | - if (!item.questionTitle) { | ||
| 244 | - valid += index + 1 + "、"; | ||
| 245 | - } | ||
| 246 | - }); | ||
| 247 | - if (valid) { | ||
| 248 | - this.$message.error( | ||
| 249 | - `大题名称不能为空,请检查第${valid.slice(0, -1)}题!` | ||
| 250 | - ); | ||
| 251 | - return; | ||
| 252 | - } | 241 | + // let valid = ""; |
| 242 | + // this.form.questionList.map((item, index) => { | ||
| 243 | + // if (!item.questionTitle) { | ||
| 244 | + // valid += index + 1 + "、"; | ||
| 245 | + // } | ||
| 246 | + // }); | ||
| 247 | + // if (valid) { | ||
| 248 | + // this.$message.error( | ||
| 249 | + // `大题名称不能为空,请检查第${valid.slice(0, -1)}题!` | ||
| 250 | + // ); | ||
| 251 | + // return; | ||
| 252 | + // } | ||
| 253 | let questionList = this.form.questionList.map((item) => { | 253 | let questionList = this.form.questionList.map((item) => { |
| 254 | item.score = null; | 254 | item.score = null; |
| 255 | // item.questionId = ""; | 255 | // item.questionId = ""; |
src/views/examinationPaper/index.vue
| @@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
| 108 | }} | 108 | }} |
| 109 | <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i | 109 | <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i |
| 110 | ></span> | 110 | ></span> |
| 111 | - <el-tooltip effect="dark" content="同步" placement="right"> | 111 | + <el-tooltip effect="dark" content="刷新同步状态" placement="right"> |
| 112 | <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i> | 112 | <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i> |
| 113 | </el-tooltip> | 113 | </el-tooltip> |
| 114 | </p> | 114 | </p> |
src/views/test/index.vue
| @@ -322,8 +322,12 @@ | @@ -322,8 +322,12 @@ | ||
| 322 | </div> | 322 | </div> |
| 323 | </div> | 323 | </div> |
| 324 | <div v-show="tabIndex == 2" v-loading="loading"> | 324 | <div v-show="tabIndex == 2" v-loading="loading"> |
| 325 | - <el-empty :image-size="100" v-if="!tableData.length&&loading==false" description="没有更多数据"></el-empty> | ||
| 326 | - <template v-if="tableData.length&&loading==false"> | 325 | + <el-empty |
| 326 | + :image-size="100" | ||
| 327 | + v-if="!tableData.length && loading == false" | ||
| 328 | + description="没有更多数据" | ||
| 329 | + ></el-empty> | ||
| 330 | + <template v-if="tableData.length && loading == false"> | ||
| 327 | <el-table | 331 | <el-table |
| 328 | :max-height="tableMaxHeight" | 332 | :max-height="tableMaxHeight" |
| 329 | v-if="role == 'ROLE_JIAOSHI'" | 333 | v-if="role == 'ROLE_JIAOSHI'" |
| @@ -417,8 +421,12 @@ | @@ -417,8 +421,12 @@ | ||
| 417 | </template> | 421 | </template> |
| 418 | </div> | 422 | </div> |
| 419 | <p class="down" v-if="tabIndex == 2 && tableData.length"> | 423 | <p class="down" v-if="tabIndex == 2 && tableData.length"> |
| 420 | - <el-button type="primary" plain round icon="fa fa-cloud-download" | ||
| 421 | - @click="downExl" | 424 | + <el-button |
| 425 | + type="primary" | ||
| 426 | + plain | ||
| 427 | + round | ||
| 428 | + icon="fa fa-cloud-download" | ||
| 429 | + @click="downExl" | ||
| 422 | >导出报表</el-button | 430 | >导出报表</el-button |
| 423 | > | 431 | > |
| 424 | </p> | 432 | </p> |
| @@ -462,7 +470,7 @@ export default { | @@ -462,7 +470,7 @@ export default { | ||
| 462 | components: { editAnswer }, | 470 | components: { editAnswer }, |
| 463 | data() { | 471 | data() { |
| 464 | return { | 472 | return { |
| 465 | - exportLoading:false, | 473 | + exportLoading: false, |
| 466 | tableMaxHeight: 300, | 474 | tableMaxHeight: 300, |
| 467 | role: "", | 475 | role: "", |
| 468 | loading: false, | 476 | loading: false, |
| @@ -842,8 +850,8 @@ export default { | @@ -842,8 +850,8 @@ export default { | ||
| 842 | this.$message.error(info); | 850 | this.$message.error(info); |
| 843 | } | 851 | } |
| 844 | }, | 852 | }, |
| 845 | - async downExl(){ | ||
| 846 | - if (this.exportLoading == true) return; | 853 | + async downExl() { |
| 854 | + if (this.exportLoading == true) return; | ||
| 847 | let query = {}; | 855 | let query = {}; |
| 848 | for (let key in this.query) { | 856 | for (let key in this.query) { |
| 849 | if (this.query[key] != "") { | 857 | if (this.query[key] != "") { |
| @@ -870,21 +878,22 @@ export default { | @@ -870,21 +878,22 @@ export default { | ||
| 870 | return; | 878 | return; |
| 871 | } | 879 | } |
| 872 | } | 880 | } |
| 881 | + const exportPhaseExamReport = | ||
| 882 | + this.role == "ROLE_BANZHUREN" | ||
| 883 | + ? this.$request.cTExportPhaseExamReport | ||
| 884 | + : this.$request.exportPhaseExamReport; | ||
| 873 | this.exportLoading = true; | 885 | this.exportLoading = true; |
| 874 | - const data = await this.$request.exportPhaseExamReport({ ...query }); | 886 | + const data = await exportPhaseExamReport({ ...query }); |
| 875 | this.exportLoading = false; | 887 | this.exportLoading = false; |
| 876 | if (data) { | 888 | if (data) { |
| 877 | let blob = new Blob([data], { | 889 | let blob = new Blob([data], { |
| 878 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | 890 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| 879 | }); | 891 | }); |
| 880 | - downloadFile( | ||
| 881 | - "即时测-阶段测练报表.xlsx", | ||
| 882 | - blob | ||
| 883 | - ); | 892 | + downloadFile("即时测-阶段测练报表.xlsx", blob); |
| 884 | } else { | 893 | } else { |
| 885 | this.$message.error("下载失败"); | 894 | this.$message.error("下载失败"); |
| 886 | } | 895 | } |
| 887 | - } | 896 | + }, |
| 888 | }, | 897 | }, |
| 889 | }; | 898 | }; |
| 890 | </script> | 899 | </script> |