woals
08-20
240820 권민수 학부모 대시보드 학생정보 받아오기 추가
@2a38eb6c865d20902976d7da327e3e273940555a
--- client/views/layout/Side.vue
+++ client/views/layout/Side.vue
... | ... | @@ -16,9 +16,7 @@ |
16 | 16 |
</p> |
17 | 17 |
<!-- <progress-bar :progress="progress"></progress-bar> --> |
18 | 18 |
<span>지금까지 푼 총 문제 수:</span> |
19 |
- <span class="brown ml10" |
|
20 |
- >{{ studentInfo.totalProblemsSolved }} 개</span |
|
21 |
- > |
|
19 |
+ <span class="brown ml10">{{ studentInfo.totalProblemsSolved }} 개</span> |
|
22 | 20 |
</div> |
23 | 21 |
</div> |
24 | 22 |
<hr /> |
--- client/views/pages/parents/Main_p.vue
+++ client/views/pages/parents/Main_p.vue
... | ... | @@ -12,18 +12,25 @@ |
12 | 12 |
<div> |
13 | 13 |
<img src="../../../resources/img/img16_s.png" alt=""> |
14 | 14 |
<div class="mt10" style="width: 100%;"> |
15 |
- <p class="name mb10">학생이름</p> |
|
16 |
- <p class="mb5">xx중학교 3학년 x반</p> |
|
17 |
- <progress-bar :progress="progress"></progress-bar> |
|
18 |
- <span @click="increaseProgress">오늘의 공부</span> |
|
19 |
- <span class="brown ml10">{{ progress }}%</span> |
|
15 |
+ <p class="name mb10">{{ studentInfo.studentName }}</p> |
|
16 |
+ <p class="mb5"> |
|
17 |
+ {{ studentInfo.institutionName }} {{ studentInfo.grade }}학년 |
|
18 |
+ {{ studentInfo.className }} |
|
19 |
+ </p> |
|
20 |
+ <!-- <progress-bar :progress="progress"></progress-bar> --> |
|
21 |
+ <span>지금까지 푼 총 문제 수:</span> |
|
22 |
+ <span class="brown ml10">{{ studentInfo.totalProblemsSolved }} 개</span> |
|
20 | 23 |
</div> |
21 | 24 |
</div> |
22 | 25 |
<hr> |
23 | 26 |
<p class="title2 mb25">최근 학습 히스토리</p> |
24 | 27 |
<ul class="flex justify-between ml30"> |
25 |
- <li>자학사 3학년 2학기</li> |
|
26 |
- <li>자학사 3학년 2학기</li> |
|
28 |
+ <li |
|
29 |
+ v-for="historyItem in studentInfo.history" |
|
30 |
+ :key="historyItem.unitId" |
|
31 |
+ > |
|
32 |
+ [{{ historyItem.bookName }}] {{ historyItem.unitName }} |
|
33 |
+ </li> |
|
27 | 34 |
</ul> |
28 | 35 |
|
29 | 36 |
<hr> |
... | ... | @@ -190,17 +197,31 @@ |
190 | 197 |
progress: 20, |
191 | 198 |
donutChartData: {}, |
192 | 199 |
currentDate: "2024-08-14", |
200 |
+ studentInfo: { |
|
201 |
+ studentName: "", |
|
202 |
+ institutionName: "", |
|
203 |
+ grade: "", |
|
204 |
+ className: "", |
|
205 |
+ studentQuestion: "", |
|
206 |
+ history: [], |
|
207 |
+ }, |
|
193 | 208 |
currentStdId: "1" |
194 | 209 |
} |
195 | 210 |
}, |
196 | 211 |
|
197 | 212 |
methods: { |
198 | 213 |
|
199 |
- increaseProgress() { |
|
200 |
- if (this.progress < 100) { |
|
201 |
- this.progress += 10; |
|
202 |
- } |
|
203 |
- }, |
|
214 |
+ // 학생 데이터 가져오기 |
|
215 |
+ fetchStudentInfo() { |
|
216 |
+ axios.post("/studentInfo/getInfo.json", { userId: this.currentStdId }) |
|
217 |
+ .then((response) => { |
|
218 |
+ console.log(response.data); |
|
219 |
+ this.studentInfo = response.data; |
|
220 |
+ }) |
|
221 |
+ .catch((error) => { |
|
222 |
+ console.error("학생 정보 가져오기 실패:", error); |
|
223 |
+ }); |
|
224 |
+ }, |
|
204 | 225 |
|
205 | 226 |
// 현재 날짜의 학생 학습률 데이터 가져오기 |
206 | 227 |
getStdProgressData() { |
... | ... | @@ -244,6 +265,7 @@ |
244 | 265 |
|
245 | 266 |
mounted() { |
246 | 267 |
this.getStdProgressData(); |
268 |
+ this.fetchStudentInfo(); |
|
247 | 269 |
} |
248 | 270 |
|
249 | 271 |
} |
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?