Commit aed43d3a67738842d5099f531f857ac72ef2b055

Authored by 阿宝
1 parent 45504a95

即时测修改答案

src/views/analysis/index.vue
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 </div> 59 </div>
60 </div> 60 </div>
61 <div class="table-box"> 61 <div class="table-box">
62 - <div class="radio-box" v-if="this.$store.getters.info.showRoleName == '集团管理员'"> 62 + <div class="radio-box" v-if="role == 'ROLE_JITUAN'">
63 <el-radio-group v-model="type" @change="changeType"> 63 <el-radio-group v-model="type" @change="changeType">
64 <el-radio-button :label="1">学校使用对比</el-radio-button> 64 <el-radio-button :label="1">学校使用对比</el-radio-button>
65 <el-radio-button :label="2">学段使用对比</el-radio-button> 65 <el-radio-button :label="2">学段使用对比</el-radio-button>
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 </el-table> 95 </el-table>
96 <p 96 <p
97 class="down" 97 class="down"
98 - v-if="this.$store.getters.info.showRoleName != '集团管理员'" 98 + v-if="role != 'ROLE_JITUAN'"
99 > 99 >
100 <el-button plain round icon="fa fa-cloud-download" 100 <el-button plain round icon="fa fa-cloud-download"
101 >导出报表</el-button 101 >导出报表</el-button
@@ -111,6 +111,7 @@ import { formatDate } from &quot;@/utils&quot;; @@ -111,6 +111,7 @@ import { formatDate } from &quot;@/utils&quot;;
111 export default { 111 export default {
112 data() { 112 data() {
113 return { 113 return {
  114 + role:"",
114 date: "", //今天-本周-本月-本季度 115 date: "", //今天-本周-本月-本季度
115 type:1, //集团管理员 表格切换 116 type:1, //集团管理员 表格切换
116 query: { 117 query: {
@@ -153,6 +154,9 @@ export default { @@ -153,6 +154,9 @@ export default {
153 }; 154 };
154 }, 155 },
155 created() { 156 created() {
  157 + this.role = this.$store.getters.info.permissions.find(
  158 + (item) => item.roleName == this.$store.getters.info.showRoleName
  159 + )?.role;
156 this._QueryDataGrade(); 160 this._QueryDataGrade();
157 // this.setDate(1); 161 // this.setDate(1);
158 let startDay = this.query?.startDay; 162 let startDay = this.query?.startDay;
src/views/down/client.vue
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 </li> 48 </li>
49 </ul> 49 </ul>
50 </div> 50 </div>
51 - <div class="edit-dia" v-show="dialogVis" width="1000px" height="100%"> 51 + <div class="edit-dia" v-show="dialogVis" height="100%">
52 <div class="back"> 52 <div class="back">
53 <div class="back-l" @click="dialogVis = false"> 53 <div class="back-l" @click="dialogVis = false">
54 <i class="fa fa-mail-reply-all"></i> 54 <i class="fa fa-mail-reply-all"></i>
src/views/duoji/erji.vue deleted
1 -<template>  
2 - <div>  
3 - 无限级菜单测试======二级页面  
4 - </div>  
5 -</template>  
6 -  
7 -<script>  
8 -export default {  
9 - name: "erji"  
10 -}  
11 -</script>  
12 -  
13 -<style scoped>  
14 -  
15 -</style>  
src/views/duoji/sanji.vue deleted
1 -<template>  
2 - <div>  
3 - 无限级菜单测试======三级页面  
4 - </div>  
5 -</template>  
6 -  
7 -<script>  
8 -export default {  
9 - name: "sanji"  
10 -}  
11 -</script>  
12 -  
13 -<style scoped>  
14 -  
15 -</style>  
src/views/duoji/siji.vue deleted
1 -<template>  
2 - <div>  
3 - 无限级菜单测试======四级页面  
4 - </div>  
5 -</template>  
6 -  
7 -<script>  
8 -export default {  
9 - name: "siji"  
10 -}  
11 -</script>  
12 -  
13 -<style scoped>  
14 -  
15 -</style>  
src/views/examinationPaper/edit.vue
@@ -71,26 +71,38 @@ @@ -71,26 +71,38 @@
71 > 71 >
72 </p> 72 </p>
73 <p v-if="subQuestions.questionType == 3" class="answer-box"> 73 <p v-if="subQuestions.questionType == 3" class="answer-box">
74 - <span  
75 - class="answer-s" 74 + <template
76 v-for="option in subQuestions.answerOptions.split(',')" 75 v-for="option in subQuestions.answerOptions.split(',')"
77 - :class="  
78 - subQuestions.correctAnswer.includes(option) ? 'active' : ''  
79 - "  
80 - :key="option"  
81 - @click="changAnswer(subQuestions, option)"  
82 - >{{ option }}</span  
83 > 76 >
  77 + <span
  78 + v-if="option"
  79 + class="answer-s"
  80 + :class="
  81 + subQuestions.correctAnswer.includes(option)
  82 + ? 'active'
  83 + : ''
  84 + "
  85 + :key="option"
  86 + @click="changAnswer(subQuestions, option)"
  87 + >{{ option }}</span
  88 + >
  89 + </template>
84 </p> 90 </p>
85 <p v-if="subQuestions.questionType == 2" class="answer-box"> 91 <p v-if="subQuestions.questionType == 2" class="answer-box">
86 - <span  
87 - class="answer-s" 92 + <template
88 v-for="option in subQuestions.answerOptions.split(',')" 93 v-for="option in subQuestions.answerOptions.split(',')"
89 - :class="subQuestions.correctAnswer == option ? 'active' : ''"  
90 - :key="option"  
91 - @click="subQuestions.correctAnswer = option"  
92 - >{{ option }}</span  
93 > 94 >
  95 + <span
  96 + class="answer-s"
  97 + v-if="option"
  98 + :class="
  99 + subQuestions.correctAnswer == option ? 'active' : ''
  100 + "
  101 + :key="option"
  102 + @click="subQuestions.correctAnswer = option"
  103 + >{{ option }}</span
  104 + >
  105 + </template>
94 </p> 106 </p>
95 </div> 107 </div>
96 </li> 108 </li>
src/views/setUp/conglomerate.vue
1 <template> 1 <template>
2 - <div>集团管理</div> 2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>学校管理</span>
  6 + </template>
  7 + </back-box>
  8 + </div>
3 </template> 9 </template>
4 10
5 <script> 11 <script>
6 -export default {  
7 -  
8 -} 12 +export default {};
9 </script> 13 </script>
10 14
11 <style> 15 <style>
12 -  
13 </style> 16 </style>
14 \ No newline at end of file 17 \ No newline at end of file
src/views/test/index.vue
1 <template> 1 <template>
2 - <div> 2 + <div class="page-container">
3 <back-box> 3 <back-box>
4 <template slot="title"> 4 <template slot="title">
5 <span>即时测-数据报表</span> 5 <span>即时测-数据报表</span>
@@ -253,13 +253,201 @@ @@ -253,13 +253,201 @@
253 > 253 >
254 </p> 254 </p>
255 </div> 255 </div>
256 - <set-answer  
257 - :diaVisible="dialogVisible"  
258 - :questionList="form.questionList"  
259 - :paperId="form.id"  
260 - @saveSuccess="handleSuccess"  
261 - @cancel="cancel"  
262 - /> 256 + <div class="edit-dia" v-show="dialogVisible" height="100%">
  257 + <div class="back">
  258 + <div class="back-l" @click="dialogVisible = false">
  259 + <i class="fa fa-mail-reply-all"></i>
  260 + <p>修改答案</p>
  261 + </div>
  262 + </div>
  263 + <div class="form-box">
  264 + <div class="answer-title">
  265 + <p class="name">{{ form.title }}</p>
  266 + <p class="totals">卷面总分:{{ form.score }}分</p>
  267 + </div>
  268 + <div v-if="questionList && questionList.length">
  269 + <div v-for="(question, index) in questionList" :key="index">
  270 + <p class="question-title">
  271 + <span>{{ setBigNum(index) }}、</span>
  272 + <span class="title-txt">{{ question.questionTitle }}</span>
  273 + <span>共 {{ question.score }} 分</span>
  274 + </p>
  275 + <ul class="questions-ul">
  276 + <li class="sub-questions">
  277 + <div class="qs-num">题号</div>
  278 + <div class="qs-type">题型</div>
  279 + <div class="qs-score">分数</div>
  280 + <div class="qs-partScore">漏选得分</div>
  281 + <div class="qs-options qs-options2">选项设置</div>
  282 + </li>
  283 + <li
  284 + v-for="(subQuestions, indexs) in question.subQuestions"
  285 + :key="indexs"
  286 + >
  287 + <p
  288 + class="set-ans-btn"
  289 + v-if="
  290 + subQuestions.qusType &&
  291 + subQuestions.subNum &&
  292 + subQuestions.subNum > 4
  293 + "
  294 + >
  295 + <el-button type="primary" @click="setFormAns(index, indexs)"
  296 + >批量设置答案</el-button
  297 + >
  298 + </p>
  299 + <div v-else class="sub-questions">
  300 + <div class="qs-num">{{ subQuestions.questionIndex }}</div>
  301 + <div class="qs-type">
  302 + {{ setSubPro(subQuestions.questionType) }}
  303 + </div>
  304 + <div class="qs-score">
  305 + {{ subQuestions.score }}
  306 + </div>
  307 + <div class="qs-partScore">
  308 + <p v-if="subQuestions.questionType != 3">--</p>
  309 + <p v-else>{{ subQuestions.partScore }}</p>
  310 + </div>
  311 + <div class="qs-options qs-options2">
  312 + <p v-if="subQuestions.questionType == 5">--</p>
  313 + <p v-if="subQuestions.questionType == 4" class="answer-box">
  314 + <span
  315 + class="answer-s"
  316 + :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
  317 + @click="subQuestions.correctAnswer = 1"
  318 + >✓</span
  319 + >
  320 + <span
  321 + class="answer-s"
  322 + :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
  323 + @click="subQuestions.correctAnswer = 2"
  324 + >✗</span
  325 + >
  326 + </p>
  327 + <p v-if="subQuestions.questionType == 3" class="answer-box">
  328 + <template
  329 + v-for="option in subQuestions.answerOptions.split(',')"
  330 + >
  331 + <span
  332 + v-if="option"
  333 + class="answer-s"
  334 + :class="
  335 + subQuestions.correctAnswer.includes(option)
  336 + ? 'active'
  337 + : ''
  338 + "
  339 + :key="option"
  340 + @click="changAnswer(subQuestions, option)"
  341 + >{{ option }}</span
  342 + >
  343 + </template>
  344 + </p>
  345 + <p v-if="subQuestions.questionType == 2" class="answer-box">
  346 + <template
  347 + v-for="option in subQuestions.answerOptions.split(',')"
  348 + >
  349 + <span
  350 + class="answer-s"
  351 + v-if="option"
  352 + :class="
  353 + subQuestions.correctAnswer == option ? 'active' : ''
  354 + "
  355 + :key="option"
  356 + @click="subQuestions.correctAnswer = option"
  357 + >{{ option }}</span
  358 + >
  359 + </template>
  360 + </p>
  361 + </div>
  362 + </div>
  363 + </li>
  364 + </ul>
  365 + </div>
  366 + </div>
  367 + <div class="btn-box">
  368 + <el-button type="danger" plain round @click="dialogVisible = false"
  369 + >取消</el-button
  370 + >
  371 + <el-button type="primary" round @click="saveAnswer">保存</el-button>
  372 + </div>
  373 + </div>
  374 + </div>
  375 + <el-dialog title="批量设置答案" :visible.sync="diaSetAns" width="400">
  376 + <div class="qs-options">
  377 + <p class="dia-tips">
  378 + 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
  379 + </p>
  380 + <p>{{ setSubPro(formAns.qusType) }}:</p>
  381 + <p class="ipt">
  382 + <el-input
  383 + v-model="formAns.answerList"
  384 + @keydown.native="keydownAnswer($event)"
  385 + ></el-input>
  386 + </p>
  387 + <p class="answer-box">
  388 + <template v-if="formAns.qusType == 4">
  389 + <span
  390 + class="answer-s active"
  391 + @click="
  392 + formAns.answerList.length < formAns.subNum
  393 + ? (formAns.answerList += '✓')
  394 + : ''
  395 + "
  396 + >✓</span
  397 + >
  398 + <span
  399 + class="answer-s active"
  400 + @click="
  401 + formAns.answerList.length < formAns.subNum
  402 + ? (formAns.answerList += '✗')
  403 + : ''
  404 + "
  405 + >✗</span
  406 + >
  407 + </template>
  408 + <template v-if="formAns.qusType == 3">
  409 + <span
  410 + class="answer-s active"
  411 + v-for="option in formAns.answerOptions"
  412 + :key="option"
  413 + @click="setMultiple(formAns, option)"
  414 + >{{ option }}</span
  415 + >
  416 + <span
  417 + class="answer-s active"
  418 + @click="
  419 + formAns.answerList.split(',').length < formAns.subNum
  420 + ? (formAns.answerList += ',')
  421 + : ''
  422 + "
  423 + >,</span
  424 + >
  425 + </template>
  426 + <template v-if="formAns.qusType == 2" class="answer-box">
  427 + <span
  428 + class="answer-s active"
  429 + v-for="option in formAns.answerOptions"
  430 + :key="option"
  431 + @click="
  432 + formAns.answerList.length < formAns.subNum
  433 + ? (formAns.answerList += option)
  434 + : ''
  435 + "
  436 + >{{ option }}</span
  437 + >
  438 + </template>
  439 + <span
  440 + class="answer-s delButton"
  441 + @click="formAns.answerList = formAns.answerList.slice(0, -1)"
  442 + >x</span
  443 + >
  444 + </p>
  445 + </div>
  446 + <div class="dialog-footer" slot="footer">
  447 + <el-button @click="saveFormAns">确 定</el-button>
  448 + <el-button @click="diaSetAns = false">取 消</el-button>
  449 + </div>
  450 + </el-dialog>
263 </div> 451 </div>
264 </template> 452 </template>
265 453
@@ -271,7 +459,17 @@ export default { @@ -271,7 +459,17 @@ export default {
271 role: "", 459 role: "",
272 loading: false, 460 loading: false,
273 dialogVisible: false, 461 dialogVisible: false,
274 - form: { questionList: [] }, 462 + diaSetAns: false,
  463 + form: {},
  464 + questionList: [],
  465 + formAns: {
  466 + listIndex: 0, //大题位置
  467 + endIndex: 0, //相同题目最后一位题目的questionIndex
  468 + qusType: "", //题目类型
  469 + subNum: 0, //数量
  470 + answerOptions: [], //答案选项
  471 + answerList: "", //答案列表-字符串
  472 + },
275 date: "", //今天-昨天-本周 473 date: "", //今天-昨天-本周
276 query: { 474 query: {
277 //搜索条件 475 //搜索条件
@@ -308,7 +506,7 @@ export default { @@ -308,7 +506,7 @@ export default {
308 score: 1, 506 score: 1,
309 partScore: 0, 507 partScore: 0,
310 selectNum: 4, 508 selectNum: 4,
311 - answerOptions: ["A", "B", "C", "D"], 509 + answerOptions: "A, B, C, D",
312 correctAnswer: "B", 510 correctAnswer: "B",
313 }, 511 },
314 { 512 {
@@ -317,29 +515,101 @@ export default { @@ -317,29 +515,101 @@ export default {
317 score: 1, 515 score: 1,
318 partScore: 0, 516 partScore: 0,
319 selectNum: 4, 517 selectNum: 4,
320 - answerOptions: ["A", "B", "C", "D", "E", "F"], 518 + answerOptions: "A, B, C, D,E,F",
321 correctAnswer: "A", 519 correctAnswer: "A",
322 }, 520 },
323 { 521 {
324 - questionIndex: 2, 522 + questionIndex: 3,
  523 + questionType: 2,
  524 + score: 1,
  525 + partScore: 0,
  526 + selectNum: 4,
  527 + answerOptions: "A, B, C, D,E,F",
  528 + correctAnswer: "A",
  529 + },
  530 + {
  531 + questionIndex: 4,
  532 + questionType: 2,
  533 + score: 1,
  534 + partScore: 0,
  535 + selectNum: 4,
  536 + answerOptions: "A, B, C, D,E,F",
  537 + correctAnswer: "A",
  538 + },
  539 + {
  540 + questionIndex: 5,
  541 + questionType: 2,
  542 + score: 1,
  543 + partScore: 0,
  544 + selectNum: 4,
  545 + answerOptions: "A, B, C, D,E,F",
  546 + correctAnswer: "A",
  547 + },
  548 + {
  549 + questionIndex: 6,
325 questionType: 3, 550 questionType: 3,
326 score: 1, 551 score: 1,
327 partScore: 0, 552 partScore: 0,
328 selectNum: 4, 553 selectNum: 4,
329 - answerOptions: ["A", "B", "C", "D", "E", "F"], 554 + answerOptions: "A, B, C, D,E,F",
330 correctAnswer: "AB", 555 correctAnswer: "AB",
331 }, 556 },
332 { 557 {
333 - questionIndex: 2, 558 + questionIndex: 7,
  559 + questionType: 4,
  560 + score: 1,
  561 + partScore: 0,
  562 + selectNum: 0,
  563 + answerOptions: [],
  564 + correctAnswer: "1",
  565 + },
  566 + {
  567 + questionIndex: 8,
334 questionType: 3, 568 questionType: 3,
335 score: 1, 569 score: 1,
336 partScore: 0, 570 partScore: 0,
337 selectNum: 4, 571 selectNum: 4,
338 - answerOptions: ["A", "B", "C", "D", "E", "F"], 572 + answerOptions: "A, B, C, D,E,F",
339 correctAnswer: "AB", 573 correctAnswer: "AB",
340 }, 574 },
341 { 575 {
342 - questionIndex: 3, 576 + questionIndex: 9,
  577 + questionType: 3,
  578 + score: 1,
  579 + partScore: 0,
  580 + selectNum: 4,
  581 + answerOptions: "A, B, C, D,E,F",
  582 + correctAnswer: "AB",
  583 + },
  584 + {
  585 + questionIndex: 10,
  586 + questionType: 3,
  587 + score: 1,
  588 + partScore: 0,
  589 + selectNum: 4,
  590 + answerOptions: "A, B, C, D,E,F",
  591 + correctAnswer: "AB",
  592 + },
  593 + {
  594 + questionIndex: 11,
  595 + questionType: 3,
  596 + score: 1,
  597 + partScore: 0,
  598 + selectNum: 4,
  599 + answerOptions: "A, B, C, D,E,F",
  600 + correctAnswer: "AB",
  601 + },
  602 + {
  603 + questionIndex: 12,
  604 + questionType: 3,
  605 + score: 1,
  606 + partScore: 0,
  607 + selectNum: 4,
  608 + answerOptions: "A, B, C, D,E,F",
  609 + correctAnswer: "AB",
  610 + },
  611 + {
  612 + questionIndex: 13,
343 questionType: 4, 613 questionType: 4,
344 score: 1, 614 score: 1,
345 partScore: 0, 615 partScore: 0,
@@ -396,7 +666,7 @@ export default { @@ -396,7 +666,7 @@ export default {
396 }, 666 },
397 ], 667 ],
398 answerList: [ 668 answerList: [
399 - //设置多卷内容供tabel表格数据用 669 + //设置多卷内容供tableStage表格数据用
400 { 670 {
401 title: "周测卷20221130", 671 title: "周测卷20221130",
402 totalScore: 6, 672 totalScore: 6,
@@ -438,7 +708,52 @@ export default { @@ -438,7 +708,52 @@ export default {
438 }, 708 },
439 }); 709 });
440 }, 710 },
  711 + setSubPro(type) {
  712 + let tit;
  713 + switch (type) {
  714 + case 2:
  715 + tit = "单选题";
  716 + break;
  717 + case 3:
  718 + tit = "多选题";
  719 + break;
  720 + case 4:
  721 + tit = "判断题";
  722 + break;
  723 + case 5:
  724 + tit = "主观题";
  725 + break;
  726 + }
  727 + return tit;
  728 + },
  729 + setBigNum(num) {
  730 + let txt = "";
  731 + let bigNum = [
  732 + "一",
  733 + "二",
  734 + "三",
  735 + "四",
  736 + "五",
  737 + "六",
  738 + "七",
  739 + "八",
  740 + "九",
  741 + "十",
  742 + "十一",
  743 + "十二",
  744 + "十三",
  745 + "十四",
  746 + "十五",
  747 + "十六",
  748 + "十七",
  749 + "十八",
  750 + "十九",
  751 + "二十",
  752 + ];
  753 + txt = bigNum[num];
441 754
  755 + return txt;
  756 + },
442 setDate(index) { 757 setDate(index) {
443 const that = this; 758 const that = this;
444 this.date = index == this.date ? "" : index; 759 this.date = index == this.date ? "" : index;
@@ -507,17 +822,169 @@ export default { @@ -507,17 +822,169 @@ export default {
507 } 822 }
508 } 823 }
509 }, 824 },
  825 + keydownAnswer(event) {
  826 + //快速答案设置禁止输入
  827 + if (
  828 + event.key == "Meta" ||
  829 + event.key == "CapsLock" ||
  830 + event.key == "Shift" ||
  831 + event.key == "Enter" ||
  832 + event.key == "Alt" ||
  833 + event.key == "Backspace" ||
  834 + event.key == "Delete" ||
  835 + event.key == "ArrowUp" ||
  836 + event.key == "ArrowDown" ||
  837 + event.key == "ArrowLeft" ||
  838 + event.key == "v" ||
  839 + event.key == "V" ||
  840 + event.key == "ArrowRight"
  841 + ) {
  842 + return;
  843 + } else {
  844 + event.returnValue = "";
  845 + }
  846 + },
  847 + setAnswer(type, ans) {
  848 + let txt = "";
  849 + if (type == 2) {
  850 + txt = ans;
  851 + } else if (type == 3) {
  852 + txt = ans + ",";
  853 + } else if (type == 4) {
  854 + txt = ans == 1 ? "✓" : "✗";
  855 + }
  856 + return txt;
  857 + },
  858 + setMultiple(obj, answer) {
  859 + //多选答案设置
  860 + obj.answerList += answer;
  861 + let str = obj.answerList;
  862 + let str2 = checkAnswer(
  863 + str,
  864 + 3,
  865 + obj.answerOptions.split(",").length,
  866 + obj.answerList.length
  867 + );
  868 + obj.answerList = str2;
  869 + },
510 edit(item) { 870 edit(item) {
  871 + //修改答案
511 this.form = deepClone(item); 872 this.form = deepClone(item);
  873 + this.questionList = deepClone(item?.questionList || []);
  874 + this.questionList?.map((item) => {
  875 + let types = [{}];
  876 + let addndex = 0;
  877 + item.subQuestions.map((sub, index) => {
  878 + if (!!sub.questionType) {
  879 + if (sub.questionType == types[addndex].qusType) {
  880 + //同类型批量答案+1
  881 + types[addndex].subNum += 1;
  882 + if (
  883 + types[addndex].answerOptions.length < sub.answerOptions.length
  884 + ) {
  885 + types[addndex].answerOptions = sub.answerOptions;
  886 + }
  887 + types[addndex].answerList += this.setAnswer(
  888 + sub.questionType,
  889 + sub.correctAnswer
  890 + );
  891 + if (index == item.subQuestions.length - 1) {
  892 + //循环最后类型数量大于等于5,保存批量答案
  893 + if (types[addndex].subNum && types[addndex].subNum >= 5) {
  894 + types[addndex].endIndex = sub.questionIndex;
  895 + types[addndex].index = index;
  896 + }
  897 + }
  898 + } else {
  899 + if (types[addndex].subNum && types[addndex].subNum >= 5) {
  900 + //不同类型时如果原有类型数量大于等于5,保存批量答案
  901 + types[addndex].endIndex =
  902 + item.subQuestions[index - 1].questionIndex;
  903 + types[addndex].index = index;
  904 + addndex += 1;
  905 + types[addndex] = {};
  906 + }
  907 + //不同类型初始化批量答案
  908 + types[addndex].qusType = sub.questionType;
  909 + types[addndex].subNum = 1;
  910 + types[addndex].answerOptions = sub.answerOptions;
  911 + types[addndex].answerList = this.setAnswer(
  912 + sub.questionType,
  913 + sub.correctAnswer
  914 + );
  915 + }
  916 + }
  917 + });
  918 + for (let i = 0; i < types.length; i++) {
  919 + if (types[i].qusType == 3) {
  920 + types[i].answerList = types[i].answerList.slice(0, -1);
  921 + }
  922 + if (types[i].subNum >= 5) {
  923 + item.subQuestions.splice(
  924 + types[i].index + i,
  925 + 0,
  926 + deepClone(types[i])
  927 + );
  928 + }
  929 + }
  930 + });
512 this.dialogVisible = true; 931 this.dialogVisible = true;
513 }, 932 },
514 - cancel() {  
515 - this.dialogVisible = false; 933 + setFormAns(index, indexs) {
  934 + //初始化要修改的答案
  935 + this.formAns = { ...this.questionList[index].subQuestions[indexs] };
  936 + this.formAns.listIndex = index;
  937 + this.diaSetAns = true;
516 }, 938 },
517 - handleSuccess() {  
518 - this.dialogVisible = false;  
519 - this._QueryData(); 939 + saveFormAns() {
  940 + //批量修改答案
  941 + let EndIndex;
  942 + let subNum = this.formAns.subNum - 1;
  943 + this.questionList[this.formAns.listIndex].subQuestions.some(
  944 + (item, index) => {
  945 + if (this.formAns.endIndex == item.questionIndex) {
  946 + EndIndex = index;
  947 + return;
  948 + }
  949 + }
  950 + );
  951 + for (let i = 0; i <= subNum; i++) {
  952 + let correctAnswer = "";
  953 + if (this.formAns.qusType == 2) {
  954 + correctAnswer = this.formAns.answerList[subNum - i];
  955 + } else if (this.formAns.qusType == 3) {
  956 + correctAnswer = this.formAns.answerList.split(",")[subNum - i];
  957 +
  958 + console.log(this.formAns.answerList.split(",")[subNum - i]);
  959 + } else if (this.formAns.qusType == 4) {
  960 + correctAnswer = this.formAns.answerList[subNum - i] == "✓" ? 1 : 2;
  961 + }
  962 + this.questionList[this.formAns.listIndex].subQuestions[
  963 + EndIndex - i
  964 + ].correctAnswer = correctAnswer;
  965 + }
  966 + this.diaSetAns = false;
520 }, 967 },
  968 + async saveAnswer() {
  969 + //保存答案
  970 + for (let i = 0; i < this.questionList.length; i++) {
  971 + for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
  972 + if (this.questionList[i].subQuestions[j].qusType) {
  973 + this.questionList[i].subQuestions.splice(j, 1);
  974 + }
  975 + }
  976 + }
  977 + const { data, status, message } = await this.$request.modifyPaper({
  978 + paperId: this.form.id,
  979 + questionList: [...this.questionList],
  980 + });
  981 + if (status == 0) {
  982 + this._QueryData();
  983 + } else {
  984 + this.$message.error(message);
  985 + }
  986 + },
  987 +
521 async changClazz() { 988 async changClazz() {
522 await this._QuerySubjectList(); 989 await this._QuerySubjectList();
523 await this.setDate(1); 990 await this.setDate(1);
@@ -548,13 +1015,13 @@ export default { @@ -548,13 +1015,13 @@ export default {
548 label: item, 1015 label: item,
549 }; 1016 };
550 }) || []; 1017 }) || [];
551 - if (this.role == "ROLE_BANZHUREN") { 1018 + if (this.role == "ROLE_BANZHUREN") {
552 this.subjectList.unshift({ 1019 this.subjectList.unshift({
553 value: "", 1020 value: "",
554 label: "全部", 1021 label: "全部",
555 }); 1022 });
556 this.query.subjectId = [this.subjectList[0]?.value]; 1023 this.query.subjectId = [this.subjectList[0]?.value];
557 - }else{ 1024 + } else {
558 this.query.subjectId = this.subjectList[0]?.value; 1025 this.query.subjectId = this.subjectList[0]?.value;
559 } 1026 }
560 } else { 1027 } else {
@@ -611,16 +1078,11 @@ export default { @@ -611,16 +1078,11 @@ export default {
611 .dia-tips { 1078 .dia-tips {
612 padding-bottom: 10px; 1079 padding-bottom: 10px;
613 } 1080 }
614 -.dia-question-box {  
615 - padding: 16px 16px 1px;  
616 - background: #f8f8f8;  
617 - border-radius: 10px;  
618 -  
619 - .answer-s {  
620 - width: 36px;  
621 - height: 28px;  
622 - cursor: pointer;  
623 - } 1081 +.answer-s {
  1082 + width: 32px;
  1083 + height: 28px;
  1084 + cursor: pointer;
  1085 + user-select: none;
624 } 1086 }
625 .set-questions { 1087 .set-questions {
626 display: flex; 1088 display: flex;
@@ -630,16 +1092,17 @@ export default { @@ -630,16 +1092,17 @@ export default {
630 flex-shrink: 0; 1092 flex-shrink: 0;
631 margin-right: 10px; 1093 margin-right: 10px;
632 } 1094 }
633 - .qs-options {  
634 - flex: 1;  
635 - .ipt {  
636 - margin-bottom: 5px;  
637 - } 1095 +}
  1096 +.qs-options {
  1097 + flex: 1;
  1098 + .ipt {
  1099 + margin-bottom: 5px;
638 } 1100 }
639 .delButton { 1101 .delButton {
640 border-color: #ff6868; 1102 border-color: #ff6868;
641 background: #ff6868 url("../../assets/images/arrow.png") no-repeat center; 1103 background: #ff6868 url("../../assets/images/arrow.png") no-repeat center;
642 background-size: 19px; 1104 background-size: 19px;
  1105 + cursor: pointer;
643 color: transparent; 1106 color: transparent;
644 } 1107 }
645 .ac { 1108 .ac {
@@ -651,4 +1114,138 @@ export default { @@ -651,4 +1114,138 @@ export default {
651 .down { 1114 .down {
652 padding-top: 16px; 1115 padding-top: 16px;
653 } 1116 }
  1117 +.page-container {
  1118 + position: relative;
  1119 +}
  1120 +.edit-dia {
  1121 + position: absolute;
  1122 + left: 0;
  1123 + top: 0;
  1124 + right: 0;
  1125 + bottom: 0;
  1126 + width: 100%;
  1127 + height: calc(100vh - 80px);
  1128 + background: #fff;
  1129 + overflow-y: auto;
  1130 + z-index: 10;
  1131 + .back {
  1132 + width: 100%;
  1133 + height: 56px;
  1134 + border-bottom: 1px solid #e2e2e2;
  1135 + display: flex;
  1136 + align-items: center;
  1137 + padding: 0 20px;
  1138 + box-sizing: border-box;
  1139 + .back-l {
  1140 + display: flex;
  1141 + align-items: center;
  1142 + cursor: pointer;
  1143 + flex-shrink: 0;
  1144 + font-size: 18px;
  1145 + font-weight: 500;
  1146 + }
  1147 + .fa-mail-reply-all {
  1148 + font-size: 28px;
  1149 + color: #b3b3b3;
  1150 + margin-right: 12px;
  1151 + }
  1152 + }
  1153 + .form-box {
  1154 + padding: 20px;
  1155 + }
  1156 + .answer-title {
  1157 + text-align: center;
  1158 + font-size: 20px;
  1159 + color: #333;
  1160 + font-weight: 700;
  1161 + padding-bottom: 20px;
  1162 + .totals {
  1163 + font-size: 16px;
  1164 + color: #888;
  1165 + font-weight: normal;
  1166 + }
  1167 + }
  1168 + .question-title {
  1169 + line-height: 40px;
  1170 + .ipt {
  1171 + width: 300px;
  1172 + margin: 0 16px 0 10px;
  1173 + :deep(.el-input__inner) {
  1174 + border-radius: 20px;
  1175 + border-color: #667ffd;
  1176 + background: rgba($color: #667ffd, $alpha: 0.05);
  1177 + }
  1178 + }
  1179 + .delete {
  1180 + margin-right: 8px;
  1181 + }
  1182 + .title-txt {
  1183 + margin-right: 20px;
  1184 + font-size: 16px;
  1185 + font-weight: 700;
  1186 + }
  1187 + }
  1188 + .questions-ul {
  1189 + border-left: 1px solid #e2e2e2;
  1190 + border-top: 1px solid #e2e2e2;
  1191 + margin: 12px 0;
  1192 + }
  1193 + .sub-questions {
  1194 + width: 100%;
  1195 + display: flex;
  1196 + border-bottom: 1px solid #e2e2e2;
  1197 + & > div {
  1198 + min-height: 40px;
  1199 + padding: 5px;
  1200 + flex-shrink: 0;
  1201 + border-right: 1px solid #e2e2e2;
  1202 + display: flex;
  1203 + justify-content: center;
  1204 + align-items: center;
  1205 + }
  1206 + .qs-num {
  1207 + width: 80px;
  1208 + }
  1209 + .qs-type {
  1210 + width: 160px;
  1211 + }
  1212 + .qs-score,
  1213 + .qs-partScore {
  1214 + width: 160px;
  1215 + }
  1216 + .qs-options {
  1217 + flex: 1;
  1218 + }
  1219 + .qs-set {
  1220 + width: 80px;
  1221 + }
  1222 + .qs-options2 {
  1223 + text-align: left;
  1224 + justify-content: flex-start;
  1225 + padding-left: 20px;
  1226 + .answer-s {
  1227 + cursor: pointer;
  1228 + }
  1229 + }
  1230 + :deep(.el-select) {
  1231 + .el-input__inner {
  1232 + border-radius: 20px;
  1233 + border-color: #667ffd;
  1234 + width: 150px;
  1235 + height: 32px;
  1236 + line-height: 32px;
  1237 + background: rgba($color: #667ffd, $alpha: 0.05);
  1238 + }
  1239 + .el-input__icon {
  1240 + line-height: 32px;
  1241 + }
  1242 + }
  1243 + }
  1244 + .set-ans-btn {
  1245 + width: 100%;
  1246 + padding: 10px 0 10px 630px;
  1247 + box-sizing: border-box;
  1248 + border-bottom: 1px solid #e2e2e2;
  1249 + }
  1250 +}
654 </style> 1251 </style>
655 \ No newline at end of file 1252 \ No newline at end of file