--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }"> |
24 | 24 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[1] ? 'block' : 'none' }"> |
25 | 25 |
</button> |
26 |
- <p>지문1</p> |
|
26 |
+ <p>{{ labeledItems[0] }}</p> |
|
27 | 27 |
</div> |
28 | 28 |
<div class="race-btn" @click="goToPage('Chapter2')"> |
29 | 29 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }"> |
34 | 34 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[2] ? 'block' : 'none' }"> |
35 | 35 |
</button> |
36 |
- <p>단어장</p> |
|
36 |
+ <p>{{ labeledItems[1] }}</p> |
|
37 | 37 |
</div> |
38 | 38 |
</div> |
39 | 39 |
<div class="lcon flex justify-between mb5"> |
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }"> |
46 | 46 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[7] ? 'block' : 'none' }"> |
47 | 47 |
</button> |
48 |
- <p>문제1</p> |
|
48 |
+ <p>{{ labeledItems[6] }}</p> |
|
49 | 49 |
</div> |
50 | 50 |
<div class="race-btn" @click="goToPage('Chapter6')"> |
51 | 51 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }"> |
56 | 56 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[6] ? 'block' : 'none' }"> |
57 | 57 |
</button> |
58 |
- <p>단어장</p> |
|
58 |
+ <p>{{ labeledItems[5] }}</p> |
|
59 | 59 |
</div> |
60 | 60 |
<div class="race-btn" @click="goToPage('Chapter2_8')"> |
61 | 61 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }"> |
66 | 66 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[5] ? 'block' : 'none' }"> |
67 | 67 |
</button> |
68 |
- <p>지문2</p> |
|
68 |
+ <p>{{ labeledItems[4] }}</p> |
|
69 | 69 |
</div> |
70 | 70 |
<div class="race-btn" @click="goToPage('Chapter2_7')"> |
71 | 71 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -75,7 +75,7 @@ |
75 | 75 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }"> |
76 | 76 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[4] ? 'block' : 'none' }"> |
77 | 77 |
</button> |
78 |
- <p>문제2</p> |
|
78 |
+ <p>{{ labeledItems[3] }}</p> |
|
79 | 79 |
</div> |
80 | 80 |
<div class="race-btn" @click="goToPage('Chapter2_8')"> |
81 | 81 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -85,7 +85,7 @@ |
85 | 85 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }"> |
86 | 86 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[3] ? 'block' : 'none' }"> |
87 | 87 |
</button> |
88 |
- <p>문제1</p> |
|
88 |
+ <p>{{ labeledItems[2] }}</p> |
|
89 | 89 |
</div> |
90 | 90 |
</div> |
91 | 91 |
<div class="rcon flex"> |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 |
<img :src="item.imgSrc3" :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }"> |
98 | 98 |
<img :src="item.imgSrc4" :style="{ display: rabbitCompl[8] ? 'block' : 'none' }"> |
99 | 99 |
</button> |
100 |
- <p class="long">중간 평가</p> |
|
100 |
+ <p class="long">{{ labeledItems[7] }}</p> |
|
101 | 101 |
</div> |
102 | 102 |
<div class="race-btn" @click="goToPage('Chapter2_8')"> |
103 | 103 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -107,7 +107,7 @@ |
107 | 107 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }"> |
108 | 108 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[9] ? 'block' : 'none' }"> |
109 | 109 |
</button> |
110 |
- <p>지문3</p> |
|
110 |
+ <p>{{ labeledItems[8] }}</p> |
|
111 | 111 |
</div> |
112 | 112 |
<div class="race-btn" @click="goToPage('Chapter10')"> |
113 | 113 |
<div class="rabbit-running"><img src="../../../resources/img/img09_s.png" alt="" |
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 |
<img :src="item.imgSrc1" :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }"> |
118 | 118 |
<img :src="item.imgSrc2" :style="{ display: rabbitCompl[10] ? 'block' : 'none' }"> |
119 | 119 |
</button> |
120 |
- <p>단어장</p> |
|
120 |
+ <p>{{ labeledItems[9] }}</p> |
|
121 | 121 |
</div> |
122 | 122 |
|
123 | 123 |
<div class="race-btn" @click="goToPage('Chapter2_8')"> |
... | ... | @@ -128,11 +128,8 @@ |
128 | 128 |
<img :src="item.imgSrc3" :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }"> |
129 | 129 |
<img :src="item.imgSrc4" :style="{ display: rabbitCompl[11] ? 'block' : 'none' }"> |
130 | 130 |
</button> |
131 |
- <p class="long">최종 평가</p> |
|
131 |
+ <p class="long">{{ labeledItems[10] }}</p> |
|
132 | 132 |
</div> |
133 |
- |
|
134 |
- |
|
135 |
- |
|
136 | 133 |
</div> |
137 | 134 |
<div class="race-btn"> |
138 | 135 |
<div class="rabbit-running" style=" |
... | ... | @@ -380,6 +377,14 @@ |
380 | 377 |
bottomRight: { x: 0, y: 0 } |
381 | 378 |
}, |
382 | 379 |
roadmapData: [], |
380 |
+ labeledItems: [], |
|
381 |
+ |
|
382 |
+ problemCounter: 0, |
|
383 |
+ wordCounter: 0, |
|
384 |
+ textCounter: 0, |
|
385 |
+ evalCounter: 0, |
|
386 |
+ book_id: null, |
|
387 |
+ unit_id: null, |
|
383 | 388 |
|
384 | 389 |
schedules: [], |
385 | 390 |
nowSchedule: "", |
... | ... | @@ -415,7 +420,7 @@ |
415 | 420 |
else |
416 | 421 |
this.rabbitPos[0] = true |
417 | 422 |
}, |
418 |
- fetchSchedule() { |
|
423 |
+ fetchSchedule(unit_id, book_id) { |
|
419 | 424 |
axios({ |
420 | 425 |
url: "/schedule/selectSchedule.json", |
421 | 426 |
method: "post", |
... | ... | @@ -437,7 +442,7 @@ |
437 | 442 |
} else { |
438 | 443 |
this.nowSchedule = this.schedules.find(schedule => schedule.finish === null || schedule.finish === "F"); |
439 | 444 |
if (this.nowSchedule) { |
440 |
- this.fetchRoadmapData(); |
|
445 |
+ this.fetchRoadmapData(unit_id, book_id); |
|
441 | 446 |
this.state = 'studying'; |
442 | 447 |
} else { |
443 | 448 |
this.state = 'notRegistered'; |
... | ... | @@ -462,7 +467,7 @@ |
462 | 467 |
finish: "T" |
463 | 468 |
} |
464 | 469 |
}) |
465 |
- .then(response => { |
|
470 |
+ .then(response => { |
|
466 | 471 |
const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id); |
467 | 472 |
alert("학습을 완료했습니다!"); |
468 | 473 |
window.location.reload(); |
... | ... | @@ -477,8 +482,7 @@ |
477 | 482 |
console.error("Error updating schedule:", error); |
478 | 483 |
}); |
479 | 484 |
}, |
480 |
- |
|
481 |
- fetchRoadmapData() { |
|
485 |
+ fetchRoadmapData(unit_id, book_id) { |
|
482 | 486 |
axios({ |
483 | 487 |
url: "/unitLearning/find.json", |
484 | 488 |
method: "post", |
... | ... | @@ -486,21 +490,22 @@ |
486 | 490 |
"Content-Type": "application/json; charset=UTF-8", |
487 | 491 |
}, |
488 | 492 |
data: { |
489 |
- unit_id: this.schedules[0].unit_id, |
|
490 |
- book_id: this.schedules[0].book_id |
|
493 |
+ unit_id: unit_id, |
|
494 |
+ book_id: book_id |
|
491 | 495 |
} |
492 | 496 |
}) |
493 |
- .then(response => { |
|
494 |
- if (response.data.length != 0) { |
|
497 |
+ .then(response => { |
|
498 |
+ if (response.data.length != 0) { |
|
495 | 499 |
this.roadmapData = response.data; |
496 |
- } else { |
|
500 |
+ this.labeledItems = this.processedRoadmap; |
|
501 |
+ } else { |
|
497 | 502 |
this.state = "noProblem" |
498 |
- } |
|
499 |
- }) |
|
500 |
- .catch(error => { |
|
503 |
+ } |
|
504 |
+ }) |
|
505 |
+ .catch(error => { |
|
501 | 506 |
this.state = "noProblem" |
502 | 507 |
console.error("Error fetching roadmap data:", error); |
503 |
- }); |
|
508 |
+ }); |
|
504 | 509 |
}, |
505 | 510 |
toggleImage(index) { |
506 | 511 |
this.items[index].isSecondImageVisible = !this.items[index].isSecondImageVisible; |
... | ... | @@ -881,13 +886,6 @@ |
881 | 886 |
}); |
882 | 887 |
}; |
883 | 888 |
}, |
884 |
- getNonNullColumn(item) { |
|
885 |
- if (item.prblm_id !== null) return '문제'; |
|
886 |
- if (item.wd_book_id !== null) return '단어장'; |
|
887 |
- if (item.text_id !== null) return '지문'; |
|
888 |
- if (item.eval_id !== null) return '평가'; |
|
889 |
- return ''; |
|
890 |
- }, |
|
891 | 889 |
showConfirm(type) { |
892 | 890 |
let message = ''; |
893 | 891 |
if (type === 'cancel') { |
... | ... | @@ -907,12 +905,34 @@ |
907 | 905 |
SvgIcon, |
908 | 906 |
}, |
909 | 907 |
mounted() { |
908 |
+ const { schdl_id, book_id, unit_id } = this.$route.query; |
|
910 | 909 |
console.log('main mounted'); |
911 |
- this.fetchSchedule(); |
|
910 |
+ this.fetchSchedule(unit_id, book_id); |
|
912 | 911 |
this.fetchRabbit(); |
913 | 912 |
}, |
914 |
- computed() { |
|
913 |
+ computed: { |
|
914 |
+ processedRoadmap() { |
|
915 |
+ let problemCounter = 0; |
|
916 |
+ let wordCounter = 0; |
|
917 |
+ let textCounter = 0; |
|
918 |
+ let evalCounter = 0; |
|
915 | 919 |
|
920 |
+ return this.roadmapData.map(item => { |
|
921 |
+ if (item.wd_book_id !== null) { |
|
922 |
+ wordCounter++; |
|
923 |
+ return `단어장${wordCounter}`; |
|
924 |
+ } else if (item.text_id !== null) { |
|
925 |
+ textCounter++; |
|
926 |
+ return `지문${textCounter}`; |
|
927 |
+ } else if (item.eval_id !== null) { |
|
928 |
+ evalCounter++; |
|
929 |
+ return evalCounter === 1 ? '중간평가' : '최종평가'; |
|
930 |
+ } else { |
|
931 |
+ problemCounter++; |
|
932 |
+ return `문제${problemCounter}`; |
|
933 |
+ } |
|
934 |
+ }); |
|
935 |
+ } |
|
916 | 936 |
}, |
917 | 937 |
beforeDestroy() { |
918 | 938 |
// 컴포넌트가 파괴되기 전에 리스너 제거 |
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
... | ... | @@ -105,46 +105,54 @@ |
105 | 105 |
}, |
106 | 106 |
methods: { |
107 | 107 |
goToPage(page, scheduleId) { |
108 |
- const startScheduleIndex = this.schedules.findIndex(schedule => schedule.schdl_id === scheduleId); |
|
108 |
+ const startScheduleIndex = this.schedules.findIndex(schedule => schedule.schdl_id === scheduleId); |
|
109 | 109 |
|
110 |
- if (startScheduleIndex === -1) { |
|
111 |
- console.error("해당 스케줄을 찾을 수 없습니다."); |
|
112 |
- return; |
|
113 |
- } |
|
110 |
+ if (startScheduleIndex === -1) { |
|
111 |
+ console.error("해당 스케줄을 찾을 수 없습니다."); |
|
112 |
+ return; |
|
113 |
+ } |
|
114 | 114 |
|
115 |
- const updates = []; |
|
116 |
- const currentSchedule = this.schedules[startScheduleIndex]; |
|
117 |
- if (currentSchedule.finish === null || currentSchedule.finish === "T") { |
|
115 |
+ const updates = []; |
|
116 |
+ const currentSchedule = this.schedules[startScheduleIndex]; |
|
117 |
+ if (currentSchedule.finish === null || currentSchedule.finish === "T") { |
|
118 |
+ updates.push( |
|
119 |
+ axios.post("/schedule/scheduleUpdate.json", { scheduleId: currentSchedule.schdl_id, finish: "F" }, { |
|
120 |
+ headers: { |
|
121 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
122 |
+ } |
|
123 |
+ }) |
|
124 |
+ ); |
|
125 |
+ } |
|
126 |
+ |
|
127 |
+ for (let i = startScheduleIndex + 1; i < this.schedules.length; i++) { |
|
128 |
+ const nextSchedule = this.schedules[i]; |
|
129 |
+ if (nextSchedule.finish === "T") { |
|
118 | 130 |
updates.push( |
119 |
- axios.post("/schedule/scheduleUpdate.json", { scheduleId: currentSchedule.schdl_id, finish: "F" }, { |
|
131 |
+ axios.post("/schedule/scheduleUpdate.json", { scheduleId: nextSchedule.schdl_id, finish: "F" }, { |
|
120 | 132 |
headers: { |
121 | 133 |
"Content-Type": "application/json; charset=UTF-8", |
122 | 134 |
} |
123 | 135 |
}) |
124 | 136 |
); |
125 | 137 |
} |
138 |
+ } |
|
126 | 139 |
|
127 |
- for (let i = startScheduleIndex + 1; i < this.schedules.length; i++) { |
|
128 |
- const nextSchedule = this.schedules[i]; |
|
129 |
- if (nextSchedule.finish === "T") { |
|
130 |
- updates.push( |
|
131 |
- axios.post("/schedule/scheduleUpdate.json", { scheduleId: nextSchedule.schdl_id, finish: "F" }, { |
|
132 |
- headers: { |
|
133 |
- "Content-Type": "application/json; charset=UTF-8", |
|
134 |
- } |
|
135 |
- }) |
|
136 |
- ); |
|
137 |
- } |
|
138 |
- } |
|
139 |
- |
|
140 |
- Promise.all(updates) |
|
141 |
- .then(() => { |
|
142 |
- this.$router.push({ name: page }); |
|
143 |
- }) |
|
144 |
- .catch(error => { |
|
145 |
- console.error("Error updating schedules:", error); |
|
146 |
- alert("학습 계획을 업데이트하는 중 오류가 발생했습니다."); |
|
140 |
+ Promise.all(updates) |
|
141 |
+ .then(() => { |
|
142 |
+ const schedule = this.schedules[startScheduleIndex]; |
|
143 |
+ this.$router.push({ |
|
144 |
+ name: page, |
|
145 |
+ query: { |
|
146 |
+ schdl_id: schedule.schdl_id, |
|
147 |
+ book_id: schedule.book_id, |
|
148 |
+ unit_id: schedule.unit_id |
|
149 |
+ } |
|
147 | 150 |
}); |
151 |
+ }) |
|
152 |
+ .catch(error => { |
|
153 |
+ console.error("Error updating schedules:", error); |
|
154 |
+ alert("학습 계획을 업데이트하는 중 오류가 발생했습니다."); |
|
155 |
+ }); |
|
148 | 156 |
}, |
149 | 157 |
goToPage2(page) { |
150 | 158 |
this.$router.push({ name: page }); |
--- client/views/pages/main/MyPlan2.vue
+++ client/views/pages/main/MyPlan2.vue
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 |
<p class="title">오늘 공부를 계획해봅시다.</p> |
6 | 6 |
</div> |
7 | 7 |
<div class="wrap"> |
8 |
- <p class="title1"> 학습 교재를 선택합시다.</p> |
|
8 |
+ <p class="title1"> 학습 단원을 선택합시다.</p> |
|
9 | 9 |
<div class="search-wrap flex justify-end mb20 mt20"> |
10 | 10 |
<input class="data-wrap" type="text" placeholder="검색하세요." v-model="keyword"> |
11 | 11 |
<button type="button" title="위원회 검색" @click="searchBook"> |
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?