Commit 236b1f0ec23f7f97a3414a55b1990a442b62efe8
1 parent
277915e3
周末-飞书bug
Showing
20 changed files
with
247 additions
and
136 deletions
src/api/apis/apis.js
... | ... | @@ -282,6 +282,24 @@ export default { |
282 | 282 | responseType: 'arraybuffer', |
283 | 283 | }); |
284 | 284 | }, |
285 | + //任课老师-导出阶段测练报表 | |
286 | + exportPhaseExamReport(data) { | |
287 | + return service({ | |
288 | + url: setUpUrls.exportPhaseExamReport, | |
289 | + method: "POST", | |
290 | + data, | |
291 | + responseType: 'arraybuffer', | |
292 | + }); | |
293 | + }, | |
294 | + //任课老师-导出单卷测练报表 | |
295 | + exportExamReport(data) { | |
296 | + return service({ | |
297 | + url: setUpUrls.exportExamReport, | |
298 | + method: "POST", | |
299 | + data, | |
300 | + responseType: 'arraybuffer', | |
301 | + }); | |
302 | + }, | |
285 | 303 | |
286 | 304 | |
287 | 305 | // 查询角色列表 | ... | ... |
src/api/axios.js
... | ... | @@ -39,7 +39,7 @@ service.interceptors.response.use( |
39 | 39 | store.commit("delTokenSources", response.config.cancelToken); |
40 | 40 | } |
41 | 41 | if (response.status == 200) { |
42 | - // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | |
42 | + // Cookies.set("access_token", response.data.info, { expires: 1 / 12 }) | |
43 | 43 | // console.log(response.status) |
44 | 44 | if (res.status == 999) { |
45 | 45 | if (!location.href.includes("localhost")) { |
... | ... | @@ -57,7 +57,7 @@ service.interceptors.response.use( |
57 | 57 | } |
58 | 58 | } |
59 | 59 | } else { |
60 | - // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | |
60 | + // Cookies.set("access_token", response.data.info, { expires: 1 / 12 }) | |
61 | 61 | } |
62 | 62 | } |
63 | 63 | return Promise.resolve(res); | ... | ... |
src/api/urls/apis.js
... | ... | @@ -69,6 +69,10 @@ export default { |
69 | 69 | exportPhaseInteractiveReport: "/api_html/teaching/exportPhaseInteractiveReport", |
70 | 70 | //任课老师-导出单课时报表 |
71 | 71 | exportPeriodReport: "/api_html/teaching/exportPeriodReport", |
72 | + //任课老师-导出阶段测练报表 | |
73 | + exportPhaseExamReport: "/api_html/teaching/exportPhaseExamReport", | |
74 | + //任课老师-导出单卷测练报表 | |
75 | + exportExamReport: "/api_html/teaching/exportExamReport", | |
72 | 76 | |
73 | 77 | |
74 | 78 | ... | ... |
src/components/charts/scatterChart.vue
... | ... | @@ -42,9 +42,10 @@ export default { |
42 | 42 | type: "cross", |
43 | 43 | }, |
44 | 44 | formatter: function (params) { |
45 | + let value = params.data.value.toFixed(2) | |
45 | 46 | return ( |
46 | 47 | params.marker + |
47 | - ` 占比:${params.data.value}% <br>数量:${params.data.count}` | |
48 | + ` 占比:${value}% <br>数量:${params.data.count}` | |
48 | 49 | ); |
49 | 50 | }, |
50 | 51 | }, | ... | ... |
src/components/setAnswer.vue
src/router/index.js
... | ... | @@ -34,13 +34,14 @@ const SetUpTeacher = () => import("@/views/setUp/teacher") |
34 | 34 | * 重写路由的push方法 |
35 | 35 | */ |
36 | 36 | const routerPush = Router.prototype.push |
37 | -Router.prototype.push = function push (location) { | |
37 | +Router.prototype.push = function push(location) { | |
38 | 38 | return routerPush.call(this, location).catch(error => error) |
39 | 39 | } |
40 | 40 | Vue.use(Router) |
41 | 41 | let routeName = en.routeName |
42 | 42 | let defaultRouter = [ |
43 | - { path: "/", | |
43 | + { | |
44 | + path: "/", | |
44 | 45 | redirect: "/index", |
45 | 46 | hidden: true, |
46 | 47 | children: [] |
... | ... | @@ -97,7 +98,7 @@ let addrouters = [ //测试用,后续后端获取 |
97 | 98 | iconCls: "", // 图标样式class |
98 | 99 | name: "添加答题卡", |
99 | 100 | component: ExaminationPaperAdd, |
100 | - parent:"examinationPaper", | |
101 | + parent: "examinationPaper", | |
101 | 102 | children: [] |
102 | 103 | }, |
103 | 104 | { |
... | ... | @@ -105,7 +106,7 @@ let addrouters = [ //测试用,后续后端获取 |
105 | 106 | iconCls: "", // 图标样式class |
106 | 107 | name: "修改答题卡", |
107 | 108 | component: ExaminationPaperEdit, |
108 | - parent:"examinationPaper", | |
109 | + parent: "examinationPaper", | |
109 | 110 | children: [] |
110 | 111 | }, |
111 | 112 | { |
... | ... | @@ -113,7 +114,7 @@ let addrouters = [ //测试用,后续后端获取 |
113 | 114 | iconCls: "", // 图标样式class |
114 | 115 | name: "已归档答题卡", |
115 | 116 | component: ExaminationPaperRecycle, |
116 | - parent:"examinationPaper", | |
117 | + parent: "examinationPaper", | |
117 | 118 | children: [] |
118 | 119 | }, |
119 | 120 | ] |
... | ... | @@ -130,6 +131,9 @@ let addrouters = [ //测试用,后续后端获取 |
130 | 131 | iconCls: "fa fa-bar-chart", // 图标样式class |
131 | 132 | name: "", |
132 | 133 | component: Ask, |
134 | + meta: { | |
135 | + keepAlive: true, | |
136 | + }, | |
133 | 137 | children: [] |
134 | 138 | |
135 | 139 | }, |
... | ... | @@ -138,7 +142,7 @@ let addrouters = [ //测试用,后续后端获取 |
138 | 142 | iconCls: "", // 图标样式class |
139 | 143 | name: "随堂问报表分析", |
140 | 144 | component: AskAnalysis, |
141 | - parent:"ask", | |
145 | + parent: "ask", | |
142 | 146 | children: [] |
143 | 147 | } |
144 | 148 | ] |
... | ... | @@ -155,6 +159,9 @@ let addrouters = [ //测试用,后续后端获取 |
155 | 159 | iconCls: "fa fa-pie-chart", // 图标样式class |
156 | 160 | name: "", |
157 | 161 | component: Test, |
162 | + meta: { | |
163 | + keepAlive: true, | |
164 | + }, | |
158 | 165 | children: [] |
159 | 166 | }, |
160 | 167 | { |
... | ... | @@ -162,7 +169,7 @@ let addrouters = [ //测试用,后续后端获取 |
162 | 169 | iconCls: "", // 图标样式class |
163 | 170 | name: "即时测报表分析", |
164 | 171 | component: TestAnalysis, |
165 | - parent:"test", | |
172 | + parent: "test", | |
166 | 173 | children: [] |
167 | 174 | } |
168 | 175 | |
... | ... | @@ -184,7 +191,7 @@ let addrouters = [ //测试用,后续后端获取 |
184 | 191 | // } |
185 | 192 | // ] |
186 | 193 | // }, |
187 | - | |
194 | + | |
188 | 195 | { |
189 | 196 | path: "/setUpConglomerate", |
190 | 197 | iconCls: "fa fa-building", // 图标样式class |
... | ... | @@ -274,6 +281,9 @@ let addrouters = [ //测试用,后续后端获取 |
274 | 281 | iconCls: "fa fa-dashboard", // 图标样式class |
275 | 282 | name: "", |
276 | 283 | component: Device, |
284 | + meta: { | |
285 | + keepAlive: true, | |
286 | + }, | |
277 | 287 | children: [] |
278 | 288 | }, |
279 | 289 | { |
... | ... | @@ -281,7 +291,7 @@ let addrouters = [ //测试用,后续后端获取 |
281 | 291 | iconCls: "fa fa-list-alt", // 图标样式class |
282 | 292 | name: "", |
283 | 293 | component: DeviceLog, |
284 | - parent:"device", | |
294 | + parent: "device", | |
285 | 295 | children: [] |
286 | 296 | } |
287 | 297 | ] |
... | ... | @@ -321,7 +331,7 @@ let addrouters = [ //测试用,后续后端获取 |
321 | 331 | iconCls: "", // 图标样式class |
322 | 332 | name: "授课端软件", |
323 | 333 | component: DownClient, |
324 | - parent:"down", | |
334 | + parent: "down", | |
325 | 335 | children: [] |
326 | 336 | } |
327 | 337 | ] |
... | ... | @@ -347,4 +357,4 @@ let addrouters = [ //测试用,后续后端获取 |
347 | 357 | export default new Router({ |
348 | 358 | routes: defaultRouter |
349 | 359 | }) |
350 | -export {defaultRouter,addrouters} | |
360 | +export { defaultRouter, addrouters } | ... | ... |
src/views/ask/analysis.vue
src/views/ask/index.vue
src/views/device/index.vue
... | ... | @@ -447,7 +447,7 @@ |
447 | 447 | clearable |
448 | 448 | v-model="form.classIds" |
449 | 449 | :options="gradeList" |
450 | - :props="{ expandTrigger: 'hover', checkStrictly: true }" | |
450 | + :props="{ expandTrigger: 'hover'}" | |
451 | 451 | :show-all-levels="false" |
452 | 452 | ></el-cascader> |
453 | 453 | </el-col> |
... | ... | @@ -467,7 +467,7 @@ |
467 | 467 | </el-form-item> |
468 | 468 | </el-form> |
469 | 469 | <div class="dialog-footer" slot="footer"> |
470 | - <el-button type="primary" @click="addAnswerEqu">确 定</el-button> | |
470 | + <el-button type="primary" @click="setAnswerEqu">确 定</el-button> | |
471 | 471 | <el-button @click="diaAnswerEqu = false">取 消</el-button> |
472 | 472 | </div> |
473 | 473 | </el-dialog> |
... | ... | @@ -541,7 +541,7 @@ export default { |
541 | 541 | sn: "", |
542 | 542 | frequency: "", |
543 | 543 | pairingCode: "", |
544 | - classIds: [], | |
544 | + classIds: "", | |
545 | 545 | roomName: "", |
546 | 546 | }, |
547 | 547 | formRules: { |
... | ... | @@ -615,9 +615,7 @@ export default { |
615 | 615 | edit(obj) { |
616 | 616 | for (let key in this.form) { |
617 | 617 | if (key == "classIds") { |
618 | - this.form[key] = obj.classList?.map((item) => { | |
619 | - return [item.classId]; | |
620 | - }); | |
618 | + this.form[key] = obj.classList[0]?.classId | |
621 | 619 | } else { |
622 | 620 | this.form[key] = obj[key]; |
623 | 621 | } |
... | ... | @@ -713,7 +711,7 @@ export default { |
713 | 711 | this.selectionTabIds = []; |
714 | 712 | this.$message.success("开启自动更新成功"); |
715 | 713 | } else { |
716 | - this.$message.error(data.message); | |
714 | + this.$message.error(data.info); | |
717 | 715 | } |
718 | 716 | }, |
719 | 717 | async stopUpdate(id) { |
... | ... | @@ -733,7 +731,7 @@ export default { |
733 | 731 | this._QueryData(false); |
734 | 732 | this.$message.success("关闭自动更新成功"); |
735 | 733 | } else { |
736 | - this.$message.error(data.message); | |
734 | + this.$message.error(data.info); | |
737 | 735 | } |
738 | 736 | }, |
739 | 737 | async downExcel() { |
... | ... | @@ -750,16 +748,18 @@ export default { |
750 | 748 | } |
751 | 749 | }, |
752 | 750 | |
753 | - // 添加设备 | |
754 | - addAnswerEqu() { | |
751 | + // 修改基站 | |
752 | + setAnswerEqu() { | |
755 | 753 | this.$refs.forms.validate(async (valid) => { |
756 | 754 | if (valid) { |
757 | 755 | if (this.loadingAnswerEqu) return; |
758 | 756 | this.loadingAnswerEqu = true; |
759 | 757 | let query = { ...this.form }; |
760 | - query.classIds = query.classIds.map((item) => { | |
761 | - return item[1]; | |
762 | - }); | |
758 | + | |
759 | + // query.classIds = query.classIds.map((item) => { | |
760 | + // return item[1]; | |
761 | + // }); | |
762 | + query.classIds = [query.classIds] | |
763 | 763 | const { data, status, info } = await this.$request.updateDevice({ |
764 | 764 | ...query, |
765 | 765 | }); | ... | ... |
src/views/examinationPaper/add.vue
... | ... | @@ -186,7 +186,7 @@ |
186 | 186 | class="number-ipt" |
187 | 187 | size="medium" |
188 | 188 | :min="1" |
189 | - :max="100" | |
189 | + :max="200" | |
190 | 190 | :precision="2" |
191 | 191 | :step="1" |
192 | 192 | v-model="subQuestions.score" |
... | ... | @@ -308,7 +308,7 @@ |
308 | 308 | > |
309 | 309 | <div class="dia-content"> |
310 | 310 | <el-form |
311 | - ref="form" | |
311 | + ref="form" | |
312 | 312 | :model="questionForm" |
313 | 313 | :rules="questionFormRules" |
314 | 314 | label-width="100px" |
... | ... | @@ -364,7 +364,7 @@ |
364 | 364 | <el-input-number |
365 | 365 | v-model="questionForm.score" |
366 | 366 | :min="1" |
367 | - :max="100" | |
367 | + :max="200" | |
368 | 368 | :precision="2" |
369 | 369 | :step="1" |
370 | 370 | label="label" |
... | ... | @@ -439,7 +439,7 @@ |
439 | 439 | class="number-ipt" |
440 | 440 | size="medium" |
441 | 441 | :min="1" |
442 | - :max="100" | |
442 | + :max="200" | |
443 | 443 | :precision="2" |
444 | 444 | v-model="subQuestions.score" |
445 | 445 | label="单题分值" |
... | ... | @@ -508,6 +508,7 @@ |
508 | 508 | <el-dialog |
509 | 509 | title="批量设置答案" |
510 | 510 | :visible.sync="diaSetAns" |
511 | + :close-on-click-modal="false" | |
511 | 512 | width="400" |
512 | 513 | :modal-append-to-body="false" |
513 | 514 | > | ... | ... |
src/views/examinationPaper/index.vue
... | ... | @@ -108,6 +108,9 @@ |
108 | 108 | }} |
109 | 109 | <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i |
110 | 110 | ></span> |
111 | + <el-tooltip effect="dark" content="同步" placement="right"> | |
112 | + <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i> | |
113 | + </el-tooltip> | |
111 | 114 | </p> |
112 | 115 | <p class="person"> |
113 | 116 | {{ item.realName }}<em class="s-line">|</em |
... | ... | @@ -221,6 +224,11 @@ export default { |
221 | 224 | this._QueryTypeList(); |
222 | 225 | }, |
223 | 226 | methods: { |
227 | + refreshStic(){ | |
228 | + setTimeout(function(){ | |
229 | + window.location.reload() | |
230 | + },500) | |
231 | + }, | |
224 | 232 | toAdd(query) { |
225 | 233 | let routerItem = { |
226 | 234 | path: "/examinationPaperAdd", |
... | ... | @@ -499,6 +507,13 @@ export default { |
499 | 507 | margin-right: 12px; |
500 | 508 | } |
501 | 509 | } |
510 | + .icon-refresh{ | |
511 | + margin-left:20px; | |
512 | + cursor: pointer; | |
513 | + &:hover{ | |
514 | + color:#2e9afe | |
515 | + } | |
516 | + } | |
502 | 517 | } |
503 | 518 | } |
504 | 519 | .answer-header { | ... | ... |
src/views/layout/layout.vue
... | ... | @@ -5,10 +5,13 @@ |
5 | 5 | <el-container> |
6 | 6 | <layoutHeader></layoutHeader> |
7 | 7 | <el-main id="elmain"> |
8 | - <transition name="main" mode="out-in"> | |
9 | - <keep-alive> | |
10 | - <router-view></router-view> | |
8 | + <!-- <transition name="main" mode="out-in"> | |
9 | + <keep-alive key="keepAlive"> | |
10 | + <router-view v-if="$route.meta.keepAlive" ></router-view> | |
11 | 11 | </keep-alive> |
12 | + </transition> --> | |
13 | + <transition name="main" mode="out-in"> | |
14 | + <router-view key="not-keepAlive"></router-view> | |
12 | 15 | </transition> |
13 | 16 | </el-main> |
14 | 17 | <el-footer height="28px"> |
... | ... | @@ -41,6 +44,7 @@ export default { |
41 | 44 | }, |
42 | 45 | created() { |
43 | 46 | // this.initRouter(); |
47 | + console.log(this.$route.meta.keepAlive) | |
44 | 48 | }, |
45 | 49 | methods: { |
46 | 50 | initRouter() { | ... | ... |
src/views/login/index.vue
... | ... | @@ -95,14 +95,14 @@ export default { |
95 | 95 | loginForm: { |
96 | 96 | // username: "15911715665", |
97 | 97 | // password: "715665", |
98 | - username: "18314340313", | |
99 | - password: "Pw340313#", | |
98 | + // username: "18314340313", | |
99 | + // password: "Pw340313#", | |
100 | 100 | // username: "18687826606", |
101 | 101 | // password: "Pw826606#", |
102 | 102 | // username: "18893712576", |
103 | 103 | // password: "712576", |
104 | - // username: "13247726488", | |
105 | - // password: "726488", | |
104 | + username: "13247726488", | |
105 | + password: "726488", | |
106 | 106 | }, |
107 | 107 | loginRules: { |
108 | 108 | username: [ | ... | ... |
src/views/setUp/account.vue
src/views/setUp/school.vue
src/views/setUp/student.vue
src/views/setUp/teacher.vue
... | ... | @@ -761,9 +761,9 @@ export default { |
761 | 761 | let blob = new Blob([data], { |
762 | 762 | type: "application/vnd.ms-excel;charset=utf-8", |
763 | 763 | }); |
764 | - downloadFile(`设备信息.xlsx`, blob); | |
764 | + downloadFile(`教师名单.xlsx`, blob); | |
765 | 765 | } else { |
766 | - this.$message.error(data.message); | |
766 | + this.$message.error(data.info); | |
767 | 767 | } |
768 | 768 | }, |
769 | 769 | }, | ... | ... |
src/views/test/analysis.vue
... | ... | @@ -131,12 +131,12 @@ |
131 | 131 | :label="item.title" |
132 | 132 | :prop="'count' + index" |
133 | 133 | align="center" |
134 | - ><template slot-scope="scope"><p class="present">{{ | |
134 | + ><template slot-scope="scope"><p class="persent">{{ | |
135 | 135 | scope.row.questionType == "5" |
136 | 136 | ? "" |
137 | 137 | : scope.row["option" + index] |
138 | 138 | ? `${scope.row["option" + index]}(${ |
139 | - scope.row["present" + index] | |
139 | + scope.row["persent" + index] | |
140 | 140 | })` |
141 | 141 | : "" |
142 | 142 | }}</p></template> |
... | ... | @@ -522,7 +522,7 @@ export default { |
522 | 522 | }); |
523 | 523 | downloadFile(`主观题模版.xlsx`, blob); |
524 | 524 | } else { |
525 | - this.$message.error(data.message); | |
525 | + this.$message.error(data.info); | |
526 | 526 | } |
527 | 527 | }, |
528 | 528 | async _QueryData() { |
... | ... | @@ -625,8 +625,8 @@ export default { |
625 | 625 | if (index != 4) { |
626 | 626 | params["count" + index] = |
627 | 627 | defaultArr[index]?.option != "未答" ? defaultArr[index]?.count : ""; |
628 | - params["present" + index] = | |
629 | - defaultArr[index]?.option != "未答" ? defaultArr[index]?.present : ""; | |
628 | + params["persent" + index] = | |
629 | + defaultArr[index]?.option != "未答" ? defaultArr[index]?.persent : ""; | |
630 | 630 | params["option" + index] = |
631 | 631 | defaultArr[index]?.option != "未答" |
632 | 632 | ? defaultArr[index]?.option == 1 |
... | ... | @@ -639,7 +639,7 @@ export default { |
639 | 639 | } else { |
640 | 640 | items["title"] = "未答"; |
641 | 641 | params["count" + index] = lastOPtion.count; |
642 | - params["present" + index] = lastOPtion.present; | |
642 | + params["persent" + index] = lastOPtion.persent; | |
643 | 643 | params["option" + index] = "?"; |
644 | 644 | } |
645 | 645 | }); |
... | ... | @@ -660,15 +660,23 @@ export default { |
660 | 660 | }, |
661 | 661 | //导出 |
662 | 662 | async exportData() { |
663 | - // if (this.exportLoading == true) return; | |
664 | - // this.exportLoading = true; | |
665 | - // const { data, status, info } = await this.$request.exportPeriodReport(); | |
666 | - // this.exportLoading = false; | |
667 | - // if (data) { | |
668 | - // downloadFile(this.title + "报表", data); | |
669 | - // } else { | |
670 | - // this.$message.error(info); | |
671 | - // } | |
663 | + if (this.exportLoading == true) return; | |
664 | + this.exportLoading = true; | |
665 | + const data = await this.$request.exportExamReport({ | |
666 | + examId:this.id | |
667 | + }); | |
668 | + this.exportLoading = false; | |
669 | + if (data) { | |
670 | + let blob = new Blob([data], { | |
671 | + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | |
672 | + }); | |
673 | + downloadFile( | |
674 | + "即时测-单卷测练报表.xlsx", | |
675 | + blob | |
676 | + ); | |
677 | + } else { | |
678 | + this.$message.error("下载失败"); | |
679 | + } | |
672 | 680 | }, |
673 | 681 | }, |
674 | 682 | }; |
... | ... | @@ -706,7 +714,7 @@ div::-webkit-scrollbar-thumb { |
706 | 714 | z-index: 10; |
707 | 715 | } |
708 | 716 | } |
709 | -.present{ | |
717 | +.persent{ | |
710 | 718 | white-space: nowrap; |
711 | 719 | } |
712 | 720 | .error { | ... | ... |
src/views/test/editAnswer.vue
src/views/test/index.vue
... | ... | @@ -322,99 +322,103 @@ |
322 | 322 | </div> |
323 | 323 | </div> |
324 | 324 | <div v-show="tabIndex == 2" v-loading="loading"> |
325 | - <el-table | |
326 | - :max-height="tableMaxHeight" | |
327 | - v-if="role == 'ROLE_JIAOSHI'" | |
328 | - :data="tableData" | |
329 | - border | |
330 | - style="width: 100%" | |
331 | - > | |
332 | - <el-table-column | |
333 | - prop="studentCode" | |
334 | - label="学号" | |
335 | - align="center" | |
336 | - fixed | |
337 | - ></el-table-column> | |
338 | - <el-table-column | |
339 | - prop="studentName" | |
340 | - label="姓名" | |
341 | - fixed | |
342 | - align="center" | |
343 | - ></el-table-column> | |
344 | - <el-table-column | |
345 | - align="center" | |
346 | - v-for="(item, index) in answerList" | |
347 | - :key="index" | |
348 | - :label="item.title" | |
325 | + <el-empty :image-size="100" v-if="!tableData.length&&loading==false" description="没有更多数据"></el-empty> | |
326 | + <template v-if="tableData.length&&loading==false"> | |
327 | + <el-table | |
328 | + :max-height="tableMaxHeight" | |
329 | + v-if="role == 'ROLE_JIAOSHI'" | |
330 | + :data="tableData" | |
331 | + border | |
332 | + style="width: 100%" | |
349 | 333 | > |
350 | 334 | <el-table-column |
351 | - :prop="'score' + index" | |
352 | - :label="index == 0 ? '总分' : '成绩'" | |
335 | + prop="studentCode" | |
336 | + label="学号" | |
353 | 337 | align="center" |
354 | - :class-name="index % 2 == 0 ? 'bg' : ''" | |
338 | + fixed | |
355 | 339 | ></el-table-column> |
356 | 340 | <el-table-column |
357 | - :prop="'classRank' + index" | |
358 | - label="班名" | |
341 | + prop="studentName" | |
342 | + label="姓名" | |
343 | + fixed | |
359 | 344 | align="center" |
360 | - :class-name="index % 2 == 0 ? 'bg' : ''" | |
361 | 345 | ></el-table-column> |
362 | - </el-table-column> | |
363 | - </el-table> | |
364 | - <el-table | |
365 | - v-else | |
366 | - :data="tableData" | |
367 | - :max-height="tableMaxHeight" | |
368 | - border | |
369 | - style="width: 100%" | |
370 | - > | |
371 | - <el-table-column | |
372 | - prop="studentCode" | |
373 | - label="学号" | |
374 | - align="center" | |
375 | - fixed | |
376 | - ></el-table-column> | |
377 | - <el-table-column | |
378 | - prop="studentName" | |
379 | - label="姓名" | |
380 | - fixed | |
381 | - align="center" | |
382 | - ></el-table-column> | |
383 | - <el-table-column | |
384 | - align="center" | |
385 | - v-for="(item, index) in answerList" | |
386 | - :key="index" | |
387 | - :label="item" | |
388 | - > | |
389 | 346 | <el-table-column |
390 | - :prop="'examCount' + item" | |
391 | - label="测练数" | |
392 | 347 | align="center" |
393 | - :class-name="index % 2 == 0 ? 'bg' : ''" | |
394 | - ></el-table-column> | |
348 | + v-for="(item, index) in answerList" | |
349 | + :key="index" | |
350 | + :label="item.title" | |
351 | + > | |
352 | + <el-table-column | |
353 | + :prop="'score' + index" | |
354 | + :label="index == 0 ? '总分' : '成绩'" | |
355 | + align="center" | |
356 | + :class-name="index % 2 == 0 ? 'bg' : ''" | |
357 | + ></el-table-column> | |
358 | + <el-table-column | |
359 | + :prop="'classRank' + index" | |
360 | + label="班名" | |
361 | + align="center" | |
362 | + :class-name="index % 2 == 0 ? 'bg' : ''" | |
363 | + ></el-table-column> | |
364 | + </el-table-column> | |
365 | + </el-table> | |
366 | + <el-table | |
367 | + v-else | |
368 | + :data="tableData" | |
369 | + :max-height="tableMaxHeight" | |
370 | + border | |
371 | + style="width: 100%" | |
372 | + > | |
395 | 373 | <el-table-column |
396 | - :prop="'participationCount' + item" | |
397 | - label="参与数" | |
374 | + prop="studentCode" | |
375 | + label="学号" | |
398 | 376 | align="center" |
399 | - :class-name="index % 2 == 0 ? 'bg' : ''" | |
377 | + fixed | |
400 | 378 | ></el-table-column> |
401 | 379 | <el-table-column |
402 | - :prop="'score' + item" | |
403 | - label="总分" | |
380 | + prop="studentName" | |
381 | + label="姓名" | |
382 | + fixed | |
404 | 383 | align="center" |
405 | - :class-name="index % 2 == 0 ? 'bg' : ''" | |
406 | 384 | ></el-table-column> |
407 | 385 | <el-table-column |
408 | - :prop="'classRank' + item" | |
409 | - label="班名" | |
410 | 386 | align="center" |
411 | - :class-name="index % 2 == 0 ? 'bg' : ''" | |
412 | - ></el-table-column> | |
413 | - </el-table-column> | |
414 | - </el-table> | |
387 | + v-for="(item, index) in answerList" | |
388 | + :key="index" | |
389 | + :label="item" | |
390 | + > | |
391 | + <el-table-column | |
392 | + :prop="'examCount' + item" | |
393 | + label="测练数" | |
394 | + align="center" | |
395 | + :class-name="index % 2 == 0 ? 'bg' : ''" | |
396 | + ></el-table-column> | |
397 | + <el-table-column | |
398 | + :prop="'participationCount' + item" | |
399 | + label="参与数" | |
400 | + align="center" | |
401 | + :class-name="index % 2 == 0 ? 'bg' : ''" | |
402 | + ></el-table-column> | |
403 | + <el-table-column | |
404 | + :prop="'score' + item" | |
405 | + label="总分" | |
406 | + align="center" | |
407 | + :class-name="index % 2 == 0 ? 'bg' : ''" | |
408 | + ></el-table-column> | |
409 | + <el-table-column | |
410 | + :prop="'classRank' + item" | |
411 | + label="班名" | |
412 | + align="center" | |
413 | + :class-name="index % 2 == 0 ? 'bg' : ''" | |
414 | + ></el-table-column> | |
415 | + </el-table-column> | |
416 | + </el-table> | |
417 | + </template> | |
415 | 418 | </div> |
416 | - <p class="down" v-if="tabIndex == 2"> | |
419 | + <p class="down" v-if="tabIndex == 2 && tableData.length"> | |
417 | 420 | <el-button type="primary" plain round icon="fa fa-cloud-download" |
421 | + @click="downExl" | |
418 | 422 | >导出报表</el-button |
419 | 423 | > |
420 | 424 | </p> |
... | ... | @@ -458,6 +462,7 @@ export default { |
458 | 462 | components: { editAnswer }, |
459 | 463 | data() { |
460 | 464 | return { |
465 | + exportLoading:false, | |
461 | 466 | tableMaxHeight: 300, |
462 | 467 | role: "", |
463 | 468 | loading: false, |
... | ... | @@ -643,7 +648,7 @@ export default { |
643 | 648 | }); |
644 | 649 | downloadFile(`主观题模版.xlsx`, blob); |
645 | 650 | } else { |
646 | - this.$message.error(data.message); | |
651 | + this.$message.error(data.info); | |
647 | 652 | } |
648 | 653 | }, |
649 | 654 | async changClazz() { |
... | ... | @@ -837,6 +842,49 @@ export default { |
837 | 842 | this.$message.error(info); |
838 | 843 | } |
839 | 844 | }, |
845 | + async downExl(){ | |
846 | + if (this.exportLoading == true) return; | |
847 | + let query = {}; | |
848 | + for (let key in this.query) { | |
849 | + if (this.query[key] != "") { | |
850 | + if (key == "subjectNames" && this.role != "ROLE_BANZHUREN") { | |
851 | + query["subjectName"] = this.query[key]; | |
852 | + } else { | |
853 | + query[key] = this.query[key]; | |
854 | + } | |
855 | + } | |
856 | + } | |
857 | + if (this.role == "ROLE_BANZHUREN") { | |
858 | + if ( | |
859 | + query["subjectNames"] && | |
860 | + query["subjectNames"].length == 1 && | |
861 | + query["subjectNames"][0] == "全部" | |
862 | + ) { | |
863 | + query["subjectNames"] = this.subjectList.map((item) => { | |
864 | + return item.value; | |
865 | + }); | |
866 | + query["subjectNames"].shift(); | |
867 | + } | |
868 | + if (!query["subjectNames"]) { | |
869 | + this.$message.warning("请选择科目"); | |
870 | + return; | |
871 | + } | |
872 | + } | |
873 | + this.exportLoading = true; | |
874 | + const data = await this.$request.exportPhaseExamReport({ ...query }); | |
875 | + this.exportLoading = false; | |
876 | + if (data) { | |
877 | + let blob = new Blob([data], { | |
878 | + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | |
879 | + }); | |
880 | + downloadFile( | |
881 | + "即时测-阶段测练报表.xlsx", | |
882 | + blob | |
883 | + ); | |
884 | + } else { | |
885 | + this.$message.error("下载失败"); | |
886 | + } | |
887 | + } | |
840 | 888 | }, |
841 | 889 | }; |
842 | 890 | </script> | ... | ... |