
--- client/views/pages/main/MyPlan2.vue
+++ client/views/pages/main/MyPlan2.vue
... | ... | @@ -174,7 +174,7 @@ |
174 | 174 |
alert('교재를 선택해 주세요.'); |
175 | 175 |
} else { |
176 | 176 |
if (this.checkedItems.length === 1) { |
177 |
- if (this.unitList.find(item => item === this.checkedItems[0])) { |
|
177 |
+ if (this.unitList.find(item => item === this.checkedItems[0].value)) { |
|
178 | 178 |
alert('이미 지정된 시간입니다.'); |
179 | 179 |
} else { |
180 | 180 |
this.addToNewDataArray(this.checkedItems[0]); |
... | ... | @@ -182,7 +182,7 @@ |
182 | 182 |
this.nowID = "" |
183 | 183 |
this.nowunitID = "" |
184 | 184 |
this.nowName = "" |
185 |
- this.unitList.push(this.checkedItems[0]) |
|
185 |
+ this.unitList.push(this.checkedItems[0].value) |
|
186 | 186 |
this.checkedItems = [] |
187 | 187 |
} |
188 | 188 |
} else if (this.checkedItems.length > 1) { |
... | ... | @@ -259,12 +259,28 @@ |
259 | 259 |
...book, |
260 | 260 |
isSelected: false |
261 | 261 |
})); |
262 |
+ this.searchUnit() |
|
262 | 263 |
}) |
263 | 264 |
.catch(error => { |
264 | 265 |
console.error("fetchBooks - error: ", error); |
265 | 266 |
alert("교재 목록을 불러오는 중 오류가 발생했습니다."); |
266 | 267 |
}); |
267 |
- }, |
|
268 |
+ }, searchUnit() { |
|
269 |
+ axios.post("schedule/selectSchedule.json", {stdId:"2"}, { |
|
270 |
+ headers: { |
|
271 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
272 |
+ } |
|
273 |
+ }) |
|
274 |
+ .then(response => { |
|
275 |
+ const units = response.data.map(item => item.schdl_unit); |
|
276 |
+ this.unitList.push(...units); |
|
277 |
+ console.log(this.unitList) |
|
278 |
+ }) |
|
279 |
+ .catch(error => { |
|
280 |
+ console.error("searchUnit - error: ", error); |
|
281 |
+ alert("교재 목록을 불러오는 중 오류가 발생했습니다."); |
|
282 |
+ }); |
|
283 |
+ } |
|
268 | 284 |
}, |
269 | 285 |
watch: { |
270 | 286 |
// Watchers for reactivity (if needed) |
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?