jichoi / lms_front star
이은진 이은진 2024-08-13
240813 이은진 학습일정수정 기능 추가
@7bb79b7574e65b9c12db313aff6965488679d097
client/views/pages/main/MyPlan.vue
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
@@ -25,13 +25,18 @@
                                     <p class="title2">{{ schedule.book_nm }}</p>
                                     <!-- <p class="title2">wirte a</p> -->
                                 </div>
-                                <button v-if="schedule.finish=='T'" type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard')">
+                                <button v-if="schedule.finish == 'T'" type="button" title="바로가기" class="yellow-btn"
+                                    @click="goToPage('Dashboard')">
                                     학습완료
                                 </button>
-                                <button v-else type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard')">
+                                <button v-else type="button" title="바로가기" class="yellow-btn"
+                                    @click="goToPage('Dashboard')">
                                     바로가기
                                 </button>
                                 <div><img src="../../../resources/img/img214_19s.png" alt=""></div>
+                                <button type="button" class="popup-close-btn" @click="deleteSchedule(schedule.schdl_id)">
+                                    <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
+                                </button>
                             </div>
                         </div>
                     </div>
@@ -143,6 +148,20 @@
                     console.error("fetchUnits - error:", error);
                     alert("단원 목록을 불러오는 중 오류가 발생했습니다.");
                 });
+        }, deleteSchedule(scheduleId){
+            axios.post("/schedule/scheduleDelete.json", { scheduleId: scheduleId }, {
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                }
+            })
+                .then(response => {
+                    alert("학습일정이 삭제되었습니다.")
+                    window.location.reload();
+                })
+                .catch(error => {
+                    console.error("fetchUnits - error:", error);
+                    alert("단원 목록을 불러오는 중 오류가 발생했습니다.");
+                });
         }
     },
     watch: {
client/views/pages/main/MyPlan2.vue
--- client/views/pages/main/MyPlan2.vue
+++ client/views/pages/main/MyPlan2.vue
@@ -273,8 +273,7 @@
             })
                 .then(response => { 
                     const units = response.data.map(item => item.schdl_unit); 
-                    this.unitList.push(...units);
-                    console.log(this.unitList)
+                    this.unitList.push(...units); 
                 })
                 .catch(error => {
                     console.error("searchUnit - error: ", error);
Add a comment
List