jichoi / lms_front star
박민혁 박민혁 08-29
240829 박민혁
@da99f9fa15ac2c642d49382722c26970252e1a8c
client/resources/css/style.css
--- client/resources/css/style.css
+++ client/resources/css/style.css
@@ -875,7 +875,7 @@
 details > summary::-webkit-details-marker { background:#444; color:#fff; background-size:contain; transform:rotate3d(0, 0, 1, 90deg); transition:transform 0.25s;}
 details[open] > summary::-webkit-details-marker { transform:rotate3d(0, 0, 1, 180deg);}
 details[open] > summary ~ * { animation:reveal 0.5s;}
-.tpt {font-family: 'Pretendard-SemiBold'; font-size: 20px;padding:10px; line-height:25px; cursor: pointer;}
+.tpt {font-family: 'Pretendard-SemiBold'; font-size: 20px;padding:5px; line-height:25px; cursor: pointer;}
 .side_t .tpt{ margin:5px 0 10px 30px; }
 .side_t .tpt:hover{background-color: #fff; border: 1px solid #FFBA08; border-radius: 5px; text-decoration: underline; text-decoration-color: #FFBA08;
 text-decoration-thickness: 3px;}
client/views/layout/Side_t.vue
--- client/views/layout/Side_t.vue
+++ client/views/layout/Side_t.vue
@@ -26,7 +26,7 @@
                     <router-link to="/Home.page" class="tpt">홈</router-link>
                     <router-link to="/Board.page" class="tpt">게시판</router-link>
                     <router-link to="/StudentList.page" class="tpt">학생목록</router-link>
-                    <router-link to="/C_Textbook.page" class="tpt">교재</router-link>
+                    <router-link to="/textbook.page" class="tpt">교재</router-link>
                 </details>
            </div>
             <div>
client/views/pages/AppRouter.js
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
@@ -458,9 +458,12 @@
                 next();
             }
         } else if (userInfo.author[0].authority === 'PARENT') {
-            if (to.name !== 'Main_p') {
+             if(to.name === 'PhotoBook'){
+                next();
+            }
+            if (to.name !== 'Main_p' ) {
                 next({ name: 'Main_p' });
-            } else {
+            }  else {
                 next(); 
             }
         } else {
client/views/pages/main/PhotoBook.vue
--- client/views/pages/main/PhotoBook.vue
+++ client/views/pages/main/PhotoBook.vue
@@ -5,11 +5,8 @@
   <div class="myphoto mb30">
     <div>
       <div class="title-box flex justify-end mb40">
-        <select name="" id="">
-          <option v-for="classItem in classList" :key="classItem.sclsId" :value="classItem.sclsId" @click="
-            currentPage = 1;
-          stdPhotoSelectList(classItem.sclsId);
-          ">
+        <select @change="handleClassChange">
+          <option v-for="classItem in classList" :key="classItem.sclsId" :value="classItem.sclsId">
             {{ classItem.sclsNm }}
           </option>
         </select>
@@ -116,6 +113,7 @@
       showModal: false,
       searchOpen: false,
       searchOpen2: false,
+      selectedSclsId: null,
     };
   },
   methods: {
@@ -135,6 +133,9 @@
           console.log("classList - response : ", response.data);
           vm.classList = response.data.data;
           vm.currentPage = 1;
+          vm.selectedSclsId= vm.classList[0].sclsId;
+          vm.stdPhotoSelectList();
+
         })
         .catch(function (error) {
           console.log("classList - error : ", error);
@@ -142,32 +143,36 @@
         });
     },
 
