Commit 45504a9526025fb3edd41d23e3be926d74d826ba

Authored by 阿宝
1 parent aeac66d4

即时测页面,以及小题修改答案

src/components/setAnswer.vue
1 1 <template>
2   - <div class="el-dialog-wrapper" v-show="diaVisible" width="400" center @click.self="cancel">
  2 + <div
  3 + class="el-dialog-wrapper"
  4 + v-show="diaVisible"
  5 + width="400"
  6 + center
  7 + @click.self="cancel"
  8 + >
3 9 <div class="el-dialog-content">
4 10 <p class="title">
5   - <!-- 设置答案 <i class="fa fa-exchange" @click="editType = !editType"></i> -->
6   - 设置答案
  11 + 设置答案 <i class="fa fa-exchange" @click="editType = !editType"></i>
  12 + <!-- 设置答案 -->
7 13 <i class="el-icon-close" @click="cancel"></i>
8 14 </p>
9   - <div v-show="editType">
  15 + <div v-if="editType">
10 16 <div v-for="(item, index) in FormQuestionList" :key="index">
11 17 <template v-for="(subQuestions, indexs) in item.subQuestions">
12 18 <div
... ... @@ -61,97 +67,90 @@
61 67 </template>
62 68 </div>
63 69 </div>
64   - <!-- <div v-show="!editType">
  70 + <div v-else>
65 71 <p class="dia-tips">
66   - 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
67   - </p>
  72 + 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
  73 + </p>
68 74 <div class="dia-question-box">
69 75 <div v-for="(item, index) in FormQuestionList2" :key="index">
70   - <template v-for="(items, indexs) in item.subQuestions">
71   - <div class="set-questions" :key="indexs">
72   - <div class="qs-num">
73   - <p>{{ items.name }}</p>
74   - <p>共{{ items.list.length }}题</p>
75   - </div>
76   - <div class="qs-options">
77   - <p class="ipt">
78   - <el-input
79   - v-model="items.answerList"
80   - @keydown.native="keydownAnswer($event)"
81   - ></el-input>
82   - </p>
83   - <p class="answer-box">
84   - <template v-if="items.list[0].questionType == 4">
85   - <span
86   - class="answer-s active"
87   - @click="
88   - items.answerList.length < items.list.length
89   - ? (items.answerList += '✓')
90   - : ''
91   - "
92   - >✓</span
93   - >
94   - <span
95   - class="answer-s active"
96   - @click="
97   - items.answerList.length < items.list.length
98   - ? (items.answerList += '✗')
99   - : ''
100   - "
101   - >✗</span
102   - >
103   - </template>
104   - <template v-if="items.list[0].questionType == 3">
105   - <span
106   - class="answer-s active"
107   - v-for="option in items.list[0].answerOptions"
108   - :key="option"
109   - @click="setAnswer(items,option)"
110   - >{{ option }}</span
111   - >
112   - <span
113   - class="answer-s active"
114   - @click="
115   - items.answerList.split(',').length < items.list.length
116   - ? (items.answerList += ',')
117   - : ''
118   - "
119   - >,</span
120   - >
121   - </template>
122   - <template
123   - v-if="items.list[0].questionType == 2"
124   - class="answer-box"
  76 + <div class="set-questions">
  77 + <div class="qs-num">
  78 + <p class="txt">{{ item.name }}</p>
  79 + <p class="num">共{{ item.list.length }}题</p>
  80 + </div>
  81 + <div class="qs-options">
  82 + <p class="ipt">
  83 + <el-input
  84 + v-model="item.answerList"
  85 + @keydown.native="keydownAnswer($event)"
  86 + ></el-input>
  87 + </p>
  88 + <p class="answer-box">
  89 + <template v-if="item.list[0].questionType == 4">
  90 + <span
  91 + class="answer-s active"
  92 + @click="
  93 + item.answerList.length < item.list.length
  94 + ? (item.answerList += '✓')
  95 + : ''
  96 + "
  97 + >✓</span
  98 + >
  99 + <span
  100 + class="answer-s active"
  101 + @click="
  102 + item.answerList.length < item.list.length
  103 + ? (item.answerList += '✗')
  104 + : ''
  105 + "
  106 + >✗</span
