Commit d34c89756c8454dbeea9b325d823767712850687

Authored by 刘有才luck
1 parent a1adf9e8

wip: bug修复

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