

240814 권민수 오답노트 목록의 각 문제에 대한 링크 설정
@d02c5b5afb5f8dba9c97ed970165c55fd870d8f4
--- client/views/pages/main/PreviewNote.vue
+++ client/views/pages/main/PreviewNote.vue
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
<p class="title2">{{ note.prblmExpln }}</p> |
34 | 34 |
</td> |
35 | 35 |
<td> |
36 |
- <button type="button" title="" class="new-btn" @click="viewDetail(note.prblmId)"> |
|
36 |
+ <button type="button" title="" class="new-btn" @click="viewDetail(note)"> |
|
37 | 37 |
View Detail |
38 | 38 |
</button> |
39 | 39 |
</td> |
... | ... | @@ -59,14 +59,16 @@ |
59 | 59 |
currentUnitId: "1", // 임시 유닛 아이디 |
60 | 60 |
wrongAnswerNotes: [], // 오답 노트 목록 데이터 |
61 | 61 |
unitData: {}, // 단원 정보 데이터 |
62 |
+ problemType: null, // 링크될 문제 유형 페이지 이름 |
|
62 | 63 |
} |
63 | 64 |
}, |
64 | 65 |
methods: { |
65 | 66 |
|
66 | 67 |
// 오답노트 상세 보기 버튼 클릭 |
67 |
- viewDetail(prblmId) { |
|
68 |
- // 상세 보기 페이지로 이동하는 로직을 추가 할 예정 |
|
69 |
- console.log('링크될 문제 ID:', prblmId); |
|
68 |
+ viewDetail(prblm) { |
|
69 |
+ console.log('링크될 문제 ID와 문제 타입 ID:', prblm.prblmId, prblm.prblmTypeId); |
|
70 |
+ this.handleProblemDetail(prblm); |
|
71 |
+ this.goToPage(this.problemType); |
|
70 | 72 |
}, |
71 | 73 |
|
72 | 74 |
// 단원 정보를 불러오는 API 호출 |
... | ... | @@ -98,6 +100,29 @@ |
98 | 100 |
.catch(error => { |
99 | 101 |
console.error('오답노트를 불러오는 중 오류 발생:', error); |
100 | 102 |
}); |
103 |
+ }, |
|
104 |
+ |
|
105 |
+ // 문제 유형에 따른 라우팅 메서드 |
|
106 |
+ handleProblemDetail(item) { |
|
107 |
+ // sessionStorage.setItem("prblmId", JSON.stringify(item.prblmId)); |
|
108 |
+ // console.log(item.prblmTypeId); |
|
109 |
+ if (item.prblmTypeId === "11") { |
|
110 |
+ this.problemType = "Chapter3_9"; |
|
111 |
+ } else if (item.prblmTypeId === "12") { |
|
112 |
+ this.problemType = "Chapter3_4"; |
|
113 |
+ } else if (item.prblmTypeId === "4") { |
|
114 |
+ this.problemType = "Chapter3_3"; |
|
115 |
+ } else if (item.prblmTypeId === "3") { |
|
116 |
+ this.problemType = "Chapter3_7"; |
|
117 |
+ } else if (item.prblmTypeId === "10") { |
|
118 |
+ this.problemType = "Chapter3_2"; |
|
119 |
+ } else if (item.prblmTypeId === "14") { |
|
120 |
+ this.problemType = "Chapter3_12"; |
|
121 |
+ } |
|
122 |
+ }, |
|
123 |
+ |
|
124 |
+ goToPage(page) { |
|
125 |
+ this.$router.push({ name: page }); |
|
101 | 126 |
} |
102 | 127 |
|
103 | 128 |
}, |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?