Commit 097f457f94c532278a4ee6cfcf3ad382f1c0a777
1 parent
25fa9812
wip: bug修复
Showing
1 changed file
with
14 additions
and
3 deletions
src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
@@ -300,7 +300,7 @@ export default { | @@ -300,7 +300,7 @@ export default { | ||
300 | data() { | 300 | data() { |
301 | return { | 301 | return { |
302 | score: 0, // 分数 | 302 | score: 0, // 分数 |
303 | - inputValue: " 2024年11月11日数学-错题复习", // 标题 | 303 | + inputValue: "", // 标题 |
304 | isEditing: false, // 用于判断是否处于编辑模式 | 304 | isEditing: false, // 用于判断是否处于编辑模式 |
305 | selectedIndex: null, // 当前选中的外层对象的索引 | 305 | selectedIndex: null, // 当前选中的外层对象的索引 |
306 | selectedItemIndex: null, // 当前选中的内层对象的索引 | 306 | selectedItemIndex: null, // 当前选中的内层对象的索引 |
@@ -323,6 +323,9 @@ export default { | @@ -323,6 +323,9 @@ export default { | ||
323 | watch: { | 323 | watch: { |
324 | visible(val) { | 324 | visible(val) { |
325 | if (val) { | 325 | if (val) { |
326 | + this.inputValue = | ||
327 | + JSON.parse(localStorage.getItem(this.userId + "input")) || | ||
328 | + this.getFormattedDate() + this.subjectName + "--错题复习"; | ||
326 | // 上面数据测试 | 329 | // 上面数据测试 |
327 | this.testData = | 330 | this.testData = |
328 | JSON.parse(localStorage.getItem(this.userId + "testData")) || []; | 331 | JSON.parse(localStorage.getItem(this.userId + "testData")) || []; |
@@ -363,8 +366,7 @@ export default { | @@ -363,8 +366,7 @@ export default { | ||
363 | // 初始化 | 366 | // 初始化 |
364 | init() { | 367 | init() { |
365 | console.log("初始化"); | 368 | console.log("初始化"); |
366 | - this.time = this.getFormattedDate(); | ||
367 | - this.inputValue = this.time + this.subjectName + "--错题复习"; | 369 | + |
368 | this.groups = this.classifyByType( | 370 | this.groups = this.classifyByType( |
369 | this.list.map((item, index) => { | 371 | this.list.map((item, index) => { |
370 | return { ...item, globalIndex: index + 1 }; | 372 | return { ...item, globalIndex: index + 1 }; |
@@ -546,6 +548,10 @@ export default { | @@ -546,6 +548,10 @@ export default { | ||
546 | }, | 548 | }, |
547 | handleMouseLeave() { | 549 | handleMouseLeave() { |
548 | this.isHovered = false; | 550 | this.isHovered = false; |
551 | + localStorage.setItem( | ||
552 | + this.userId + "input", | ||
553 | + JSON.stringify(this.inputValue) | ||
554 | + ); | ||
549 | }, | 555 | }, |
550 | 556 | ||
551 | getFormattedDate() { | 557 | getFormattedDate() { |
@@ -726,6 +732,7 @@ export default { | @@ -726,6 +732,7 @@ export default { | ||
726 | if (res.status == 0) { | 732 | if (res.status == 0) { |
727 | this.groups = []; | 733 | this.groups = []; |
728 | this.testData = []; | 734 | this.testData = []; |
735 | + this.inputValue = ""; | ||
729 | localStorage.setItem( | 736 | localStorage.setItem( |
730 | this.userId + "testlist", | 737 | this.userId + "testlist", |
731 | JSON.stringify(this.testData) | 738 | JSON.stringify(this.testData) |
@@ -734,6 +741,10 @@ export default { | @@ -734,6 +741,10 @@ export default { | ||
734 | this.userId + "question", | 741 | this.userId + "question", |
735 | JSON.stringify(this.groups) | 742 | JSON.stringify(this.groups) |
736 | ); | 743 | ); |
744 | + localStorage.setItem( | ||
745 | + this.userId + "input", | ||
746 | + JSON.stringify(this.inputValue) | ||
747 | + ); | ||
737 | this.$emit("setQuestions"); | 748 | this.$emit("setQuestions"); |
738 | this.handleClose(); | 749 | this.handleClose(); |
739 | this.$message({ | 750 | this.$message({ |