

241025 정다정 학부모페이지 학습 일정 API 연결
@a405da636f80d4244dc6b36aaf9eb6b14dd4e23f
--- client/views/pages/parents/Main_p.vue
+++ client/views/pages/parents/Main_p.vue
... | ... | @@ -156,7 +156,12 @@ |
156 | 156 |
<div class="flex"> |
157 | 157 |
<div class="wrap" style="flex: 1"> |
158 | 158 |
<p class="name">오늘의 학습 일정</p> |
159 |
- <div class="flex-column mt20" style="gap: 20px"> |
|
159 |
+ <div |
|
160 |
+ class="scheduleBox mt20" |
|
161 |
+ style="gap: 20px" |
|
162 |
+ v-for="(schedule, index) in schedules" |
|
163 |
+ :key="index" |
|
164 |
+ > |
|
160 | 165 |
<div class="flex justify-between align-center" style="gap: 70px"> |
161 | 166 |
<div><img src="../../../resources/img/img217_22s.png" alt="" /></div> |
162 | 167 |
<div |
... | ... | @@ -168,13 +173,15 @@ |
168 | 173 |
<div class="text-lf flex justify-between align-center"> |
169 | 174 |
<div> |
170 | 175 |
<div class="flex align-center mb10" style="gap: 10px"> |
171 |
- <p class="title2"><em class="gray-bd">1교시</em></p> |
|
172 |
- <p class="title1">9:00</p> |
|
173 |
- <p class="title1">~</p> |
|
174 |
- <p class="title1">10:00</p> |
|
176 |
+ <p class="title2"> |
|
177 |
+ <em class="gray-bd">{{ schedule.schdl_unit }}교시</em> |
|
178 |
+ </p> |
|
179 |
+ <p class="title1">{{ schedule.schedule_time }}</p> |
|
175 | 180 |
</div> |
176 |
- <div class="title-box mb10"><span class="title">the best</span></div> |
|
177 |
- <p class="title2">wirte a</p> |
|
181 |
+ <div class="title-box mb10"> |
|
182 |
+ <span class="title">{{ schedule.unit_nm }}</span> |
|
183 |
+ </div> |
|
184 |
+ <p class="title2">{{ schedule.book_nm }}</p> |
|
178 | 185 |
</div> |
179 | 186 |
<div class=""> |
180 | 187 |
<img src="../../../resources/img/img214_19s.png" alt="" /> |
... | ... | @@ -229,7 +236,7 @@ |
229 | 236 |
time_rank: 0, |
230 | 237 |
progress: 20, |
231 | 238 |
donutChartData: {}, |
232 |
- currentDate: '2024-08-14', |
|
239 |
+ currentDate: '2024-10-25', |
|
233 | 240 |
studentInfo: { |
234 | 241 |
studentName: '', |
235 | 242 |
institutionName: '', |
... | ... | @@ -238,7 +245,16 @@ |
238 | 245 |
studentQuestion: '', |
239 | 246 |
history: [], |
240 | 247 |
}, |
241 |
- currentStdId: '1', |
|
248 |
+ currentStdId: 'USID_000000000000002', |
|
249 |
+ schedules: [], |
|
250 |
+ timeList: [ |
|
251 |
+ { label: '1교시', time: '08:00 ~ 09:00', value: '1' }, |
|
252 |
+ { label: '2교시', time: '09:00 ~ 10:00', value: '2' }, |
|
253 |
+ { label: '3교시', time: '10:00 ~ 11:00', value: '3' }, |
|
254 |
+ { label: '4교시', time: '11:00 ~ 12:00', value: '4' }, |
|
255 |
+ { label: '5교시', time: '13:00 ~ 14:00', value: '5' }, |
|
256 |
+ { label: '6교시', time: '14:00 ~ 15:00', value: '6' }, |
|
257 |
+ ], |
|
242 | 258 |
}; |
243 | 259 |
}, |
244 | 260 |
|
... | ... | @@ -385,6 +401,34 @@ |
385 | 401 |
console.error('오늘의 학생 학습 현황 데이터를 가져오는 중 오류 발생:', error); |
386 | 402 |
}); |
387 | 403 |
}, |
404 |
+ |
|
405 |
+ // 현재학생의 학습 스케줄 가져오기 |
|
406 |
+ fetchSchedules() { |
|
407 |
+ axios |
|
408 |
+ .post( |
|
409 |
+ '/schedule/selectSchedule.json', |
|
410 |
+ { stdId: '2' }, |
|
411 |
+ { |
|
412 |
+ headers: { |
|
413 |
+ 'Content-Type': 'application/json; charset=UTF-8', |
|
414 |
+ }, |
|
415 |
+ } |
|
416 |
+ ) |
|
417 |
+ .then((response) => { |
|
418 |
+ this.schedules = response.data.map((schedule) => { |
|
419 |
+ const matchingTime = this.timeList.find((time) => time.value === schedule.schdl_unit); |
|
420 |
+ return { |
|
421 |
+ ...schedule, |
|
422 |
+ schedule_time: matchingTime ? matchingTime.time : '시간 정보 없음', |
|
423 |
+ }; |
|
424 |
+ }); |
|
425 |
+ console.log(this.schedules); |
|
426 |
+ }) |
|
427 |
+ .catch((error) => { |
|
428 |
+ console.error('fetchUnits - error:', error); |
|
429 |
+ alert('단원 목록을 불러오는 중 오류가 발생했습니다.'); |
|
430 |
+ }); |
|
431 |
+ }, |
|
388 | 432 |
}, |
389 | 433 |
|
390 | 434 |
watch: {}, |
... | ... | @@ -413,6 +457,7 @@ |
413 | 457 |
this.getUserRankByScore(); |
414 | 458 |
this.problemRankByProblemData(); |
415 | 459 |
this.getUserRankByStudyTime(); |
460 |
+ this.fetchSchedules(); |
|
416 | 461 |
}, |
417 | 462 |
}; |
418 | 463 |
</script> |
... | ... | @@ -450,4 +495,9 @@ |
450 | 495 |
border-radius: 8px; |
451 | 496 |
padding: 10px 10px; |
452 | 497 |
} |
498 |
+ |
|
499 |
+.scheduleBox { |
|
500 |
+ display: flex; |
|
501 |
+ flex-direction: column; |
|
502 |
+} |
|
453 | 503 |
</style> |
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?