
Merge branch 'master' of http://210.180.118.83/jichoi/lms_front
@210e95db554fe0e489e71601ee66ee6f5383edf8
--- client/views/layout/Side.vue
+++ client/views/layout/Side.vue
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 |
<p class="title1 mb15">선생님께 질문 있어요~</p> |
27 | 27 |
|
28 | 28 |
<div class="memo mb15"><textarea name="" id="" placeholder="궁금한 것을 적어보세요." v-model="studentInfo.studentQuestion"></textarea></div> |
29 |
- <div class="flex justify-end"><button>질문하기</button></div> |
|
29 |
+ <div class="flex justify-end"><button @click="updateQuestion">질문하기</button></div> |
|
30 | 30 |
</div> |
31 | 31 |
<!-- <div class="btn-wrap flex justify-between"> |
32 | 32 |
<button class="login-btn" @click="handleClick" > |
... | ... | @@ -73,6 +73,22 @@ |
73 | 73 |
}); |
74 | 74 |
}, |
75 | 75 |
|
76 |
+ // 질문 업데이트 메서드 |
|
77 |
+ updateQuestion() { |
|
78 |
+ axios.post('/studentInfo/updateQuestion.json', { |
|
79 |
+ userId: this.userId, |
|
80 |
+ studentQuestion: this.studentInfo.studentQuestion |
|
81 |
+ }) |
|
82 |
+ .then(response => { |
|
83 |
+ console.log('질문이 성공적으로 업데이트되었습니다.'); |
|
84 |
+ alert('질문이 성공적으로 업데이트되었습니다.'); |
|
85 |
+ }) |
|
86 |
+ .catch(error => { |
|
87 |
+ console.error('질문 업데이트 실패:', error); |
|
88 |
+ alert('질문 업데이트에 실패했습니다.'); |
|
89 |
+ }); |
|
90 |
+ }, |
|
91 |
+ |
|
76 | 92 |
handleClick() { |
77 | 93 |
this.toggleText(); |
78 | 94 |
this.goToPage('PreviewNote'); |
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
... | ... | @@ -1,27 +1,12 @@ |
1 | 1 |
<template> |
2 | 2 |
<p class="title1" v-if="state === 'finish'">오늘 공부를 다했어요! 너무 고생했어요!</p> |
3 | 3 |
<p class="title1" v-else-if="state === 'notRegistered'">지금은 학습 루트가 등록이 안됐어요! 학습 일정에서 학습루트를 등록해볼까요?</p> |
4 |
- <!-- 1번 템플릿 --> |
|
5 | 4 |
<div v-else class="main"> |
6 | 5 |
<div class="race-wrap"> |
7 | 6 |
<div class="title-box"> |
8 | 7 |
<p class="title">{{ roadmapData[0].unit_nm }}</p> |
9 | 8 |
<p class="subtitle">{{ roadmapData[0].book_nm }}</p> |
10 | 9 |
</div> |
11 |
- <!-- |
|
12 |
- <div class="race-box"> |
|
13 |
- <div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt=""></div> |
|
14 |
- <div class="rcon flex justify-between mb5"> |
|
15 |
- <div class="race-btn" v-for="roadmap in roadmapData" :key="roadmap.learning_id" @click="goToPage('Chapter7')"> |
|
16 |
- <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="2"> |
|
17 |
- <img :src="item.imgSrc1"> |
|
18 |
- <img :src="item.imgSrc2" :style="{ display: item.isSecondImageVisible ? 'block' : 'none' }"> |
|
19 |
- </button> |
|
20 |
- <p>{{getNonNullColumn(roadmap)}}</p> |
|
21 |
- </div> |
|
22 |
- </div> |
|
23 |
- </div> |
|
24 |
- --> |
|
25 | 10 |
<div class="race-box"> |
26 | 11 |
<div class="rabbit-start"><img src="../../../resources/img/img09_s.png" alt=""></div> |
27 | 12 |
<div class="rcon flex justify-end mb5"> |
... | ... | @@ -384,15 +369,13 @@ |
384 | 369 |
if (this.schedules.length == 0) { |
385 | 370 |
this.state = 'notRegistered'; |
386 | 371 |
} else { |
387 |
- // 모든 계획의 finish 값이 T인지 확인 |
|
388 | 372 |
const allFinished = this.schedules.every(schedule => schedule.finish === "T"); |
389 |
- |
|
390 | 373 |
if (allFinished) { |
391 | 374 |
this.state = 'finish'; |
392 | 375 |
} else { |
393 | 376 |
this.nowSchedule = this.schedules.find(schedule => schedule.finish === null || schedule.finish === "F"); |
394 | 377 |
if (this.nowSchedule) { |
395 |
- this.fetchRoadmapData(); // 진행 중인 스케줄이 있을 때 데이터를 가져오는 함수 호출 |
|
378 |
+ this.fetchRoadmapData(); |
|
396 | 379 |
this.state = 'studying'; |
397 | 380 |
} else { |
398 | 381 |
this.state = 'notRegistered'; |
... | ... | @@ -421,14 +404,11 @@ |
421 | 404 |
const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id); |
422 | 405 |
alert("학습을 완료했습니다!"); |
423 | 406 |
if (nextSchedule) { |
424 |
- // 다음 스케줄로 이동 |
|
425 | 407 |
this.nowSchedule = nextSchedule; |
426 | 408 |
this.$router.push({ name: 'Dashboard' }); |
427 | 409 |
} else { |
428 |
- window.location.reload(); // 전체 페이지 새로고침 |
|
410 |
+ window.location.reload(); |
|
429 | 411 |
alert("모든 학습을 완료했습니다!"); |
430 |
- // 페이지를 새로고침하여 Dashboard.vue를 다시 로드 |
|
431 |
- |
|
432 | 412 |
} |
433 | 413 |
}) |
434 | 414 |
.catch(error => { |
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
... | ... | @@ -1,5 +1,4 @@ |
1 | 1 |
<template> |
2 |
- |
|
3 | 2 |
<div class="main"> |
4 | 3 |
<div class="myplan"> |
5 | 4 |
<div class="title-box flex justify-between mb40"> |
... | ... | @@ -23,7 +22,6 @@ |
23 | 22 |
<span class="title">{{schedule.unit_nm}}</span> |
24 | 23 |
</div> |
25 | 24 |
<p class="title2">{{ schedule.book_nm }}</p> |
26 |
- <!-- <p class="title2">wirte a</p> --> |
|
27 | 25 |
</div> |
28 | 26 |
<div> |
29 | 27 |
<p class="title" @click="goToPage('Dashboard', schedule.schdl_id)">바로가기</p> |
... | ... | @@ -64,7 +62,6 @@ |
64 | 62 |
</div> |
65 | 63 |
</div> |
66 | 64 |
</div> |
67 |
- |
|
68 | 65 |
</template> |
69 | 66 |
|
70 | 67 |
<script> |
... | ... | @@ -95,46 +92,46 @@ |
95 | 92 |
}, |
96 | 93 |
methods: { |
97 | 94 |
goToPage(page, scheduleId) { |
98 |
- const startScheduleIndex = this.schedules.findIndex(schedule => schedule.schdl_id === scheduleId); |
|
95 |
+ const startScheduleIndex = this.schedules.findIndex(schedule => schedule.schdl_id === scheduleId); |
|
99 | 96 |
|
100 |
- if (startScheduleIndex === -1) { |
|
101 |
- console.error("해당 스케줄을 찾을 수 없습니다."); |
|
102 |
- return; |
|
103 |
- } |
|
97 |
+ if (startScheduleIndex === -1) { |
|
98 |
+ console.error("해당 스케줄을 찾을 수 없습니다."); |
|
99 |
+ return; |
|
100 |
+ } |
|
104 | 101 |
|
105 |
- const updates = []; |
|
106 |
- const currentSchedule = this.schedules[startScheduleIndex]; |
|
107 |
- if (currentSchedule.finish === null || currentSchedule.finish === "T") { |
|
108 |
- updates.push( |
|
109 |
- axios.post("/schedule/scheduleUpdate.json", { scheduleId: currentSchedule.schdl_id, finish: "F" }, { |
|
110 |
- headers: { |
|
111 |
- "Content-Type": "application/json; charset=UTF-8", |
|
112 |
- } |
|
113 |
- }) |
|
114 |
- ); |
|
115 |
- } |
|
116 |
- |
|
117 |
- for (let i = startScheduleIndex + 1; i < this.schedules.length; i++) { |
|
118 |
- const nextSchedule = this.schedules[i]; |
|
119 |
- if (nextSchedule.finish === "T") { |
|
102 |
+ const updates = []; |
|
103 |
+ const currentSchedule = this.schedules[startScheduleIndex]; |
|
104 |
+ if (currentSchedule.finish === null || currentSchedule.finish === "T") { |
|
120 | 105 |
updates.push( |
121 |
- axios.post("/schedule/scheduleUpdate.json", { scheduleId: nextSchedule.schdl_id, finish: "F" }, { |
|
106 |
+ axios.post("/schedule/scheduleUpdate.json", { scheduleId: currentSchedule.schdl_id, finish: "F" }, { |
|
122 | 107 |
headers: { |
123 | 108 |
"Content-Type": "application/json; charset=UTF-8", |
124 | 109 |
} |
125 | 110 |
}) |
126 | 111 |
); |
127 | 112 |
} |
128 |
- } |
|
129 | 113 |
|
130 |
- Promise.all(updates) |
|
131 |
- .then(() => { |
|
132 |
- this.$router.push({ name: page }); |
|
133 |
- }) |
|
134 |
- .catch(error => { |
|
135 |
- console.error("Error updating schedules:", error); |
|
136 |
- alert("학습 계획을 업데이트하는 중 오류가 발생했습니다."); |
|
137 |
- }); |
|
114 |
+ for (let i = startScheduleIndex + 1; i < this.schedules.length; i++) { |
|
115 |
+ const nextSchedule = this.schedules[i]; |
|
116 |
+ if (nextSchedule.finish === "T") { |
|
117 |
+ updates.push( |
|
118 |
+ axios.post("/schedule/scheduleUpdate.json", { scheduleId: nextSchedule.schdl_id, finish: "F" }, { |
|
119 |
+ headers: { |
|
120 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
121 |
+ } |
|
122 |
+ }) |
|
123 |
+ ); |
|
124 |
+ } |
|
125 |
+ } |
|
126 |
+ |
|
127 |
+ Promise.all(updates) |
|
128 |
+ .then(() => { |
|
129 |
+ this.$router.push({ name: page }); |
|
130 |
+ }) |
|
131 |
+ .catch(error => { |
|
132 |
+ console.error("Error updating schedules:", error); |
|
133 |
+ alert("학습 계획을 업데이트하는 중 오류가 발생했습니다."); |
|
134 |
+ }); |
|
138 | 135 |
}, |
139 | 136 |
showConfirm(type) { |
140 | 137 |
let message = ''; |
--- client/views/pages/main/PreviewNote.vue
+++ client/views/pages/main/PreviewNote.vue
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 |
<p class="title">오답노트</p> |
17 | 17 |
</div> |
18 | 18 |
<div class="wrap" style="border-radius: 0;"> |
19 |
- |
|
19 |
+ㄴ |
|
20 | 20 |
<div class="table-wrap"> |
21 | 21 |
<table> |
22 | 22 |
<colgroup> |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 |
currentStdId: "1", // 임시 학생 아이디 |
57 | 57 |
currentUnitId: "1", // 임시 유닛 아이디 |
58 | 58 |
wrongAnswerNotes: [], // 오답 노트 목록 데이터 |
59 |
- unitData: {}, |
|
59 |
+ unitData: {}, // 단원 정보 데이터 |
|
60 | 60 |
} |
61 | 61 |
}, |
62 | 62 |
methods: { |
... | ... | @@ -67,6 +67,7 @@ |
67 | 67 |
console.log('링크될 문제 ID:', prblmId); |
68 | 68 |
}, |
69 | 69 |
|
70 |
+ // 단원 정보를 불러오는 API 호출 |
|
70 | 71 |
fetchUnitDetail() { |
71 | 72 |
axios.post('/unit/unitDetail.json', { |
72 | 73 |
unitId: this.currentUnitId |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?