Commit 049db2b22d61b673c614c13f60ca24558346573f
1 parent
7812e986
接口联调
Showing
15 changed files
with
114 additions
and
29 deletions
public/tex-mml-chtml.js renamed to public/Temp/js/tex-mml-chtml.js
src/api/apis/apis.js
| ... | ... | @@ -1287,6 +1287,15 @@ export default { |
| 1287 | 1287 | data |
| 1288 | 1288 | }); |
| 1289 | 1289 | }, |
| 1290 | + // 导出随堂问单科多课时报表 | |
| 1291 | + pExportPhaseAnswerReport(data) { | |
| 1292 | + return service({ | |
| 1293 | + url: setUpUrls.pExportPhaseAnswerReport, | |
| 1294 | + method: "POST", | |
| 1295 | + data, | |
| 1296 | + responseType: 'arraybuffer', | |
| 1297 | + }); | |
| 1298 | + }, | |
| 1290 | 1299 | |
| 1291 | 1300 | /** 平台管理 */ |
| 1292 | 1301 | //账户管理 |
| ... | ... | @@ -1593,7 +1602,8 @@ export default { |
| 1593 | 1602 | return service({ |
| 1594 | 1603 | url: setUpUrls.exportExamMultiReport, |
| 1595 | 1604 | method: "POST", |
| 1596 | - data | |
| 1605 | + data, | |
| 1606 | + responseType: 'arraybuffer', | |
| 1597 | 1607 | }); |
| 1598 | 1608 | }, |
| 1599 | 1609 | // 查询即时测多班默认等级列表 |
| ... | ... | @@ -1651,7 +1661,8 @@ export default { |
| 1651 | 1661 | return service({ |
| 1652 | 1662 | url: setUpUrls.exportTClassAndStudent, |
| 1653 | 1663 | method: "POST", |
| 1654 | - data | |
| 1664 | + data, | |
| 1665 | + responseType: 'arraybuffer', | |
| 1655 | 1666 | }); |
| 1656 | 1667 | }, |
| 1657 | 1668 | // 删除班级信息(新) | ... | ... |
src/api/axios.js
| ... | ... | @@ -20,17 +20,15 @@ service.interceptors.request.use( |
| 20 | 20 | (config) => { |
| 21 | 21 | NProgress.start(); |
| 22 | 22 | // config.headers["Content-Type"] = "application/json;charset=UTF-8"; |
| 23 | - | |
| 24 | 23 | const source = axios.CancelToken.source(); |
| 25 | 24 | store.commit("setTokenSources", [source.token, source.cancel]); |
| 26 | 25 | config.cancelToken = source.token; |
| 27 | - const role = store.getters.info.showRole || store.getters.info.permissions[0].role; | |
| 26 | + const role = store.getters.info?.showRole | |
| 28 | 27 | if (role == "ROLE_BANZHUREN") { |
| 29 | - const classes = store.getters.classes | |
| 28 | + const classes = store.getters?.classes | |
| 30 | 29 | config.manager = 1 |
| 31 | 30 | config.classes = classes |
| 32 | 31 | } |
| 33 | - console.log(config) | |
| 34 | 32 | return config; |
| 35 | 33 | }, |
| 36 | 34 | (error) => { | ... | ... |
src/api/urls/apis.js
| ... | ... | @@ -364,6 +364,9 @@ export default { |
| 364 | 364 | // 载指定版本授课端 |
| 365 | 365 | pGetAppDownloadUrl: "/api_html/personal/getAppDownloadUrl", |
| 366 | 366 | |
| 367 | + //导出随堂问单科多课时报表 | |
| 368 | + pExportPhaseAnswerReport: "/api_html/personal/exportPhaseAnswerReport", | |
| 369 | + | |
| 367 | 370 | |
| 368 | 371 | // 修改密码 |
| 369 | 372 | changePwd: "/api_html/changePwd", | ... | ... |
src/components/exportDia.vue
| ... | ... | @@ -24,13 +24,17 @@ |
| 24 | 24 | <el-table-column type="selection"></el-table-column> |
| 25 | 25 | <el-table-column prop="studentName" label="姓名" align="center"></el-table-column> |
| 26 | 26 | <el-table-column label="班名" align="center"> |
| 27 | - <template slot-scope="scoped">{{ | |
| 28 | - scoped.row.classRank || scoped.row.rank || scoped.row.examList[0].classRank }}</template> | |
| 27 | + <template slot-scope="scoped"> | |
| 28 | + <span v-if="scoped.row.classRank || scoped.row.rank">{{ | |
| 29 | + scoped.row.classRank || scoped.row.rank }}</span> | |
| 30 | + <span v-else>{{ scoped.row.examList && scoped.row.examList[0].classRank }}</span> | |
| 31 | + | |
| 32 | + </template> | |
| 29 | 33 | </el-table-column> |
| 30 | 34 | <el-table-column prop="correctRate" :label="this.lastLabel" align="center"><template slot-scope="scoped"> |
| 31 | 35 | <span v-if="scoped.row.correctRate || scoped.row.scoringRate">{{ |
| 32 | 36 | scoped.row.correctRate || scoped.row.scoringRate }}%</span> |
| 33 | - <span v-else>{{ scoped.row.examList[0].score }}</span> | |
| 37 | + <span v-else>{{ scoped.row.examList && scoped.row.examList[0].score }}</span> | |
| 34 | 38 | </template></el-table-column> |
| 35 | 39 | </el-table> |
| 36 | 40 | </ul> |
| ... | ... | @@ -89,7 +93,7 @@ export default { |
| 89 | 93 | return item.studentId |
| 90 | 94 | }) |
| 91 | 95 | } |
| 92 | - this.$emit('exportData', { studentIds: studentIds }) | |
| 96 | + this.$emit('exportData', studentIds) | |
| 93 | 97 | }, |
| 94 | 98 | cancel() { |
| 95 | 99 | if (this.exportType == 2) { |
| ... | ... | @@ -116,4 +120,30 @@ export default { |
| 116 | 120 | cursor: pointer; |
| 117 | 121 | } |
| 118 | 122 | } |
| 123 | + | |
| 124 | +:deep(.el-dialog) { | |
| 125 | + .el-dialog__body { | |
| 126 | + padding: 0 20px 10px; | |
| 127 | + } | |
| 128 | + | |
| 129 | + .down-item { | |
| 130 | + font-size: 15px; | |
| 131 | + margin-bottom: 10px; | |
| 132 | + | |
| 133 | + .tit { | |
| 134 | + line-height: 18px; | |
| 135 | + padding: 10px 0; | |
| 136 | + } | |
| 137 | + } | |
| 138 | + | |
| 139 | + .export-tit { | |
| 140 | + text-align: center; | |
| 141 | + font-size: 16px; | |
| 142 | + padding-bottom: 10px; | |
| 143 | + } | |
| 144 | +} | |
| 145 | + | |
| 146 | +.dialog-footer { | |
| 147 | + text-align: center; | |
| 148 | +} | |
| 119 | 149 | </style> |
| 120 | 150 | \ No newline at end of file | ... | ... |
src/views/basic/ask/analysis.vue
| ... | ... | @@ -2,7 +2,10 @@ |
| 2 | 2 | <div> |
| 3 | 3 | <back-box> |
| 4 | 4 | <template slot="title"> |
| 5 | - <span>单课分析</span> | |
| 5 | + <span>{{ | |
| 6 | + types == 1 ? "单课分析" : | |
| 7 | + types == 2 ? `${className}-${subjectNames[0]}汇总分析` : | |
| 8 | + `${className}-多科汇总分析` }}</span> | |
| 6 | 9 | </template> |
| 7 | 10 | </back-box> |
| 8 | 11 | <div class="page-content"> |
| ... | ... | @@ -14,7 +17,7 @@ |
| 14 | 17 | <div id="print-content"> |
| 15 | 18 | |
| 16 | 19 | <!-- 学生答题情况 --> |
| 17 | - <Detail v-if="type == 1" :types="types" :detail="detail" /> | |
| 20 | + <Detail v-if="type == 1" :types="types" :detail="detail" :id="id" /> | |
| 18 | 21 | <!-- 学生答题情况 --> |
| 19 | 22 | <Example v-if="type == 1" :types="types" :tableData="tableData" /> |
| 20 | 23 | <!-- 学生问答 --> |
| ... | ... | @@ -56,6 +59,7 @@ export default { |
| 56 | 59 | role: "", |
| 57 | 60 | loading: false, |
| 58 | 61 | classId: "", |
| 62 | + className: "", | |
| 59 | 63 | subjectNames: "", |
| 60 | 64 | id: [], |
| 61 | 65 | type: 1, |
| ... | ... | @@ -76,6 +80,7 @@ export default { |
| 76 | 80 | this.$store.getters.info.showRole || |
| 77 | 81 | this.$store.getters.info.permissions[0].role; |
| 78 | 82 | this.types = Number(this.$route.query.types) |
| 83 | + this.className = this.$route.query.className | |
| 79 | 84 | const queryData = JSON.parse(this.$route.query.params) |
| 80 | 85 | this.classId = queryData.classId |
| 81 | 86 | console.log(this.$route.query) |
| ... | ... | @@ -189,13 +194,16 @@ export default { |
| 189 | 194 | } |
| 190 | 195 | } |
| 191 | 196 | if (this.types == 1) { |
| 197 | + query.periodId = this.id[0] | |
| 192 | 198 | query.type = this.type - 1 |
| 193 | - } else if (this.types == 3) { | |
| 194 | - query.subjectNames = this.subjectNames | |
| 199 | + } else { | |
| 200 | + query.periodIds = this.id | |
| 201 | + if (this.types == 3) { | |
| 202 | + query.subjectNames = this.subjectNames | |
| 203 | + } | |
| 195 | 204 | } |
| 196 | 205 | this.loading = true; |
| 197 | 206 | let { data, info, status } = await queryData({ |
| 198 | - periodIds: this.id, | |
| 199 | 207 | classId: this.classId, |
| 200 | 208 | ...query, |
| 201 | 209 | }); |
| ... | ... | @@ -223,17 +231,20 @@ export default { |
| 223 | 231 | queryData = this.$request.periodStudentReport |
| 224 | 232 | } |
| 225 | 233 | query.type = this.type - 1 |
| 226 | - } else if (this.types == 2) { | |
| 227 | - queryData = this.$request.phaseAnswerReport | |
| 228 | - } else if (this.types == 3) { | |
| 229 | - queryData = this.$request.cTPhaseAnswerReport | |
| 234 | + query.periodId = this.id[0] | |
| 235 | + } else { | |
| 236 | + query.periodIds = this.id | |
| 237 | + if (this.types == 2) { | |
| 238 | + queryData = this.$request.phaseAnswerReport | |
| 239 | + } else if (this.types == 3) { | |
| 240 | + queryData = this.$request.cTPhaseAnswerReport | |
| 241 | + } | |
| 230 | 242 | } |
| 231 | 243 | if (this.types != 1) { |
| 232 | 244 | query.classId = this.classId |
| 233 | 245 | } |
| 234 | 246 | this.loading = true; |
| 235 | 247 | let { data, info, status } = await queryData({ |
| 236 | - periodIds: this.id, | |
| 237 | 248 | onlyRate: true, |
| 238 | 249 | ...query, |
| 239 | 250 | }); |
| ... | ... | @@ -262,8 +273,16 @@ export default { |
| 262 | 273 | } else if (studentIds.length > 0) { |
| 263 | 274 | query.studentIds = studentIds |
| 264 | 275 | } |
| 265 | - const data = await this.$request.exportPeriodReport({ | |
| 266 | - periodIds: this.id, | |
| 276 | + let exportPeriodReport = "" | |
| 277 | + if (this.id.length == 1) { | |
| 278 | + query.periodId = this.id[0] | |
| 279 | + exportPeriodReport = this.$request.exportPeriodReport | |
| 280 | + } else { | |
| 281 | + query.periodIds = this.id | |
| 282 | + exportPeriodReport = this.role == "ROLE_PERSONAL" ? this.$request.pExportPhaseAnswerReport : this.$request.exportPhaseAnswerReport | |
| 283 | + } | |
| 284 | + const data = await exportPeriodReport({ | |
| 285 | + classId: this.classId, | |
| 267 | 286 | ...query |
| 268 | 287 | }); |
| 269 | 288 | this.exportLoading = false; | ... | ... |
src/views/basic/ask/components/detail.vue
| ... | ... | @@ -23,7 +23,8 @@ |
| 23 | 23 | </ul> |
| 24 | 24 | <ul class="info" v-else-if="types == 2"> |
| 25 | 25 | <li class="info-item">科目:{{ detail.subjectName }}</li> |
| 26 | - <li class="info-item">课时总数:{{ detail.title }}</li> | |
| 26 | + <li class="info-item" v-if="id.length == 1">课时名称:{{ detail.title }}</li> | |
| 27 | + <li class="info-item" v-else>课时总数:{{ id.length }}</li> | |
| 27 | 28 | <li class="info-item">课时时长:{{ detail.duration }}分钟</li> |
| 28 | 29 | <li class="info-item"> |
| 29 | 30 | 反馈时长:{{ setDuration(detail.consumingDuration) }} |
| ... | ... | @@ -45,6 +46,7 @@ |
| 45 | 46 | <script> |
| 46 | 47 | export default { |
| 47 | 48 | props: { |
| 49 | + id: Array, | |
| 48 | 50 | types: Number, |
| 49 | 51 | detail: Object, |
| 50 | 52 | }, | ... | ... |
src/views/basic/ask/index.vue
| ... | ... | @@ -224,9 +224,16 @@ export default { |
| 224 | 224 | }, |
| 225 | 225 | //去列表 |
| 226 | 226 | goList() { |
| 227 | + let className; | |
| 228 | + this.classList.map(item => { | |
| 229 | + if (item.value == this.query.classId) { | |
| 230 | + className = item.label | |
| 231 | + } | |
| 232 | + }) | |
| 227 | 233 | this.$router.push({ |
| 228 | 234 | path: '/askList', |
| 229 | 235 | query: { |
| 236 | + className: className, | |
| 230 | 237 | params: JSON.stringify(this.query) |
| 231 | 238 | } |
| 232 | 239 | }) | ... | ... |
src/views/basic/ask/list.vue
| ... | ... | @@ -137,7 +137,9 @@ export default { |
| 137 | 137 | query: { |
| 138 | 138 | id: JSON.stringify([obj.id]), |
| 139 | 139 | types: types, |
| 140 | + subjectNames: obj.subjectName, | |
| 140 | 141 | params: this.$route.query.params, |
| 142 | + className: this.$route.query.className, | |
| 141 | 143 | }, |
| 142 | 144 | }); |
| 143 | 145 | }, |
| ... | ... | @@ -160,6 +162,7 @@ export default { |
| 160 | 162 | types: this.multipleSelection.length == 1 ? 1 : subjectArr.length == 1 ? 2 : 3, |
| 161 | 163 | subjectNames: subjectArr.join(','), |
| 162 | 164 | params: this.$route.query.params, |
| 165 | + className: this.$route.query.className, | |
| 163 | 166 | }, |
| 164 | 167 | }); |
| 165 | 168 | }, | ... | ... |
src/views/basic/setUp/student.vue
| ... | ... | @@ -446,6 +446,7 @@ export default { |
| 446 | 446 | const { data, status, info } = await this.$request.delStudent({ |
| 447 | 447 | type: this.query.classType, |
| 448 | 448 | studentId: obj.id, |
| 449 | + classId: this.query.classId | |
| 449 | 450 | }); |
| 450 | 451 | if (status === 0) { |
| 451 | 452 | this.$message.success("删除成功"); | ... | ... |
src/views/basic/test/components/contrast.vue
| ... | ... | @@ -339,7 +339,7 @@ export default { |
| 339 | 339 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| 340 | 340 | }); |
| 341 | 341 | downloadFile( |
| 342 | - `多班_${this.subjectNames}_${this.title}_测练成绩对比分析`, | |
| 342 | + `多班_${this.subjectName}_${this.title}_测练成绩对比分析`, | |
| 343 | 343 | blob |
| 344 | 344 | ); |
| 345 | 345 | } else { | ... | ... |
src/views/basic/test/components/multipleSubTest.vue
| ... | ... | @@ -244,7 +244,8 @@ export default { |
| 244 | 244 | query.studentIds = studentIds |
| 245 | 245 | } |
| 246 | 246 | const data = await this.$request.exportExamReport({ |
| 247 | - examId: this.ids, | |
| 247 | + classId: this.classId, | |
| 248 | + examIds: this.ids, | |
| 248 | 249 | ...query |
| 249 | 250 | }); |
| 250 | 251 | this.exportLoading = false; |
| ... | ... | @@ -258,6 +259,8 @@ export default { |
| 258 | 259 | : "即时测-单卷测练报表.xlsx", |
| 259 | 260 | blob |
| 260 | 261 | ); |
| 262 | + this.$message.error("下载成功"); | |
| 263 | + this.cancel() | |
| 261 | 264 | } else { |
| 262 | 265 | this.$message.error("下载失败"); |
| 263 | 266 | } | ... | ... |
src/views/basic/test/components/multipleTest.vue
| ... | ... | @@ -31,7 +31,8 @@ |
| 31 | 31 | <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" /> |
| 32 | 32 | </div> |
| 33 | 33 | </el-dialog> |
| 34 | - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" lastLabel="总分"/> | |
| 34 | + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" | |
| 35 | + lastLabel="总分" /> | |
| 35 | 36 | </div> |
| 36 | 37 | <!-- 单科多卷 --> |
| 37 | 38 | </template> |
| ... | ... | @@ -201,7 +202,7 @@ export default { |
| 201 | 202 | async exportData(arr) { |
| 202 | 203 | if (this.exportLoading == true) return; |
| 203 | 204 | this.exportLoading = true; |
| 204 | - let studentIds = arr | |
| 205 | + let studentIds = [...arr] | |
| 205 | 206 | let query = {}; |
| 206 | 207 | if (studentIds.length == this.exportStudent.length) { |
| 207 | 208 | query.studentIds = [] |
| ... | ... | @@ -212,7 +213,9 @@ export default { |
| 212 | 213 | ? this.$request.pExportPhaseExamReport |
| 213 | 214 | : this.$request.exportPhaseExamReport; |
| 214 | 215 | const data = await exportPhaseExamReport({ |
| 215 | - examId: this.ids, | |
| 216 | + classId: this.classId, | |
| 217 | + examIds: this.ids, | |
| 218 | + ...query | |
| 216 | 219 | }); |
| 217 | 220 | this.exportLoading = false; |
| 218 | 221 | if (data) { |
| ... | ... | @@ -220,6 +223,8 @@ export default { |
| 220 | 223 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| 221 | 224 | }); |
| 222 | 225 | downloadFile("即时测-单科多卷报表.xlsx", blob); |
| 226 | + this.$message.error("下载成功"); | |
| 227 | + this.cancel() | |
| 223 | 228 | } else { |
| 224 | 229 | this.$message.error("下载失败"); |
| 225 | 230 | } | ... | ... |
src/views/basic/test/list.vue
src/views/layout/header/header.vue
| ... | ... | @@ -298,6 +298,7 @@ export default { |
| 298 | 298 | handleCommand(command) { |
| 299 | 299 | //刷新权限跳转首页 |
| 300 | 300 | this.$store.dispatch("permissions", command); |
| 301 | + this.$store.commit('setClasses', "") | |
| 301 | 302 | }, |
| 302 | 303 | async logOut() { |
| 303 | 304 | const { data, status, info } = await this.$request.logout(); |
| ... | ... | @@ -311,6 +312,7 @@ export default { |
| 311 | 312 | this.$store.commit("setInfo", ""); |
| 312 | 313 | this.$store.commit("setRouters", ""); |
| 313 | 314 | this.$store.commit("resetTabnavBox"); |
| 315 | + this.$store.commit('setClasses', "") | |
| 314 | 316 | this.$router.push({ |
| 315 | 317 | path: "/login", |
| 316 | 318 | }); | ... | ... |