Commit 0e46bc25a9b3d6f04a6622e6f74d32e0905faf61

Authored by 梁保满
1 parent 3de13776

优化

src/api/apis/apis.js
@@ -740,6 +740,7 @@ export default { @@ -740,6 +740,7 @@ export default {
740 url: setUpUrls.exportSchoolContrast, 740 url: setUpUrls.exportSchoolContrast,
741 method: "POST", 741 method: "POST",
742 data, 742 data,
  743 + responseType: 'arraybuffer',
743 }); 744 });
744 }, 745 },
745 // 导出年级使用对比 746 // 导出年级使用对比
@@ -748,6 +749,7 @@ export default { @@ -748,6 +749,7 @@ export default {
748 url: setUpUrls.exportGradeContrast, 749 url: setUpUrls.exportGradeContrast,
749 method: "POST", 750 method: "POST",
750 data, 751 data,
  752 + responseType: 'arraybuffer',
751 }); 753 });
752 }, 754 },
753 }; 755 };
src/utils/index.js
@@ -454,7 +454,7 @@ export function checkAnswer( @@ -454,7 +454,7 @@ export function checkAnswer(
454 //单选 454 //单选
455 console.log(s.length + " " + questionCount); 455 console.log(s.length + " " + questionCount);
456 if (s.length > questionCount) { 456 if (s.length > questionCount) {
457 - s = s.substring(s.length - questionCount, s.length); 457 + s = s.substring(0, questionCount+1);
458 } 458 }
459 } else if (questionType == 3) { 459 } else if (questionType == 3) {
460 //多选 460 //多选
src/views/analysis/index.vue
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 </template> 133 </template>
134 </el-table-column> 134 </el-table-column>
135 </el-table> 135 </el-table>
136 - <p class="down" v-if="role != 'ROLE_JITUAN' && tableData.length"> 136 + <p class="down" v-if="tableData.length">
137 <el-button 137 <el-button
138 @click="downExc" 138 @click="downExc"
139 type="primary" 139 type="primary"
@@ -202,7 +202,10 @@ export default { @@ -202,7 +202,10 @@ export default {
202 delete query.regionId; 202 delete query.regionId;
203 } 203 }
204 this.exportLoading = true; 204 this.exportLoading = true;
205 - const data = await this.$request.exportUsageAnalysis({ ...query }); 205 +
  206 + const exportUsageAnalysis = this.role != "ROLE_JITUAN"?this.$request.exportUsageAnalysis:
  207 + this.type ==1?this.$request.exportSchoolContrast:this.$request.exportGradeContrast
  208 + const data = await exportUsageAnalysis({ ...query });
206 this.exportLoading = false; 209 this.exportLoading = false;
207 if (data) { 210 if (data) {
208 let blob = new Blob([data], { 211 let blob = new Blob([data], {
src/views/ask/analysis.vue
@@ -338,7 +338,7 @@ export default { @@ -338,7 +338,7 @@ export default {
338 let ms = times 338 let ms = times
339 let aTime; 339 let aTime;
340 if(times==0){ 340 if(times==0){
341 - aTime = `0分钟` 341 + aTime = `0`
342 }else{ 342 }else{
343 if(m==0&&s==0){ 343 if(m==0&&s==0){
344 aTime = `${ms}毫秒` 344 aTime = `${ms}毫秒`
src/views/device/index.vue
@@ -320,6 +320,7 @@ @@ -320,6 +320,7 @@
320 </div> 320 </div>
321 </div> 321 </div>
322 <el-table 322 <el-table
  323 + ref="multipleTable"
323 :data="tableData" 324 :data="tableData"
324 border 325 border
325 style="width: 100%" 326 style="width: 100%"
@@ -405,7 +406,11 @@ @@ -405,7 +406,11 @@
405 <el-button @click="diaUp = false">取 消</el-button> 406 <el-button @click="diaUp = false">取 消</el-button>
406 </div> 407 </div>
407 </el-dialog> 408 </el-dialog>
408 - <el-dialog :title="isAdd?'添加基站':'修改基站'" :visible.sync="diaAnswerEqu" width="400"> 409 + <el-dialog
  410 + :title="isAdd ? '添加基站' : '修改基站'"
  411 + :visible.sync="diaAnswerEqu"
  412 + width="400"
  413 + >
409 <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> 414 <el-form ref="forms" :model="form" :rules="formRules" label-width="140px">
410 <el-form-item label="设备编码:" prop="sn"> 415 <el-form-item label="设备编码:" prop="sn">
411 <el-col :span="16" 416 <el-col :span="16"
@@ -508,7 +513,7 @@ export default { @@ -508,7 +513,7 @@ export default {
508 }, 513 },
509 data() { 514 data() {
510 return { 515 return {
511 - isAdd:false,//添加还是修改基站 516 + isAdd: false, //添加还是修改基站
512 role: "", 517 role: "",
513 code: "", 518 code: "",
514 loading: false, 519 loading: false,
@@ -624,7 +629,7 @@ export default { @@ -624,7 +629,7 @@ export default {
624 this._QueryData(); 629 this._QueryData();
625 }, 630 },
626 edit(obj) { 631 edit(obj) {
627 - this.isAdd=false 632 + this.isAdd = false;
628 for (let key in this.form) { 633 for (let key in this.form) {
629 if (key == "classIds") { 634 if (key == "classIds") {
630 this.form[key] = obj.classList[0]?.classId; 635 this.form[key] = obj.classList[0]?.classId;
@@ -632,7 +637,7 @@ export default { @@ -632,7 +637,7 @@ export default {
632 this.form[key] = obj[key]; 637 this.form[key] = obj[key];
633 } 638 }
634 } 639 }
635 - delete this.form.schoolId 640 + delete this.form.schoolId;
636 this.form.deviceId = obj.id; 641 this.form.deviceId = obj.id;
637 this.diaAnswerEqu = true; 642 this.diaAnswerEqu = true;
638 }, 643 },
@@ -693,9 +698,9 @@ export default { @@ -693,9 +698,9 @@ export default {
693 this.form.pairingCode = ""; 698 this.form.pairingCode = "";
694 this.form.classIds = ""; 699 this.form.classIds = "";
695 this.form.roomName = ""; 700 this.form.roomName = "";
696 - this.form.schoolId= this.school.id  
697 - delete this.form.deviceId  
698 - this.isAdd = true 701 + this.form.schoolId = this.school.id;
  702 + delete this.form.deviceId;
  703 + this.isAdd = true;
699 this.diaAnswerEqu = true; 704 this.diaAnswerEqu = true;
700 }, 705 },
701 async showSchool() { 706 async showSchool() {
@@ -783,13 +788,18 @@ export default { @@ -783,13 +788,18 @@ export default {
783 // query.classIds = query.classIds.map((item) => { 788 // query.classIds = query.classIds.map((item) => {
784 // return item[1]; 789 // return item[1];
785 // }); 790 // });
786 - if(typeof query.classIds == 'string' || typeof query.classIds == 'number'){ 791 + if (
  792 + typeof query.classIds == "string" ||
  793 + typeof query.classIds == "number"
  794 + ) {
787 query.classIds = [query.classIds]; 795 query.classIds = [query.classIds];
788 - }else{ 796 + } else {
789 query.classIds = [query.classIds[1]]; 797 query.classIds = [query.classIds[1]];
790 } 798 }
791 -  
792 - let deviceApi = this.isAdd?this.$request.addStation:this.$request.updateDevice 799 +
  800 + let deviceApi = this.isAdd
  801 + ? this.$request.addStation
  802 + : this.$request.updateDevice;
793 const { data, status, info } = await deviceApi({ 803 const { data, status, info } = await deviceApi({
794 ...query, 804 ...query,
795 }); 805 });
@@ -799,8 +809,8 @@ export default { @@ -799,8 +809,8 @@ export default {
799 this.diaAnswerEqu = false; 809 this.diaAnswerEqu = false;
800 this.$message.success(info); 810 this.$message.success(info);
801 this._QueryData(); 811 this._QueryData();
802 - if(this.isAdd){  
803 - this.stationReport() 812 + if (this.isAdd) {
  813 + this.stationReport();
804 } 814 }
805 } else { 815 } else {
806 this.$message.error(info); 816 this.$message.error(info);
@@ -1030,9 +1040,16 @@ export default { @@ -1030,9 +1040,16 @@ export default {
1030 return item; 1040 return item;
1031 })) || 1041 })) ||
1032 []; 1042 [];
  1043 +
1033 this.total = data.count; 1044 this.total = data.count;
1034 this.$nextTick(function () { 1045 this.$nextTick(function () {
1035 this.$refs.main.scrollTop = 0; 1046 this.$refs.main.scrollTop = 0;
  1047 + if (this.query.classId.length) {
  1048 + this.selectionTabIds = this.tableData.map((item) => {
  1049 + this.$refs.multipleTable.toggleRowSelection(item);
  1050 + return item.id;
  1051 + });
  1052 + }
1036 }); 1053 });
1037 } else { 1054 } else {
1038 this.$message.error(info); 1055 this.$message.error(info);
src/views/examinationPaper/add.vue
@@ -400,7 +400,7 @@ @@ -400,7 +400,7 @@
400 <p class="question-title"> 400 <p class="question-title">
401 <span>{{ setBigNum(index) }}、</span> 401 <span>{{ setBigNum(index) }}、</span>
402 <span class="title-txt">{{ question.questionTitle }}</span> 402 <span class="title-txt">{{ question.questionTitle }}</span>
403 - <span class="m20">共:{{ question.subQuestions.length }}题</span> 403 + <span class="m20">共:{{ setNums(question.subQuestions) }}题</span>
404 <span>共:{{ setScore(question) }} 分</span> 404 <span>共:{{ setScore(question) }} 分</span>
405 </p> 405 </p>
406 <ul class="questions-ul"> 406 <ul class="questions-ul">
@@ -519,13 +519,13 @@ @@ -519,13 +519,13 @@
519 <p>{{ setSubPro(formAns.qusType) }}:</p> 519 <p>{{ setSubPro(formAns.qusType) }}:</p>
520 <p class="ipt"> 520 <p class="ipt">
521 <el-input 521 <el-input
522 - v-if="formAns.qusType ==2 ||formAns.qusType==3" 522 + v-if="formAns.qusType == 2 || formAns.qusType == 3"
523 v-model="formAns.answerList" 523 v-model="formAns.answerList"
524 - @keydown.native="keydownAnswer($event,formAns.qusType)" 524 + @keydown.native="keydownAnswer($event, formAns.qusType)"
525 @input="setAllAnswer($event, formAns.qusType)" 525 @input="setAllAnswer($event, formAns.qusType)"
526 ></el-input> 526 ></el-input>
527 <el-input 527 <el-input
528 - v-if="formAns.qusType ==4" 528 + v-if="formAns.qusType == 4"
529 v-model="formAns.answerList" 529 v-model="formAns.answerList"
530 readonly="" 530 readonly=""
531 ></el-input> 531 ></el-input>
@@ -782,6 +782,14 @@ export default { @@ -782,6 +782,14 @@ export default {
782 } 782 }
783 return lengths + subIndex + 1; 783 return lengths + subIndex + 1;
784 }, 784 },
  785 + setNums(ques) {
  786 + let lengths = 0;
  787 + let subArr = ques.filter((item) => {
  788 + return !!item.questionType;
  789 + });
  790 + lengths = subArr.length;
  791 + return lengths
  792 + },
785 setBigNum(num) { 793 setBigNum(num) {
786 let txt = ""; 794 let txt = "";
787 let bigNum = [ 795 let bigNum = [
@@ -912,12 +920,12 @@ export default { @@ -912,12 +920,12 @@ export default {
912 event.returnValue = ""; 920 event.returnValue = "";
913 } 921 }
914 }, 922 },
915 - setAllAnswer(event, type){ 923 + setAllAnswer(event, type) {
916 let str = this.formAns.answerList; 924 let str = this.formAns.answerList;
917 let str2 = checkAnswer( 925 let str2 = checkAnswer(
918 str, 926 str,
919 type, 927 type,
920 - this.formAns.answerOptions.split(',').length, 928 + this.formAns.answerOptions.split(",").length,
921 this.formAns.subNum 929 this.formAns.subNum
922 ); 930 );
923 this.formAns.answerList = str2; 931 this.formAns.answerList = str2;
src/views/login/index.vue
@@ -95,8 +95,8 @@ export default { @@ -95,8 +95,8 @@ export default {
95 loginForm: { 95 loginForm: {
96 // username: "15911715665", 96 // username: "15911715665",
97 // password: "715665", 97 // password: "715665",
98 - // username: "18314340313",  
99 - // password: "Pw340313#", 98 + username: "18314340313",
  99 + password: "Pw340313#",
100 // username: "18687826606", 100 // username: "18687826606",
101 // password: "Pw826606#", 101 // password: "Pw826606#",
102 // username: "18893712576", 102 // username: "18893712576",
src/views/setUp/teacher.vue
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <span>教师管理</span> 5 <span>教师管理</span>
6 </template> 6 </template>
7 <template slot="btns" v-if="!code"> 7 <template slot="btns" v-if="!code">
8 - <el-tooltip effect="dark" content="导入教师名单" placement="bottom"> 8 + <!-- <el-tooltip effect="dark" content="导入教师名单" placement="bottom">
9 <el-button 9 <el-button
10 type="primary" 10 type="primary"
11 icon="el-icon-upload2" 11 icon="el-icon-upload2"
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 circle 14 circle
15 @click="diaUp = true" 15 @click="diaUp = true"
16 ></el-button> 16 ></el-button>
17 - </el-tooltip> 17 + </el-tooltip> -->
18 <el-tooltip effect="dark" content="添加教师" placement="bottom"> 18 <el-tooltip effect="dark" content="添加教师" placement="bottom">
19 <el-button 19 <el-button
20 type="primary" 20 type="primary"
src/views/test/analysis.vue
@@ -341,7 +341,10 @@ @@ -341,7 +341,10 @@
341 > 341 >
342 <template slot-scope="scope"> 342 <template slot-scope="scope">
343 <span 343 <span
344 - v-if="scope.row['answer' + item.id]" 344 + v-if="tableData[index].questionType==5"
  345 + >*</span>
  346 + <span
  347 + v-else-if="scope.row['answer' + item.id]"
345 :class="scope.row['isRight' + item.id] ? '' : 'error'" 348 :class="scope.row['isRight' + item.id] ? '' : 'error'"
346 > 349 >
347 {{ scope.row["answer" + item.id] }} 350 {{ scope.row["answer" + item.id] }}
@@ -349,9 +352,7 @@ @@ -349,9 +352,7 @@
349 <span 352 <span
350 v-else 353 v-else
351 :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'" 354 :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'"
352 - >  
353 - {{ scope.row["questionType" + item.id] == 5 ? "*" : "-" }}  
354 - </span> 355 + >-</span>
355 </template> 356 </template>
356 </el-table-column> 357 </el-table-column>
357 </el-table> 358 </el-table>