jichoi / lms_front star
guntaek 2024-08-22
240822 김건택 MyPlan.page ai 맞춤형 학습 코스 수정(수정 중)
@70876b015776a0baa8db2db6105b4a024f5f4726
client/views/pages/main/MyPlan.vue
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
@@ -50,18 +50,18 @@
             <div class="wrap mt30">
                 <p class="title1 mb20">AI 맞춤형 학습 코스는 어떨까요?</p>
                 <div class="imgGroup flex justify-between">
-                    <div class="text-lf aiClick" @click="goToPage2('AIDashboard')">
+                    <div class="text-lf aiClick" v-for="(ai_learning, index) in aiLearningList" :key="index" @click="goToPage('Dashboard', aiLearningList[index].unit_id)">
+                        <img src="../../../resources/img/img215_22s.png" alt="" />
+                        <p class="title2 mt10">추천 학습 단원</p>
+                    </div>
+                    <!-- <div class="text-lf aiClick" @click="goToPage2('AIDashboard')">
                         <img src="../../../resources/img/img215_22s.png" alt="" />
                         <p class="title2 mt10">추천 학습 단원</p>
                     </div>
                     <div class="text-lf aiClick" @click="goToPage2('AIDashboard')">
                         <img src="../../../resources/img/img215_22s.png" alt="" />
                         <p class="title2 mt10">추천 학습 단원</p>
-                    </div>
-                    <div class="text-lf aiClick" @click="goToPage2('AIDashboard')">
-                        <img src="../../../resources/img/img215_22s.png" alt="" />
-                        <p class="title2 mt10">추천 학습 단원</p>
-                    </div>
+                    </div> -->
                 </div>
             </div>
         </div>
@@ -92,6 +92,8 @@
                 { label: "5교시", time: "13:00 ~ 14:00", value: "5" },
                 { label: "6교시", time: "14:00 ~ 15:00", value: "6" },
             ],
+
+            aiLearningList: [],
         };
     },
     methods: {
@@ -238,6 +240,29 @@
                     alert("단원 목록을 불러오는 중 오류가 발생했습니다.");
                 });
         },
+
+        selectAiLearning: function () {
+            const vm = this;
+            axios({
+                url: "/aiLearning/selectAILearning.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    std_id: this.stdId
+                }
+            })
+                .then(function (response) {
+                    console.log("aiLearningList - response : ", response.data);
+                    vm.aiLearningList = response.data;
+                })
+                .catch(function (error) {
+                    console.log("aiLearningList - error : ", error);
+                    alert("ai learning 조회에 오류가 발생했습니다.");
+                });
+        },
+
     },
     watch: {},
     computed: {
@@ -249,6 +274,7 @@
     mounted() {
         console.log("Main2 mounted");
         this.fetchSchedules();
+        this.selectAiLearning();
     },
 };
 </script>
Add a comment
List