--- client/views/pages/teacher/RoadMap.vue
+++ client/views/pages/teacher/RoadMap.vue
... | ... | @@ -1,20 +1,26 @@ |
1 | 1 |
<template> |
2 | 2 |
<div class="title-box flex justify-between mb40"> |
3 |
- <p class="title">A반</p> |
|
4 |
- <select name="" id=""> |
|
5 |
- <option value="">A 교재</option> |
|
3 |
+ <label for="" class="title2 ">로드맵 등록</label> |
|
4 |
+ <select name="" id="" v-model="selectedBook" @change="fetchUnits"> |
|
5 |
+ <option value="" disabled selected>교재를 선택하세요</option> |
|
6 |
+ <option v-for="book in books" :key="book.book_id" :value="book.book_id"> |
|
7 |
+ {{ book.book_nm }} |
|
8 |
+ </option> |
|
6 | 9 |
</select> |
7 | 10 |
</div> |
8 |
- <div class="board-wrap" style=" height: calc(100% - 16rem);"> |
|
9 |
- <label for="" class="title2">단원</label> |
|
10 |
- <div class="table-pagination flex mt10"> |
|
11 |
- <button class="selected-btn">1</button> |
|
12 |
- <button>2</button> |
|
13 |
- <button>3</button> |
|
14 |
- </div> |
|
15 |
- <hr> |
|
16 |
- <label for="" class="title2 ">1단원 로드맵 등록</label> |
|
17 |
- <div class="search-wrap flex mb20 mt30"> |
|
11 |
+ <div class="board-wrap" style="height: calc(100% - 13rem);"> |
|
12 |
+ <div class="content-t"> |
|
13 |
+ |
|
14 |
+ <label for="" class="title2">단원</label> |
|
15 |
+ <div class="unit-pagination flex mt10 mb20" style="gap: 10px;"> |
|
16 |
+ <button v-for="(unit, index) in units" :key="index" |
|
17 |
+ :class="{ 'selected-btn': selectedUnit === unit.unitId }" @click="selectUnit(unit.unitId)"> |
|
18 |
+ {{ unit.unitName }} |
|
19 |
+ </button> |
|
20 |
+ </div> |
|
21 |
+ <hr> |
|
22 |
+ <div class="search-wrap flex mb20 mt30"> |
|
23 |
+ <!-- |
|
18 | 24 |
<select v-model="selectedSearchOption" class="mr10 data-wrap"> |
19 | 25 |
<option value="bbsTtl">제목</option> |
20 | 26 |
<option value="bbsCnt">내용</option> |
... | ... | @@ -25,56 +31,345 @@ |
25 | 31 |
<button type="button" @click="boardDataSearch()" title="게시글 검색"> |
26 | 32 |
<img src="../../../resources/img/look_t.png" alt="" /> |
27 | 33 |
</button> |
28 |
- </div> |
|
29 |
- <div class="flex justify-between align-center mypage mt10" style="height: calc(100% - 23rem);"> |
|
30 |
- <div class="textbook big book-gray"> |
|
31 |
- <div class="text "> |
|
32 |
- <p class="title1">학습항목</p> |
|
33 |
- </div> |
|
34 |
- <div class="box flex-column" style="gap: 30px;"> |
|
35 |
- <!-- 지문 --> |
|
36 |
- <div class="textbook book-red"> |
|
37 |
- <div class="text "> |
|
38 |
- <p class="title1" style="color: #fff;">지문. 제목</p> |
|
39 |
- </div> |
|
40 |
- <div class="box"> |
|
41 |
- |
|
42 |
- <P class="title2 mt10">지문 내용</P> |
|
43 |
- </div> |
|
44 |
- </div> |
|
45 |
- <!-- 단어 --> |
|
46 |
- <div class="textbook "> |
|
47 |
- <div class="text "> |
|
48 |
- <p class="title1" style="color: #fff;">단어장1</p> |
|
49 |
- </div> |
|
50 |
- <div class="box"> |
|
51 |
- |
|
52 |
- <P class="title2 mt10">단어1</P> |
|
53 |
- </div> |
|
54 |
- </div> |
|
55 |
- <!-- 문제 --> |
|
56 |
- <div class="textbook book-blue"> |
|
57 |
- <div class="text "> |
|
58 |
- <p class="title1" style="color: #fff;">문제1</p> |
|
59 |
- </div> |
|
60 |
- <div class="box"> |
|
61 |
- |
|
62 |
- <P class="title2 mt10">문제유형</P> |
|
63 |
- <P class="title2 mt10">정답</P> |
|
64 |
- </div> |
|
65 |
- </div> |
|
66 |
- <!-- 평가 --> |
|
67 |
- <div class="textbook book-navy"> |
|
68 |
- <div class="text "> |
|
69 |
- <p class="title1" style="color: #fff;">평가1</p> |
|
70 |
- </div> |
|
71 |
- <div class="box"> |
|
72 |
- |
|
73 |
- <P class="title2 mt10">평가 내용</P> |
|
74 |
- </div> |
|
75 |
- </div> |
|
76 |
- </div> |
|
34 |
+ --> |
|
77 | 35 |
</div> |
36 |
+ <div class="flex justify-between align-center mypage mt10"> |
|
37 |
+ <div class="textbook big book-gray"> |
|
38 |
+ <div class="text "> |
|
39 |
+ <p class="title1">학습 로드맵</p> |
|
40 |
+ </div> |
|
41 |
+ <div class="box flex-column" style="gap: 10px;"> |
|
42 |
+ <!-- 지문 --> |
|
43 |
+ <div class="textbook book-red"> |
|
44 |
+ <div class="text "> |
|
45 |
+ <p class="title1" style="color: #fff;">지문 1</p> |
|
46 |
+ </div> |
|
47 |
+ <div class="box"> |
|
48 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('0')"> |
|
49 |
+ 지문 추가 |
|
50 |
+ </button> |
|
51 |
+ <table> |
|
52 |
+ <thead> |
|
53 |
+ <tr> |
|
54 |
+ <td>지문</td> |
|
55 |
+ <td></td> |
|
56 |
+ </tr> |
|
57 |
+ </thead> |
|
58 |
+ <tbody> |
|
59 |
+ <tr v-for="(text, index) in RoadMap[0]" :key="text.textId"> |
|
60 |
+ <td> |
|
61 |
+ <P class="title2 mt10">{{ text.textTtl }}</P> |
|
62 |
+ </td> |
|
63 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
64 |
+ @click="deleteRoadMap('0', text.textId)"> |
|
65 |
+ 삭제 |
|
66 |
+ </button></td> |
|
67 |
+ </tr> |
|
68 |
+ </tbody> |
|
69 |
+ </table> |
|
70 |
+ </div> |
|
71 |
+ </div> |
|
72 |
+ <!-- 단어 --> |
|
73 |
+ <div class="textbook "> |
|
74 |
+ <div class="text "> |
|
75 |
+ <p class="title1" style="color: #fff;">단어장 1</p> |
|
76 |
+ </div> |
|
77 |
+ <div class="box"> |
|
78 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('1')"> |
|
79 |
+ 단어장 추가 |
|
80 |
+ </button> |
|
81 |
+ <table> |
|
82 |
+ <thead> |
|
83 |
+ <tr> |
|
84 |
+ <td>단어장</td> |
|
85 |
+ <td></td> |
|
86 |
+ </tr> |
|
87 |
+ </thead> |
|
88 |
+ <tbody> |
|
89 |
+ <tr v-for="(wordBook, index) in RoadMap[1]" :key="wordBook.wdBookId"> |
|
90 |
+ <td> |
|
91 |
+ <P class="title2 mt10">{{ wordBook.textTtl }}</P> |
|
92 |
+ </td> |
|
93 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
94 |
+ @click="deleteRoadMap('1', wordBook.wdBookId)"> |
|
95 |
+ 삭제 |
|
96 |
+ </button></td> |
|
97 |
+ |
|
98 |
+ </tr> |
|
99 |
+ </tbody> |
|
100 |
+ </table> |
|
101 |
+ </div> |
|
102 |
+ </div> |
|
103 |
+ <!-- 문제 --> |
|
104 |
+ <div class="textbook book-blue"> |
|
105 |
+ <div class="text "> |
|
106 |
+ <p class="title1" style="color: #fff;">문제 1</p> |
|
107 |
+ </div> |
|
108 |
+ <div class="box"> |
|
109 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('2')"> |
|
110 |
+ 문제 추가 |
|
111 |
+ </button> |
|
112 |
+ <table> |
|
113 |
+ <thead> |
|
114 |
+ <tr> |
|
115 |
+ <td>문제</td> |
|
116 |
+ <td></td> |
|
117 |
+ </tr> |
|
118 |
+ </thead> |
|
119 |
+ <tbody> |
|
120 |
+ <tr v-for="(prblm, index) in RoadMap[2]" :key="prblm.prblmId"> |
|
121 |
+ <td> |
|
122 |
+ <P class="title2 mt10">{{ prblm.prblmExpln }}</P> |
|
123 |
+ </td> |
|
124 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
125 |
+ @click="deleteRoadMap('2', prblm.prblmId)"> |
|
126 |
+ 삭제 |
|
127 |
+ </button></td> |
|
128 |
+ </tr> |
|
129 |
+ </tbody> |
|
130 |
+ </table> |
|
131 |
+ </div> |
|
132 |
+ </div> |
|
133 |
+ <div class="textbook book-blue"> |
|
134 |
+ <div class="text "> |
|
135 |
+ <p class="title1" style="color: #fff;">문제 2</p> |
|
136 |
+ </div> |
|
137 |
+ <div class="box"> |
|
138 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('3')"> |
|
139 |
+ 문제 추가 |
|
140 |
+ </button> |
|
141 |
+ <table> |
|
142 |
+ <thead> |
|
143 |
+ <tr> |
|
144 |
+ <td>문제</td> |
|
145 |
+ <td></td> |
|
146 |
+ </tr> |
|
147 |
+ </thead> |
|
148 |
+ <tbody> |
|
149 |
+ <tr v-for="(prblm, index) in RoadMap[3]" :key="prblm.prblmId"> |
|
150 |
+ <td> |
|
151 |
+ <P class="title2 mt10">{{ prblm.prblmExpln }}</P> |
|
152 |
+ </td> |
|
153 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
154 |
+ @click="deleteRoadMap('3', prblm.prblmId)"> |
|
155 |
+ 삭제 |
|
156 |
+ </button></td> |
|
157 |
+ </tr> |
|
158 |
+ </tbody> |
|
159 |
+ </table> |
|
160 |
+ </div> |
|
161 |
+ </div> |
|
162 |
+ <div class="textbook book-red"> |
|
163 |
+ <div class="text "> |
|
164 |
+ <p class="title1" style="color: #fff;">지문 2</p> |
|
165 |
+ </div> |
|
166 |
+ <div class="box"> |
|
167 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('4')"> |
|
168 |
+ 지문 추가 |
|
169 |
+ </button> |
|
170 |
+ <table> |
|
171 |
+ <thead> |
|
172 |
+ <tr> |
|
173 |
+ <td>지문</td> |
|
174 |
+ <td></td> |
|
175 |
+ </tr> |
|
176 |
+ </thead> |
|
177 |
+ <tbody> |
|
178 |
+ <tr v-for="(text, index) in RoadMap[4]" :key="text.textId"> |
|
179 |
+ <td> |
|
180 |
+ <P class="title2 mt10">{{ text.textTtl }}</P> |
|
181 |
+ </td> |
|
182 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
183 |
+ @click="deleteRoadMap('4', text.textId)"> |
|
184 |
+ 삭제 |
|
185 |
+ </button></td> |
|
186 |
+ |
|
187 |
+ </tr> |
|
188 |
+ </tbody> |
|
189 |
+ </table> |
|
190 |
+ </div> |
|
191 |
+ </div> |
|
192 |
+ <div class="textbook "> |
|
193 |
+ <div class="text "> |
|
194 |
+ <p class="title1" style="color: #fff;">단어장 2</p> |
|
195 |
+ </div> |
|
196 |
+ <div class="box"> |
|
197 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('5')"> |
|
198 |
+ 단어장 추가 |
|
199 |
+ </button> |
|
200 |
+ <table> |
|
201 |
+ <thead> |
|
202 |
+ <tr> |
|
203 |
+ <td>지문</td> |
|
204 |
+ <td></td> |
|
205 |
+ </tr> |
|
206 |
+ </thead> |
|
207 |
+ <tbody> |
|
208 |
+ <tr v-for="(wordBook, index) in RoadMap[5]" :key="wordBook.wdBookId"> |
|
209 |
+ <td> |
|
210 |
+ <P class="title2 mt10">{{ wordBook.textTtl }}</P> |
|
211 |
+ </td> |
|
212 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
213 |
+ @click="deleteRoadMap('5', wordBook.wdBookId)"> |
|
214 |
+ 삭제 |
|
215 |
+ </button></td> |
|
216 |
+ |
|
217 |
+ </tr> |
|
218 |
+ </tbody> |
|
219 |
+ </table> |
|
220 |
+ </div> |
|
221 |
+ </div> |
|
222 |
+ <div class="textbook book-blue"> |
|
223 |
+ <div class="text "> |
|
224 |
+ <p class="title1" style="color: #fff;">문제 3</p> |
|
225 |
+ </div> |
|
226 |
+ <div class="box"> |
|
227 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('6')"> |
|
228 |
+ 문제 추가 |
|
229 |
+ </button> |
|
230 |
+ <table> |
|
231 |
+ <thead> |
|
232 |
+ <tr> |
|
233 |
+ <td>문제</td> |
|
234 |
+ <td></td> |
|
235 |
+ </tr> |
|
236 |
+ </thead> |
|
237 |
+ <tbody> |
|
238 |
+ <tr v-for="(prblm, index) in RoadMap[6]" :key="prblm.prblmId"> |
|
239 |
+ <td> |
|
240 |
+ <P class="title2 mt10">{{ prblm.prblmExpln }}</P> |
|
241 |
+ </td> |
|
242 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
243 |
+ @click="deleteRoadMap('6', prblm.prblmId)"> |
|
244 |
+ 삭제 |
|
245 |
+ </button></td> |
|
246 |
+ </tr> |
|
247 |
+ </tbody> |
|
248 |
+ </table> |
|
249 |
+ </div> |
|
250 |
+ </div> |
|
251 |
+ <!-- 평가 --> |
|
252 |
+ <div class="textbook book-navy"> |
|
253 |
+ <div class="text "> |
|
254 |
+ <p class="title1" style="color: #fff;">중간 평가</p> |
|
255 |
+ </div> |
|
256 |
+ <div class="box"> |
|
257 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('7')"> |
|
258 |
+ 중간평가 추가 |
|
259 |
+ </button> |
|
260 |
+ <table> |
|
261 |
+ <thead> |
|
262 |
+ <tr> |
|
263 |
+ <td>중간 평가 문항 갯수</td> |
|
264 |
+ <td></td> |
|
265 |
+ </tr> |
|
266 |
+ </thead> |
|
267 |
+ <tbody> |
|
268 |
+ <tr v-for="(evaluation, index) in RoadMap[7]" :key="evaluation.evalId"> |
|
269 |
+ <td> |
|
270 |
+ <P class="title2 mt10">{{ evaluation.problemCount }}</P> |
|
271 |
+ </td> |
|
272 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
273 |
+ @click="deleteRoadMap('7', evaluation.evalId)"> |
|
274 |
+ 삭제 |
|
275 |
+ </button></td> |
|
276 |
+ |
|
277 |
+ </tr> |
|
278 |
+ </tbody> |
|
279 |
+ </table> |
|
280 |
+ </div> |
|
281 |
+ </div> |
|
282 |
+ <div class="textbook book-red"> |
|
283 |
+ <div class="text "> |
|
284 |
+ <p class="title1" style="color: #fff;">지문 3</p> |
|
285 |
+ </div> |
|
286 |
+ <div class="box"> |
|
287 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('8')"> |
|
288 |
+ 지문 추가 |
|
289 |
+ </button> |
|
290 |
+ <table> |
|
291 |
+ <thead> |
|
292 |
+ <tr> |
|
293 |
+ <td>지문</td> |
|
294 |
+ <td></td> |
|
295 |
+ </tr> |
|
296 |
+ </thead> |
|
297 |
+ <tbody> |
|
298 |
+ <tr v-for="(text, index) in RoadMap[8]" :key="text.textId"> |
|
299 |
+ <td> |
|
300 |
+ <P class="title2 mt10">{{ text.textTtl }}</P> |
|
301 |
+ </td> |
|
302 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
303 |
+ @click="deleteRoadMap('8', text.textId)"> |
|
304 |
+ 삭제 |
|
305 |
+ </button></td> |
|
306 |
+ </tr> |
|
307 |
+ </tbody> |
|
308 |
+ </table> |
|
309 |
+ </div> |
|
310 |
+ </div> |
|
311 |
+ <div class="textbook "> |
|
312 |
+ <div class="text "> |
|
313 |
+ <p class="title1" style="color: #fff;">단어장 3</p> |
|
314 |
+ </div> |
|
315 |
+ <div class="box"> |
|
316 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('9')"> |
|
317 |
+ 단어장 추가 |
|
318 |
+ </button> |
|
319 |
+ <table> |
|
320 |
+ <thead> |
|
321 |
+ <tr> |
|
322 |
+ <td>지문</td> |
|
323 |
+ <td></td> |
|
324 |
+ </tr> |
|
325 |
+ </thead> |
|
326 |
+ <tbody> |
|
327 |
+ <tr v-for="(wordBook, index) in RoadMap[9]" :key="wordBook.wdBookId"> |
|
328 |
+ <td> |
|
329 |
+ <P class="title2 mt10">{{ wordBook.textTtl }}</P> |
|
330 |
+ </td> |
|
331 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
332 |
+ @click="deleteRoadMap('9', wordBook.wdBookId)"> |
|
333 |
+ 삭제 |
|
334 |
+ </button></td> |
|
335 |
+ </tr> |
|
336 |
+ </tbody> |
|
337 |
+ </table> |
|
338 |
+ </div> |
|
339 |
+ </div> |
|
340 |
+ <div class="textbook book-navy"> |
|
341 |
+ <div class="text "> |
|
342 |
+ <p class="title1" style="color: #fff;">최종 평가</p> |
|
343 |
+ </div> |
|
344 |
+ <div class="box"> |
|
345 |
+ <button type="button" title="글쓰기" class="new-btn ml10" @click="buttonSearch('10')"> |
|
346 |
+ 최종평가 추가 |
|
347 |
+ </button> |
|
348 |
+ <table> |
|
349 |
+ <thead> |
|
350 |
+ <tr> |
|
351 |
+ <td>최종 평가 문항 갯수</td> |
|
352 |
+ <td></td> |
|
353 |
+ </tr> |
|
354 |
+ </thead> |
|
355 |
+ <tbody> |
|
356 |
+ <tr v-for="(evaluation, index) in RoadMap[10]" :key="evaluation.evalId"> |
|
357 |
+ <td> |
|
358 |
+ <P class="title2 mt10">{{ evaluation.problemCount }}</P> |
|
359 |
+ </td> |
|
360 |
+ <td><button type="button" title="글쓰기" class="new-btn" |
|
361 |
+ @click="deleteRoadMap('10', evaluation.evalId)"> |
|
362 |
+ 삭제 |
|
363 |
+ </button></td> |
|
364 |
+ </tr> |
|
365 |
+ </tbody> |
|
366 |
+ </table> |
|
367 |
+ |
|
368 |
+ </div> |
|
369 |
+ </div> |
|
370 |
+ </div> |
|
371 |
+ </div> |
|
372 |
+ <!-- |
|
78 | 373 |
<div class="textbook big book-gray"> |
79 | 374 |
<div class="text "> |
80 | 375 |
<p class="title1">로드맵</p> |
... | ... | @@ -87,20 +382,279 @@ |
87 | 382 |
<div class="dropbox"><P class="title2">여기로 드래그 하세요</P></div> |
88 | 383 |
</div> |
89 | 384 |
</div> |
90 |
- </div> |
|
385 |
+ --> |
|
386 |
+ </div> |
|
91 | 387 |
|
92 |
- </div> |
|
93 |
- <div class="flex justify-end mt30" style="gap: 10px;"> |
|
94 |
- <!-- <button type="button" title="" class="new-btn" @click="showConfirm('delete')"> |
|
388 |
+ </div> |
|
389 |
+ <div class="flex justify-end mt30" style="gap: 10px;"> |
|
390 |
+ <!-- <button type="button" title="" class="new-btn" @click="showConfirm('delete')"> |
|
95 | 391 |
추가 |
96 | 392 |
</button> --> |
97 |
- <button type="button" title="" class="new-btn" @click="goToPage('TextBookDetail')"> |
|
98 |
- 취소 |
|
99 |
- </button> |
|
100 |
- <button type="button" title="" class="new-btn" @click="goToPage('TextBookDetail')"> |
|
101 |
- 등록 |
|
102 |
- </button> |
|
393 |
+ <button type="button" title="" class="new-btn" @click="goToPage('TextBookDetail')"> |
|
394 |
+ 취소 |
|
395 |
+ </button> |
|
396 |
+ <button type="button" title="" class="new-btn" @click="postRoadMaps"> |
|
397 |
+ 등록 |
|
398 |
+ </button> |
|
399 |
+ </div> |
|
103 | 400 |
</div> |
401 |
+ <!--지문 등록 팝업--> |
|
402 |
+ <div v-show="searchTextOpen" class="popup-wrap"> |
|
403 |
+ <div class="popup-box "> |
|
404 |
+ <div class="flex justify-between mb30"> |
|
405 |
+ <p class="popup-title">지문 검색</p> |
|
406 |
+ <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
407 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
408 |
+ |
|
409 |
+ </button> |
|
410 |
+ </div> |
|
411 |
+ <div class="search-wrap mb30"> |
|
412 |
+ <input type="text" class="data-wrap" placeholder="" v-model="searchKeyword"> |
|
413 |
+ <button type="button" @click="fetchText"> |
|
414 |
+ <img src="../../../resources/img/look_t.png" alt=""> |
|
415 |
+ </button> |
|
416 |
+ </div> |
|
417 |
+ <div class="table-wrap"> |
|
418 |
+ <table> |
|
419 |
+ <thead> |
|
420 |
+ <tr> |
|
421 |
+ <td></td> |
|
422 |
+ <td>No.</td> |
|
423 |
+ <td>제목</td> |
|
424 |
+ <td>내용</td> |
|
425 |
+ <td>등록일</td> |
|
426 |
+ </tr> |
|
427 |
+ </thead> |
|
428 |
+ <tbody> |
|
429 |
+ <tr v-for="(post, index) in posts" :key="index" class="post"> |
|
430 |
+ <td><input type="checkbox" :checked="post.check" |
|
431 |
+ @change="selectText(post)"></td> |
|
432 |
+ <td>{{ index + 1 }}</td> |
|
433 |
+ <td>{{ post.textTtl.slice(0, 20) }}{{ post.textTtl.length > 20 ? '...' : '' }}</td> |
|
434 |
+ <td>{{ post.textCnt.slice(0, 20) }}{{ post.textCnt.length > 20 ? '...' : '' }}</td> |
|
435 |
+ <td>{{ post.regDt }}</td> |
|
436 |
+ </tr> |
|
437 |
+ </tbody> |
|
438 |
+ </table> |
|
439 |
+ <article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
|
440 |
+ <button @click="changePage(currentPage - 1)" :disabled="currentPage === 1"> |
|
441 |
+ <img src="../../../resources/img/btn27_90t_normal.png" alt="Previous"> |
|
442 |
+ </button> |
|
443 |
+ <button v-for="page in paginationButtons" :key="page" @click="changePage(page)" |
|
444 |
+ :class="{ 'selected-btn': currentPage === page }"> |
|
445 |
+ {{ page }} |
|
446 |
+ </button> |
|
447 |
+ <button @click="changePage(currentPage + 1)" :disabled="currentPage === totalPages"> |
|
448 |
+ <img src="../../../resources/img/btn28_90t_normal.png" alt="Next"> |
|
449 |
+ </button> |
|
450 |
+ </article> |
|
451 |
+ |
|
452 |
+ </div> |
|
453 |
+ <div class="flex justify-end "> |
|
454 |
+ <button type="button" title="" class="new-btn mr10" @click="closeBtn"> |
|
455 |
+ 취소 |
|
456 |
+ </button> |
|
457 |
+ <button type="button" title="" class="new-btn" @click="insertRoadMap2"> |
|
458 |
+ 등록 |
|
459 |
+ </button> |
|
460 |
+ </div> |
|
461 |
+ </div> |
|
462 |
+ </div> |
|
463 |
+ |
|
464 |
+ <!--문제 등록 팝업--> |
|
465 |
+ <div v-show="searchPrblmOpen" class="popup-wrap"> |
|
466 |
+ <div class="popup-box "> |
|
467 |
+ <div class="flex justify-between mb30"> |
|
468 |
+ <p class="popup-title">문제 검색</p> |
|
469 |
+ <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
470 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
471 |
+ |
|
472 |
+ </button> |
|
473 |
+ </div> |
|
474 |
+ <div class="search-wrap mb30"> |
|
475 |
+ <input type="text" class="data-wrap" placeholder="" v-model="searchKeyword"> |
|
476 |
+ <button type="button" @click="fetchProblems"> |
|
477 |
+ <img src="../../../resources/img/look_t.png" alt=""> |
|
478 |
+ </button> |
|
479 |
+ </div> |
|
480 |
+ <div class="table-wrap"> |
|
481 |
+ <table> |
|
482 |
+ <colgroup> |
|
483 |
+ <col style="width: 10%;"> |
|
484 |
+ <col style="width: 10%;"> |
|
485 |
+ <col style="width: 30%;"> |
|
486 |
+ <col style="width: 10%;"> |
|
487 |
+ <col style="width: 10%;"> |
|
488 |
+ <col style="width: 10%;"> |
|
489 |
+ <col style="width: 20%;"> |
|
490 |
+ </colgroup> |
|
491 |
+ <thead> |
|
492 |
+ <tr> |
|
493 |
+ <td></td> |
|
494 |
+ <td>No.</td> |
|
495 |
+ <td>문제</td> |
|
496 |
+ <td>유형</td> |
|
497 |
+ <td>점수</td> |
|
498 |
+ <td>작성자</td> |
|
499 |
+ <td>등록일</td> |
|
500 |
+ </tr> |
|
501 |
+ </thead> |
|
502 |
+ <tbody> |
|
503 |
+ <tr v-for="(problem, index) in problems" :key="problem.prblmId"> |
|
504 |
+ <td><input type="checkbox" v-model="problem.check"></td> |
|
505 |
+ <td>{{ index + 1 }}</td> |
|
506 |
+ <td>{{ problem.prblmExpln }}</td> |
|
507 |
+ <td>{{ problem.prblmTypeNm }}</td> |
|
508 |
+ <td>{{ problem.prblmScr }}</td> |
|
509 |
+ <td>{{ problem.userId }}</td> |
|
510 |
+ <td>{{ problem.regDt }}</td> |
|
511 |
+ </tr> |
|
512 |
+ </tbody> |
|
513 |
+ </table> |
|
514 |
+ <article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
|
515 |
+ <button @click="changePage(currentPage - 1)" :disabled="currentPage === 1"> |
|
516 |
+ <img src="../../../resources/img/btn27_90t_normal.png" alt="Previous"> |
|
517 |
+ </button> |
|
518 |
+ <button v-for="page in paginationButtons" :key="page" @click="changePage(page)" |
|
519 |
+ :class="{ 'selected-btn': currentPage === page }"> |
|
520 |
+ {{ page }} |
|
521 |
+ </button> |
|
522 |
+ <button @click="changePage(currentPage + 1)" :disabled="currentPage === totalPages"> |
|
523 |
+ <img src="../../../resources/img/btn28_90t_normal.png" alt="Next"> |
|
524 |
+ </button> |
|
525 |
+ </article> |
|
526 |
+ |
|
527 |
+ </div> |
|
528 |
+ <div class="flex justify-end "> |
|
529 |
+ <button type="button" title="" class="new-btn mr10" @click="closeBtn"> |
|
530 |
+ 취소 |
|
531 |
+ </button> |
|
532 |
+ <button type="button" title="" class="new-btn" @click="insertRoadMap"> |
|
533 |
+ 등록 |
|
534 |
+ </button> |
|
535 |
+ </div> |
|
536 |
+ </div> |
|
537 |
+ </div> |
|
538 |
+ |
|
539 |
+ <!--단어장 등록 팝업--> |
|
540 |
+ <div v-show="searchWordOpen" class="popup-wrap"> |
|
541 |
+ <div class="popup-box "> |
|
542 |
+ <div class="flex justify-between mb30"> |
|
543 |
+ <p class="popup-title">단어장 검색</p> |
|
544 |
+ </div> |
|
545 |
+ <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
546 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
547 |
+ </button> |
|
548 |
+ <select v-model="searchType" class="mr10 data-wrap"> |
|
549 |
+ <option value="text">지문</option> |
|
550 |
+ <option value="word">단어</option> |
|
551 |
+ </select> |
|
552 |
+ <div class="search-wrap mb30"> |
|
553 |
+ <input type="text" class="data-wrap" placeholder="" v-model="searchKeyword"> |
|
554 |
+ <button type="button" @click="searchWordBooks"> |
|
555 |
+ <img src="../../../resources/img/look_t.png" alt=""> |
|
556 |
+ </button> |
|
557 |
+ |
|
558 |
+ </div> |
|
559 |
+ <div class="table-wrap"> |
|
560 |
+ <table> |
|
561 |
+ <thead> |
|
562 |
+ <td></td> |
|
563 |
+ <td>No.</td> |
|
564 |
+ <td>지문</td> |
|
565 |
+ <td>단어 목록</td> |
|
566 |
+ <td>작성자</td> |
|
567 |
+ </thead> |
|
568 |
+ <tbody> |
|
569 |
+ <tr v-for="(wordBook, index) in wordBooks" :key="wordBook.wdBookId"> |
|
570 |
+ <td><input type="checkbox" v-model="wordBook.check"></td> |
|
571 |
+ <td>{{ index + 1 }}</td> |
|
572 |
+ <td>{{ wordBook.textTtl }}</td> |
|
573 |
+ <td>{{ wordBook.wordsPreview }}</td> |
|
574 |
+ <td>{{ wordBook.userNm }}</td> |
|
575 |
+ </tr> |
|
576 |
+ </tbody> |
|
577 |
+ </table> |
|
578 |
+ <article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
|
579 |
+ <button @click="changePage(currentPage - 1)" :disabled="currentPage === 1"> |
|
580 |
+ <img src="../../../resources/img/btn27_90t_normal.png" alt="Previous"> |
|
581 |
+ </button> |
|
582 |
+ <button v-for="page in paginationButtons" :key="page" @click="changePage(page)" |
|
583 |
+ :class="{ 'selected-btn': currentPage === page }"> |
|
584 |
+ {{ page }} |
|
585 |
+ </button> |
|
586 |
+ <button @click="changePage(currentPage + 1)" :disabled="currentPage === totalPages"> |
|
587 |
+ <img src="../../../resources/img/btn28_90t_normal.png" alt="Next"> |
|
588 |
+ </button> |
|
589 |
+ </article> |
|
590 |
+ |
|
591 |
+ </div> |
|
592 |
+ <div class="flex justify-end "> |
|
593 |
+ <button type="button" title="" class="new-btn mr10" @click="closeBtn"> |
|
594 |
+ 취소 |
|
595 |
+ </button> |
|
596 |
+ <button type="button" title="" class="new-btn" @click="insertRoadMap3"> |
|
597 |
+ 등록 |
|
598 |
+ </button> |
|
599 |
+ </div> |
|
600 |
+ </div> |
|
601 |
+ </div> |
|
602 |
+ |
|
603 |
+ <!--평가 등록 팝업--> |
|
604 |
+ <div v-show="searchEvalOpen" class="popup-wrap"> |
|
605 |
+ <div class="popup-box "> |
|
606 |
+ <div class="flex justify-between mb30"> |
|
607 |
+ <p class="popup-title">문제 검색</p> |
|
608 |
+ <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
609 |
+ <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
610 |
+ </button> |
|
611 |
+ </div> |
|
612 |
+ <div class="table-wrap"> |
|
613 |
+ <table> |
|
614 |
+ <thead> |
|
615 |
+ <tr> |
|
616 |
+ <td></td> |
|
617 |
+ <td>No.</td> |
|
618 |
+ <td>중간/최종</td> |
|
619 |
+ <td>문항 갯수</td> |
|
620 |
+ </tr> |
|
621 |
+ </thead> |
|
622 |
+ <tbody> |
|
623 |
+ <tr v-for="(evaluation, index) in evals" :key="evaluation.evalId"> |
|
624 |
+ <td><input type="checkbox" :checked="evaluation.check" |
|
625 |
+ @change="selectEvaluation(evaluation)"> |
|
626 |
+ </td> |
|
627 |
+ <td>{{ index + 1 }}</td> |
|
628 |
+ <td>{{ evaluation.evalType }}</td> |
|
629 |
+ <td>{{ evaluation.problemCount }}</td> |
|
630 |
+ </tr> |
|
631 |
+ </tbody> |
|
632 |
+ </table> |
|
633 |
+ <article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
|
634 |
+ <button @click="changePage(currentPage - 1)" :disabled="currentPage === 1"> |
|
635 |
+ <img src="../../../resources/img/btn27_90t_normal.png" alt="Previous"> |
|
636 |
+ </button> |
|
637 |
+ <button v-for="page in paginationButtons" :key="page" @click="changePage(page)" |
|
638 |
+ :class="{ 'selected-btn': currentPage === page }"> |
|
639 |
+ {{ page }} |
|
640 |
+ </button> |
|
641 |
+ <button @click="changePage(currentPage + 1)" :disabled="currentPage === totalPages"> |
|
642 |
+ <img src="../../../resources/img/btn28_90t_normal.png" alt="Next"> |
|
643 |
+ </button> |
|
644 |
+ </article> |
|
645 |
+ |
|
646 |
+ </div> |
|
647 |
+ <div class="flex justify-end "> |
|
648 |
+ <button type="button" title="" class="new-btn mr10" @click="closeBtn"> |
|
649 |
+ 취소 |
|
650 |
+ </button> |
|
651 |
+ <button type="button" title="" class="new-btn" @click="insertRoadMap4"> |
|
652 |
+ 등록 |
|
653 |
+ </button> |
|
654 |
+ </div> |
|
655 |
+ </div> |
|
656 |
+ </div> |
|
657 |
+ |
|
104 | 658 |
</template> |
105 | 659 |
|
106 | 660 |
<script> |
... | ... | @@ -108,6 +662,7 @@ |
108 | 662 |
import { mdiMagnify, mdilArrowRight } from '@mdi/js'; |
109 | 663 |
import { mdilArrowDown } from '@mdi/light-js'; |
110 | 664 |
import ProgressBar from '../../component/ProgressBar.vue'; |
665 |
+import axios from 'axios'; |
|
111 | 666 |
|
112 | 667 |
|
113 | 668 |
export default { |
... | ... | @@ -117,12 +672,35 @@ |
117 | 672 |
mdiMagnify: mdiMagnify, |
118 | 673 |
mdilArrowRight: mdilArrowRight, |
119 | 674 |
timer: "00:00", |
120 |
- progress: 20 |
|
675 |
+ progress: 20, |
|
676 |
+ |
|
677 |
+ books: [], |
|
678 |
+ units: [], |
|
679 |
+ posts: [], |
|
680 |
+ RoadMap: [], |
|
681 |
+ problems: [], |
|
682 |
+ wordBooks: [], |
|
683 |
+ evals: [], |
|
684 |
+ selectedBook: "", |
|
685 |
+ selectedUnit: null, |
|
686 |
+ |
|
687 |
+ currentPage: 1, |
|
688 |
+ pageSize: 5, |
|
689 |
+ totalPosts: 0, |
|
690 |
+ searchOption: '', |
|
691 |
+ searchKeyword: '', |
|
692 |
+ searchType: 'text', |
|
693 |
+ searchPrblmOpen: false, |
|
694 |
+ searchTextOpen: false, |
|
695 |
+ searchWordOpen: false, |
|
696 |
+ searchEvalOpen: false, |
|
697 |
+ |
|
698 |
+ selectedPop: 0, |
|
121 | 699 |
} |
122 | 700 |
}, |
123 | 701 |
methods: { |
124 | 702 |
goToPage(page) { |
125 |
- this.$router.push({ name: page }); |
|
703 |
+ this.$router.push({ name: page, query: { unit_id: this.selectedUnit, book_id: this.selectedBook } }); |
|
126 | 704 |
}, |
127 | 705 |
increaseProgress() { |
128 | 706 |
if (this.progress < 100) { |
... | ... | @@ -143,11 +721,429 @@ |
143 | 721 |
this.goBack(); |
144 | 722 |
} |
145 | 723 |
}, |
724 |
+ |
|
725 |
+ // 모달 열기 |
|
726 |
+ buttonSearch(page) { |
|
727 |
+ this.selectedPop = page; |
|
728 |
+ if (this.selectedPop === '2' || this.selectedPop === '3' || this.selectedPop === '6') { |
|
729 |
+ this.searchPrblmOpen = true; |
|
730 |
+ this.fetchProblems(); |
|
731 |
+ } else if (this.selectedPop === '0' || this.selectedPop === '4' || this.selectedPop === '8') { |
|
732 |
+ this.searchTextOpen = true; |
|
733 |
+ this.fetchText(); |
|
734 |
+ } else if (this.selectedPop === '1' || this.selectedPop === '5' || this.selectedPop === '9') { |
|
735 |
+ this.searchWordOpen = true; |
|
736 |
+ this.fetchWords(); |
|
737 |
+ } else if (this.selectedPop === '7') { |
|
738 |
+ this.searchEvalOpen = true; |
|
739 |
+ this.fetchEval('중간평가'); |
|
740 |
+ } else if (this.selectedPop === '10') { |
|
741 |
+ this.searchEvalOpen = true; |
|
742 |
+ this.fetchEval('최종평가'); |
|
743 |
+ } |
|
744 |
+ }, |
|
745 |
+ |
|
746 |
+ // 모달 닫기 |
|
747 |
+ closeBtn() { |
|
748 |
+ this.problems = []; |
|
749 |
+ this.posts = []; |
|
750 |
+ this.wordBooks = []; |
|
751 |
+ this.evals = []; |
|
752 |
+ |
|
753 |
+ this.selectedPop = ''; |
|
754 |
+ |
|
755 |
+ this.currentPage = 1; |
|
756 |
+ this.pageSize = 5; |
|
757 |
+ this.totalPosts = 0; |
|
758 |
+ |
|
759 |
+ this.searchPrblmOpen = false; |
|
760 |
+ this.searchTextOpen = false; |
|
761 |
+ this.searchWordOpen = false; |
|
762 |
+ this.searchEvalOpen = false; |
|
763 |
+ }, |
|
764 |
+ |
|
765 |
+ // 로드맵 지정된 것 삭제 |
|
766 |
+ deleteRoadMap(page, id){ |
|
767 |
+ if (page === '2' || page === '3' || page === '6') { |
|
768 |
+ this.RoadMap[page] = this.RoadMap[page].filter(prblm => prblm.prblmId !== id); |
|
769 |
+ } else if (page === '0' || page === '4' || page === '8') { |
|
770 |
+ this.RoadMap[page] = this.RoadMap[page].filter(text => text.textId !== id); |
|
771 |
+ } else if (page === '1' || page === '5' || page === '9') { |
|
772 |
+ this.RoadMap[page] = this.RoadMap[page].filter(wordBook => wordBook.wdBookId !== id); |
|
773 |
+ } else if (page === '7' || page === '10') { |
|
774 |
+ this.RoadMap[page] = this.RoadMap[page].filter(evaluation => evaluation.evalId !== id); |
|
775 |
+ } |
|
776 |
+ }, |
|
777 |
+ |
|
778 |
+ fetchBooks() { |
|
779 |
+ axios({ |
|
780 |
+ url: "/book/findAll.json", |
|
781 |
+ method: "post", |
|
782 |
+ headers: { |
|
783 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
784 |
+ }, |
|
785 |
+ }) |
|
786 |
+ .then(response => { |
|
787 |
+ console.log(response.data) |
|
788 |
+ this.books = response.data; |
|
789 |
+ |
|
790 |
+ }) |
|
791 |
+ .catch(error => { |
|
792 |
+ console.error("fetchBooks - error: ", error); |
|
793 |
+ alert("교재 목록을 불러오는 중 오류가 발생했습니다."); |
|
794 |
+ }); |
|
795 |
+ }, |
|
796 |
+ fetchUnits() { |
|
797 |
+ if (!this.selectedBook) return; |
|
798 |
+ |
|
799 |
+ axios({ |
|
800 |
+ url: "/unit/unitList.json", |
|
801 |
+ method: "post", |
|
802 |
+ headers: { |
|
803 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
804 |
+ }, |
|
805 |
+ data: { |
|
806 |
+ "bookId": this.selectedBook |
|
807 |
+ }, |
|
808 |
+ }) |
|
809 |
+ .then(response => { |
|
810 |
+ console.log(response.data) |
|
811 |
+ this.units = response.data; |
|
812 |
+ }) |
|
813 |
+ .catch(error => { |
|
814 |
+ console.error("fetchUnits - error: ", error); |
|
815 |
+ alert("단원 목록을 불러오는 중 오류가 발생했습니다."); |
|
816 |
+ }); |
|
817 |
+ }, |
|
818 |
+ |
|
819 |
+ // 단원을 선택했을 때 호출되는 메서드 |
|
820 |
+ selectUnit(unitId) { |
|
821 |
+ this.selectedUnit = unitId; |
|
822 |
+ //this.fetchData(); |
|
823 |
+ }, |
|
824 |
+ |
|
825 |
+ // 문제 가져오기 |
|
826 |
+ async fetchProblems(page = 1) { |
|
827 |
+ try { |
|
828 |
+ const response = await axios.post('/problem/problemList.json', { |
|
829 |
+ option: this.searchOption, |
|
830 |
+ keyword: this.searchKeyword, |
|
831 |
+ unitId: this.selectedUnit, |
|
832 |
+ pageSize: this.pageSize, |
|
833 |
+ startIndex: (page - 1) * 5 |
|
834 |
+ }); |
|
835 |
+ this.problems = response.data.problems; |
|
836 |
+ this.totalPosts = response.data.totalProblem; |
|
837 |
+ |
|
838 |
+ this.currentPage = page; |
|
839 |
+ } catch (error) { |
|
840 |
+ console.error('문제 목록을 불러오는 중 오류가 발생했습니다.', error); |
|
841 |
+ } |
|
842 |
+ }, |
|
843 |
+ changePage(page) { |
|
844 |
+ if (page < 1 || page > this.totalPages) return; |
|
845 |
+ this.currentPage = page; |
|
846 |
+ this.fetchProblems(page); |
|
847 |
+ }, |
|
848 |
+ |
|
849 |
+ // 지문 가져오기 |
|
850 |
+ fetchText() { |
|
851 |
+ const idx = (this.currentPage - 1) * this.pageSize; |
|
852 |
+ axios({ |
|
853 |
+ url: "/text/textSearch.json", |
|
854 |
+ method: "post", |
|
855 |
+ headers: { |
|
856 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
857 |
+ }, |
|
858 |
+ data: { |
|
859 |
+ "option": this.option, |
|
860 |
+ "keyword": this.keyword, |
|
861 |
+ "pageSize": this.pageSize, |
|
862 |
+ "startIndex": idx, |
|
863 |
+ "unitId": this.selectedUnit |
|
864 |
+ }, |
|
865 |
+ }) |
|
866 |
+ .then(response => { |
|
867 |
+ this.posts = response.data.list; |
|
868 |
+ if (!this.searching || this.keyword === "") { |
|
869 |
+ this.totalPosts = response.data.totalText; |
|
870 |
+ } else if (this.searching) { |
|
871 |
+ this.totalPosts = response.data.resultCount; |
|
872 |
+ } |
|
873 |
+ }) |
|
874 |
+ .catch(error => { |
|
875 |
+ console.error("fetchData - error: ", error); |
|
876 |
+ alert("검색 중 오류가 발생했습니다."); |
|
877 |
+ }); |
|
878 |
+ }, |
|
879 |
+ |
|
880 |
+ // 단어장 목록 가져오기 |
|
881 |
+ fetchWords() { |
|
882 |
+ const vm = this; |
|
883 |
+ axios({ |
|
884 |
+ url: "/wordbook/findByUnitId.json", |
|
885 |
+ method: "post", |
|
886 |
+ headers: { |
|
887 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
888 |
+ }, |
|
889 |
+ data: { |
|
890 |
+ unitId: vm.selectedUnit, |
|
891 |
+ page: vm.currentPage, |
|
892 |
+ pageSize: vm.pageSize |
|
893 |
+ }, |
|
894 |
+ }) |
|
895 |
+ .then(function (response) { |
|
896 |
+ console.log("dataList - response: ", response.data); |
|
897 |
+ const wordBooks = response.data.wordBooks; |
|
898 |
+ vm.totalPosts = response.data.totalWordBooks; |
|
899 |
+ |
|
900 |
+ // 지문 제목 및 단어 목록 가져오기 |
|
901 |
+ const fetchDataPromises = wordBooks.map(wordBook => { |
|
902 |
+ const textTitlePromise = axios.post("/text/selectOneText.json", { |
|
903 |
+ textId: wordBook.textId |
|
904 |
+ }).then(textResponse => { |
|
905 |
+ wordBook.textTtl = textResponse.data[0].text_ttl; |
|
906 |
+ }).catch(error => { |
|
907 |
+ console.error(`${wordBook.textId}으로 지문 제목 가져오기 실패: `, error); |
|
908 |
+ wordBook.textTtl = '제목값없음'; // 오류 시 기본값 설정 |
|
909 |
+ }); |
|
910 |
+ |
|
911 |
+ const wordsPromise = axios.post("/word/getWordsByBookId.json", { |
|
912 |
+ wdBookId: wordBook.wdBookId |
|
913 |
+ }).then(wordsResponse => { |
|
914 |
+ const words = wordsResponse.data.map(word => word.wdNm); |
|
915 |
+ wordBook.wordsPreview = vm.generateWordsPreview(words); |
|
916 |
+ }).catch(error => { |
|
917 |
+ console.error(`${wordBook.wdBookId}으로 단어 목록 가져오기 실패: `, error); |
|
918 |
+ wordBook.wordsPreview = '단어값없음'; // 오류 시 기본값 설정 |
|
919 |
+ }); |
|
920 |
+ |
|
921 |
+ return Promise.all([textTitlePromise, wordsPromise]); |
|
922 |
+ }); |
|
923 |
+ |
|
924 |
+ // 모든 데이터 가져오기 작업이 완료되면 dataList에 데이터 설정 |
|
925 |
+ Promise.all(fetchDataPromises).then(() => { |
|
926 |
+ vm.wordBooks = wordBooks; |
|
927 |
+ }); |
|
928 |
+ }) |
|
929 |
+ .catch(function (error) { |
|
930 |
+ console.log("dataList - error: ", error); |
|
931 |
+ alert("단어장 목록 조회에 오류가 발생했습니다."); |
|
932 |
+ }); |
|
933 |
+ }, |
|
934 |
+ |
|
935 |
+ // 단어장 검색 |
|
936 |
+ searchWordBooks() { |
|
937 |
+ const vm = this; |
|
938 |
+ let url = ''; |
|
939 |
+ let data = {}; |
|
940 |
+ |
|
941 |
+ if (this.searchType === 'text') { |
|
942 |
+ // 지문으로 검색 |
|
943 |
+ url = '/wordbook/findByTextTitle.json'; |
|
944 |
+ data = { |
|
945 |
+ unitId: vm.selectedUnit, |
|
946 |
+ textTitle: vm.searchKeyword, |
|
947 |
+ page: vm.currentPage, |
|
948 |
+ pageSize: vm.pageSize |
|
949 |
+ }; |
|
950 |
+ } else if (this.searchType === 'word') { |
|
951 |
+ // 단어로 검색 |
|
952 |
+ url = '/wordbook/findByWord.json'; |
|
953 |
+ data = { |
|
954 |
+ unitId: vm.selectedUnit, |
|
955 |
+ word: vm.searchKeyword, |
|
956 |
+ page: vm.currentPage, |
|
957 |
+ pageSize: vm.pageSize |
|
958 |
+ }; |
|
959 |
+ } |
|
960 |
+ |
|
961 |
+ axios.post(url, data) |
|
962 |
+ .then(function (response) { |
|
963 |
+ console.log("searchWordBooks - response: ", response.data); |
|
964 |
+ const wordBooks = response.data.wordBooks; |
|
965 |
+ vm.totalPosts = response.data.totalWordBooks; |
|
966 |
+ |
|
967 |
+ // 지문 제목 및 단어 목록 가져오기 |
|
968 |
+ const fetchDataPromises = wordBooks.map(wordBook => { |
|
969 |
+ const textTitlePromise = axios.post("/text/selectOneText.json", { |
|
970 |
+ textId: wordBook.textId |
|
971 |
+ }).then(textResponse => { |
|
972 |
+ wordBook.textTtl = textResponse.data[0].text_ttl; |
|
973 |
+ }).catch(error => { |
|
974 |
+ wordBook.textTtl = '제목값없음'; // 오류 시 기본값 설정 |
|
975 |
+ }); |
|
976 |
+ |
|
977 |
+ const wordsPromise = axios.post("/word/getWordsByBookId.json", { |
|
978 |
+ wdBookId: wordBook.wdBookId |
|
979 |
+ }).then(wordsResponse => { |
|
980 |
+ const words = wordsResponse.data.map(word => word.wdNm); |
|
981 |
+ wordBook.wordsPreview = vm.generateWordsPreview(words); |
|
982 |
+ }).catch(error => { |
|
983 |
+ wordBook.wordsPreview = '단어값없음'; // 오류 시 기본값 설정 |
|
984 |
+ }); |
|
985 |
+ |
|
986 |
+ return Promise.all([textTitlePromise, wordsPromise]); |
|
987 |
+ }); |
|
988 |
+ |
|
989 |
+ // 모든 데이터 가져오기 작업이 완료되면 dataList에 데이터 설정 |
|
990 |
+ Promise.all(fetchDataPromises).then(() => { |
|
991 |
+ vm.wordBooks = wordBooks; |
|
992 |
+ }); |
|
993 |
+ }) |
|
994 |
+ .catch(function (error) { |
|
995 |
+ console.log("searchWordBooks - error: ", error); |
|
996 |
+ alert("단어장 검색에 오류가 발생했습니다."); |
|
997 |
+ }); |
|
998 |
+ }, |
|
999 |
+ |
|
1000 |
+ // 단어 목록 생략 String 생성 메서드 |
|
1001 |
+ generateWordsPreview(words) { |
|
1002 |
+ const maxLength = 20; // 최대 표시 길이 설정 |
|
1003 |
+ const wordString = words.join(', '); |
|
1004 |
+ |
|
1005 |
+ if (wordString.length > maxLength) { |
|
1006 |
+ return wordString.substring(0, maxLength) + '...'; |
|
1007 |
+ } else { |
|
1008 |
+ return wordString; |
|
1009 |
+ } |
|
1010 |
+ }, |
|
1011 |
+ |
|
1012 |
+ // 평가 정보 가져오기 |
|
1013 |
+ fetchEval(evalType) { |
|
1014 |
+ const idx = (this.currentPage - 1) * this.pageSize; |
|
1015 |
+ |
|
1016 |
+ let option = null; |
|
1017 |
+ let searchKeyword = null; |
|
1018 |
+ |
|
1019 |
+ if (evalType !== '') { |
|
1020 |
+ option = 'eval_type'; |
|
1021 |
+ searchKeyword = evalType; |
|
1022 |
+ } |
|
1023 |
+ |
|
1024 |
+ axios({ |
|
1025 |
+ url: "/evaluation/evaluationUnitList.json", |
|
1026 |
+ method: "post", |
|
1027 |
+ headers: { |
|
1028 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
1029 |
+ }, |
|
1030 |
+ data: { |
|
1031 |
+ "option": option, |
|
1032 |
+ "keyword": searchKeyword, |
|
1033 |
+ "pageSize": this.pageSize, |
|
1034 |
+ "startIndex": idx, |
|
1035 |
+ "unitId": this.selectedUnit |
|
1036 |
+ }, |
|
1037 |
+ }) |
|
1038 |
+ .then(response => { |
|
1039 |
+ this.evals = response.data; |
|
1040 |
+ }) |
|
1041 |
+ .catch(error => { |
|
1042 |
+ console.error("fetchData - error: ", error); |
|
1043 |
+ alert("검색 중 오류가 발생했습니다."); |
|
1044 |
+ }); |
|
1045 |
+ }, |
|
1046 |
+ |
|
1047 |
+ // 평가는 1개만 선택되도록 제한 |
|
1048 |
+ selectEvaluation(selectedEvaluation) { |
|
1049 |
+ this.evals.forEach(evaluation => { |
|
1050 |
+ evaluation.check = false; // 모든 체크 해제 |
|
1051 |
+ }); |
|
1052 |
+ selectedEvaluation.check = true; // 선택한 항목만 체크 |
|
1053 |
+ }, |
|
1054 |
+ |
|
1055 |
+ // 지문은 1개만 선택되도록 제한 |
|
1056 |
+ selectText(selectedText) { |
|
1057 |
+ this.posts.forEach(text => { |
|
1058 |
+ text.check = false; // 모든 체크 해제 |
|
1059 |
+ }); |
|
1060 |
+ selectedText.check = true; // 선택한 항목만 체크 |
|
1061 |
+ }, |
|
1062 |
+ |
|
1063 |
+ |
|
1064 |
+ // 팝업 문제 데이터 가져오기 |
|
1065 |
+ insertRoadMap() { |
|
1066 |
+ const selectedProblems = this.problems.filter(problem => problem.check); |
|
1067 |
+ // RoadMap의 해당 인덱스가 초기화되어 있는지 확인 |
|
1068 |
+ if (!this.RoadMap[this.selectedPop]) { |
|
1069 |
+ this.RoadMap[this.selectedPop] = []; // 초기화 |
|
1070 |
+ } |
|
1071 |
+ |
|
1072 |
+ |
|
1073 |
+ // 이미 있는 데이터인지 확인 |
|
1074 |
+ selectedProblems.forEach(problem => { |
|
1075 |
+ const exists = this.RoadMap[this.selectedPop].some(existingProblem => existingProblem.prblmId === problem.prblmId); |
|
1076 |
+ if (!exists) { |
|
1077 |
+ this.RoadMap[this.selectedPop].push(problem); // 존재하지 않으면 추가 |
|
1078 |
+ } |
|
1079 |
+ }); |
|
1080 |
+ this.closeBtn(); |
|
1081 |
+ }, |
|
1082 |
+ |
|
1083 |
+ // 팝업 지문 데이터 가져오기 |
|
1084 |
+ insertRoadMap2() { |
|
1085 |
+ const selectedTexts = this.posts.filter(post => post.check); |
|
1086 |
+ this.RoadMap[this.selectedPop] = selectedTexts; |
|
1087 |
+ this.closeBtn(); |
|
1088 |
+ }, |
|
1089 |
+ // 팝업 단어장 데이터 가져오기 |
|
1090 |
+ insertRoadMap3() { |
|
1091 |
+ const selectedBooks = this.wordBooks.filter(wordBook => wordBook.check); |
|
1092 |
+ |
|
1093 |
+ if (!this.RoadMap[this.selectedPop]) { |
|
1094 |
+ this.RoadMap[this.selectedPop] = []; |
|
1095 |
+ } |
|
1096 |
+ |
|
1097 |
+ // 이미 있는 데이터인지 확인 |
|
1098 |
+ selectedBooks.forEach(wordBook => { |
|
1099 |
+ const exists = this.RoadMap[this.selectedPop].some(existingBook => existingBook.wdBookId === wordBook.wdBookId); |
|
1100 |
+ if (!exists) { |
|
1101 |
+ this.RoadMap[this.selectedPop].push(wordBook); // 존재하지 않으면 추가 |
|
1102 |
+ } |
|
1103 |
+ }); |
|
1104 |
+ this.closeBtn(); |
|
1105 |
+ }, |
|
1106 |
+ |
|
1107 |
+ // 평가 데이터 가져오기 |
|
1108 |
+ insertRoadMap4() { |
|
1109 |
+ const selectedEval = this.evals.filter(evaluation => evaluation.check); |
|
1110 |
+ this.RoadMap[this.selectedPop] = selectedEval; |
|
1111 |
+ this.closeBtn(); |
|
1112 |
+ }, |
|
1113 |
+ |
|
1114 |
+ // 로드맵 등록하기 |
|
1115 |
+ postRoadMaps(){ |
|
1116 |
+ console.log(this.RoadMap); |
|
1117 |
+ |
|
1118 |
+ }, |
|
1119 |
+ |
|
1120 |
+ // prblmbook 만들어 id 가져오기 |
|
1121 |
+ |
|
1122 |
+ // wordcontent 만들어 id 가져오기 |
|
1123 |
+ |
|
146 | 1124 |
}, |
147 | 1125 |
watch: { |
148 | 1126 |
|
149 | 1127 |
}, |
150 | 1128 |
computed: { |
1129 |
+ totalPages() { |
|
1130 |
+ return Math.ceil(this.totalPosts / this.pageSize); |
|
1131 |
+ }, |
|
1132 |
+ paginationButtons() { |
|
1133 |
+ let start = Math.max(0, this.currentPage - 2); |
|
1134 |
+ let end = Math.min(start + 5, this.totalPages); |
|
1135 |
+ |
|
1136 |
+ if (end - start < 5) { |
|
1137 |
+ start = Math.max(0, end - 5); |
|
1138 |
+ } |
|
1139 |
+ |
|
1140 |
+ return Array.from({ length: end - start }, (_, i) => start + i + 1); |
|
1141 |
+ }, |
|
1142 |
+ |
|
1143 |
+ startIndex() { |
|
1144 |
+ return this.currentPage * this.itemsPerPage; |
|
1145 |
+ } |
|
1146 |
+ |
|
151 | 1147 |
|
152 | 1148 |
}, |
153 | 1149 |
components: { |
... | ... | @@ -155,7 +1151,12 @@ |
155 | 1151 |
ProgressBar |
156 | 1152 |
}, |
157 | 1153 |
mounted() { |
158 |
- console.log('Main2 mounted'); |
|
1154 |
+ this.selectedUnit = this.$route.query.unit_id || ''; |
|
1155 |
+ this.selectedBook = this.$route.query.book_id || ''; |
|
1156 |
+ |
|
1157 |
+ this.fetchBooks(); |
|
1158 |
+ this.fetchUnits(); |
|
1159 |
+ |
|
159 | 1160 |
} |
160 | 1161 |
} |
161 | 1162 |
</script> |
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?