jichoi / lms_front star
박민혁 박민혁 2024-08-22
Merge branch 'master' of http://210.180.118.83/jichoi/lms_front
@e7f2519ddf1dc6598967b98270b8e6ef4c32c451
client/views/pages/main/MyPage.vue
--- client/views/pages/main/MyPage.vue
+++ client/views/pages/main/MyPage.vue
@@ -59,16 +59,16 @@
                     </div>
                     <div class="box " style="gap: 10px;">
                         <div><img src="../../../resources/img/img196_12p.png" alt=""></div>
-                        <P class="title2 mt10">현재 30명 중 <em class="red">2등</em>입니다.</P>
+                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="red">{{ photo_rank }}등</em>입니다.</P>
                     </div>
                 </div>
                 <div class="textbook ">
                     <div class="text ">
-                        <p class="title1" style="color: #fff;">포토북 랭킹</p>
+                        <p class="title1" style="color: #fff;">진도율 랭킹</p>
                     </div>
                     <div class="box " style="gap: 10px;">
                         <div><img src="../../../resources/img/img196_12p.png" alt=""></div>
-                        <P class="title2 mt10">현재 30명 중 <em class="yellow">2등</em>입니다.</P>
+                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="yellow">{{ problem_rank }}등</em>입니다.</P>
                     </div>
                 </div>
                 <div class="textbook book-blue">
@@ -77,16 +77,16 @@
                     </div>
                     <div class="box " style="gap: 10px;">
                         <div><img src="../../../resources/img/img196_12p.png" alt=""></div>
-                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="blue">{{ rank }}등</em>입니다.</P>
+                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="blue">{{score_rank}}등</em>입니다.</P>
                     </div>
                 </div>
                 <div class="textbook book-navy">
                     <div class="text ">
-                        <p class="title1" style="color: #fff;">포토북 랭킹</p>
+                        <p class="title1" style="color: #fff;">학습시간 랭킹</p>
                     </div>
                     <div class="box " style="gap: 10px;">
                         <div><img src="../../../resources/img/img196_12p.png" alt=""></div>
-                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="navy">2등</em>입니다.</P>
+                        <P class="title2 mt10">현재 30명 중 <em class="navy">2등</em>입니다.</P>
                     </div>
                 </div>
             </div>
@@ -106,8 +106,9 @@
     data() {
         return {
             stdCount: 0,
-            rank: 0,
-
+            photo_rank: 0,
+            problem_rank: 0,
+            score_rank: 0,
             mdiMagnify: mdiMagnify,
             mdilArrowRight: mdilArrowRight,
             timer: "00:00",
@@ -151,11 +152,11 @@
                 }
             })
                 .then(function (response) {
-                    console.log("Rank - response : ", response.data);
-                    vm.rank = response.data;
+                    console.log("Photo Rank - response : ", response.data);
+                    vm.photo_rank = response.data;
                 })
                 .catch(function (error) {
-                    console.log("Rank - error : ", error);
+                    console.log("Photo Rank - error : ", error);
                     alert("학생 사진 랭킹 조회에 오류가 발생했습니다.");
                 });
         },
@@ -173,14 +174,36 @@
             })
                 .then(function (response) {
                     console.log("User Rank - response : ", response.data);
-                    vm.rank = response.data; 
+                    vm.score_rank = response.data; 
                 })
                 .catch(function (error) {
                     console.log("User Rank - error : ", error);
-                    alert("학생 랭킹 조회에 오류가 발생했습니다.");
+                    alert("점수 랭킹 조회에 오류가 발생했습니다.");
                 });
         },
 
+        problemRankByProblemData: function () {
+            const vm = this;
+            axios({
+                url: "/problemLog/problemRankByProblemData.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    sclsId: "1",
+                    stdId: "2"
+                }
+            })
+                .then(function (response) {
+                    console.log("Problem Rank - response : ", response.data);
+                    vm.problem_rank = response.data;
+                })
+                .catch(function (error) {
+                    console.log("Problem Rank - error : ", error);
+                    alert("학생 문제 랭킹 조회에 오류가 발생했습니다.");
+                });
+        },
         goToPage(page) {
             this.$router.push({ name: page });
         },
@@ -219,6 +242,7 @@
         this.classStdCount();
         this.photoRankByLikeData();
         this.getUserRankByScore();
+        this.problemRankByProblemData();
     }
 }
 </script>
Add a comment
List