Commit d34c89756c8454dbeea9b325d823767712850687

Authored by 刘有才luck
1 parent a1adf9e8

wip: bug修复

src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
... ... @@ -202,9 +202,10 @@
202 202 v-model="group.questionScore"
203 203 :min="1"
204 204 :max="30"
205   - style="width: 100px"
206   - :step="1"
207   - :precision="0"
  205 + style="width: 120px"
  206 + :precision="1"
  207 + :step="0.5"
  208 + @change="handleInput"
208 209 ></el-input-number>
209 210 </div>
210 211 </div>
... ... @@ -315,8 +316,10 @@ export default {
315 316 this.arraysHaveSameIds(this.testData, this.list) &&
316 317 JSON.parse(localStorage.getItem("question"))
317 318 ) {
  319 + console.log("一致");
318 320 return;
319 321 } else {
  322 + console.log("不一致", this.testData, this.list);
320 323 let data = this.findMissingIds(this.testData, this.list);
321 324 this.testData = this.list;
322 325 localStorage.setItem("testData", JSON.stringify(this.testData));
... ... @@ -608,16 +611,16 @@ export default {
608 611 // 删除数据
609 612 arr3.forEach((item3) => {
610 613 // 在 array1 中找到匹配的 type
611   - let matchedArray1Item = arr1.find(
612   - (item1) => item1.questionType == item3.questionType
  614 + let matchedArray1Item = arr1.find((item1) =>
  615 + item1.subQuestionIds.filter((item) => item.id == item3.id)
613 616 );
  617 + console.log(matchedArray1Item, "matchedArray1Item");
  618 +
614 619 if (matchedArray1Item) {
615 620 // 如果找到了匹配的 type,遍历 matchedArray1Item 的 items
616 621 let _index = matchedArray1Item.subQuestionIds.findIndex(
617 622 (item) => item.id === item3.id
618 623 );
619   - console.log("_index");
620   -
621 624 if (_index != -1) {
622 625 matchedArray1Item.subQuestionIds.splice(_index, 1);
623 626 }
... ... @@ -724,6 +727,11 @@ export default {
724 727 return sum + Number(item.questionScore) * item.subQuestionIds.length;
725 728 }, 0);
726 729 },
  730 +
  731 + // 当分数发生变化的时候
  732 + handleInput() {
  733 + localStorage.setItem("question", JSON.stringify(this.groups));
  734 + },
727 735 },
728 736 };
729 737 </script>
... ...
src/views/basic/askTestQuestion/wrongQuestion.vue
... ... @@ -310,7 +310,7 @@ export default {
310 310 type: "onDay", // 时间类型
311 311 dateRange: ["2022-03-01", "2023-05-01"], // 开始结束时间
312 312 startScoreRate: 0, // 开始区间
313   - endScoreRate: 100, // 结束区间
  313 + endScoreRate: 60, // 结束区间
314 314 questionType: null, // 题型
315 315 subjectName: null, // 科目
316 316 grade: null, // 年级
... ... @@ -370,7 +370,10 @@ export default {
370 370 return list;
371 371 },
372 372 // 获取列表
373   - async getList() {
  373 + async getList(type) {
  374 + if (type) {
  375 + this.listPage.page = 1;
  376 + }
374 377 let param = {
375 378 ...this.listPage,
376 379 ...this.formData,
... ... @@ -389,7 +392,7 @@ export default {
389 392 },
390 393 pageSizeChange(value) {
391 394 this.listPage.page = value;
392   - this.handleSearch();
  395 + this.getList();
393 396 },
394 397  
395 398 // 全选按钮
... ... @@ -448,7 +451,7 @@ export default {
448 451 // 搜索按钮
449 452 handleSearch() {
450 453 this.queryLoading = true;
451   - this.getList();
  454 + this.getList("type");
452 455 },
453 456  
454 457 // 加入试卷
... ... @@ -572,7 +575,7 @@ export default {
572 575 }),
573 576 ];
574 577 this.formData.classId = null;
575   - this.getList();
  578 + this.getList("type");
576 579 },
577 580  
578 581 // 年级改变
... ...