
--- client/views/pages/main/MyPage.vue
+++ client/views/pages/main/MyPage.vue
... | ... | @@ -181,7 +181,6 @@ |
181 | 181 |
alert("점수 랭킹 조회에 오류가 발생했습니다."); |
182 | 182 |
}); |
183 | 183 |
}, |
184 |
- |
|
185 | 184 |
problemRankByProblemData: function () { |
186 | 185 |
const vm = this; |
187 | 186 |
axios({ |
--- client/views/pages/parents/Main_p.vue
+++ client/views/pages/parents/Main_p.vue
... | ... | @@ -44,28 +44,28 @@ |
44 | 44 |
<p class="title1" style="color: #fff;">포토북 랭킹</p> |
45 | 45 |
</div> |
46 | 46 |
<div class="box"> |
47 |
- <P class="title2 mt10">현재 30명 중 <em class="red">2등</em>입니다.</P> |
|
47 |
+ <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="red">{{ photo_rank }}등</em>입니다.</P> |
|
48 | 48 |
</div> |
49 | 49 |
</div> |
50 | 50 |
<div class="textbook "> |
51 | 51 |
<div class="text "> |
52 |
- <p class="title1" style="color: #fff;">포토북 랭킹</p> |
|
52 |
+ <p class="title1" style="color: #fff;">진도율 랭킹</p> |
|
53 | 53 |
</div> |
54 | 54 |
<div class="box"> |
55 |
- <P class="title2 mt10">현재 30명 중 <em class="yellow">2등</em>입니다.</P> |
|
55 |
+ <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="yellow">{{ problem_rank }}등</em>입니다.</P> |
|
56 | 56 |
</div> |
57 | 57 |
</div> |
58 | 58 |
<div class="textbook book-blue"> |
59 | 59 |
<div class="text "> |
60 |
- <p class="title1" style="color: #fff;">포토북 랭킹</p> |
|
60 |
+ <p class="title1" style="color: #fff;">점수 랭킹</p> |
|
61 | 61 |
</div> |
62 | 62 |
<div class="box"> |
63 |
- <P class="title2 mt10">현재 30명 중 <em class="blue">2등</em>입니다.</P> |
|
63 |
+ <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="blue">{{score_rank}}등</em>입니다.</P> |
|
64 | 64 |
</div> |
65 | 65 |
</div> |
66 | 66 |
<div class="textbook book-navy"> |
67 | 67 |
<div class="text "> |
68 |
- <p class="title1" style="color: #fff;">포토북 랭킹</p> |
|
68 |
+ <p class="title1" style="color: #fff;">학습시간 랭킹</p> |
|
69 | 69 |
</div> |
70 | 70 |
<div class="box"> |
71 | 71 |
<P class="title2 mt10">현재 30명 중 <em class="navy">2등</em>입니다.</P> |
... | ... | @@ -195,6 +195,10 @@ |
195 | 195 |
|
196 | 196 |
data() { |
197 | 197 |
return { |
198 |
+ stdCount: 0, |
|
199 |
+ photo_rank: 0, |
|
200 |
+ problem_rank: 0, |
|
201 |
+ score_rank: 0, |
|
198 | 202 |
progress: 20, |
199 | 203 |
donutChartData: {}, |
200 | 204 |
currentDate: "2024-08-14", |
... | ... | @@ -211,6 +215,93 @@ |
211 | 215 |
}, |
212 | 216 |
|
213 | 217 |
methods: { |
218 |
+ classStdCount: function () { |
|
219 |
+ const vm = this; |
|
220 |
+ axios({ |
|
221 |
+ url: "/userclass/classStdCountByUserId.json", |
|
222 |
+ method: "post", |
|
223 |
+ headers: { |
|
224 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
225 |
+ }, |
|
226 |
+ data: { |
|
227 |
+ userId: "USID_000000000000002" // 로그인한 학생의 userId |
|
228 |
+ } |
|
229 |
+ }) |
|
230 |
+ .then(function (response) { |
|
231 |
+ console.log("classStdCount - response : ", response.data); |
|
232 |
+ vm.stdCount = response.data; |
|
233 |
+ }) |
|
234 |
+ .catch(function (error) { |
|
235 |
+ console.log("classStdCount - error : ", error); |
|
236 |
+ alert("반 학생 수 조회에 오류가 발생했습니다."); |
|
237 |
+ }); |
|
238 |
+ }, |
|
239 |
+ |
|
240 |
+ photoRankByLikeData: function () { |
|
241 |
+ const vm = this; |
|
242 |
+ axios({ |
|
243 |
+ url: "/photo/photoRankByLikeData.json", |
|
244 |
+ method: "post", |
|
245 |
+ headers: { |
|
246 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
247 |
+ }, |
|
248 |
+ data: { |
|
249 |
+ sclsId: "1", |
|
250 |
+ stdId: "1" |
|
251 |
+ } |
|
252 |
+ }) |
|
253 |
+ .then(function (response) { |
|
254 |
+ console.log("Photo Rank - response : ", response.data); |
|
255 |
+ vm.photo_rank = response.data; |
|
256 |
+ }) |
|
257 |
+ .catch(function (error) { |
|
258 |
+ console.log("Photo Rank - error : ", error); |
|
259 |
+ alert("학생 사진 랭킹 조회에 오류가 발생했습니다."); |
|
260 |
+ }); |
|
261 |
+ }, |
|
262 |
+ getUserRankByScore: function () { |
|
263 |
+ const vm = this; |
|
264 |
+ axios({ |
|
265 |
+ url: "/userclass/getUserRankByScore.json", |
|
266 |
+ method: "post", |
|
267 |
+ headers: { |
|
268 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
269 |
+ }, |
|
270 |
+ data: { |
|
271 |
+ userId: "USID_000000000000002" // 로그인한 학생의 userId |
|
272 |
+ } |
|
273 |
+ }) |
|
274 |
+ .then(function (response) { |
|
275 |
+ console.log("User Rank - response : ", response.data); |
|
276 |
+ vm.score_rank = response.data; |
|
277 |
+ }) |
|
278 |
+ .catch(function (error) { |
|
279 |
+ console.log("User Rank - error : ", error); |
|
280 |
+ alert("점수 랭킹 조회에 오류가 발생했습니다."); |
|
281 |
+ }); |
|
282 |
+ }, |
|
283 |
+ problemRankByProblemData: function () { |
|
284 |
+ const vm = this; |
|
285 |
+ axios({ |
|
286 |
+ url: "/problemLog/problemRankByProblemData.json", |
|
287 |
+ method: "post", |
|
288 |
+ headers: { |
|
289 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
290 |
+ }, |
|
291 |
+ data: { |
|
292 |
+ sclsId: "1", |
|
293 |
+ stdId: "2" |
|
294 |
+ } |
|
295 |
+ }) |
|
296 |
+ .then(function (response) { |
|
297 |
+ console.log("Problem Rank - response : ", response.data); |
|
298 |
+ vm.problem_rank = response.data; |
|
299 |
+ }) |
|
300 |
+ .catch(function (error) { |
|
301 |
+ console.log("Problem Rank - error : ", error); |
|
302 |
+ alert("학생 문제 랭킹 조회에 오류가 발생했습니다."); |
|
303 |
+ }); |
|
304 |
+ }, |
|
214 | 305 |
|
215 | 306 |
// 학생 데이터 가져오기 |
216 | 307 |
fetchStudentInfo() { |
... | ... | @@ -268,6 +359,10 @@ |
268 | 359 |
mounted() { |
269 | 360 |
this.getStdProgressData(); |
270 | 361 |
this.fetchStudentInfo(); |
362 |
+ this.classStdCount(); |
|
363 |
+ this.photoRankByLikeData(); |
|
364 |
+ this.getUserRankByScore(); |
|
365 |
+ this.problemRankByProblemData(); |
|
271 | 366 |
} |
272 | 367 |
|
273 | 368 |
} |
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?