guntaek
10-21
20241021 김건택 선생님페이지 헤더 메뉴, 사이드, 학생리스트, 지문 리스트, 교재 리스트 수정
@0bbd6716b0ce35f01a3d7f6a212fb136de0758cd
+++ client/views/layout/Header_t.vue
... | ... | @@ -0,0 +1,267 @@ |
1 | +<template> | |
2 | + <div class="header flex justify-between align-center header-box"> | |
3 | + <div> | |
4 | + <router-link to="/MyPlan.page"> | |
5 | + <div class="logo"> | |
6 | + <img src="../../resources/img/new_img/logo_v2.png" alt="" /> | |
7 | + </div> | |
8 | + </router-link> | |
9 | + </div> | |
10 | + <div class="flex align-center"> | |
11 | + <!-- <Menu :currentRoute="$route.path"></Menu> --> | |
12 | + <div class="notice" @click="buttonSearch"> | |
13 | + <img src="../../resources/img/icon2.png" alt="" /> | |
14 | + <p>{{ unCheck }}</p> | |
15 | + </div> | |
16 | + <img src="../../resources/img/new_img/profile_img.png" alt="" /> | |
17 | + <div class="look-btn" @click="logout"> | |
18 | + <img src="../../resources/img/new_img/icon/logout_icon.png" alt="" /> | |
19 | + </div> | |
20 | + <div class="popup-wrap" v-show="searchOpen"> | |
21 | + <div class="popup-box"> | |
22 | + <div class="flex mb10 justify-between"> | |
23 | + <p class="popup-title">알림</p> | |
24 | + <button type="button" class="popup-close-btn" @click="closeBtn"> | |
25 | + <svg-icon | |
26 | + type="mdi" | |
27 | + :path="mdiWindowClose" | |
28 | + class="close-btn" | |
29 | + ></svg-icon> | |
30 | + </button> | |
31 | + </div> | |
32 | + <article | |
33 | + class="flex justify-between mt20" | |
34 | + v-for="item in dataList" | |
35 | + :key="item.id" | |
36 | + :class="{ 'selected-row': selectedRow == item.dataList }" | |
37 | + > | |
38 | + <img | |
39 | + style="width: fit-content" | |
40 | + src="../../resources/img/img200_13p.png" | |
41 | + alt="" | |
42 | + /> | |
43 | + <p class="title1 ml20" style="width: 60%">{{ item.bbsTtl }}</p> | |
44 | + <button | |
45 | + @click="buttonSearch2(item)" | |
46 | + type="button" | |
47 | + title="글쓰기" | |
48 | + class="new-btn" | |
49 | + > | |
50 | + 자세히 보기 | |
51 | + </button> | |
52 | + </article> | |
53 | + <article | |
54 | + class="table-pagination flex justify-center align-center mb20 mt30" | |
55 | + style="gap: 10px" | |
56 | + > | |
57 | + <button @click="previousPage" :disabled="page === 1">이전</button> | |
58 | + <button class="selected-btn">{{ page }}</button> | |
59 | + <button @click="nextPage" :disabled="page === totalPages"> | |
60 | + 다음 | |
61 | + </button> | |
62 | + </article> | |
63 | + </div> | |
64 | + </div> | |
65 | + <div class="popup-wrap popup2" v-show="searchOpen2"> | |
66 | + <div class="popup-box"> | |
67 | + <div class="flex mb10 justify-between"> | |
68 | + <p class="popup-title">알림 자세히 보기</p> | |
69 | + <button type="button" class="popup-close-btn" @click="closeBtn2"> | |
70 | + <svg-icon | |
71 | + type="mdi" | |
72 | + :path="mdiWindowClose" | |
73 | + class="close-btn" | |
74 | + ></svg-icon> | |
75 | + </button> | |
76 | + </div> | |
77 | + <div class="board-wrap"> | |
78 | + <div class="flex align-center"> | |
79 | + <label for="" class="title2">{{ boardData.bbsTtl }}</label> | |
80 | + </div> | |
81 | + <hr /> | |
82 | + <!-- <textarea readonly name="" id="">{{ boardData.bbsCnt }}</textarea> --> | |
83 | + </div> | |
84 | + <div class="flex justify-center mt20"> | |
85 | + <button | |
86 | + type="button" | |
87 | + title="확인" | |
88 | + class="new-btn" | |
89 | + @click="closeBtn2" | |
90 | + > | |
91 | + 확인 | |
92 | + </button> | |
93 | + </div> | |
94 | + </div> | |
95 | + </div> | |
96 | + </div> | |
97 | + </div> | |
98 | +</template> | |
99 | + | |
100 | +<script> | |
101 | +import SvgIcon from "@jamescoyle/vue-icon"; | |
102 | +import { mdiMagnify, mdiWindowClose } from "@mdi/js"; | |
103 | +import axios from "axios"; | |
104 | +import Menu from "./Menu.vue"; | |
105 | +export default { | |
106 | + data() { | |
107 | + return { | |
108 | + mdiWindowClose: mdiWindowClose, | |
109 | + showModal: false, | |
110 | + searchOpen: false, | |
111 | + searchOpen2: false, | |
112 | + | |
113 | + // 게시글 정보 | |
114 | + dataList: [], | |
115 | + totalBoard: null, | |
116 | + selectedRow: "", | |
117 | + unCheck: null, | |
118 | + | |
119 | + boardData: [], | |
120 | + | |
121 | + // 페이징 정보 | |
122 | + page: 1, | |
123 | + pageSize: 2, | |
124 | + totalpages: null, | |
125 | + | |
126 | + // 사용자 정보 | |
127 | + userId: "USID_000000000000006", | |
128 | + stdId: "", | |
129 | + }; | |
130 | + }, | |
131 | + methods: { | |
132 | + closeModal() { | |
133 | + this.showModal = false; | |
134 | + }, | |
135 | + buttonSearch() { | |
136 | + this.searchOpen = true; | |
137 | + }, | |
138 | + buttonSearch2(item) { | |
139 | + const vm = this; | |
140 | + this.searchOpen2 = true; | |
141 | + this.boardData = item; | |
142 | + | |
143 | + axios({ | |
144 | + url: "/board/boardStudentCheck.json", | |
145 | + method: "post", | |
146 | + headers: { | |
147 | + "Content-Type": "application/json; charset=UTF-8", | |
148 | + }, | |
149 | + data: { | |
150 | + bbsId: item.bbsId, | |
151 | + stdId: vm.stdId, | |
152 | + }, | |
153 | + }) | |
154 | + .then(function (res) { | |
155 | + vm.boardList(); | |
156 | + }) | |
157 | + .catch(function (error) { | |
158 | + console.log("result - error : ", error); | |
159 | + }); | |
160 | + }, | |
161 | + closeBtn() { | |
162 | + this.searchOpen = false; | |
163 | + }, | |
164 | + closeBtn2() { | |
165 | + this.searchOpen2 = false; | |
166 | + }, | |
167 | + | |
168 | + logout() { | |
169 | + const result = confirm("로그아웃 하시겠습니까?"); | |
170 | + if (result) { | |
171 | + this.$store.dispatch("logout"); | |
172 | + this.goToPage("login"); | |
173 | + } else { | |
174 | + return; | |
175 | + } | |
176 | + }, | |
177 | + goToPage(page) { | |
178 | + this.$router.push({ name: page }); | |
179 | + }, | |
180 | + | |
181 | + // 공지 조회 | |
182 | + boardList() { | |
183 | + const vm = this; | |
184 | + axios({ | |
185 | + url: "/board/boardStudentList.json", | |
186 | + method: "post", | |
187 | + headers: { | |
188 | + "Content-Type": "application/json; charset=UTF-8", | |
189 | + }, | |
190 | + data: { page: vm.page, pageSize: vm.pageSize, userId: vm.userId }, | |
191 | + }) | |
192 | + .then(function (res) { | |
193 | + vm.dataList = res.data.result[0].boardClass[0].board; | |
194 | + vm.userNm = res.data.result[0].userNm; | |
195 | + vm.userId = res.data.result[0].userId; | |
196 | + vm.unCheck = res.data.unCheck; | |
197 | + vm.stdId = | |
198 | + res.data.result[0].boardClass[0].board[0].boardStudent[0].stdId; | |
199 | + vm.totalBoard = res.data.totalBoard; | |
200 | + vm.totalPages = Math.ceil(vm.totalBoard / vm.pageSize); | |
201 | + }) | |
202 | + .catch(function (error) { | |
203 | + console.log("result - error : ", error); | |
204 | + }); | |
205 | + }, | |
206 | + | |
207 | + previousPage() { | |
208 | + if (this.page > 1) { | |
209 | + this.page -= 1; | |
210 | + this.boardList(); | |
211 | + } | |
212 | + }, | |
213 | + | |
214 | + nextPage() { | |
215 | + if (this.page < this.totalPages) { | |
216 | + this.page += 1; | |
217 | + this.boardList(); | |
218 | + } | |
219 | + }, | |
220 | + }, | |
221 | + watch: {}, | |
222 | + computed: {}, | |
223 | + components: { | |
224 | + SvgIcon, | |
225 | + Menu: Menu, | |
226 | + }, | |
227 | + mounted() { | |
228 | + console.log("Header mounted"); | |
229 | + this.boardList(); | |
230 | + }, | |
231 | +}; | |
232 | +</script> | |
233 | +<style scoped> | |
234 | +.popup-wrap { | |
235 | + position: fixed; | |
236 | + background-color: transparent; | |
237 | + width: fit-content; | |
238 | + height: fit-content; | |
239 | + z-index: 10; | |
240 | +} | |
241 | + | |
242 | +.popup-box { | |
243 | + top: 300px; | |
244 | + left: 62%; | |
245 | +} | |
246 | + | |
247 | +.popup2 .popup-box { | |
248 | + top: 450px; | |
249 | + left: 38%; | |
250 | +} | |
251 | + | |
252 | +/* | |
253 | +.header-box { | |
254 | + background-color: white; | |
255 | + padding: 10px 50px; | |
256 | + box-shadow: rgba(14, 63, 126, 0.04) 0px 0px 0px 1px, rgba(42, 51, 69, 0.04) 0px 1px 1px -0.5px, | |
257 | + rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.04) 0px 6px 6px -3px, | |
258 | + rgba(14, 63, 126, 0.04) 0px 12px 12px -6px, rgba(14, 63, 126, 0.04) 0px 24px 24px -12px; | |
259 | +} */ | |
260 | + | |
261 | +.header-box { | |
262 | + background-color: #ffffff80; | |
263 | + padding: 10px 50px; | |
264 | + /* box-shadow: rgba(14, 63, 126, 0.04) 0px 0px 0px 1px, rgba(42, 51, 69, 0.04) 0px 1px 1px -0.5px, rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.04) 0px 6px 6px -3px, rgba(14, 63, 126, 0.04) 0px 12px 12px -6px, rgba(14, 63, 126, 0.04) 0px 24px 24px -12px; */ | |
265 | + backdrop-filter: blur(10px); | |
266 | +} | |
267 | +</style> |
--- client/views/layout/Side_t.vue
+++ client/views/layout/Side_t.vue
... | ... | @@ -1,6 +1,6 @@ |
1 | 1 |
<template> |
2 | 2 |
<div class="side_t side"> |
3 |
- <div class="logo mb25"><img src="../../resources/img/logo2.png" alt=""></div> |
|
3 |
+ <!-- <div class="logo mb25"><img src="../../resources/img/logo2.png" alt=""></div> --> |
|
4 | 4 |
<div class=" mb30"> |
5 | 5 |
<div> |
6 | 6 |
<img src="../../resources/img/img16_s.png" alt=""> |
... | ... | @@ -73,4 +73,13 @@ |
73 | 73 |
console.log('Menu mounted'); |
74 | 74 |
} |
75 | 75 |
} |
76 |
-</script>(파일 끝에 줄바꿈 문자 없음) |
|
76 |
+</script> |
|
77 |
+ |
|
78 |
+ |
|
79 |
+<style scoped> |
|
80 |
+.side { |
|
81 |
+ max-height: 100vh; /* 사이드바가 화면의 높이를 넘지 않도록 설정 */ |
|
82 |
+ overflow-y: auto; /* 컨텐츠가 많을 경우 스크롤바 추가 */ |
|
83 |
+} |
|
84 |
+ |
|
85 |
+</style>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/teacher/Main_t.vue
+++ client/views/pages/teacher/Main_t.vue
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
<div class="flex justify-between" style="height: 100%;"> |
3 | 3 |
<Side_t></Side_t> |
4 | 4 |
<div style="padding: 15px 60px 120px 0px "> |
5 |
- <Header></Header> |
|
5 |
+ <Header_t></Header_t> |
|
6 | 6 |
<div class="main-wrap"> |
7 | 7 |
<router-view /> |
8 | 8 |
</div> |
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 |
</template> |
13 | 13 |
|
14 | 14 |
<script> |
15 |
-import Header from '../../layout/Header.vue'; |
|
15 |
+import Header_t from '../../layout/Header_t.vue'; |
|
16 | 16 |
import Menu from '../../layout/Menu.vue'; |
17 | 17 |
import Side_t from '../../layout/Side_t.vue'; |
18 | 18 |
|
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 |
|
32 | 32 |
}, |
33 | 33 |
components: { |
34 |
- Header: Header, |
|
34 |
+ Header_t: Header_t, |
|
35 | 35 |
Menu: Menu, |
36 | 36 |
// Footer:Footer, |
37 | 37 |
Side_t:Side_t, |
--- client/views/pages/teacher/StudentList.vue
+++ client/views/pages/teacher/StudentList.vue
... | ... | @@ -1,8 +1,11 @@ |
1 | 1 |
<template> |
2 | 2 |
<div class="title-box flex justify-between mb40"> |
3 | 3 |
<p class="title">게시판</p> |
4 |
- <select name="" id=""> |
|
5 |
- <option value="">A반</option> |
|
4 |
+ <select name="" id="" v-model="selectedClass" @click="fetchStudents"> |
|
5 |
+ <option value="" disabled selected>반을 선택하세요</option> |
|
6 |
+ <option v-for="sClass in classesList" :key="sClass.sclsId" :value="sClass.sclsId"> |
|
7 |
+ {{ sClass.sclsNm }} |
|
8 |
+ </option> |
|
6 | 9 |
</select> |
7 | 10 |
</div> |
8 | 11 |
<div class="flex justify-end mb20"> |
... | ... | @@ -25,24 +28,25 @@ |
25 | 28 |
<td>No.</td> |
26 | 29 |
<td>학년</td> |
27 | 30 |
<td>반</td> |
28 |
- <td>성별</td> |
|
29 | 31 |
<td>이름</td> |
30 | 32 |
</thead> |
31 | 33 |
<tbody> |
32 |
- <tr @click="goToPage('StudentDetail')"> |
|
33 |
- <td></td> |
|
34 |
- <td></td> |
|
35 |
- <td></td> |
|
36 |
- <td></td> |
|
37 |
- <td></td> |
|
34 |
+ <!-- StudentDetail로 갈때 stdId? userId? --> |
|
35 |
+ <tr v-for="(student, index) in students" :key="index" class="student" |
|
36 |
+ @click="goToPage('StudentDetail')"> |
|
37 |
+ <td>{{ index + 1 + (currentPage - 1) * pageSize }}</td> |
|
38 |
+ <td>{{ student.grd_no }}</td> |
|
39 |
+ <td>{{ student.scls_nm }}</td> |
|
40 |
+ <td>{{ student.user_nm }}</td> |
|
38 | 41 |
</tr> |
39 | 42 |
</tbody> |
40 | 43 |
</table> |
41 | 44 |
<article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
42 | 45 |
<button><img src="../../../resources/img/btn27_90t_normal.png" alt=""></button> |
43 |
- <button class="selected-btn">1</button> |
|
44 |
- <button>2</button> |
|
45 |
- <button>3</button> |
|
46 |
+ <button v-for="page in totalPages" :key="page" @click="changePage(page)" |
|
47 |
+ :class="{ 'selected-btn': currentPage === page }"> |
|
48 |
+ {{ page }} |
|
49 |
+ </button> |
|
46 | 50 |
<button><img src="../../../resources/img/btn28_90t_normal.png" alt=""></button> |
47 | 51 |
</article> |
48 | 52 |
<div class="flex justify-end "> |
... | ... | @@ -82,15 +86,16 @@ |
82 | 86 |
<td></td> |
83 | 87 |
<td></td> |
84 | 88 |
<td></td> |
85 |
- <td><input type="checkbox" class="ui-checkbox"></td> |
|
86 | 89 |
</tr> |
90 |
+ <td><input type="checkbox" class="ui-checkbox"></td> |
|
87 | 91 |
</tbody> |
88 | 92 |
</table> |
89 | 93 |
<article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;"> |
90 | 94 |
<button><img src="../../../resources/img/btn27_90t_normal.png" alt=""></button> |
91 |
- <button class="selected-btn">1</button> |
|
92 |
- <button>2</button> |
|
93 |
- <button>3</button> |
|
95 |
+ <button v-for="page in totalPages" :key="page" @click="changePage(page)" |
|
96 |
+ :class="{ 'selected-btn': currentPage === page }"> |
|
97 |
+ {{ page }} |
|
98 |
+ </button> |
|
94 | 99 |
<button><img src="../../../resources/img/btn28_90t_normal.png" alt=""></button> |
95 | 100 |
</article> |
96 | 101 |
<div class="flex justify-end "> |
... | ... | @@ -113,18 +118,86 @@ |
113 | 118 |
<script> |
114 | 119 |
import SvgIcon from '@jamescoyle/vue-icon'; |
115 | 120 |
import { mdiMagnify, mdiWindowClose } from '@mdi/js'; |
121 |
+import axios from 'axios'; |
|
116 | 122 |
|
117 | 123 |
|
118 | 124 |
export default { |
119 | 125 |
data() { |
120 | 126 |
return { |
127 |
+ classesList: [], |
|
128 |
+ |
|
121 | 129 |
mdiMagnify: mdiMagnify, |
122 | 130 |
mdiWindowClose: mdiWindowClose, |
123 | 131 |
showModal: false, |
124 | 132 |
searchOpen: false, |
133 |
+ |
|
134 |
+ selectedClass: "", |
|
135 |
+ |
|
136 |
+ students: [], |
|
137 |
+ |
|
138 |
+ currentPage: 1, |
|
139 |
+ pageSize: 10, |
|
140 |
+ totalStudents: 0, |
|
125 | 141 |
} |
126 | 142 |
}, |
127 | 143 |
methods: { |
144 |
+ selectClass(){ |
|
145 |
+ axios({ |
|
146 |
+ url: "/classes/selectClass.json", |
|
147 |
+ method: "post", |
|
148 |
+ headers: { |
|
149 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
150 |
+ }, |
|
151 |
+ data: { |
|
152 |
+ userId: "2" |
|
153 |
+ }, |
|
154 |
+ }) |
|
155 |
+ .then((res) => { |
|
156 |
+ if (res.data.status === "success") { |
|
157 |
+ console.log("classesList - response(조회) : ", res.data.data); |
|
158 |
+ this.classesList = res.data.data; |
|
159 |
+ } else { |
|
160 |
+ console.log("조회에 실패했습니다: ", res.data); |
|
161 |
+ alert("조회에 실패했습니다.") |
|
162 |
+ } |
|
163 |
+ }).catch((err) => { |
|
164 |
+ console.log("classesList - error(조회) : ", err); |
|
165 |
+ alert("조회에 오류가 발생했습니다."); |
|
166 |
+ }); |
|
167 |
+ }, |
|
168 |
+ |
|
169 |
+ fetchStudents() { |
|
170 |
+ const idx = (this.currentPage - 1) * this.pageSize; |
|
171 |
+ axios({ |
|
172 |
+ url: "/userclass/find.json", |
|
173 |
+ method: "post", |
|
174 |
+ headers: { |
|
175 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
176 |
+ }, |
|
177 |
+ data: { |
|
178 |
+ "pageSize": this.pageSize, |
|
179 |
+ "startIndex": idx, |
|
180 |
+ "sclsId": this.selectedClass |
|
181 |
+ }, |
|
182 |
+ }) |
|
183 |
+ .then(response => { |
|
184 |
+ console.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>",response.data.students); |
|
185 |
+ this.students = response.data.students; |
|
186 |
+ this.totalStudents = response.data.totalStudent; |
|
187 |
+ }) |
|
188 |
+ .catch(error => { |
|
189 |
+ console.error("fetchStudents - error: ", error); |
|
190 |
+ alert("조회 중 오류가 발생했습니다."); |
|
191 |
+ }); |
|
192 |
+ }, |
|
193 |
+ |
|
194 |
+ changePage(page) { |
|
195 |
+ if (page > 0 && page <= this.totalPages) { |
|
196 |
+ this.currentPage = page; |
|
197 |
+ this.fetchStudents(); |
|
198 |
+ } |
|
199 |
+ }, |
|
200 |
+ |
|
128 | 201 |
goToPage(page) { |
129 | 202 |
this.$router.push({ name: page }); |
130 | 203 |
}, |
... | ... | @@ -158,13 +231,17 @@ |
158 | 231 |
|
159 | 232 |
}, |
160 | 233 |
computed: { |
161 |
- |
|
234 |
+ totalPages() { |
|
235 |
+ console.log("totalPages@@@@@@@@@@@@@@@@@@@@@@@") |
|
236 |
+ return Math.ceil(this.totalStudents / this.pageSize); |
|
237 |
+ } |
|
162 | 238 |
}, |
163 | 239 |
components: { |
164 | 240 |
SvgIcon |
165 | 241 |
}, |
166 | 242 |
mounted() { |
167 | 243 |
console.log('Main2 mounted'); |
244 |
+ this.selectClass(); |
|
168 | 245 |
} |
169 | 246 |
} |
170 | 247 |
</script>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/teacher/TextList.vue
+++ client/views/pages/teacher/TextList.vue
... | ... | @@ -122,6 +122,7 @@ |
122 | 122 |
}, |
123 | 123 |
selectUnit(unitId) { |
124 | 124 |
this.selectedUnit = unitId; |
125 |
+ this.currentPage = 1; |
|
125 | 126 |
this.fetchData(); |
126 | 127 |
}, |
127 | 128 |
search() { |
... | ... | @@ -151,6 +152,7 @@ |
151 | 152 |
}) |
152 | 153 |
.then(response => { |
153 | 154 |
this.posts = response.data.list; |
155 |
+ console.log(response.data.totalText); |
|
154 | 156 |
if (!this.searching || this.keyword === "") { |
155 | 157 |
this.totalPosts = response.data.totalText; |
156 | 158 |
} else if (this.searching) { |
--- client/views/pages/teacher/textbook.vue
+++ client/views/pages/teacher/textbook.vue
... | ... | @@ -33,9 +33,9 @@ |
33 | 33 |
</div> |
34 | 34 |
<div class="search-wrap mb30"> |
35 | 35 |
<input type="text" class="data-wrap" v-model="newBookName" placeholder="교재 이름을 입력하세요"> |
36 |
- <button type="button" title="교재 검색" @click="insertBook"> |
|
36 |
+ <!-- <button type="button" title="교재 검색" @click="insertBook"> |
|
37 | 37 |
<img src="../../../resources/img/look_t.png" alt=""> |
38 |
- </button> |
|
38 |
+ </button> --> |
|
39 | 39 |
</div> |
40 | 40 |
<div class="flex justify-center"> |
41 | 41 |
<button type="button" title="취소" class="new-btn mr10" @click="closeBtn"> |
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?