Commit 049db2b22d61b673c614c13f60ca24558346573f

Authored by 梁保满
1 parent 7812e986

接口联调

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,6 +1287,15 @@ export default {
1287 data 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,7 +1602,8 @@ export default {
1593 return service({ 1602 return service({
1594 url: setUpUrls.exportExamMultiReport, 1603 url: setUpUrls.exportExamMultiReport,
1595 method: "POST", 1604 method: "POST",
1596 - data 1605 + data,
  1606 + responseType: 'arraybuffer',
1597 }); 1607 });
1598 }, 1608 },
1599 // 查询即时测多班默认等级列表 1609 // 查询即时测多班默认等级列表
@@ -1651,7 +1661,8 @@ export default { @@ -1651,7 +1661,8 @@ export default {
1651 return service({ 1661 return service({
1652 url: setUpUrls.exportTClassAndStudent, 1662 url: setUpUrls.exportTClassAndStudent,
1653 method: "POST", 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,17 +20,15 @@ service.interceptors.request.use(
20 (config) => { 20 (config) => {
21 NProgress.start(); 21 NProgress.start();
22 // config.headers["Content-Type"] = "application/json;charset=UTF-8"; 22 // config.headers["Content-Type"] = "application/json;charset=UTF-8";
23 -  
24 const source = axios.CancelToken.source(); 23 const source = axios.CancelToken.source();
25 store.commit("setTokenSources", [source.token, source.cancel]); 24 store.commit("setTokenSources", [source.token, source.cancel]);
26 config.cancelToken = source.token; 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 if (role == "ROLE_BANZHUREN") { 27 if (role == "ROLE_BANZHUREN") {
29 - const classes = store.getters.classes 28 + const classes = store.getters?.classes
30 config.manager = 1 29 config.manager = 1
31 config.classes = classes 30 config.classes = classes
32 } 31 }
33 - console.log(config)  
34 return config; 32 return config;
35 }, 33 },
36 (error) => { 34 (error) => {
src/api/urls/apis.js
@@ -364,6 +364,9 @@ export default { @@ -364,6 +364,9 @@ export default {
364 // 载指定版本授课端 364 // 载指定版本授课端
365 pGetAppDownloadUrl: "/api_html/personal/getAppDownloadUrl", 365 pGetAppDownloadUrl: "/api_html/personal/getAppDownloadUrl",
366 366
  367 + //导出随堂问单科多课时报表
  368 + pExportPhaseAnswerReport: "/api_html/personal/exportPhaseAnswerReport",
  369 +
367 370
368 // 修改密码 371 // 修改密码
369 changePwd: "/api_html/changePwd", 372 changePwd: "/api_html/changePwd",
src/components/exportDia.vue
@@ -24,13 +24,17 @@ @@ -24,13 +24,17 @@
24 <el-table-column type="selection"></el-table-column> 24 <el-table-column type="selection"></el-table-column>
25 <el-table-column prop="studentName" label="姓名" align="center"></el-table-column> 25 <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
26 <el-table-column label="班名" align="center"> 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 </el-table-column> 33 </el-table-column>
30 <el-table-column prop="correctRate" :label="this.lastLabel" align="center"><template slot-scope="scoped"> 34 <el-table-column prop="correctRate" :label="this.lastLabel" align="center"><template slot-scope="scoped">
31 <span v-if="scoped.row.correctRate || scoped.row.scoringRate">{{ 35 <span v-if="scoped.row.correctRate || scoped.row.scoringRate">{{
32 scoped.row.correctRate || scoped.row.scoringRate }}%</span> 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 </template></el-table-column> 38 </template></el-table-column>
35 </el-table> 39 </el-table>
36 </ul> 40 </ul>
@@ -89,7 +93,7 @@ export default { @@ -89,7 +93,7 @@ export default {
89 return item.studentId 93 return item.studentId
90 }) 94 })
91 } 95 }
92 - this.$emit('exportData', { studentIds: studentIds }) 96 + this.$emit('exportData', studentIds)
93 }, 97 },
94 cancel() { 98 cancel() {
95 if (this.exportType == 2) { 99 if (this.exportType == 2) {
@@ -116,4 +120,30 @@ export default { @@ -116,4 +120,30 @@ export default {
116 cursor: pointer; 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 </style> 149 </style>
120 \ No newline at end of file 150 \ No newline at end of file
src/views/basic/ask/analysis.vue
@@ -2,7 +2,10 @@ @@ -2,7 +2,10 @@
2 <div> 2 <div>
3 <back-box> 3 <back-box>
4 <template slot="title"> 4 <template slot="title">
5 - <span>单课分析</span> 5 + <span>{{
  6 + types == 1 ? "单课分析" :
  7 + types == 2 ? `${className}-${subjectNames[0]}汇总分析` :
  8 + `${className}-多科汇总分析` }}</span>
6 </template> 9 </template>
7 </back-box> 10 </back-box>
8 <div class="page-content"> 11 <div class="page-content">
@@ -14,7 +17,7 @@ @@ -14,7 +17,7 @@
14 <div id="print-content"> 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 <Example v-if="type == 1" :types="types" :tableData="tableData" /> 22 <Example v-if="type == 1" :types="types" :tableData="tableData" />
20 <!-- 学生问答 --> 23 <!-- 学生问答 -->
@@ -56,6 +59,7 @@ export default { @@ -56,6 +59,7 @@ export default {
56 role: "", 59 role: "",
57 loading: false, 60 loading: false,
58 classId: "", 61 classId: "",
  62 + className: "",
59 subjectNames: "", 63 subjectNames: "",
60 id: [], 64 id: [],
61 type: 1, 65 type: 1,
@@ -76,6 +80,7 @@ export default { @@ -76,6 +80,7 @@ export default {
76 this.$store.getters.info.showRole || 80 this.$store.getters.info.showRole ||
77 this.$store.getters.info.permissions[0].role; 81 this.$store.getters.info.permissions[0].role;
78 this.types = Number(this.$route.query.types) 82 this.types = Number(this.$route.query.types)
  83 + this.className = this.$route.query.className
79 const queryData = JSON.parse(this.$route.query.params) 84 const queryData = JSON.parse(this.$route.query.params)
80 this.classId = queryData.classId 85 this.classId = queryData.classId
81 console.log(this.$route.query) 86 console.log(this.$route.query)
@@ -189,13 +194,16 @@ export default { @@ -189,13 +194,16 @@ export default {
189 } 194 }
190 } 195 }
191 if (this.types == 1) { 196 if (this.types == 1) {
  197 + query.periodId = this.id[0]
192 query.type = this.type - 1 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 this.loading = true; 205 this.loading = true;
197 let { data, info, status } = await queryData({ 206 let { data, info, status } = await queryData({
198 - periodIds: this.id,  
199 classId: this.classId, 207 classId: this.classId,
200 ...query, 208 ...query,
201 }); 209 });
@@ -223,17 +231,20 @@ export default { @@ -223,17 +231,20 @@ export default {
223 queryData = this.$request.periodStudentReport 231 queryData = this.$request.periodStudentReport
224 } 232 }
225 query.type = this.type - 1 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 if (this.types != 1) { 243 if (this.types != 1) {
232 query.classId = this.classId 244 query.classId = this.classId
233 } 245 }
234 this.loading = true; 246 this.loading = true;
235 let { data, info, status } = await queryData({ 247 let { data, info, status } = await queryData({
236 - periodIds: this.id,  
237 onlyRate: true, 248 onlyRate: true,
238 ...query, 249 ...query,
239 }); 250 });
@@ -262,8 +273,16 @@ export default { @@ -262,8 +273,16 @@ export default {
262 } else if (studentIds.length > 0) { 273 } else if (studentIds.length > 0) {
263 query.studentIds = studentIds 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 ...query 286 ...query
268 }); 287 });
269 this.exportLoading = false; 288 this.exportLoading = false;
src/views/basic/ask/components/detail.vue
@@ -23,7 +23,8 @@ @@ -23,7 +23,8 @@
23 </ul> 23 </ul>
24 <ul class="info" v-else-if="types == 2"> 24 <ul class="info" v-else-if="types == 2">
25 <li class="info-item">科目:{{ detail.subjectName }}</li> 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 <li class="info-item">课时时长:{{ detail.duration }}分钟</li> 28 <li class="info-item">课时时长:{{ detail.duration }}分钟</li>
28 <li class="info-item"> 29 <li class="info-item">
29 反馈时长:{{ setDuration(detail.consumingDuration) }} 30 反馈时长:{{ setDuration(detail.consumingDuration) }}
@@ -45,6 +46,7 @@ @@ -45,6 +46,7 @@
45 <script> 46 <script>
46 export default { 47 export default {
47 props: { 48 props: {
  49 + id: Array,
48 types: Number, 50 types: Number,
49 detail: Object, 51 detail: Object,
50 }, 52 },
src/views/basic/ask/index.vue
@@ -224,9 +224,16 @@ export default { @@ -224,9 +224,16 @@ export default {
224 }, 224 },
225 //去列表 225 //去列表
226 goList() { 226 goList() {
  227 + let className;
  228 + this.classList.map(item => {
  229 + if (item.value == this.query.classId) {
  230 + className = item.label
  231 + }
  232 + })
227 this.$router.push({ 233 this.$router.push({
228 path: '/askList', 234 path: '/askList',
229 query: { 235 query: {
  236 + className: className,
230 params: JSON.stringify(this.query) 237 params: JSON.stringify(this.query)
231 } 238 }
232 }) 239 })
src/views/basic/ask/list.vue
@@ -137,7 +137,9 @@ export default { @@ -137,7 +137,9 @@ export default {
137 query: { 137 query: {
138 id: JSON.stringify([obj.id]), 138 id: JSON.stringify([obj.id]),
139 types: types, 139 types: types,
  140 + subjectNames: obj.subjectName,
140 params: this.$route.query.params, 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,6 +162,7 @@ export default {
160 types: this.multipleSelection.length == 1 ? 1 : subjectArr.length == 1 ? 2 : 3, 162 types: this.multipleSelection.length == 1 ? 1 : subjectArr.length == 1 ? 2 : 3,
161 subjectNames: subjectArr.join(','), 163 subjectNames: subjectArr.join(','),
162 params: this.$route.query.params, 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,6 +446,7 @@ export default {
446 const { data, status, info } = await this.$request.delStudent({ 446 const { data, status, info } = await this.$request.delStudent({
447 type: this.query.classType, 447 type: this.query.classType,
448 studentId: obj.id, 448 studentId: obj.id,
  449 + classId: this.query.classId
449 }); 450 });
450 if (status === 0) { 451 if (status === 0) {
451 this.$message.success("删除成功"); 452 this.$message.success("删除成功");
src/views/basic/test/components/contrast.vue
@@ -339,7 +339,7 @@ export default { @@ -339,7 +339,7 @@ export default {
339 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 339 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
340 }); 340 });
341 downloadFile( 341 downloadFile(
342 - `多班_${this.subjectNames}_${this.title}_测练成绩对比分析`, 342 + `多班_${this.subjectName}_${this.title}_测练成绩对比分析`,
343 blob 343 blob
344 ); 344 );
345 } else { 345 } else {
src/views/basic/test/components/multipleSubTest.vue
@@ -244,7 +244,8 @@ export default { @@ -244,7 +244,8 @@ export default {
244 query.studentIds = studentIds 244 query.studentIds = studentIds
245 } 245 }
246 const data = await this.$request.exportExamReport({ 246 const data = await this.$request.exportExamReport({
247 - examId: this.ids, 247 + classId: this.classId,
  248 + examIds: this.ids,
248 ...query 249 ...query
249 }); 250 });
250 this.exportLoading = false; 251 this.exportLoading = false;
@@ -258,6 +259,8 @@ export default { @@ -258,6 +259,8 @@ export default {
258 : "即时测-单卷测练报表.xlsx", 259 : "即时测-单卷测练报表.xlsx",
259 blob 260 blob
260 ); 261 );
  262 + this.$message.error("下载成功");
  263 + this.cancel()
261 } else { 264 } else {
262 this.$message.error("下载失败"); 265 this.$message.error("下载失败");
263 } 266 }
src/views/basic/test/components/multipleTest.vue
@@ -31,7 +31,8 @@ @@ -31,7 +31,8 @@
31 <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" /> 31 <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" />
32 </div> 32 </div>
33 </el-dialog> 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 </div> 36 </div>
36 <!-- 单科多卷 --> 37 <!-- 单科多卷 -->
37 </template> 38 </template>
@@ -201,7 +202,7 @@ export default { @@ -201,7 +202,7 @@ export default {
201 async exportData(arr) { 202 async exportData(arr) {
202 if (this.exportLoading == true) return; 203 if (this.exportLoading == true) return;
203 this.exportLoading = true; 204 this.exportLoading = true;
204 - let studentIds = arr 205 + let studentIds = [...arr]
205 let query = {}; 206 let query = {};
206 if (studentIds.length == this.exportStudent.length) { 207 if (studentIds.length == this.exportStudent.length) {
207 query.studentIds = [] 208 query.studentIds = []
@@ -212,7 +213,9 @@ export default { @@ -212,7 +213,9 @@ export default {
212 ? this.$request.pExportPhaseExamReport 213 ? this.$request.pExportPhaseExamReport
213 : this.$request.exportPhaseExamReport; 214 : this.$request.exportPhaseExamReport;
214 const data = await exportPhaseExamReport({ 215 const data = await exportPhaseExamReport({
215 - examId: this.ids, 216 + classId: this.classId,
  217 + examIds: this.ids,
  218 + ...query
216 }); 219 });
217 this.exportLoading = false; 220 this.exportLoading = false;
218 if (data) { 221 if (data) {
@@ -220,6 +223,8 @@ export default { @@ -220,6 +223,8 @@ export default {
220 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 223 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
221 }); 224 });
222 downloadFile("即时测-单科多卷报表.xlsx", blob); 225 downloadFile("即时测-单科多卷报表.xlsx", blob);
  226 + this.$message.error("下载成功");
  227 + this.cancel()
223 } else { 228 } else {
224 this.$message.error("下载失败"); 229 this.$message.error("下载失败");
225 } 230 }
src/views/basic/test/list.vue
@@ -231,7 +231,8 @@ export default { @@ -231,7 +231,8 @@ export default {
231 classId: obj.classIds.join(','), 231 classId: obj.classIds.join(','),
232 subjectName: obj.subjectName, 232 subjectName: obj.subjectName,
233 title: obj.title, 233 title: obj.title,
234 - type: 4 234 + type: 4,
  235 + params: this.$route.query.params
235 }, 236 },
236 }); 237 });
237 }, 238 },
src/views/layout/header/header.vue
@@ -298,6 +298,7 @@ export default { @@ -298,6 +298,7 @@ export default {
298 handleCommand(command) { 298 handleCommand(command) {
299 //刷新权限跳转首页 299 //刷新权限跳转首页
300 this.$store.dispatch("permissions", command); 300 this.$store.dispatch("permissions", command);
  301 + this.$store.commit('setClasses', "")
301 }, 302 },
302 async logOut() { 303 async logOut() {
303 const { data, status, info } = await this.$request.logout(); 304 const { data, status, info } = await this.$request.logout();
@@ -311,6 +312,7 @@ export default { @@ -311,6 +312,7 @@ export default {
311 this.$store.commit("setInfo", ""); 312 this.$store.commit("setInfo", "");
312 this.$store.commit("setRouters", ""); 313 this.$store.commit("setRouters", "");
313 this.$store.commit("resetTabnavBox"); 314 this.$store.commit("resetTabnavBox");
  315 + this.$store.commit('setClasses', "")
314 this.$router.push({ 316 this.$router.push({
315 path: "/login", 317 path: "/login",
316 }); 318 });