-    stdPhotoSelectList: function (sclsId) {
-      const vm = this;
-      axios({
-        url: "/photo/stdPhotoList.json",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json; charset=UTF-8",
-        },
-        data: {
-          stdId: "1",
-          sclsId: "1", // 여기에 sclsId들어가야함
-          page: vm.currentPage,
-          pageSize: vm.pageSize,
-        },
+    handleClassChange(event) {
+    this.selectedSclsId = event.target.value; // 선택된 sclsId 가져오기
+    this.currentPage = 1; // 페이지 초기화
+    this.stdPhotoSelectList(); // 함수 호출
+  },
+  stdPhotoSelectList: function (scsId) {
+    const vm = this;
+    axios({
+      url: "/photo/stdPhotoList.json",
+      method: "post",
+      headers: {
+        "Content-Type": "application/json; charset=UTF-8",
+      },
+      data: {
+        stdId: "1",
+        sclsId: vm.selectedSclsId, // 여기에 sclsId 들어가야 함
+        page: vm.currentPage,
+        pageSize: vm.pageSize,
+      },
+    })
+      .then(function (response) {
+        console.log("photoList - response : ", response.data);
+        vm.photoList = response.data;
+        vm.totalPages = Math.ceil(response.data.photoCount / vm.pageSize);
       })
-        .then(function (response) {
-          console.log("photoList - response : ", response.data);
-          vm.photoList = response.data;
-          vm.totalPages = Math.ceil(response.data.photoCount / vm.pageSize);
-        })
-        .catch(function (error) {
-          console.log("photoList - error : ", error);
-          alert("반별 내 사진 조회에 오류가 발생했습니다.");
-        });
-    },
-
+      .catch(function (error) {
+        console.log("photoList - error : ", error);
+        alert("반별 내 사진 조회에 오류가 발생했습니다.");
+      });
+  },
     getRotation(index) {
       const rotations = [2, -1, 1, -2, 1, -1];
       return `rotate(${rotations[index]}deg)`;
@@ -277,7 +282,6 @@
   mounted() {
     console.log("Main2 mounted");
     this.stdClassesSelectList();
-    this.stdPhotoSelectList();
   },
 };
 </script>
client/views/pages/parents/Main_p.vue
--- client/views/pages/parents/Main_p.vue
+++ client/views/pages/parents/Main_p.vue
@@ -25,10 +25,7 @@
                         <hr>
                         <p class="title2 mb25">최근 학습 히스토리</p>
                         <ul class="flex justify-between ml30">
-                            <li
-                                v-for="historyItem in studentInfo.history"
-                                :key="historyItem.unitId"
-                            >
+                            <li v-for="historyItem in studentInfo.history" :key="historyItem.unitId">
                                 [{{ historyItem.bookName }}] {{ historyItem.unitName }}
                             </li>
                         </ul>
@@ -44,7 +41,8 @@
                                         <p class="title1" style="color: #fff;">포토북 랭킹</p>
                                     </div>
                                     <div class="box">
-                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="red">{{ photo_rank }}등</em>입니다.</P>
+                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="red">{{ photo_rank
+                                                }}등</em>입니다.</P>
                                     </div>
                                 </div>
                                 <div class="textbook ">
@@ -52,7 +50,8 @@
                                         <p class="title1" style="color: #fff;">진도율 랭킹</p>
                                     </div>
                                     <div class="box">
-                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="yellow">{{ problem_rank }}등</em>입니다.</P>
+                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="yellow">{{ problem_rank
+                                                }}등</em>입니다.</P>
                                     </div>
                                 </div>
                                 <div class="textbook book-blue">
@@ -60,7 +59,8 @@
                                         <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,8 @@
                                         <p class="title1" style="color: #fff;">학습시간 랭킹</p>
                                     </div>
                                     <div class="box">
-                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="navy">{{ time_rank }}등</em>입니다.</P>
+                                        <P class="title2 mt10">현재 {{ stdCount }}명 중 <em class="navy">{{ time_rank
+                                                }}등</em>입니다.</P>
                                     </div>
                                 </div>
                             </div>
@@ -85,7 +86,7 @@
                                     </div>
                                     <div class="text mt10">
                                         <p class="title1 mb10">나의 사진첩</p>
-                                        <button @click="selectedTab = 'tab4'; goToPage('PhotoBook')" type="button"
+                                        <button @click="goToPage('PhotoBook')" type="button"
                                             title="글쓰기" class="new-btn">
                                             바로가기
                                         </button>
@@ -104,14 +105,17 @@
                     <div class="flex">
                         <div class="wrap" style="flex: 1;">
                             <p class="name">학습 현황</p>
-                            <div class="flex justify-center"><Dounutchart/></div>
+                            <div class="flex justify-center">
+                                <Dounutchart />
+                            </div>
                             <div class="textbox">
                                 <p class="title2">오늘의 학습현황</p>
                                 <!-- 안전하게 진도율을 소수점 한자리 수까지 표시 -->
-                                <p class="name"> 
-                                    {{ donutChartData.clearUnitNum && donutChartData.totalScheduleUnitNum 
-                                        ? (donutChartData.clearUnitNum / donutChartData.totalScheduleUnitNum * 100).toFixed(1) 
-                                        : 0 }} %
+                                <p class="name">
+                                    {{ donutChartData.clearUnitNum && donutChartData.totalScheduleUnitNum
+                                        ? (donutChartData.clearUnitNum / donutChartData.totalScheduleUnitNum *
+                                            100).toFixed(1)
+                                    : 0 }} %
                                 </p>
                             </div>
                             <p class="title2">학습시간</p>
@@ -120,7 +124,7 @@
                         <div class="wrap" style="flex: 1;">
                             <p class="name">이해/표현 점수</p>
                             <div class="flex justify-center mt50">
-                                <ColumnLineChart/>
+                                <ColumnLineChart />
                             </div>
                         </div>
                     </div>
@@ -160,12 +164,16 @@
                         <div class="flex-column" style="flex: 1;">
                             <div class="wrap">
                                 <p class="name">교재별 오답률</p>
-                                <div class="flex justify-center"><Barchart /></div>
+                                <div class="flex justify-center">
+                                    <Barchart />
+                                </div>
                             </div>
 
                             <div class="wrap">
                                 <p class="name">문제 카테고리별 세부 점수</p>
-                                <div class="flex justify-center"><CategoryBarChart /></div>
+                                <div class="flex justify-center">
+                                    <CategoryBarChart />
+                                </div>
                             </div>
 
                         </div>
@@ -216,6 +224,10 @@
     },
 
     methods: {
+        goToPage(page) {
+            this.$router.push({ name: page });
+        },
+
         classStdCount: function () {
             const vm = this;
             axios({
@@ -274,7 +286,7 @@
             })
                 .then(function (response) {
                     console.log("User Rank - response : ", response.data);
-                    vm.score_rank = response.data; 
+                    vm.score_rank = response.data;
                 })
                 .catch(function (error) {
                     console.log("User Rank - error : ", error);
@@ -295,7 +307,7 @@
             })
                 .then(function (response) {
                     console.log("User Rank - response : ", response.data);
-                    vm.time_rank = response.data; 
+                    vm.time_rank = response.data;
                 })
                 .catch(function (error) {
                     console.log("User Rank - error : ", error);
@@ -328,15 +340,15 @@
         // 학생 데이터 가져오기
         fetchStudentInfo() {
             axios.post("/studentInfo/getInfo.json", { userId: this.currentStdId })
-            .then((response) => {
-                console.log(response.data);
-                this.studentInfo = response.data;
-            })
-            .catch((error) => {
-                console.error("학생 정보 가져오기 실패:", error);
-            });
-        }, 
-       
+                .then((response) => {
+                    console.log(response.data);
+                    this.studentInfo = response.data;
+                })
+                .catch((error) => {
+                    console.error("학생 정보 가져오기 실패:", error);
+                });
+        },
+
         // 현재 날짜의 학생 학습률 데이터 가져오기
         getStdProgressData() {
             const vm = this;
@@ -344,13 +356,13 @@
                 std_id: vm.currentStdId,
                 current_date: vm.currentDate
             })
-            .then(response => {
-                vm.donutChartData = response.data;
-                console.log(vm.donutChartData);
-            })
-            .catch(error => {
-                console.error('오늘의 학생 학습 현황 데이터를 가져오는 중 오류 발생:', error);
-            })
+                .then(response => {
+                    vm.donutChartData = response.data;
+                    console.log(vm.donutChartData);
+                })
+                .catch(error => {
+                    console.error('오늘의 학생 학습 현황 데이터를 가져오는 중 오류 발생:', error);
+                })
         },
 
     },
client/views/pages/teacher/ClassDetail.vue
--- client/views/pages/teacher/ClassDetail.vue
+++ client/views/pages/teacher/ClassDetail.vue
@@ -40,7 +40,7 @@
     <div class="wrap mb30">
       <div class="flex justify-between mb30 align-center">
         <label for="" class="title1">학생 목록</label>
-        <div class="look-btn align-center flex">
+        <div class="look-btn align-center flex" @click="goToPage('StudentList')">
           <p>자세히 보기</p>
           <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon>
         </div>
@@ -67,7 +67,7 @@
     <div class="wrap mb30">
       <div class="flex justify-between mb30 align-center">
         <label for="" class="title1">책 </label>
-        <div class="align-center flex look-btn">
+        <div class="align-center flex look-btn"  @click="goToPage('textbook')">
           <p>자세히 보기</p>
           <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon>
         </div>
Add a comment
List