![](/assets/images/project_default_logo.png)
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -7,21 +7,7 @@ |
7 | 7 |
<div class="title-box"> |
8 | 8 |
<p class="title">{{ roadmapData[0].unit_nm }}</p> |
9 | 9 |
<p class="subtitle">{{ roadmapData[0].book_nm }}</p> |
10 |
- </div> |
|
11 |
- <!-- |
|
12 |
- <div class="race-box"> |
|
13 |
- <div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt=""></div> |
|
14 |
- <div class="rcon flex justify-between mb5"> |
|
15 |
- <div class="race-btn" v-for="roadmap in roadmapData" :key="roadmap.learning_id" @click="goToPage('Chapter7')"> |
|
16 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="2"> |
|
17 |
- <img :src="item.imgSrc1"> |
|
18 |
- <img :src="item.imgSrc2" :style="{ display: item.isSecondImageVisible ? 'block' : 'none' }"> |
|
19 |
- </button> |
|
20 |
- <p>{{getNonNullColumn(roadmap)}}</p> |
|
21 |
- </div> |
|
22 |
- </div> |
|
23 |
- </div> |
|
24 |
- --> |
|
10 |
+ </div> |
|
25 | 11 |
<div class="race-box"> |
26 | 12 |
<div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt=""></div> |
27 | 13 |
<div class="rcon flex justify-end mb5"> |
... | ... | @@ -360,9 +346,6 @@ |
360 | 346 |
topLeft: { x: 0, y: 0 }, |
361 | 347 |
bottomRight: { x: 0, y: 0 } |
362 | 348 |
}, |
363 |
- |
|
364 |
- |
|
365 |
- roadViewTF: false, |
|
366 | 349 |
roadmapData: [], |
367 | 350 |
|
368 | 351 |
schedules: [], |
... | ... | @@ -421,8 +404,7 @@ |
421 | 404 |
}); |
422 | 405 |
}, |
423 | 406 |
|
424 |
- fetchRoadmapData() { |
|
425 |
- const vm = this; |
|
407 |
+ fetchRoadmapData() { |
|
426 | 408 |
axios({ |
427 | 409 |
url: "/unitLearning/find.json", |
428 | 410 |
method: "post", |
... | ... | @@ -430,14 +412,13 @@ |
430 | 412 |
"Content-Type": "application/json; charset=UTF-8", |
431 | 413 |
}, |
432 | 414 |
data: { |
433 |
- unit_id: this.schedules[0].unit_id, |
|
434 |
- book_id: this.schedules[0].book_id |
|
415 |
+ unit_id: this.nowSchedule.unit_id, |
|
416 |
+ book_id: this.nowSchedule.book_id |
|
435 | 417 |
} |
436 | 418 |
}) |
437 | 419 |
.then(response => { |
420 |
+ console.log(response.data) |
|
438 | 421 |
this.roadmapData = response.data; |
439 |
- console.log(this.roadmapData) |
|
440 |
- this.roadViewTF = vm.roadmapData.length > 0; |
|
441 | 422 |
}) |
442 | 423 |
.catch(error => { |
443 | 424 |
console.error("Error fetching roadmap data:", error); |
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
... | ... | @@ -5,9 +5,9 @@ |
5 | 5 |
<div class="title-box flex justify-between mb40"> |
6 | 6 |
<p class="title">오늘 공부할 내용을 확인해봅시다.</p> |
7 | 7 |
</div> |
8 |
- <div class="wrap" style="border-radius: 0; min-height: 197px;"> |
|
8 |
+ <div class="wrap" style="border-radius: 0; min-height: 197px;"> |
|
9 | 9 |
<p class="title1" v-if="!schedules || schedules.length === 0"> 오늘 학습할 내용이 없습니다.</p> |
10 |
- |
|
10 |
+ |
|
11 | 11 |
<div class="flex-column" style="gap: 20px;" v-else v-for="(schedule, index) in schedules" :key="index"> |
12 | 12 |
<div class="flex justify-between align-center" style="gap: 70px;"> |
13 | 13 |
<div><img src="../../../resources/img/img217_22s.png" alt=""></div> |
... | ... | @@ -17,14 +17,20 @@ |
17 | 17 |
<p class="title2">grade 3</p> |
18 | 18 |
<div class="flex align-center mb10" style="gap: 10px;"> |
19 | 19 |
<p class="title2"><em class="gray-bd">{{ schedule.schdl_unit }}교시</em></p> |
20 |
- <p class="title1">{{ schedule.schedule_time }}</p> |
|
20 |
+ <p class="title1">{{ schedule.schedule_time }}</p> |
|
21 | 21 |
</div> |
22 | 22 |
<div class="title-box mb10"> |
23 |
- <span class="title">{{schedule.unit_nm}}</span> |
|
23 |
+ <span class="title">{{ schedule.unit_nm }}</span> |
|
24 | 24 |
</div> |
25 | 25 |
<p class="title2">{{ schedule.book_nm }}</p> |
26 | 26 |
<!-- <p class="title2">wirte a</p> --> |
27 | 27 |
</div> |
28 |
+ <button v-if="schedule.finish=='T'" type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard')"> |
|
29 |
+ 학습완료 |
|
30 |
+ </button> |
|
31 |
+ <button v-else type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard')"> |
|
32 |
+ 바로가기 |
|
33 |
+ </button> |
|
28 | 34 |
<div><img src="../../../resources/img/img214_19s.png" alt=""></div> |
29 | 35 |
</div> |
30 | 36 |
</div> |
--- client/views/pages/main/MyPlan2.vue
+++ client/views/pages/main/MyPlan2.vue
... | ... | @@ -24,11 +24,11 @@ |
24 | 24 |
<td><input type="checkbox" class="ui-checkbox mr10" v-model="book.isSelected"></td> |
25 | 25 |
<td><img src="../../../resources/img/img214_19s.png" alt=""></td> |
26 | 26 |
<td class="text-lf"> |
27 |
- <p class="title1">{{ book.book_nm }}</p> |
|
28 |
- <p class="title2">grade 3</p> |
|
27 |
+ <p class="title1">{{ book.bookName }}</p> |
|
28 |
+ <p class="title2">{{ book.unitName }}</p> |
|
29 | 29 |
</td> |
30 | 30 |
<td> <button type="button" title="확인" class="new-btn" |
31 |
- @click="buttonSearch(book.book_nm, book.book_id)"> |
|
31 |
+ @click="buttonSearch(book.bookName, book.bookId, book.unitId)"> |
|
32 | 32 |
시간입력 |
33 | 33 |
</button></td> |
34 | 34 |
</tr> |
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 |
<p class="title1">{{ book.scheduleTime }}</p> |
55 | 55 |
</div> |
56 | 56 |
<div class="title-box mb10"> <span class="title">{{ book.bookNm }}</span></div> |
57 |
- <p class="title2">wirte a</p> |
|
57 |
+ <p class="title2">{{ book.unitNm }}</p> |
|
58 | 58 |
</div> |
59 | 59 |
<div class=""> <img src="../../../resources/img/img214_19s.png" alt=""></div> |
60 | 60 |
</div> |
... | ... | @@ -159,9 +159,10 @@ |
159 | 159 |
closeModal() { |
160 | 160 |
this.showModal = false; |
161 | 161 |
}, |
162 |
- buttonSearch(book_nm, book_id) { |
|
162 |
+ buttonSearch(book_nm, book_id, unit_id) { |
|
163 | 163 |
this.nowID = book_id |
164 | 164 |
this.nowName = book_nm |
165 |
+ this.nowunitID = unit_id |
|
165 | 166 |
this.searchOpen = true; |
166 | 167 |
}, |
167 | 168 |
closeBtn() { |
... | ... | @@ -179,6 +180,7 @@ |
179 | 180 |
this.addToNewDataArray(this.checkedItems[0]); |
180 | 181 |
this.searchOpen = false; |
181 | 182 |
this.nowID = "" |
183 |
+ this.nowunitID = "" |
|
182 | 184 |
this.nowName = "" |
183 | 185 |
this.unitList.push(this.checkedItems[0]) |
184 | 186 |
this.checkedItems = [] |
... | ... | @@ -199,17 +201,18 @@ |
199 | 201 |
scheduleTime: selectedTime.time, |
200 | 202 |
scheduleUnit: selectedTime.value, |
201 | 203 |
bookId: this.nowID, |
204 |
+ unitId: this.nowunitID, |
|
202 | 205 |
stdId: "2" |
203 | 206 |
}; |
204 | 207 |
this.newDataArray.push(newEntry); |
205 | 208 |
}, |
206 | 209 |
async insertSchedule() { |
207 |
- |
|
208 | 210 |
this.newDataArray = this.DataArray.map(item => ({ |
209 | 211 |
scheduleUnit: item.scheduleUnit, |
210 | 212 |
bookId: item.bookId, |
213 |
+ unitId: item.unitId, |
|
211 | 214 |
stdId: item.stdId |
212 |
- })); |
|
215 |
+ })); |
|
213 | 216 |
try { |
214 | 217 |
for (let data of this.newDataArray) { |
215 | 218 |
await axios.post('/schedule/insertSchedule.json', data); |
... | ... | @@ -225,26 +228,7 @@ |
225 | 228 |
return a.scheduleUnit - b.scheduleUnit; |
226 | 229 |
}); |
227 | 230 |
|
228 |
- this.DataArray = sortedArray; |
|
229 |
- }, |
|
230 |
- fetchBooks() { |
|
231 |
- axios({ |
|
232 |
- url: "/book/findAll.json", |
|
233 |
- method: "post", |
|
234 |
- headers: { |
|
235 |
- "Content-Type": "application/json; charset=UTF-8", |
|
236 |
- }, |
|
237 |
- }) |
|
238 |
- .then(response => { |
|
239 |
- this.books = response.data.map(book => ({ |
|
240 |
- ...book, |
|
241 |
- isSelected: false |
|
242 |
- })); |
|
243 |
- }) |
|
244 |
- .catch(error => { |
|
245 |
- console.error("fetchBooks - error: ", error); |
|
246 |
- alert("교재 목록을 불러오는 중 오류가 발생했습니다."); |
|
247 |
- }); |
|
231 |
+ this.DataArray = sortedArray; |
|
248 | 232 |
}, |
249 | 233 |
searchBook() { |
250 | 234 |
this.books = "" |
... | ... | @@ -263,7 +247,24 @@ |
263 | 247 |
console.error("fetchUnits - error:", error); |
264 | 248 |
alert("단원 목록을 불러오는 중 오류가 발생했습니다."); |
265 | 249 |
}); |
266 |
- } |
|
250 |
+ }, |
|
251 |
+ fetchUnits() { |
|
252 |
+ axios.post("unit/findAll.json", { |
|
253 |
+ headers: { |
|
254 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
255 |
+ } |
|
256 |
+ }) |
|
257 |
+ .then(response => { |
|
258 |
+ this.books = response.data.map(book => ({ |
|
259 |
+ ...book, |
|
260 |
+ isSelected: false |
|
261 |
+ })); |
|
262 |
+ }) |
|
263 |
+ .catch(error => { |
|
264 |
+ console.error("fetchBooks - error: ", error); |
|
265 |
+ alert("교재 목록을 불러오는 중 오류가 발생했습니다."); |
|
266 |
+ }); |
|
267 |
+ }, |
|
267 | 268 |
}, |
268 | 269 |
watch: { |
269 | 270 |
// Watchers for reactivity (if needed) |
... | ... | @@ -276,7 +277,7 @@ |
276 | 277 |
}, |
277 | 278 |
mounted() { |
278 | 279 |
console.log('Main2 mounted'); |
279 |
- this.fetchBooks(); |
|
280 |
+ this.fetchUnits(); |
|
280 | 281 |
} |
281 | 282 |
} |
282 | 283 |
</script> |
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?