125 107 >
126   - <span
127   - class="answer-s active"
128   - v-for="option in items.list[0].answerOptions"
129   - :key="option"
130   - @click="
131   - items.answerList.length < items.list.length
132   - ? (items.answerList += option)
133   - : ''
134   - "
135   - >{{ option }}</span
136   - >
137   - </template>
  108 + </template>
  109 + <template v-if="item.list[0].questionType == 3">
138 110 <span
139   - class="answer-s delButton"
140   - @click="items.answerList = items.answerList.slice(0, -1)"
141   - >x</span
  111 + class="answer-s active"
  112 + v-for="option in item.list[0].answerOptions"
  113 + :key="option"
  114 + @click="setAnswer(item, option)"
  115 + >{{ option }}</span
142 116 >
143 117 <span
144   - class="answer-s ac"
145   - @click="items.answerList = ''"
146   - >AC</span
  118 + class="answer-s active"
  119 + @click="
  120 + item.answerList.split(',').length < item.list.length
  121 + ? (item.answerList += ',')
  122 + : ''
  123 + "
  124 + >,</span
147 125 >
148   - </p>
149   - </div>
  126 + </template>
  127 + <template
  128 + v-if="item.list[0].questionType == 2"
  129 + class="answer-box"
  130 + >
  131 + <span
  132 + class="answer-s active"
  133 + v-for="option in item.list[0].answerOptions"
  134 + :key="option"
  135 + @click="
  136 + item.answerList.length < item.list.length
  137 + ? (item.answerList += option)
  138 + : ''
  139 + "
  140 + >{{ option }}</span
  141 + >
  142 + </template>
  143 + <span
  144 + class="answer-s delButton"
  145 + @click="item.answerList = item.answerList.slice(0, -1)"
  146 + >x</span
  147 + >
  148 + </p>
150 149 </div>
151   - </template>
  150 + </div>
152 151 </div>
153 152 </div>
154   - </div> -->
  153 + </div>
155 154 <div class="footer-box">
156 155 <el-button class="dia-btn" type="primary" @click="saveAnswer"
157 156 >确 定</el-button
... ... @@ -165,7 +164,7 @@
165 164 </template>
166 165  
167 166 <script>
168   -import { deepClone } from "utils";
  167 +import { deepClone, checkAnswer } from "utils";
