jichoi / lms_front star
woals 08-20
240820 권민수 학부모 대시보드 학생정보 받아오기 추가
@2a38eb6c865d20902976d7da327e3e273940555a
client/views/layout/Side.vue
--- client/views/layout/Side.vue
+++ client/views/layout/Side.vue
@@ -16,9 +16,7 @@
           </p>
           <!-- <progress-bar :progress="progress"></progress-bar> -->
           <span>지금까지 푼 총 문제 수:</span>
-          <span class="brown ml10"
-            >{{ studentInfo.totalProblemsSolved }} 개</span
-          >
+          <span class="brown ml10">{{ studentInfo.totalProblemsSolved }} 개</span>
         </div>
       </div>
       <hr />
client/views/pages/parents/Main_p.vue
--- client/views/pages/parents/Main_p.vue
+++ client/views/pages/parents/Main_p.vue
@@ -12,18 +12,25 @@
                         <div>
                             <img src="../../../resources/img/img16_s.png" alt="">
                             <div class="mt10" style="width: 100%;">
-                                <p class="name mb10">학생이름</p>
-                                <p class="mb5">xx중학교 3학년 x반</p>
-                                <progress-bar :progress="progress"></progress-bar>
-                                <span @click="increaseProgress">오늘의 공부</span>
-                                <span class="brown ml10">{{ progress }}%</span>
+                                <p class="name mb10">{{ studentInfo.studentName }}</p>
+                                <p class="mb5">
+                                    {{ studentInfo.institutionName }} {{ studentInfo.grade }}학년
+                                    {{ studentInfo.className }}
+                                </p>
+                                <!-- <progress-bar :progress="progress"></progress-bar> -->
+                                <span>지금까지 푼 총 문제 수:</span>
+                                <span class="brown ml10">{{ studentInfo.totalProblemsSolved }} 개</span>
                             </div>
                         </div>
                         <hr>
                         <p class="title2 mb25">최근 학습 히스토리</p>
                         <ul class="flex justify-between ml30">
-                            <li>자학사 3학년 2학기</li>
-                            <li>자학사 3학년 2학기</li>
+                            <li
+                                v-for="historyItem in studentInfo.history"
+                                :key="historyItem.unitId"
+                            >
+                                [{{ historyItem.bookName }}] {{ historyItem.unitName }}
+                            </li>
                         </ul>
 
                         <hr>
@@ -190,17 +197,31 @@
             progress: 20,
             donutChartData: {},
             currentDate: "2024-08-14",
+            studentInfo: {
+                studentName: "",
+                institutionName: "",
+                grade: "",
+                className: "",
+                studentQuestion: "",
+                history: [],
+            },
             currentStdId: "1"
         }
     },
 
     methods: {
 
-        increaseProgress() {
-            if (this.progress < 100) {
-                this.progress += 10;
-            }
-        },
+        // 학생 데이터 가져오기
+        fetchStudentInfo() {
+            axios.post("/studentInfo/getInfo.json", { userId: this.currentStdId })
+            .then((response) => {
+                console.log(response.data);
+                this.studentInfo = response.data;
+            })
+            .catch((error) => {
+                console.error("학생 정보 가져오기 실패:", error);
+            });
+        }, 
        
         // 현재 날짜의 학생 학습률 데이터 가져오기
         getStdProgressData() {
@@ -244,6 +265,7 @@
 
     mounted() {
         this.getStdProgressData();
+        this.fetchStudentInfo();
     }
 
 }
Add a comment
List