

240821 정다정 css 수정
@bade3936fe25a92e89d40f7b19eb813aa5510611
--- client/views/pages/main/MyPlan.vue
+++ client/views/pages/main/MyPlan.vue
... | ... | @@ -1,22 +1,23 @@ |
1 | 1 |
<template> |
2 |
- |
|
3 | 2 |
<div class="main"> |
4 | 3 |
<div class="myplan"> |
5 | 4 |
<div class="title-box flex justify-between mb40"> |
6 | 5 |
<p class="title">오늘 공부할 내용을 확인해봅시다.</p> |
7 | 6 |
</div> |
8 |
- <div class="wrap" style="border-radius: 0; min-height: 197px;"> |
|
9 |
- <p class="title1" v-if="!schedules || schedules.length === 0"> 오늘 학습할 내용이 없습니다.</p> |
|
7 |
+ <div class="wrap" style="border-radius: 0; min-height: 197px"> |
|
8 |
+ <p class="title1" v-if="!schedules || schedules.length === 0">오늘 학습할 내용이 없습니다.</p> |
|
10 | 9 |
|
11 |
- <div class="flex-column" style="gap: 20px;" v-else v-for="(schedule, index) in schedules" :key="index"> |
|
12 |
- <div class="flex justify-between align-center" style="gap: 70px;"> |
|
13 |
- <div><img src="../../../resources/img/img217_22s.png" alt=""></div> |
|
14 |
- <div class="wrap cs-pt planBox" :class="{ 'cs-pt-clicked': isClicked }" style="width: 100%;"> |
|
10 |
+ <div class="flex-column" style="gap: 20px" v-else v-for="(schedule, index) in schedules" :key="index"> |
|
11 |
+ <div class="flex justify-between align-center" style="gap: 70px"> |
|
12 |
+ <div><img src="../../../resources/img/img217_22s.png" alt="" /></div> |
|
13 |
+ <div class="wrap cs-pt planBox" :class="{ 'cs-pt-clicked': isClicked }" style="width: 100%"> |
|
15 | 14 |
<div class="text-lf flex justify-between align-center"> |
16 |
- <div> |
|
15 |
+ <div style="flex-basis: 40rem"> |
|
17 | 16 |
<p class="title2" s>grade 3</p> |
18 |
- <div class="flex align-center mb10" style="gap: 10px; margin-top: 1.5em;"> |
|
19 |
- <p class="title2"><em class="gray-bd">{{ schedule.schdl_unit }}교시</em></p> |
|
17 |
+ <div class="flex align-center mb10" style="gap: 10px; margin-top: 1.5em"> |
|
18 |
+ <p class="title2"> |
|
19 |
+ <em class="gray-bd">{{ schedule.schdl_unit }}교시</em> |
|
20 |
+ </p> |
|
20 | 21 |
<p class="title1">{{ schedule.schedule_time }}</p> |
21 | 22 |
</div> |
22 | 23 |
<div class="title-box mb10"> |
... | ... | @@ -25,18 +26,10 @@ |
25 | 26 |
<p class="title2">{{ schedule.book_nm }}</p> |
26 | 27 |
<!-- <p class="title2">wirte a</p> --> |
27 | 28 |
</div> |
28 |
- <button v-if="schedule.finish == 'T'" type="button" title="바로가기" class="yellow-btn" |
|
29 |
- @click="goToPage('Dashboard', schedule.schdl_id)"> |
|
30 |
- 학습완료 |
|
31 |
- </button> |
|
32 |
- <button v-else type="button" title="바로가기" class="yellow-btn" |
|
33 |
- @click="goToPage('Dashboard', schedule.schdl_id)"> |
|
34 |
- 바로가기 |
|
35 |
- </button> |
|
36 |
- <div><img src="../../../resources/img/img214_19s.png" alt="" |
|
37 |
- style="height: 130px; width: 100px; "></div> |
|
38 |
- <button type="button" class="popup-close-btn" |
|
39 |
- @click="deleteSchedule(schedule.schdl_id)"> |
|
29 |
+ <button v-if="schedule.finish == 'T'" type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard', schedule.schdl_id)">학습완료</button> |
|
30 |
+ <button v-else type="button" title="바로가기" class="yellow-btn" @click="goToPage('Dashboard', schedule.schdl_id)" style="flex-basis: 18rem">바로가기</button> |
|
31 |
+ <div style="flex-basis: 100px"><img src="../../../resources/img/img214_19s.png" alt="" style="height: 130px; width: 100px" /></div> |
|
32 |
+ <button type="button" class="popup-close-btn" @click="deleteSchedule(schedule.schdl_id)" style="flex-basis: 25px"> |
|
40 | 33 |
<svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
41 | 34 |
</button> |
42 | 35 |
</div> |
... | ... | @@ -49,42 +42,38 @@ |
49 | 42 |
<div class="title-box flex justify-between align-center"> |
50 | 43 |
<div> |
51 | 44 |
<p class="title">오늘 공부를 계획해봅시다.</p> |
52 |
- <p class="title1 mt20"> 스스로 학습 일정을 바꿔볼까요?</p> |
|
45 |
+ <p class="title1 mt20">스스로 학습 일정을 바꿔볼까요?</p> |
|
53 | 46 |
</div> |
54 |
- <button type="button" title="바로가기" class="yellow-btn" @click="goToPage2('MyPlan2')"> |
|
55 |
- 바로가기 |
|
56 |
- </button> |
|
47 |
+ <button type="button" title="바로가기" class="yellow-btn" @click="goToPage2('MyPlan2')">바로가기</button> |
|
57 | 48 |
</div> |
58 | 49 |
</div> |
59 | 50 |
<div class="wrap mt30"> |
60 |
- <p class="title1 mb20"> AI 맞춤형 학습 코스는 어떨까요?</p> |
|
51 |
+ <p class="title1 mb20">AI 맞춤형 학습 코스는 어떨까요?</p> |
|
61 | 52 |
<div class="imgGroup flex justify-between"> |
62 | 53 |
<div class="text-lf aiClick" @click="goToPage2('AIDashboard')"> |
63 |
- <img src="../../../resources/img/img215_22s.png" alt=""> |
|
54 |
+ <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
64 | 55 |
<p class="title2 mt10">추천 학습 단원</p> |
65 | 56 |
</div> |
66 | 57 |
<div class="text-lf aiClick" @click="goToPage2('AIDashboard')"> |
67 |
- <img src="../../../resources/img/img215_22s.png" alt=""> |
|
58 |
+ <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
68 | 59 |
<p class="title2 mt10">추천 학습 단원</p> |
69 | 60 |
</div> |
70 | 61 |
<div class="text-lf aiClick" @click="goToPage2('AIDashboard')"> |
71 |
- <img src="../../../resources/img/img215_22s.png" alt=""> |
|
62 |
+ <img src="../../../resources/img/img215_22s.png" alt="" /> |
|
72 | 63 |
<p class="title2 mt10">추천 학습 단원</p> |
73 | 64 |
</div> |
74 | 65 |
</div> |
75 | 66 |
</div> |
76 | 67 |
</div> |
77 | 68 |
</div> |
78 |
- |
|
79 | 69 |
</template> |
80 | 70 |
|
81 | 71 |
<script> |
82 | 72 |
import axios from "axios"; |
83 |
-import SvgIcon from '@jamescoyle/vue-icon'; |
|
84 |
-import { mdiMagnify, mdiWindowClose } from '@mdi/js'; |
|
73 |
+import SvgIcon from "@jamescoyle/vue-icon"; |
|
74 |
+import { mdiMagnify, mdiWindowClose } from "@mdi/js"; |
|
85 | 75 |
import { mapActions } from "vuex"; |
86 |
-import { mapGetters } from 'vuex'; |
|
87 |
- |
|
76 |
+import { mapGetters } from "vuex"; |
|
88 | 77 |
|
89 | 78 |
export default { |
90 | 79 |
data() { |
... | ... | @@ -103,86 +92,91 @@ |
103 | 92 |
{ label: "5교시", time: "13:00 ~ 14:00", value: "5" }, |
104 | 93 |
{ label: "6교시", time: "14:00 ~ 15:00", value: "6" }, |
105 | 94 |
], |
106 |
- } |
|
95 |
+ }; |
|
107 | 96 |
}, |
108 | 97 |
methods: { |
109 |
- |
|
110 |
- ...mapActions(['updateSchdlId', 'updateBookId', 'updateUnitId']), |
|
98 |
+ ...mapActions(["updateSchdlId", "updateBookId", "updateUnitId"]), |
|
111 | 99 |
|
112 | 100 |
goToPage(page, scheduleId) { |
113 |
- const startScheduleIndex = this.schedules.findIndex(schedule => schedule.schdl_id === scheduleId); |
|
101 |
+ const startScheduleIndex = this.schedules.findIndex((schedule) => schedule.schdl_id === scheduleId); |
|
114 | 102 |
|
115 |
- if (startScheduleIndex === -1) { |
|
116 |
- console.error("해당 스케줄을 찾을 수 없습니다."); |
|
117 |
- return; |
|
118 |
- } |
|
103 |
+ if (startScheduleIndex === -1) { |
|
104 |
+ console.error("해당 스케줄을 찾을 수 없습니다."); |
|
105 |
+ return; |
|
106 |
+ } |
|
119 | 107 |
|
120 |
- const updates = []; |
|
121 |
- const currentSchedule = this.schedules[startScheduleIndex]; |
|
122 |
- if (currentSchedule.finish === null || currentSchedule.finish === "T") { |
|
123 |
- updates.push( |
|
124 |
- axios.post("/schedule/scheduleUpdate.json", { scheduleId: currentSchedule.schdl_id, finish: "F" }, { |
|
125 |
- headers: { |
|
126 |
- "Content-Type": "application/json; charset=UTF-8", |
|
127 |
- } |
|
128 |
- }) |
|
129 |
- ); |
|
130 |
- } |
|
131 |
- |
|
132 |
- for (let i = startScheduleIndex + 1; i < this.schedules.length; i++) { |
|
133 |
- const nextSchedule = this.schedules[i]; |
|
134 |
- if (nextSchedule.finish === "T") { |
|
108 |
+ const updates = []; |
|
109 |
+ const currentSchedule = this.schedules[startScheduleIndex]; |
|
110 |
+ if (currentSchedule.finish === null || currentSchedule.finish === "T") { |
|
135 | 111 |
updates.push( |
136 |
- axios.post("/schedule/scheduleUpdate.json", { scheduleId: nextSchedule.schdl_id, finish: "F" }, { |
|
137 |
- headers: { |
|
138 |
- "Content-Type": "application/json; charset=UTF-8", |
|
112 |
+ axios.post( |
|
113 |
+ "/schedule/scheduleUpdate.json", |
|
114 |
+ { scheduleId: currentSchedule.schdl_id, finish: "F" }, |
|
115 |
+ { |
|
116 |
+ headers: { |
|
117 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
118 |
+ }, |
|
139 | 119 |
} |
140 |
- }) |
|
120 |
+ ) |
|
141 | 121 |
); |
142 | 122 |
} |
143 |
- } |
|
144 | 123 |
|
145 |
- Promise.all(updates) |
|
146 |
- .then(() => { |
|
147 |
- const schedule = this.schedules[startScheduleIndex]; |
|
148 |
- // this.$router.push({ |
|
149 |
- // name: page, |
|
150 |
- // query: { |
|
151 |
- // schdl_id: schedule.schdl_id, |
|
152 |
- // book_id: schedule.book_id, |
|
153 |
- // unit_id: schedule.unit_id |
|
154 |
- // } |
|
155 |
- // }); |
|
156 |
- // 상태 업데이트가 완료된 후 라우팅 |
|
157 |
- Promise.all([ |
|
158 |
- this.updateSchdlId(schedule.schdl_id), |
|
159 |
- this.updateBookId(schedule.book_id), |
|
160 |
- this.updateUnitId(schedule.unit_id) |
|
161 |
- ]).then(() => { |
|
162 |
- console.log("Book ID:", this.getBookId); |
|
163 |
- console.log("Unit ID:", this.getUnitId); |
|
124 |
+ for (let i = startScheduleIndex + 1; i < this.schedules.length; i++) { |
|
125 |
+ const nextSchedule = this.schedules[i]; |
|
126 |
+ if (nextSchedule.finish === "T") { |
|
127 |
+ updates.push( |
|
128 |
+ axios.post( |
|
129 |
+ "/schedule/scheduleUpdate.json", |
|
130 |
+ { scheduleId: nextSchedule.schdl_id, finish: "F" }, |
|
131 |
+ { |
|
132 |
+ headers: { |
|
133 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
134 |
+ }, |
|
135 |
+ } |
|
136 |
+ ) |
|
137 |
+ ); |
|
138 |
+ } |
|
139 |
+ } |
|
164 | 140 |
|
165 |
- this.$router.push({ name: page }); |
|
166 |
- }).catch(error => { |
|
167 |
- console.error("상태 업데이트 중 오류 발생:", error); |
|
141 |
+ Promise.all(updates) |
|
142 |
+ .then(() => { |
|
143 |
+ const schedule = this.schedules[startScheduleIndex]; |
|
144 |
+ // this.$router.push({ |
|
145 |
+ // name: page, |
|
146 |
+ // query: { |
|
147 |
+ // schdl_id: schedule.schdl_id, |
|
148 |
+ // book_id: schedule.book_id, |
|
149 |
+ // unit_id: schedule.unit_id |
|
150 |
+ // } |
|
151 |
+ // }); |
|
152 |
+ // 상태 업데이트가 완료된 후 라우팅 |
|
153 |
+ Promise.all([this.updateSchdlId(schedule.schdl_id), this.updateBookId(schedule.book_id), this.updateUnitId(schedule.unit_id)]) |
|
154 |
+ .then(() => { |
|
155 |
+ console.log("Book ID:", this.getBookId); |
|
156 |
+ console.log("Unit ID:", this.getUnitId); |
|
157 |
+ |
|
158 |
+ this.$router.push({ name: page }); |
|
159 |
+ }) |
|
160 |
+ .catch((error) => { |
|
161 |
+ console.error("상태 업데이트 중 오류 발생:", error); |
|
162 |
+ }); |
|
163 |
+ }) |
|
164 |
+ .catch((error) => { |
|
165 |
+ console.error("Error updating schedules:", error); |
|
166 |
+ alert("학습 계획을 업데이트하는 중 오류가 발생했습니다."); |
|
168 | 167 |
}); |
169 |
- }) |
|
170 |
- .catch(error => { |
|
171 |
- console.error("Error updating schedules:", error); |
|
172 |
- alert("학습 계획을 업데이트하는 중 오류가 발생했습니다."); |
|
173 |
- }); |
|
174 | 168 |
}, |
175 | 169 |
goToPage2(page) { |
176 | 170 |
this.$router.push({ name: page }); |
177 | 171 |
}, |
178 | 172 |
showConfirm(type) { |
179 |
- let message = ''; |
|
180 |
- if (type === 'cancel') { |
|
181 |
- message = '삭제하시겠습니까?'; |
|
182 |
- } else if (type === 'reset') { |
|
183 |
- message = '초기화하시겠습니까?'; |
|
184 |
- } else if (type === 'save') { |
|
185 |
- message = '등록하시겠습니까?'; |
|
173 |
+ let message = ""; |
|
174 |
+ if (type === "cancel") { |
|
175 |
+ message = "삭제하시겠습니까?"; |
|
176 |
+ } else if (type === "reset") { |
|
177 |
+ message = "초기화하시겠습니까?"; |
|
178 |
+ } else if (type === "save") { |
|
179 |
+ message = "등록하시겠습니까?"; |
|
186 | 180 |
} |
187 | 181 |
|
188 | 182 |
if (confirm(message)) { |
... | ... | @@ -197,57 +191,66 @@ |
197 | 191 |
}, |
198 | 192 |
closeBtn() { |
199 | 193 |
this.searchOpen = false; |
200 |
- |
|
201 |
- }, fetchSchedules() { |
|
202 |
- axios.post("/schedule/selectSchedule.json", { stdId: this.stdId }, { |
|
203 |
- headers: { |
|
204 |
- "Content-Type": "application/json; charset=UTF-8", |
|
205 |
- } |
|
206 |
- }) |
|
207 |
- .then(response => { |
|
208 |
- this.schedules = response.data.map(schedule => { |
|
209 |
- const matchingTime = this.timeList.find(time => time.value === schedule.schdl_unit); |
|
194 |
+ }, |
|
195 |
+ fetchSchedules() { |
|
196 |
+ axios |
|
197 |
+ .post( |
|
198 |
+ "/schedule/selectSchedule.json", |
|
199 |
+ { stdId: this.stdId }, |
|
200 |
+ { |
|
201 |
+ headers: { |
|
202 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
203 |
+ }, |
|
204 |
+ } |
|
205 |
+ ) |
|
206 |
+ .then((response) => { |
|
207 |
+ this.schedules = response.data.map((schedule) => { |
|
208 |
+ const matchingTime = this.timeList.find((time) => time.value === schedule.schdl_unit); |
|
210 | 209 |
return { |
211 | 210 |
...schedule, |
212 |
- schedule_time: matchingTime ? matchingTime.time : "시간 정보 없음" |
|
211 |
+ schedule_time: matchingTime ? matchingTime.time : "시간 정보 없음", |
|
213 | 212 |
}; |
214 | 213 |
}); |
215 | 214 |
console.log(this.schedules); |
216 | 215 |
}) |
217 |
- .catch(error => { |
|
216 |
+ .catch((error) => { |
|
218 | 217 |
console.error("fetchUnits - error:", error); |
219 | 218 |
alert("단원 목록을 불러오는 중 오류가 발생했습니다."); |
220 | 219 |
}); |
221 |
- }, deleteSchedule(scheduleId) { |
|
222 |
- axios.post("/schedule/scheduleDelete.json", { scheduleId: scheduleId }, { |
|
223 |
- headers: { |
|
224 |
- "Content-Type": "application/json; charset=UTF-8", |
|
225 |
- } |
|
226 |
- }) |
|
227 |
- .then(response => { |
|
228 |
- alert("학습일정이 삭제되었습니다.") |
|
220 |
+ }, |
|
221 |
+ deleteSchedule(scheduleId) { |
|
222 |
+ axios |
|
223 |
+ .post( |
|
224 |
+ "/schedule/scheduleDelete.json", |
|
225 |
+ { scheduleId: scheduleId }, |
|
226 |
+ { |
|
227 |
+ headers: { |
|
228 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
229 |
+ }, |
|
230 |
+ } |
|
231 |
+ ) |
|
232 |
+ .then((response) => { |
|
233 |
+ alert("학습일정이 삭제되었습니다."); |
|
229 | 234 |
window.location.reload(); |
230 | 235 |
}) |
231 |
- .catch(error => { |
|
236 |
+ .catch((error) => { |
|
232 | 237 |
console.error("fetchUnits - error:", error); |
233 | 238 |
alert("단원 목록을 불러오는 중 오류가 발생했습니다."); |
234 | 239 |
}); |
235 |
- } |
|
240 |
+ }, |
|
236 | 241 |
}, |
237 |
- watch: { |
|
238 |
- |
|
239 |
- }, |
|
242 |
+ watch: {}, |
|
240 | 243 |
computed: { |
241 |
- ...mapGetters(['getBookId', 'getUnitId']) |
|
244 |
+ ...mapGetters(["getBookId", "getUnitId"]), |
|
242 | 245 |
}, |
243 | 246 |
components: { |
244 |
- SvgIcon |
|
247 |
+ SvgIcon, |
|
245 | 248 |
}, |
246 | 249 |
mounted() { |
247 |
- console.log('Main2 mounted'); |
|
250 |
+ console.log("Main2 mounted"); |
|
248 | 251 |
this.fetchSchedules(); |
249 |
- } |
|
250 |
-} |
|
252 |
+ }, |
|
253 |
+}; |
|
251 | 254 |
</script> |
252 | 255 |
<style> |
253 | 256 |
.planBox { |
... | ... | @@ -259,4 +262,4 @@ |
259 | 262 |
.aiClick { |
260 | 263 |
cursor: pointer; |
261 | 264 |
} |
262 |
-</style>(No newline at end of file) |
|
265 |
+</style> |
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?