Commit 09f87ae4a11d4b6e4363ee2beb4e7bcefa0acab6

Authored by 刘鸿
2 parents 96dbf0ac a1adf9e8

Merge branch 'ezTeach-2.0.0.0.release' of http://120.78.57.84/baoman/Ezquiz_Plat…

…form into ezTeach-2.0.0.0.release
src/api/apis/apis.js
... ... @@ -8,11 +8,11 @@ const defaltService = (url, data) => {
8 8 data,
9 9 });
10 10 };
11   -const defaltGetService = (url, data) => {
  11 +const defaltGetService = (url, params) => {
12 12 return service({
13 13 url: url,
14   - method: "Get",
15   - data,
  14 + method: "GET",
  15 + params,
16 16 });
17 17 };
18 18 const downService = (url, data) => {
... ...
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
... ... @@ -203,6 +203,8 @@
203 203 :min="1"
204 204 :max="30"
205 205 style="width: 100px"
  206 + :step="1"
  207 + :precision="0"
206 208 ></el-input-number>
207 209 </div>
208 210 </div>
... ... @@ -232,7 +234,6 @@
232 234 </el-dialog>
233 235 </template>
234 236 <script>
235   -import { number } from "echarts";
236 237 import draggable from "vuedraggable";
237 238 import { paperPrint } from "@/utils";
238 239 export default {
... ... @@ -707,7 +708,6 @@ export default {
707 708 localStorage.setItem("question", JSON.stringify(this.groups));
708 709 localStorage.setItem("testlist", JSON.stringify(this.testData));
709 710 this.$emit("setQuestions");
710   - this.handleClose();
711 711 })
712 712 .catch(() => {
713 713 console.log("取消");
... ... @@ -831,6 +831,7 @@ export default {
831 831 height: 40px;
832 832 justify-content: space-between;
833 833 cursor: pointer;
  834 + padding: 0 10px;
834 835 }
835 836 }
836 837  
... ... @@ -923,4 +924,4 @@ export default {
923 924 background: rgb(115, 142, 246);
924 925 border-bottom: 1px solid rgb(115, 142, 246);
925 926 }
926   -</style>
927 927 \ No newline at end of file
  928 +</style>
... ...
src/views/basic/askTestQuestion/wrongQuestion.vue
... ... @@ -254,11 +254,12 @@
254 254 />
255 255 </div>
256 256 </template>
257   -
258   - <script>
259   -import { setDateRules } from "@/utils";
  257 +
  258 +<script>
  259 +import { setDateRules, getKnowledge } from "@/utils";
260 260 import wrongQuestionDialog from "./components/wrongQuestionDialog.vue";
261 261 import analysisDialog from "./components/analysisDialog.vue";
  262 +
262 263 export default {
263 264 components: {
264 265 wrongQuestionDialog,
... ... @@ -373,12 +374,16 @@ export default {
373 374 let param = {
374 375 ...this.listPage,
375 376 ...this.formData,
  377 + startScoreRate: this.formData.startScoreRate.toString(),
  378 + endScoreRate: this.formData.endScoreRate.toString(),
376 379 startDate: this.formData.dateRange[0],
377 380 endDate: this.formData.dateRange[1],
378 381 };
379 382 let data = await this.$request.getWrongQuestionList(param);
380 383 this.queryLoading = false;
381   - this.topicList = data.data.records;
  384 + this.topicList = data.data.records.map((item) => {
  385 + return { ...item, knowledge: getKnowledge(item.knowledge) };
  386 + });
382 387 this.listPage.total = data.data.total;
383 388 // this.topicList = await this.loadAndModifyHTML(data.data.records);
384 389 },
... ... @@ -420,6 +425,9 @@ export default {
420 425 if (value > this.formData.endScoreRate) {
421 426 this.formData.startScoreRate = this.formData.endScoreRate;
422 427 }
  428 + if (!value) {
  429 + this.formData.startScoreRate = 0;
  430 + }
423 431 },
424 432 // 输入不超过100
425 433 endValidateInput(value) {
... ... @@ -432,6 +440,9 @@ export default {
432 440 if (value < this.formData.startScoreRate) {
433 441 this.formData.endScoreRate = this.formData.startScoreRate;
434 442 }
  443 + if (!value) {
  444 + this.formData.endScoreRate = 0;
  445 + }
435 446 },
436 447  
437 448 // 搜索按钮
... ... @@ -471,11 +482,10 @@ export default {
471 482 },
472 483 // 全部删除
473 484 handleDelTest() {
474   - let list = this.removeMatchingValues(
475   - this.topicList.map((item) => item.id),
476   - this.questions.map((item) => item.id)
477   - );
  485 + let list = this.removeMatchingValues(this.topicList, this.questions);
478 486 this.questions = list;
  487 + console.log("移除本业", this.questions);
  488 +
479 489 localStorage.setItem("testlist", JSON.stringify(this.questions));
480 490 },
481 491 // 重置 去除locastorage 以及 questions
... ... @@ -496,11 +506,11 @@ export default {
496 506 },
497 507 // 去除第二数组中存在第一数组中的值
498 508 removeMatchingValues(arr1, arr2) {
499   - // 将第一个数组的值存入 Set,提高查找效率
500   - const valuesSet = new Set(arr1);
  509 + const arr1Ids = arr1.map((item) => item.id);
  510 + const res = arr2.filter((item) => !arr1Ids.includes(item.id));
  511 + console.log(res, "res");
501 512  
502   - // 过滤第二个数组,保留不在 Set 中的值
503   - return arr2.filter((value) => !valuesSet.has(value));
  513 + return res;
504 514 },
505 515  
506 516 // 判断第一个数组在第二个种是否全部存在
... ... @@ -514,9 +524,7 @@ export default {
514 524  
515 525 // 购物车触发弹框
516 526 handleShop() {
517   - if (this.questions.length > 0) {
518   - this.visible = true;
519   - }
  527 + this.visible = true;
520 528 },
521 529  
522 530 // 获取科目列表
... ... @@ -527,6 +535,8 @@ export default {
527 535 console.log(data, "--------");
528 536  
529 537 this.subjectList = data.data.subjectNames;
  538 + console.log(this.subjectList, "我被打印了");
  539 +
530 540 this.formData.subjectName = this.subjectList[0];
531 541 this.getClassList();
532 542 },
... ... @@ -549,13 +559,17 @@ export default {
549 559 },
550 560 // 获取班级信息
551 561 async getClassList() {
552   - let data = await this.$request.getClassList({
  562 + console.log(this.formData, "this.formDate");
  563 +
  564 + let data = await this.$request.getGradeList({
553 565 grade: this.formData.grade,
554 566 subjectName: this.formData.subjectName,
555 567 });
556 568 this.classList = [
557 569 { className: "全部", classId: null },
558   - ...data.data.list,
  570 + ...data.data.map((item) => {
  571 + return { className: item.className, classId: item.id };
  572 + }),
559 573 ];
560 574 this.formData.classId = null;
561 575 this.getList();
... ... @@ -620,8 +634,8 @@ export default {
620 634 },
621 635 };
622 636 </script>
623   -
624   - <style lang="scss" scoped>
  637 +
  638 +<style lang="scss" scoped>
625 639 .page-content {
626 640 box-sizing: border-box;
627 641 padding: 0 20px;
... ... @@ -781,4 +795,4 @@ export default {
781 795 .size {
782 796 font-size: 14px !important;
783 797 }
784   -</style>
785 798 \ No newline at end of file
  799 +</style>
... ...