From d34c89756c8454dbeea9b325d823767712850687 Mon Sep 17 00:00:00 2001 From: 刘有才luck <14606842+liu-youcai-luck@user.noreply.gitee.com> Date: Thu, 5 Dec 2024 14:11:18 +0800 Subject: [PATCH] wip: bug修复 --- src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue | 22 +++++++++++++++------- src/views/basic/askTestQuestion/wrongQuestion.vue | 13 ++++++++----- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue b/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue index d594a4e..a822eeb 100644 --- a/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue +++ b/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue @@ -202,9 +202,10 @@ v-model="group.questionScore" :min="1" :max="30" - style="width: 100px" - :step="1" - :precision="0" + style="width: 120px" + :precision="1" + :step="0.5" + @change="handleInput" > @@ -315,8 +316,10 @@ export default { this.arraysHaveSameIds(this.testData, this.list) && JSON.parse(localStorage.getItem("question")) ) { + console.log("一致"); return; } else { + console.log("不一致", this.testData, this.list); let data = this.findMissingIds(this.testData, this.list); this.testData = this.list; localStorage.setItem("testData", JSON.stringify(this.testData)); @@ -608,16 +611,16 @@ export default { // 删除数据 arr3.forEach((item3) => { // 在 array1 中找到匹配的 type - let matchedArray1Item = arr1.find( - (item1) => item1.questionType == item3.questionType + let matchedArray1Item = arr1.find((item1) => + item1.subQuestionIds.filter((item) => item.id == item3.id) ); + console.log(matchedArray1Item, "matchedArray1Item"); + if (matchedArray1Item) { // 如果找到了匹配的 type,遍历 matchedArray1Item 的 items let _index = matchedArray1Item.subQuestionIds.findIndex( (item) => item.id === item3.id ); - console.log("_index"); - if (_index != -1) { matchedArray1Item.subQuestionIds.splice(_index, 1); } @@ -724,6 +727,11 @@ export default { return sum + Number(item.questionScore) * item.subQuestionIds.length; }, 0); }, + + // 当分数发生变化的时候 + handleInput() { + localStorage.setItem("question", JSON.stringify(this.groups)); + }, }, }; diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue index 948f69d..ee34d73 100644 --- a/src/views/basic/askTestQuestion/wrongQuestion.vue +++ b/src/views/basic/askTestQuestion/wrongQuestion.vue @@ -310,7 +310,7 @@ export default { type: "onDay", // 时间类型 dateRange: ["2022-03-01", "2023-05-01"], // 开始结束时间 startScoreRate: 0, // 开始区间 - endScoreRate: 100, // 结束区间 + endScoreRate: 60, // 结束区间 questionType: null, // 题型 subjectName: null, // 科目 grade: null, // 年级 @@ -370,7 +370,10 @@ export default { return list; }, // 获取列表 - async getList() { + async getList(type) { + if (type) { + this.listPage.page = 1; + } let param = { ...this.listPage, ...this.formData, @@ -389,7 +392,7 @@ export default { }, pageSizeChange(value) { this.listPage.page = value; - this.handleSearch(); + this.getList(); }, // 全选按钮 @@ -448,7 +451,7 @@ export default { // 搜索按钮 handleSearch() { this.queryLoading = true; - this.getList(); + this.getList("type"); }, // 加入试卷 @@ -572,7 +575,7 @@ export default { }), ]; this.formData.classId = null; - this.getList(); + this.getList("type"); }, // 年级改变 -- libgit2 0.21.4