Commit 503b606383864d69ad7d131c3b0fa348e655eb73

Authored by 梁保满
1 parent 236b1f0e

判断题答案选项

src/api/apis/apis.js
... ... @@ -74,6 +74,33 @@ export default {
74 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 106 tClassList(data) {
... ...
src/api/urls/apis.js
... ... @@ -18,6 +18,12 @@ export default {
18 18 cTPhaseInteractiveReport: "/api_html/class/manager/phaseInteractiveReport",
19 19 //班主任-查询阶段测练报表
20 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 29 tClassList: "/api_html/teaching/classList",
... ...
src/views/ask/analysis.vue
... ... @@ -50,7 +50,7 @@
50 50 已答总正确率:{{ detail.answerCorrectRate }}%
51 51 </li>
52 52 <li class="info-item">
53   - 反馈时长:{{ detail.consumingDuration }}分钟
  53 + 反馈时长:{{ setDuration(detail.consumingDuration) }}
54 54 </li>
55 55 </ul>
56 56 <el-table v-if="type == 1" :data="tableData" border style="width: 100%">
... ... @@ -333,9 +333,22 @@ export default {
333 333 this._QueryData();
334 334 },
335 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 353 setSubPro(type) {
341 354 let tit;
... ...
src/views/ask/index.vue
... ... @@ -93,9 +93,7 @@
93 93 @change="tabChange"
94 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 97 <!-- <el-radio-button :label="2" v-if="this.role != 'ROLE_BANZHUREN'"
100 98 >阶段问答报表</el-radio-button
101 99 > -->
... ... @@ -439,7 +437,10 @@
439 437 >
440 438 </el-pagination>
441 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 444 <el-button
444 445 @click="exportData"
445 446 type="primary"
... ... @@ -544,7 +545,7 @@ export default {
544 545 that.query.day = formatDate(new Date(), "yyyy-MM-dd");
545 546 that.query.startDay = that.query.day;
546 547 that.query.endDay = that.query.day;
547   - that.tabIndex = 1
  548 + that.tabIndex = 1;
548 549 break;
549 550 case 2:
550 551 let day = new Date().getDay();
... ... @@ -644,10 +645,10 @@ export default {
644 645 this.page = page;
645 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 653 async changClazz() {
653 654 await this._QuerySubjectList();
... ... @@ -936,10 +937,18 @@ export default {
936 937 }
937 938 }
938 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 952 const data = await exportData({ ...query });
944 953 this.exportLoading = false;
945 954 if (data) {
... ...
src/views/dataSync/index.vue
... ... @@ -31,9 +31,7 @@
31 31  
32 32 <div class="down-item">
33 33 <p class="h-title">数据导出至U盘</p>
34   - <p class="txt">
35   - 本功能将云平台的数据导出到U盘。
36   - </p>
  34 + <p class="txt">本功能将云平台的数据导出到U盘。</p>
37 35 <div class="btn-box btn-box2" v-loading="downLoading">
38 36 <i class="fa fa-cloud-download" @click="downloadFile"></i>
39 37 <el-button type="primary" round @click="downloadFile"
... ... @@ -42,6 +40,19 @@
42 40 </div>
43 41 </div>
44 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 56 </div>
46 57 </template>
47 58  
... ... @@ -53,6 +64,12 @@ export default {
53 64 downLoading: false,
54 65 url: "/api_html/teaching/importData",
55 66 file: {},
  67 + dialogVisible: false,
  68 + tipData: {
  69 + paperNum: 0,
  70 + periodNum: 0,
  71 + examNum: 0,
  72 + },
56 73 };
57 74 },
58 75 methods: {
... ... @@ -61,13 +78,16 @@ export default {
61 78 this.downLoading = true;
62 79 const data = await this.$request.exportData();
63 80 this.downLoading = false;
64   - console.log(data)
  81 + console.log(data);
65 82 if (data) {
66   - let blob = new Blob([data], {type: 'application/octet-stream'})
  83 + let blob = new Blob([data], { type: "application/octet-stream" });
67 84 const url = URL.createObjectURL(blob);
68 85 const link = document.createElement("a");
69 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 91 link.href = url;
72 92 link.click();
73 93 document.body.removeChild(link);
... ... @@ -91,16 +111,15 @@ export default {
91 111 // }
92 112 },
93 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 117 } else {
99 118 this.$message.error(res.info);
100 119 }
101 120 },
102 121 upError(res) {
103   - debugger
  122 + debugger;
104 123 if (res && res.status == 0) {
105 124 this.$message.error("上传失败");
106 125 } else {
... ... @@ -121,6 +140,7 @@ export default {
121 140 justify-content: center;
122 141 .down-item {
123 142 width: 400px;
  143 + height:330px;
124 144 border-radius: 20px;
125 145 margin: 20px;
126 146 background: #f8f8f8;
... ... @@ -140,8 +160,10 @@ export default {
140 160 }
141 161 }
142 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 168 :deep(.el-upload) {
147 169 margin: 0 auto;
... ... @@ -151,7 +173,7 @@ export default {
151 173 flex-direction: column;
152 174 justify-content: center;
153 175 align-items: center;
154   - padding-bottom: 40px;
  176 + padding-bottom: 10px;
155 177 .fa {
156 178 font-size: 80px;
157 179 color: #aeaeae;
... ...
src/views/examinationPaper/add.vue
... ... @@ -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"
... ... @@ -843,7 +843,12 @@ export default {
843 843  
844 844 console.log(this.formAns.answerList.split(",")[subNum - i]);
845 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 853 this.form.questionList[this.formAns.listIndex].subQuestions[
849 854 EndIndex - i
... ... @@ -959,7 +964,7 @@ export default {
959 964 types[addndex].qusType = sub.questionType;
960 965 types[addndex].subNum = 1;
961 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 1028 .join(",");
1024 1029 break;
1025 1030 case 4:
  1031 + questionsOptions.selectNum = 0;
  1032 + questionsOptions.answerOptions = "1,2";
  1033 + break;
1026 1034 case 5:
1027 1035 questionsOptions.selectNum = 0;
1028 1036 break;
... ... @@ -1069,6 +1077,9 @@ export default {
1069 1077 questionsOptions.partScore = 0;
1070 1078 break;
1071 1079 case 4:
  1080 + questionsOptions.selectNum = 0;
  1081 + questionsOptions.answerOptions = "1,2";
  1082 + break;
1072 1083 case 5:
1073 1084 questionsOptions.selectNum = 0;
1074 1085 break;
... ... @@ -1096,6 +1107,9 @@ export default {
1096 1107 .join(",");
1097 1108 break;
1098 1109 case 4:
  1110 + subQuestions.selectNum = 0;
  1111 + subQuestions.answerOptions = "1,2";
  1112 + break;
1099 1113 case 5:
1100 1114 subQuestions.selectNum = 0;
1101 1115 break;
... ... @@ -1384,8 +1398,8 @@ export default {
1384 1398 }
1385 1399 .question-title {
1386 1400 line-height: 40px;
1387   - .m20{
1388   - margin-right:20px;
  1401 + .m20 {
  1402 + margin-right: 20px;
1389 1403 }
1390 1404 .ipt {
1391 1405 width: 300px;
... ...
src/views/examinationPaper/edit.vue
... ... @@ -238,18 +238,18 @@ export default {
238 238 }
239 239 },
240 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 253 let questionList = this.form.questionList.map((item) => {
254 254 item.score = null;
255 255 // item.questionId = "";
... ...
src/views/examinationPaper/index.vue
... ... @@ -108,7 +108,7 @@
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">
  111 + <el-tooltip effect="dark" content="刷新同步状态" placement="right">
112 112 <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i>
113 113 </el-tooltip>
114 114 </p>
... ...
src/views/test/index.vue
... ... @@ -322,8 +322,12 @@
322 322 </div>
323 323 </div>
324 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 331 <el-table
328 332 :max-height="tableMaxHeight"
329 333 v-if="role == 'ROLE_JIAOSHI'"
... ... @@ -417,8 +421,12 @@
417 421 </template>
418 422 </div>
419 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 430 >导出报表</el-button
423 431 >
424 432 </p>
... ... @@ -462,7 +470,7 @@ export default {
462 470 components: { editAnswer },
463 471 data() {
464 472 return {
465   - exportLoading:false,
  473 + exportLoading: false,
466 474 tableMaxHeight: 300,
467 475 role: "",
468 476 loading: false,
... ... @@ -842,8 +850,8 @@ export default {
842 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 855 let query = {};
848 856 for (let key in this.query) {
849 857 if (this.query[key] != "") {
... ... @@ -870,21 +878,22 @@ export default {
870 878 return;
871 879 }
872 880 }
  881 + const exportPhaseExamReport =
  882 + this.role == "ROLE_BANZHUREN"
  883 + ? this.$request.cTExportPhaseExamReport
  884 + : this.$request.exportPhaseExamReport;
873 885 this.exportLoading = true;
874   - const data = await this.$request.exportPhaseExamReport({ ...query });
  886 + const data = await exportPhaseExamReport({ ...query });
875 887 this.exportLoading = false;
876 888 if (data) {
877 889 let blob = new Blob([data], {
878 890 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
879 891 });
880   - downloadFile(
881   - "即时测-阶段测练报表.xlsx",
882   - blob
883   - );
  892 + downloadFile("即时测-阶段测练报表.xlsx", blob);
884 893 } else {
885 894 this.$message.error("下载失败");
886 895 }
887   - }
  896 + },
888 897 },
889 898 };
890 899 </script>
... ...