jichoi / lms_front star
권지수 2024-08-23
240823 권지수 Main_p 학습시간 랭킹
@560e0cc02baf566e49375c774c7f49bf5f237d00
client/views/pages/parents/Main_p.vue
--- client/views/pages/parents/Main_p.vue
+++ client/views/pages/parents/Main_p.vue
@@ -60,7 +60,7 @@
                                         <p class="title1" style="color: #fff;">점수 랭킹</p>
                                     </div>
                                     <div class="box">
-                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="blue">{{score_rank}}등</em>입니다.</P>
+                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="blue">{{ score_rank }}등</em>입니다.</P>
                                     </div>
                                 </div>
                                 <div class="textbook book-navy">
@@ -68,7 +68,7 @@
                                         <p class="title1" style="color: #fff;">학습시간 랭킹</p>
                                     </div>
                                     <div class="box">
-                                        <P class="title2 mt10">현재 30명 중 <em class="navy">2등</em>입니다.</P>
+                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="navy">{{ time_rank }}등</em>입니다.</P>
                                     </div>
                                 </div>
                             </div>
@@ -199,6 +199,7 @@
             photo_rank: 0,
             problem_rank: 0,
             score_rank: 0,
+            time_rank: 0,
             progress: 20,
             donutChartData: {},
             currentDate: "2024-08-14",
@@ -278,6 +279,27 @@
                 .catch(function (error) {
                     console.log("User Rank - error : ", error);
                     alert("점수 랭킹 조회에 오류가 발생했습니다.");
+                });
+        },
+        getUserRankByStudyTime: function () {
+            const vm = this;
+            axios({
+                url: "/userclass/getUserRankByStudyTime.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    userId: "1"   // 로그인한 학생의 userId
+                }
+            })
+                .then(function (response) {
+                    console.log("User Rank - response : ", response.data);
+                    vm.time_rank = response.data; 
+                })
+                .catch(function (error) {
+                    console.log("User Rank - error : ", error);
+                    alert("학습시간 랭킹 조회에 오류가 발생했습니다.");
                 });
         },
         problemRankByProblemData: function () {
@@ -363,6 +385,7 @@
         this.photoRankByLikeData();
         this.getUserRankByScore();
         this.problemRankByProblemData();
+        this.getUserRankByStudyTime();
     }
 
 }
Add a comment
List