

240813 권지수 선생님 문제 목록 페이지
@6908b9c1a99f18bcc3a448dc4e85d09606725c70
--- client/views/pages/teacher/QuestionDetail.vue
+++ client/views/pages/teacher/QuestionDetail.vue
... | ... | @@ -1,83 +1,6 @@ |
1 | 1 |
<template> |
2 | 2 |
<div class="title-box flex justify-between mb40"> |
3 |
-<<<<<<< HEAD |
|
4 | 3 |
<p class="title">문제 조회</p> |
5 |
- </div> |
|
6 |
- <div class="board-wrap"> |
|
7 |
- <div class="flex align-center"> |
|
8 |
- <label for="" class="title2">문제</label> |
|
9 |
- <p class="data-wrap">{{ questionExpln }}</p> |
|
10 |
- </div> |
|
11 |
- <hr> |
|
12 |
- <div class="flex align-center"> |
|
13 |
- <label for="" class="title2">유형</label> |
|
14 |
- <p class="data-wrap">{{ questionTypeId }}</p> |
|
15 |
- </div> |
|
16 |
- <div class="flex align-center"> |
|
17 |
- <label for="" class="title2">카테고리</label> |
|
18 |
- <p class="data-wrap">{{ questionCategoryId }}</p> |
|
19 |
- </div> |
|
20 |
- <div class="flex align-center"> |
|
21 |
- <label for="" class="title2">사용자 아이디</label> |
|
22 |
- <p class="data-wrap">{{ userId }}</p> |
|
23 |
- </div> |
|
24 |
- <div class="flex align-center"> |
|
25 |
- <label for="" class="title2">책 아이디</label> |
|
26 |
- <p class="data-wrap">{{ bookId }}</p> |
|
27 |
- </div> |
|
28 |
- <div class="flex align-center"> |
|
29 |
- <label for="" class="title2">단원 아이디</label> |
|
30 |
- <p class="data-wrap">{{ unitId }}</p> |
|
31 |
- </div> |
|
32 |
- <hr> |
|
33 |
- <div class="flex align-center"> |
|
34 |
- <label for="" class="title2">문제 점수</label> |
|
35 |
- <p class="data-wrap">{{ questionScore }}</p> |
|
36 |
- </div> |
|
37 |
- <div class="flex align-center"> |
|
38 |
- <label for="" class="title2">문제 힌트</label> |
|
39 |
- <p class="data-wrap">{{ questionHint }}</p> |
|
40 |
- </div> |
|
41 |
- <div class="flex align-center"> |
|
42 |
- <label for="" class="title2">문제 해설</label> |
|
43 |
- <p class="data-wrap">{{ questionExplanation }}</p> |
|
44 |
- </div> |
|
45 |
- <hr> |
|
46 |
- <div class="flex align-center"> |
|
47 |
- <label for="" class="title2">첨부파일</label> |
|
48 |
- <p class="data-wrap">{{ questionFile }}</p> |
|
49 |
- </div> |
|
50 |
- <div class="flex align-center mb20"> |
|
51 |
- <label for="" class="title2">답</label> |
|
52 |
- <p class="data-wrap">{{ questionAnswer }}</p> |
|
53 |
- </div> |
|
54 |
- <div> |
|
55 |
- <label for="" class="title2">오답 학생</label> |
|
56 |
- <div class="table-wrap mt20"> |
|
57 |
- <table> |
|
58 |
- <thead> |
|
59 |
- <tr> |
|
60 |
- <td>No.</td> |
|
61 |
- <td>이름</td> |
|
62 |
- <td>학년</td> |
|
63 |
- <td>반</td> |
|
64 |
- <td>오답</td> |
|
65 |
- </tr> |
|
66 |
- </thead> |
|
67 |
- <tbody> |
|
68 |
- <tr v-for="(student, index) in wrongStudents" :key="index" @click="goToPage('noticeDetail')"> |
|
69 |
- <td>{{ index + 1 }}</td> |
|
70 |
- <td>{{ student.name }}</td> |
|
71 |
- <td>{{ student.grade }}</td> |
|
72 |
- <td>{{ student.class }}</td> |
|
73 |
- <td>{{ student.wrongAnswer }}</td> |
|
74 |
- </tr> |
|
75 |
- </tbody> |
|
76 |
- </table> |
|
77 |
- </div> |
|
78 |
- </div> |
|
79 |
-======= |
|
80 |
- <p class="title">문제 등록</p> |
|
81 | 4 |
</div> |
82 | 5 |
<div class="board-wrap"> |
83 | 6 |
<div class="tab-box" > |
... | ... | @@ -257,37 +180,18 @@ |
257 | 180 |
</div> |
258 | 181 |
</div> |
259 | 182 |
|
260 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
|
261 | 183 |
</div> |
262 | 184 |
<div class="flex justify-between mt50"> |
263 | 185 |
<button type="button" title="글쓰기" class="new-btn" @click="goToPage('QuestionList')"> |
264 | 186 |
목록 |
265 | 187 |
</button> |
266 | 188 |
<div class="flex"> |
267 |
-<<<<<<< HEAD |
|
268 |
- <button type="button" title="글쓰기" class="new-btn mr10" @click="editQuestion"> |
|
269 |
- 수정 |
|
270 |
- </button> |
|
271 |
- <button type="button" title="글쓰기" class="new-btn" @click="confirmDelete"> |
|
272 |
- 삭제 |
|
273 |
- </button> |
|
274 |
- </div> |
|
275 |
- </div> |
|
276 |
- |
|
277 |
- <!-- 모달 창 --> |
|
278 |
- <div v-if="showModal" class="modal-overlay"> |
|
279 |
- <div class="modal-content"> |
|
280 |
- <p>삭제하시겠습니까?</p> |
|
281 |
- <button @click="deleteQuestion">예, 삭제</button> |
|
282 |
- <button @click="cancelDelete">취소</button> |
|
283 |
-======= |
|
284 | 189 |
<button type="button" title="글쓰기" class="new-btn mr10"> |
285 | 190 |
삭제 |
286 | 191 |
</button> |
287 | 192 |
<button type="button" title="글쓰기" class="new-btn"> |
288 | 193 |
수정 |
289 | 194 |
</button> |
290 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
|
291 | 195 |
</div> |
292 | 196 |
</div> |
293 | 197 |
</template> |
... | ... | @@ -295,152 +199,29 @@ |
295 | 199 |
<script> |
296 | 200 |
import SvgIcon from '@jamescoyle/vue-icon'; |
297 | 201 |
import { mdiMagnify } from '@mdi/js'; |
298 |
-<<<<<<< HEAD |
|
299 |
-import axios from 'axios'; |
|
300 |
-======= |
|
301 |
- |
|
302 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
|
303 | 202 |
|
304 | 203 |
export default { |
305 | 204 |
data() { |
306 | 205 |
return { |
307 | 206 |
mdiMagnify: mdiMagnify, |
308 |
-<<<<<<< HEAD |
|
309 |
- questionTitle: '샘플 제목', |
|
310 |
- questionExpln: '샘플 내용', |
|
311 |
- questionFile: null, // 파일 URL을 여기에 저장 |
|
312 |
- questionAnswer: '샘플 답', |
|
313 |
- wrongStudents: [], |
|
314 |
- showModal: false, |
|
315 |
- parsedData: null, // parsedData 추가 |
|
316 |
- questionTypeId: '', |
|
317 |
- questionCategoryId: '', |
|
318 |
- userId: '', |
|
319 |
- bookId: '', |
|
320 |
- unitId: '', |
|
321 |
- questionScore: '', |
|
322 |
- questionHint: '', |
|
323 |
- questionExplanation: '' |
|
324 |
-======= |
|
325 | 207 |
selectedTab: 'tab1', |
326 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
|
327 | 208 |
} |
328 | 209 |
}, |
329 | 210 |
methods: { |
330 | 211 |
goToPage(page) { |
331 | 212 |
this.$router.push({ name: page }); |
332 | 213 |
}, |
333 |
-<<<<<<< HEAD |
|
334 |
- editQuestion() { |
|
335 |
- // 수정 로직 추가 |
|
336 |
- console.log('수정 버튼 클릭'); |
|
337 |
- }, |
|
338 |
- confirmDelete() { |
|
339 |
- this.showModal = true; |
|
340 |
- }, |
|
341 |
- async deleteQuestion() { |
|
342 |
- try { |
|
343 |
- const prblmId = this.parsedData.prblmId; // this.parsedData 사용 |
|
344 |
- const response = await axios.post('/problem/deleteProblem.json', { prblmId : prblmId }); |
|
345 |
- console.log('삭제 완료:', response.data); |
|
346 |
- this.showModal = false; |
|
347 |
- this.goToPage('QuestionList'); |
|
348 |
- } catch (error) { |
|
349 |
- console.error('삭제 실패:', error); |
|
350 |
- } |
|
351 |
- }, |
|
352 |
- cancelDelete() { |
|
353 |
- this.showModal = false; |
|
354 |
- }, |
|
355 |
- loadFromLocalStorage() { |
|
356 |
- const data = sessionStorage.getItem('selectQuestionList'); |
|
357 |
- if (data) { |
|
358 |
- this.parsedData = JSON.parse(data); // this.parsedData 설정 |
|
359 |
- console.log('Loaded data from local storage:', this.parsedData); |
|
360 |
- |
|
361 |
- this.questionExpln = this.parsedData.prblmExpln || '내용 없음'; |
|
362 |
- this.questionFile = this.parsedData.fileMngId || '첨부파일 없음'; // 파일 경로는 실제 경로에 맞게 수정 |
|
363 |
- this.questionAnswer = this.parsedData.prblmCmmt || '답 없음'; |
|
364 |
- this.wrongStudents = this.parsedData.wrongStudents || []; |
|
365 |
- this.questionTypeId = this.parsedData.prblmTypeId || '유형 아이디 없음'; |
|
366 |
- this.questionCategoryId = this.parsedData.prblmCtgryId || '카테고리 아이디 없음'; |
|
367 |
- this.userId = this.parsedData.userId || '사용자 아이디 없음'; |
|
368 |
- this.bookId = this.parsedData.bookId || '책 아이디 없음'; |
|
369 |
- this.unitId = this.parsedData.unitId || '단원 아이디 없음'; |
|
370 |
- this.questionScore = this.parsedData.prblmScr || '점수 없음', |
|
371 |
- this.questionHint = this.parsedData.prblmHint || '힌트 없음', |
|
372 |
- this.questionExplanation = this.parsedData.prblmExpln || '해설 없음' |
|
373 |
- } else { |
|
374 |
- console.log('No data found in local storage'); |
|
375 |
- } |
|
376 |
- }, |
|
377 |
- downloadFile() { |
|
378 |
- window.open(this.questionFile, '_blank'); |
|
379 |
- }, |
|
380 |
- getProblemId() { |
|
381 |
- // 문제 ID를 얻는 로직을 추가하세요 |
|
382 |
- return 'sampleProblemId'; |
|
383 |
- } |
|
384 |
-======= |
|
385 | 214 |
}, |
386 | 215 |
watch: { |
387 | 216 |
|
388 | 217 |
}, |
389 | 218 |
computed: { |
390 | 219 |
|
391 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
|
392 | 220 |
}, |
393 | 221 |
components: { |
394 | 222 |
SvgIcon |
395 | 223 |
}, |
396 | 224 |
mounted() { |
397 |
-<<<<<<< HEAD |
|
398 |
- this.loadFromLocalStorage(); |
|
399 |
- } |
|
400 |
-} |
|
401 |
-</script> |
|
402 |
- |
|
403 |
-<style> |
|
404 |
- .data-wrap { |
|
405 |
- width: -webkit-fill-available; |
|
406 |
- padding: 1.2rem; |
|
407 |
- } |
|
408 |
- .download-btn { |
|
409 |
- background-color: #007bff; |
|
410 |
- color: white; |
|
411 |
- border: none; |
|
412 |
- padding: 10px 20px; |
|
413 |
- cursor: pointer; |
|
414 |
- text-decoration: none; |
|
415 |
- font-size: 1rem; |
|
416 |
- } |
|
417 |
- .download-btn:hover { |
|
418 |
- background-color: #0056b3; |
|
419 |
- } |
|
420 |
- .modal-overlay { |
|
421 |
- position: fixed; |
|
422 |
- top: 0; |
|
423 |
- left: 0; |
|
424 |
- width: 100%; |
|
425 |
- height: 100%; |
|
426 |
- background-color: rgba(0, 0, 0, 0.5); |
|
427 |
- display: flex; |
|
428 |
- justify-content: center; |
|
429 |
- align-items: center; |
|
430 |
- } |
|
431 |
- .modal-content { |
|
432 |
- background-color: white; |
|
433 |
- padding: 20px; |
|
434 |
- border-radius: 5px; |
|
435 |
- text-align: center; |
|
436 |
- } |
|
437 |
- .modal-content button { |
|
438 |
- margin: 10px; |
|
439 |
- padding: 10px 20px; |
|
440 |
- cursor: pointer; |
|
441 |
- } |
|
442 |
-</style> |
|
443 |
-======= |
|
444 | 225 |
console.log('Main2 mounted'); |
445 | 226 |
} |
446 | 227 |
} |
... | ... | @@ -448,4 +229,3 @@ |
448 | 229 |
<style scoped> |
449 | 230 |
.ui-checkbox{width: 30px; height: 30px;} |
450 | 231 |
</style> |
451 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
--- client/views/pages/teacher/QuestionInsert.vue
+++ client/views/pages/teacher/QuestionInsert.vue
... | ... | @@ -26,10 +26,11 @@ |
26 | 26 |
<div class="flex align-center mb20"> |
27 | 27 |
<label for="" class="title2">카테고리</label> |
28 | 28 |
<select v-model="selectedSearchOption" class="mr10 data-wrap"> |
29 |
- <option value="bbsTtl">제목</option> |
|
30 |
- <option value="bbsCnt">내용</option> |
|
31 |
- <option value="userNm">작성자</option> |
|
32 |
- <option value="bbsCls">카테고리</option> |
|
29 |
+ <option value="LC">듣기 이해력</option> |
|
30 |
+ <option value="RC">독해 이해력</option> |
|
31 |
+ <option value="WT">쓰기</option> |
|
32 |
+ <option value="SP">말하기</option> |
|
33 |
+ <option value="ETC">그외</option> |
|
33 | 34 |
</select> |
34 | 35 |
</div> |
35 | 36 |
<div class="flex align-center mb20"> |
... | ... | @@ -53,10 +54,9 @@ |
53 | 54 |
<div class="flex align-center"> |
54 | 55 |
<label for="" class="title2">문제 지표</label> |
55 | 56 |
<select v-model="selectedSearchOption" class="mr10 data-wrap"> |
56 |
- <option value="bbsTtl">제목</option> |
|
57 |
- <option value="bbsCnt">내용</option> |
|
58 |
- <option value="userNm">작성자</option> |
|
59 |
- <option value="bbsCls">카테고리</option> |
|
57 |
+ <option value="bbsTtl">지표1</option> |
|
58 |
+ <option value="bbsCnt">지표2</option> |
|
59 |
+ <option value="userNm">지표3</option> |
|
60 | 60 |
</select> |
61 | 61 |
</div> |
62 | 62 |
</div> |
... | ... | @@ -189,7 +189,7 @@ |
189 | 189 |
<button type="button" title="글쓰기" class="new-btn mr10"> |
190 | 190 |
취소 |
191 | 191 |
</button> |
192 |
- <button type="button" title="글쓰기" class="new-btn"> |
|
192 |
+ <button type="button" title="글쓰기" class="new-btn" @click="submitForm"> |
|
193 | 193 |
등록 |
194 | 194 |
</button> |
195 | 195 |
</div> |
... | ... | @@ -205,13 +205,40 @@ |
205 | 205 |
data() { |
206 | 206 |
return { |
207 | 207 |
mdiMagnify: mdiMagnify, |
208 |
- selectedTab: 'tab1', |
|
208 |
+ selectedTab: '1', |
|
209 |
+ selectedSearchOption: '', // 카테고리 선택 |
|
210 |
+ prblm_ctgry_id: '', // 카테고리 ID |
|
211 |
+ prblm_type_id: '', // 문제 유형 ID |
|
212 |
+ prblm_scr: '', // 문제 배점 |
|
213 |
+ prblm_expln: '', // 내용 |
|
214 |
+ prblm_hint: '', // 힌트 |
|
215 |
+ file_mng_id: null, // 첨부파일 ID |
|
209 | 216 |
} |
210 | 217 |
}, |
211 | 218 |
methods: { |
212 | 219 |
goToPage(page) { |
213 | 220 |
this.$router.push({ name: page }); |
214 | 221 |
}, |
222 |
+ submitForm() { |
|
223 |
+ const payload = { |
|
224 |
+ prblm_ctgry_id: this.selectedSearchOption, // 카테고리 |
|
225 |
+ prblm_type_id: this.selectedTab, // 문제 유형 |
|
226 |
+ prblm_scr: this.prblm_scr, // 문제 배점 |
|
227 |
+ prblm_expln: this.prblm_expln, // 내용 |
|
228 |
+ prblm_hint: this.prblm_hint, // 힌트 |
|
229 |
+ file_mng_id: this.file_mng_id // 첨부파일 ID |
|
230 |
+ }; |
|
231 |
+ |
|
232 |
+ axios.post('/problem/insertProblem.json', payload) |
|
233 |
+ .then(response => { |
|
234 |
+ console.log('성공:', response.data); |
|
235 |
+ // 성공적으로 저장한 후 처리 로직 추가 |
|
236 |
+ }) |
|
237 |
+ .catch(error => { |
|
238 |
+ console.error('오류:', error); |
|
239 |
+ // 오류 처리 로직 추가 |
|
240 |
+ }); |
|
241 |
+ } |
|
215 | 242 |
}, |
216 | 243 |
watch: { |
217 | 244 |
|
--- client/views/pages/teacher/QuestionList.vue
+++ client/views/pages/teacher/QuestionList.vue
... | ... | @@ -7,17 +7,16 @@ |
7 | 7 |
</div> |
8 | 8 |
<label for="" class="title2">단원</label> |
9 | 9 |
<div class="unit-pagination flex mt10 mb20" style="gap: 10px;"> |
10 |
- <button class="selected-btn">1</button> |
|
11 |
- <button>2</button> |
|
12 |
- <button>3</button> |
|
10 |
+ <button @click="selectUnit('UNIT_000000000000001')" :class="{ 'selected-btn': selectedUnitId === 'UNIT_000000000000001' }">1</button> |
|
11 |
+ <button @click="selectUnit('UNIT_000000000000002')" :class="{ 'selected-btn': selectedUnitId === 'UNIT_000000000000002' }">2</button> |
|
12 |
+ <button @click="selectUnit('UNIT_000000000000003')" :class="{ 'selected-btn': selectedUnitId === 'UNIT_000000000000003' }">3</button> |
|
13 | 13 |
</div> |
14 | 14 |
<div class="search-wrap flex justify-end mb20"> |
15 | 15 |
<select name="" id="" class="mr10 data-wrap" v-model="searchOption"> |
16 | 16 |
<option value="">전체</option> |
17 |
- <option value="">제목</option> |
|
18 | 17 |
<option value="prblm_expln">문제</option> |
18 |
+ <option value="prblm_type_id">유형</option> |
|
19 | 19 |
<option value="user_id">작성자</option> |
20 |
- <option value="">등록일</option> |
|
21 | 20 |
</select> |
22 | 21 |
<input type="text" placeholder="검색하세요." v-model="searchKeyword"> |
23 | 22 |
<button type="button" title="위원회 검색" @click="searchProblems"> |
... | ... | @@ -29,22 +28,21 @@ |
29 | 28 |
<thead> |
30 | 29 |
<tr> |
31 | 30 |
<td>No.</td> |
32 |
- <td>제목</td> |
|
33 |
- <td>내용</td> |
|
31 |
+ <td>문제</td> |
|
34 | 32 |
<td>유형</td> |
35 |
- <td>지문</td> |
|
33 |
+ <td>점수</td> |
|
34 |
+ <td>작성자</td> |
|
36 | 35 |
<td>등록일</td> |
37 |
-<<<<<<< HEAD |
|
38 | 36 |
</tr> |
39 | 37 |
</thead> |
40 | 38 |
<tbody> |
41 | 39 |
<tr v-for="(problem, index) in problems" :key="problem.prblmId" @click="[goToPage('QuestionDetail', selectQuestionList(problem))]"> |
42 | 40 |
<td>{{ (currentPage - 1) * 10 + index + 1 }}</td> |
43 |
- <td>제목</td> |
|
44 | 41 |
<td>{{ problem.prblmExpln }}</td> |
42 |
+ <td>{{ problem.prblmTypeId }}</td> |
|
43 |
+ <td>{{ problem.prblmScr }}</td> |
|
45 | 44 |
<td>{{ problem.userId }}</td> |
46 |
- <td>오답률</td> |
|
47 |
- <td>등록일</td> |
|
45 |
+ <td>{{ problem.regDt}}</td> |
|
48 | 46 |
</tr> |
49 | 47 |
</tbody> |
50 | 48 |
</table> |
... | ... | @@ -59,36 +57,10 @@ |
59 | 57 |
<img src="../../../resources/img/btn28_90t_normal.png" alt=""> |
60 | 58 |
</button> |
61 | 59 |
</article> |
62 |
- <div class="flex justify-end"> |
|
60 |
+ <div class="flex justify-end "> |
|
63 | 61 |
<button type="button" title="등록" class="new-btn" @click="goToPage('QuestionInsert')"> |
64 | 62 |
등록 |
65 | 63 |
</button> |
66 |
-======= |
|
67 |
- </thead> |
|
68 |
- <tbody> |
|
69 |
- <tr @click="goToPage('QuestionDetail')"> |
|
70 |
- <td></td> |
|
71 |
- <td></td> |
|
72 |
- <td></td> |
|
73 |
- <td></td> |
|
74 |
- <td></td> |
|
75 |
- <td></td> |
|
76 |
- </tr> |
|
77 |
- </tbody> |
|
78 |
- </table> |
|
79 |
- <article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
|
80 |
- <button><img src="../../../resources/img/btn27_90t_normal.png" alt=""></button> |
|
81 |
- <button class="selected-btn">1</button> |
|
82 |
- <button>2</button> |
|
83 |
- <button>3</button> |
|
84 |
- <button><img src="../../../resources/img/btn28_90t_normal.png" alt=""></button> |
|
85 |
- </article> |
|
86 |
- <div class="flex justify-end "> |
|
87 |
- <button type="button" title="등록" class="new-btn" @click="goToPage('QuestionInsert')"> |
|
88 |
- 등록 |
|
89 |
- </button> |
|
90 |
- </div> |
|
91 |
->>>>>>> e47769b90c7ad4f0b34f38bb2a56a8a69a894941 |
|
92 | 64 |
</div> |
93 | 65 |
</div> |
94 | 66 |
</template> |
... | ... | @@ -101,20 +73,18 @@ |
101 | 73 |
export default { |
102 | 74 |
data() { |
103 | 75 |
return { |
104 |
- problems: [], |
|
105 | 76 |
mdiMagnify: mdiMagnify, |
77 |
+ problems: [], |
|
106 | 78 |
currentPage: 1, |
107 | 79 |
totalPages: 3, |
108 | 80 |
searchOption: '', |
109 | 81 |
searchKeyword: '', |
82 |
+ selectedUnitId: 'UNIT_000000000000001' |
|
110 | 83 |
} |
111 | 84 |
}, |
112 | 85 |
methods: { |
113 | 86 |
goToPage(page) { |
114 | 87 |
this.$router.push({ name: page }); |
115 |
- }, |
|
116 |
- selectQuestionList(item) { |
|
117 |
- sessionStorage.setItem("selectQuestionList", JSON.stringify(item)); |
|
118 | 88 |
}, |
119 | 89 |
showConfirm(type) { |
120 | 90 |
let message = ''; |
... | ... | @@ -130,11 +100,19 @@ |
130 | 100 |
this.goBack(); |
131 | 101 |
} |
132 | 102 |
}, |
103 |
+ selectQuestionList(item) { |
|
104 |
+ sessionStorage.setItem("selectQuestionList", JSON.stringify(item)); |
|
105 |
+ }, |
|
106 |
+ selectUnit(unitId) { |
|
107 |
+ this.selectedUnitId = unitId; // 선택된 단원 ID 설정 |
|
108 |
+ this.fetchProblems(1); // 첫 페이지로 문제 목록 새로 고침 |
|
109 |
+ }, |
|
133 | 110 |
async fetchProblems(page = 1) { |
134 | 111 |
try { |
135 | 112 |
const response = await axios.post('/problem/problemList.json', { |
136 | 113 |
option: this.searchOption, |
137 | 114 |
keyword: this.searchKeyword, |
115 |
+ unitId: this.selectedUnitId, |
|
138 | 116 |
pageSize: 10, |
139 | 117 |
startIndex: (page - 1) * 10 |
140 | 118 |
}); |
... | ... | @@ -146,13 +124,20 @@ |
146 | 124 |
}, |
147 | 125 |
changePage(page) { |
148 | 126 |
if (page < 1 || page > this.totalPages) return; |
149 |
- this.fetchProblems(page); |
|
150 | 127 |
this.currentPage = page; |
128 |
+ this.fetchProblems(page); |
|
151 | 129 |
}, |
152 | 130 |
searchProblems() { |
153 | 131 |
this.fetchProblems(1); |
154 | 132 |
} |
155 | 133 |
}, |
134 |
+ watch: { |
|
135 |
+ }, |
|
136 |
+ computed: { |
|
137 |
+ }, |
|
138 |
+ components: { |
|
139 |
+ SvgIcon |
|
140 |
+ }, |
|
156 | 141 |
mounted() { |
157 | 142 |
console.log('Main2 mounted'); |
158 | 143 |
this.fetchProblems(); |
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?