169 168 export default {
170 169 name: "SetAnswer",
171 170 props: {
... ... @@ -177,42 +176,55 @@ export default {
177 176 return {
178 177 editType: true, //修改答案模式
179 178 FormQuestionList: [],
  179 + FormQuestionList2: [],
180 180 };
181 181 },
182 182 watch: {
183 183 questionList: {
184 184 handler: function () {
185 185 this.FormQuestionList = deepClone(this.questionList);
  186 + this.FormQuestionList2 = [];
186 187 console.log(this.questionList);
187   - //组合每道大题中的相同题目
188   - // let questionList = deepClone(item.questionList);
189   - // for (let i = 0; i < questionList.length; i++) {
190   - // let jsons = {};
191   - // let answerOptions = [];
192   - // questionList[i].subQuestions.map((items) => {
193   - // let txt = this.setSubPro(items.questionType);
194   - // if (jsons[txt]) {
195   - // jsons[txt].push(items);
196   - // } else {
197   - // jsons[txt] = [items];
198   - // }
199   - // if (items.questionType == 2 || items.questionType == 3) {
200   - // if (items.answerOptions.length > answerOptions.length) {
201   - // answerOptions = items.answerOptions;
202   - // }
203   - // jsons[txt][0].answerOptions = answerOptions;
204   - // }
205   - // });
206   - // this.FormQuestionList2[i].subQuestions = Object.keys(jsons).map(
207   - // (item) => {
208   - // return {
209   - // name: item,
210   - // list: jsons[item],
211   - // answerList: "",
212   - // };
213   - // }
214   - // );
215   - // }
  188 + // 组合每道大题中的相同题目
  189 + let questionList = deepClone(this.questionList);
  190 + let jsons = {};
  191 + let answerOptions = [];
  192 + for (let i = 0; i < questionList.length; i++) {
  193 + questionList[i].subQuestions.map((items) => {
  194 + let txt = this.setSubPro(items.questionType);
  195 + if (jsons[txt]) {
  196 + jsons[txt].push(items);
  197 + } else {
  198 + jsons[txt] = [items];
  199 + }
  200 + if (items.questionType == 2 || items.questionType == 3) {
  201 + if (items.answerOptions.length > answerOptions.length) {
  202 + answerOptions = items.answerOptions;
  203 + }
  204 + jsons[txt][0].answerOptions = answerOptions;
  205 + }
  206 + });
  207 + console.log(jsons);
  208 + }
  209 + this.FormQuestionList2 = Object.keys(jsons).map((item) => {
  210 + let answerList = "";
  211 + jsons[item].map((items, index) => {
  212 + if (items.questionType == 2) {
  213 + answerList += items.correctAnswer;
  214 + } else if (items.questionType == 3) {
  215 + answerList +=
  216 + items.correctAnswer +
  217 + (jsons[item].length - 1 != index ? "," : "");
  218 + } else if (items.questionType == 4) {
  219 + answerList += items.correctAnswer == 1 ? "✓" : "✗";
  220 + }
  221 + });
  222 + return {
  223 + name: item,
  224 + list: jsons[item],
  225 + answerList: answerList,
  226 + };
  227 + });
216 228 },
217 229 deep: true,
218 230 },
... ... @@ -282,6 +294,37 @@ export default {
282 294 }
283 295 },
284 296 async saveAnswer() {
  297 + let questionList = [],
  298 + questionList2 = [];
  299 + if (this.editType) {
  300 + questionList = [...this.FormQuestionList];
  301 + } else {
  302 + this.FormQuestionList2.map((item) => {
  303 + item.list.map((items, index) => {
  304 + if (items.questionType == 2 ) {
  305 + items.correctAnswer = item.answerList.split("")[index];
  306 + } else if (items.questionType == 3) {
  307 + items.correctAnswer = item.answerList.split(",")[index];
  308 + }else if (items.questionType == 4) {
  309 + items.correctAnswer = item.answerList[index] == "✓" ? 1 : 2;
  310 + }
  311 + questionList2.push(items);
  312 + });
  313 + });
  314 + questionList = this.FormQuestionList.map((item) => {
  315 + let subQuestions = item.subQuestions.map((items) => {
  316 + items.correctAnswer = questionList2.find((question) => {
  317 + return question.questionIndex == items.questionIndex;
  318 + })?.correctAnswer;
  319 + return items;
  320 + });
  321 + return {
  322 + ...item,
  323 + subQuestions: [...subQuestions],
  324 + };
  325 + });
  326 + }
  327 + console.log(questionList);
285 328 const { data, status, message } = await this.$request.modifyPaper({
286 329 paperId: this.paperId,
287 330 questionList: questionList,
... ... @@ -315,22 +358,29 @@ export default {
315 358 z-index: 2022;
316 359 .el-dialog-content {
317 360 width: 600px;
318   - background:#fff;
  361 + background: #fff;
319 362 border-radius: 10px;
320   - padding:16px 20px 20px;
  363 + padding: 16px 20px 20px;
321 364 }
322   - .title{
  365 + .title {
323 366 font-size: 18px;
324 367 position: relative;
325   - margin-bottom:20px;
326   - .el-icon-close{
  368 + margin-bottom: 20px;
  369 + .el-icon-close {
327 370 position: absolute;
328   - top:0;
329   - right:12px;
330   - padding:2px;
  371 + top: 0;
  372 + right: 12px;
  373 + padding: 2px;
331 374 font-size: 16px;
332 375 cursor: pointer;
333   - &:hover{
  376 + &:hover {
  377 + color: #667ffa;
  378 + }
  379 + }
  380 + .fa-exchange {
  381 + color: #999;
  382 + cursor: pointer;
  383 + &:hover {
334 384 color: #667ffa;
335 385 }
336 386 }
... ... @@ -338,7 +388,7 @@ export default {
338 388 }
339 389 .footer-box {
340 390 text-align: center;
341   - padding-top:20px;
  391 + padding-top: 20px;
342 392 }
343 393 .sub-questions {
344 394 width: 100%;
... ... @@ -391,4 +441,48 @@ export default {
391 441 }
392 442 }
393 443 }
  444 +.dia-tips {
  445 + line-height: 18px;
  446 + padding-bottom: 10px;
  447 +}
  448 +.set-questions {
  449 + display: flex;
  450 + padding-right: 20px;
  451 + margin-bottom: 20px;
  452 + .qs-num {
  453 + width: 80px;
  454 + padding-top: 6px;
  455 + .txt {
  456 + font-size: 16px;
  457 + line-height: 18px;
  458 + margin-bottom: 6px;
  459 + }
  460 + }
  461 + .qs-options {
  462 + flex: 1;
  463 + .ipt {
  464 + margin-bottom: 5px;
  465 + }
  466 + .answer-box {
  467 + .answer-s {
  468 + cursor: pointer;
  469 + user-select: none;
  470 + &:first-of-type {
  471 + margin-left: 0;
  472 + }
  473 + }
  474 + }
  475 + }
  476 + .delButton {
  477 + border-color: #ff6868;
  478 + background: #ff6868 url("../assets/images/arrow.png") no-repeat center;
  479 + background-size: 19px;
  480 + color: transparent;
  481 + }
  482 + .ac {
  483 + border-color: #ff6868;
  484 + background: #ff6868;
  485 + color: #fff;
  486 + }
  487 +}
394 488 </style>
395 489 \ No newline at end of file
... ...
src/views/ask/index.vue
... ... @@ -27,7 +27,7 @@
27 27 multiple
28 28 collapse-tags
29 29 v-model="query.subjectId"
30   - placeholder=""
  30 + placeholder="选择科目"
31 31 @change="_QueryData"
32 32 >
33 33 <el-option
... ... @@ -42,7 +42,7 @@
42 42 v-else
43 43 class="sel"
44 44 v-model="query.subjectId"
45   - placeholder=""
  45 + placeholder="选择科目"
46 46 @change="_QueryData"
47 47 >
48 48 <el-option
... ... @@ -146,7 +146,7 @@
146 146 ><template slot-scope="scoped">{{scoped.row.allzheng}}%</template></el-table-column>
147 147 <el-table-column label="操作" align="center">
148 148 <template slot-scope="scoped">
149   - <el-tooltip effect="dark" content="详情" placement="left">
  149 + <el-tooltip effect="dark" content="详情" placement="top">
150 150 <el-button
151 151 type="primary"
152 152 circle
... ... @@ -155,7 +155,7 @@
155 155 @click="linkTo(scoped.row)"
156 156 ></el-button>
157 157 </el-tooltip>
158   - <el-tooltip effect="dark" content="修改答案" placement="right">
  158 + <el-tooltip effect="dark" content="修改答案" placement="top">
159 159 <el-button
160 160 type="primary"
161 161 circle
... ... @@ -345,7 +345,7 @@ export default {
345 345 correctAnswer: "A",
346 346 },
347 347 {
348   - questionIndex: 2,
  348 + questionIndex: 3,
349 349 questionType: 3,
350 350 score: 1,
351 351 partScore: 0,
... ... @@ -354,7 +354,7 @@ export default {
354 354 correctAnswer: "AB",
355 355 },
356 356 {
357   - questionIndex: 2,
  357 + questionIndex: 4,
358 358 questionType: 3,
359 359 score: 1,
360 360 partScore: 0,
... ... @@ -363,7 +363,58 @@ export default {
363 363 correctAnswer: "AB",
364 364 },
365 365 {
366   - questionIndex: 3,
  366 + questionIndex: 5,
  367 + questionType: 4,
  368 + score: 1,
  369 + partScore: 0,
  370 + selectNum: 0,
  371 + answerOptions: [],
  372 + correctAnswer: "1",
  373 + },
  374 + ],
  375 + },
  376 + {
  377 + questionTitle: "f",
  378 + score: 1,
  379 + subQuestions: [
  380 + {
  381 + questionIndex: 6,
  382 + questionType: 2,
  383 + score: 1,
  384 + partScore: 0,
  385 + selectNum: 4,
  386 + answerOptions: ["A", "B", "C", "D"],
  387 + correctAnswer: "B",
  388 + },
  389 + {
  390 + questionIndex: 7,
  391 + questionType: 2,
  392 + score: 1,
  393 + partScore: 0,
  394 + selectNum: 4,
  395 + answerOptions: ["A", "B", "C", "D", "E", "F"],
  396 + correctAnswer: "A",
  397 + },
  398 + {
  399 + questionIndex: 8,
  400 + questionType: 3,
  401 + score: 1,
  402 + partScore: 0,
  403 + selectNum: 4,
  404 + answerOptions: ["A", "B", "C", "D", "E", "F"],
  405 + correctAnswer: "AB",
  406 + },
  407 + {
  408 + questionIndex: 9,
  409 + questionType: 3,
  410 + score: 1,
  411 + partScore: 0,
  412 + selectNum: 4,
  413 + answerOptions: ["A", "B", "C", "D", "E", "F"],
  414 + correctAnswer: "AB",
  415 + },
  416 + {
  417 + questionIndex: 10,
367 418 questionType: 4,
368 419 score: 1,
369 420 partScore: 0,
... ... @@ -439,10 +490,7 @@ export default {
439 490 };
440 491 },
441 492 async created() {
442   - this.role = this.$store.getters.info.permissions[0]?.role||"";
443   - if (this.role == "ROLE_BANZHUREN") {
444   - this.query.subjectId = [];
445   - }
  493 + this.role = this.$store.getters.info.permissions.find(item=>item.roleName == this.$store.getters.info.showRoleName)?.role;
446 494 await this._QueryClassList();
447 495 await this._QuerySubjectList();
448 496 // await this.setDate(1);
... ... @@ -552,7 +600,7 @@ export default {
552 600 this.classList = data.list.map((item) => {
553 601 return {
554 602 value: item.classId,
555   - label: item.clazzName,
  603 + label: item.className,
556 604 };
557 605 });
558 606 this.query.classId = this.classList[0]?.value;
... ... @@ -565,10 +613,10 @@ export default {
565 613 {classId: this.query.classId,}
566 614 );
567 615 if (status === 0) {
568   - this.subjectList = data.list?.map((item) => {
  616 + this.subjectList = data.subjectNames?.map((item) => {
569 617 return {
570   - value: item.subjectId,
571   - label: item.subjectName,
  618 + value: item,
  619 + label: item,
572 620 };
573 621 })||[];
574 622 if (this.role == "ROLE_BANZHUREN") {
... ... @@ -576,8 +624,10 @@ export default {
576 624 value: "",
577 625 label: "全部",
578 626 });
  627 + this.query.subjectId = [this.subjectList[0]?.value];
  628 + }else{
  629 + this.query.subjectId = this.subjectList[0]?.value;
579 630 }
580   - this.query.subjectId = this.subjectList[0]?.value;
581 631 } else {
582 632 this.$message.error(info);
583 633 }
... ...
src/views/index/mainIndex.vue
... ... @@ -100,7 +100,8 @@
100 100 </div>
101 101 <div class="text" v-else-if="item.path == '/portrait'">
102 102 <p class="p1">学生画像</p>
103   - <p class="p2">共分析{{ schoolInfo.imagesCount }}名学生成绩。</p>
  103 + <!-- <p class="p2">共分析{{ schoolInfo.imagesCount }}名学生成绩。</p> -->
  104 + <p class="p2">功能开发中。</p>
104 105 </div>
105 106 <div class="text" v-else-if="item.path == '/ask'">
106 107 <p class="p1">随堂问报表</p>
... ...
src/views/login/index.vue
... ... @@ -90,12 +90,12 @@ export default {
90 90 disableClick: true,
91 91 passwordType: "password",
92 92 loginForm: {
93   - username: "13610050254",
94   - password: "Pw050254#",
  93 + // username: "13610050254",
  94 + // password: "Pw050254#",
95 95 // username: "18946034886",
96 96 // password: "Pw034886#",
97   - // username: "18332123505",
98   - // password: "Pw123505#",
  97 + username: "18332123505",
  98 + password: "Pw123505#",
99 99 },
100 100 loginRules: {
101 101 username: [
... ...
src/views/portrait/index.vue
... ... @@ -5,6 +5,9 @@
5 5 <span>{{ "学生画像" }}</span>
6 6 </template>
7 7 </back-box>
  8 + <div class="page-content">
  9 + 功能开发中。
  10 + </div>
8 11 </div>
9 12 </template>
10 13  
... ...
src/views/test/index.vue
... ... @@ -27,7 +27,7 @@
27 27 multiple
28 28 collapse-tags
29 29 v-model="query.subjectId"
30   - placeholder=""
  30 + placeholder="选择科目"
31 31 @change="_QueryData"
32 32 >
33 33 <el-option
... ... @@ -42,7 +42,7 @@
42 42 v-else
43 43 class="sel"
44 44 v-model="query.subjectId"
45   - placeholder=""
  45 + placeholder="选择科目"
46 46 @change="_QueryData"
47 47 >
48 48 <el-option
... ... @@ -175,7 +175,7 @@
175 175 >
176 176 <el-table-column label="操作" align="center">
177 177 <template slot-scope="scoped">
178   - <el-tooltip effect="dark" content="详情" placement="left">
  178 + <el-tooltip effect="dark" content="详情" placement="top">
179 179 <el-button
180 180 type="primary"
181 181 circle
... ... @@ -184,7 +184,7 @@
184 184 @click="linkTo(scoped.row)"
185 185 ></el-button>
186 186 </el-tooltip>
187   - <el-tooltip effect="dark" content="修改答案" placement="right">
  187 + <el-tooltip effect="dark" content="修改答案" placement="top">
188 188 <el-button
189 189 type="primary"
190 190 circle
... ... @@ -371,31 +371,32 @@ export default {
371 371 xingming: "丁芳菲",
372 372 totalScore: 5,
373 373 rank: 1,
374   - 周测卷20221130totalScore:10,
375   - 周测卷20221130rank:0,
376   - 周测卷20221131totalScore:11,
377   - 周测卷20221131rank:1,
378   - 周测卷20221132totalScore:12,
379   - 周测卷20221132rank:2,
380   - 周测卷20221132totalScore:13,
381   - 周测卷20221132rank:3,
  374 + 周测卷20221130totalScore: 10,
  375 + 周测卷20221130rank: 0,
  376 + 周测卷20221131totalScore: 11,
  377 + 周测卷20221131rank: 1,
  378 + 周测卷20221132totalScore: 12,
  379 + 周测卷20221132rank: 2,
  380 + 周测卷20221132totalScore: 13,
  381 + 周测卷20221132rank: 3,
382 382 },
383 383 {
384 384 xuehao: 2,
385 385 xingming: "丁芳",
386 386 totalScore: 4,
387 387 rank: 2,
388   - 周测卷20221130totalScore:20,
389   - 周测卷20221130rank:3,
390   - 周测卷20221131totalScore:21,
391   - 周测卷20221131rank:4,
392   - 周测卷20221132totalScore:22,
393   - 周测卷20221132rank:5,
394   - 周测卷20221132totalScore:22,
395   - 周测卷20221132rank:5,
  388 + 周测卷20221130totalScore: 20,
  389 + 周测卷20221130rank: 3,
  390 + 周测卷20221131totalScore: 21,
  391 + 周测卷20221131rank: 4,
  392 + 周测卷20221132totalScore: 22,
  393 + 周测卷20221132rank: 5,
  394 + 周测卷20221132totalScore: 22,
  395 + 周测卷20221132rank: 5,
396 396 },
397 397 ],
398   - answerList: [//设置多卷内容供tabel表格数据用
  398 + answerList: [
  399 + //设置多卷内容供tabel表格数据用
399 400 {
400 401 title: "周测卷20221130",
401 402 totalScore: 6,
... ... @@ -415,10 +416,9 @@ export default {
415 416 };
416 417 },
417 418 async created() {
418   - this.role = this.$store.getters.info.permissions[0]?.role || "";
419   - if (this.role == "ROLE_BANZHUREN") {
420   - this.query.subjectId = [];
421   - }
  419 + this.role = this.$store.getters.info.permissions.find(
  420 + (item) => item.roleName == this.$store.getters.info.showRoleName
  421 + )?.role;
422 422 await this._QueryClassList();
423 423 await this._QuerySubjectList();
424 424 // await this.setDate(1);
... ... @@ -528,7 +528,7 @@ export default {
528 528 this.classList = data.list.map((item) => {
529 529 return {
530 530 value: item.classId,
531   - label: item.clazzName,
  531 + label: item.className,
532 532 };
533 533 });
534 534 this.query.classId = this.classList[0]?.value;
... ... @@ -542,19 +542,21 @@ export default {
542 542 });
543 543 if (status === 0) {
544 544 this.subjectList =
545   - data.list?.map((item) => {
  545 + data.subjectNames?.map((item) => {
546 546 return {
547   - value: item.subjectId,
548   - label: item.subjectName,
  547 + value: item,
  548 + label: item,
549 549 };
550 550 }) || [];
551   - if (this.role == "ROLE_BANZHUREN") {
  551 + if (this.role == "ROLE_BANZHUREN") {
552 552 this.subjectList.unshift({
553 553 value: "",
554 554 label: "全部",
555 555 });
  556 + this.query.subjectId = [this.subjectList[0]?.value];
  557 + }else{
  558 + this.query.subjectId = this.subjectList[0]?.value;
556 559 }
557   - this.query.subjectId = this.subjectList[0]?.value;
558 560 } else {
559 561 this.$message.error(info);
560 562 }
... ...