

240807 박세훈 학생 공지 알람 추가 ui 수정 필요
@bfdcc335b2bb2231ebcbd3a8d1b1101498f9c15e
--- client/views/layout/Header.vue
+++ client/views/layout/Header.vue
... | ... | @@ -1,116 +1,220 @@ |
1 | 1 |
<template> |
2 |
- <div class="header flex justify-end"> |
|
3 |
- <img src="../../resources/img/setting.png" alt=""> |
|
4 |
- <div class="notice" @click="buttonSearch"><img src="../../resources/img/icon2.png" alt=""> |
|
5 |
- <p>1</p> |
|
6 |
- </div> |
|
7 |
- <img src="../../resources/img/img03.png" alt=""> |
|
8 |
- <div class="popup-wrap" v-show="searchOpen"> |
|
9 |
- <div class="popup-box "> |
|
10 |
- <div class="flex mb10 justify-between"> |
|
11 |
- <p class="popup-title">알림</p> |
|
12 |
- <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
13 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
14 |
- </button> |
|
15 |
- </div> |
|
16 |
- <article class="flex justify-between mt20"> |
|
17 |
- <img style="width: fit-content;" src="../../resources/img/img200_13p.png" alt=""> |
|
18 |
- <p class="title1 ml20" style="width: 60%;">1반친구들</p> |
|
19 |
- <button @click="buttonSearch2" type="button" title="글쓰기" class="new-btn"> |
|
20 |
- 자세히 보기 |
|
21 |
- </button> |
|
22 |
- </article> |
|
23 |
- </div> |
|
24 |
- </div> |
|
25 |
- <div class="popup-wrap popup2" v-show="searchOpen2"> |
|
26 |
- <div class="popup-box "> |
|
27 |
- <div class="flex mb10 justify-between"> |
|
28 |
- <p class="popup-title">알림 자세히 보기</p> |
|
29 |
- <button type="button" class="popup-close-btn" @click="closeBtn2"> |
|
30 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
31 |
- </button> |
|
32 |
- </div> |
|
33 |
- <div class="board-wrap"> |
|
34 |
- <div class="flex align-center"> |
|
35 |
- <label for="" class="title2">제목</label> |
|
36 |
- <input type="text" class="data-wrap"> |
|
37 |
- </div> |
|
38 |
- <hr> |
|
39 |
- <textarea name="" id=""></textarea> |
|
40 |
- |
|
41 |
- </div> |
|
42 |
- <div class="flex justify-center mt20"> |
|
43 |
- <button type="button" title="확인" class="new-btn"> |
|
44 |
- 확인 |
|
45 |
- </button> |
|
46 |
- </div> |
|
47 |
- </div> |
|
48 |
- </div> |
|
2 |
+ <div class="header flex justify-end"> |
|
3 |
+ <img src="../../resources/img/setting.png" alt="" /> |
|
4 |
+ <div class="notice" @click="buttonSearch"> |
|
5 |
+ <img src="../../resources/img/icon2.png" alt="" /> |
|
6 |
+ <p>{{ unCheck }}</p> |
|
49 | 7 |
</div> |
50 |
- |
|
8 |
+ <img src="../../resources/img/img03.png" alt="" /> |
|
9 |
+ <div class="popup-wrap" v-show="searchOpen"> |
|
10 |
+ <div class="popup-box"> |
|
11 |
+ <div class="flex mb10 justify-between"> |
|
12 |
+ <p class="popup-title">알림</p> |
|
13 |
+ <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
14 |
+ <svg-icon |
|
15 |
+ type="mdi" |
|
16 |
+ :path="mdiWindowClose" |
|
17 |
+ class="close-btn" |
|
18 |
+ ></svg-icon> |
|
19 |
+ </button> |
|
20 |
+ </div> |
|
21 |
+ <article |
|
22 |
+ class="flex justify-between mt20" |
|
23 |
+ v-for="(item, index) in dataList" |
|
24 |
+ :key="item.id" |
|
25 |
+ :class="{ 'selected-row': selectedRow == item.dataList }" |
|
26 |
+ > |
|
27 |
+ <img |
|
28 |
+ style="width: fit-content" |
|
29 |
+ src="../../resources/img/img200_13p.png" |
|
30 |
+ alt="" |
|
31 |
+ /> |
|
32 |
+ <p class="title1 ml20" style="width: 60%">{{ item.bbsTtl }}</p> |
|
33 |
+ <button |
|
34 |
+ @click="buttonSearch2(item)" |
|
35 |
+ type="button" |
|
36 |
+ title="글쓰기" |
|
37 |
+ class="new-btn" |
|
38 |
+ > |
|
39 |
+ 자세히 보기 |
|
40 |
+ </button> |
|
41 |
+ </article> |
|
42 |
+ <article |
|
43 |
+ class="table-pagination flex justify-center align-center mb20 mt30" |
|
44 |
+ style="gap: 10px" |
|
45 |
+ > |
|
46 |
+ <button @click="previousPage" :disabled="page === 1">이전</button> |
|
47 |
+ <button class="selected-btn">{{ page }}</button> |
|
48 |
+ <button @click="nextPage" :disabled="page === totalPages"> |
|
49 |
+ 다음 |
|
50 |
+ </button> |
|
51 |
+ </article> |
|
52 |
+ </div> |
|
53 |
+ </div> |
|
54 |
+ <div class="popup-wrap popup2" v-show="searchOpen2"> |
|
55 |
+ <div class="popup-box"> |
|
56 |
+ <div class="flex mb10 justify-between"> |
|
57 |
+ <p class="popup-title">알림 자세히 보기</p> |
|
58 |
+ <button type="button" class="popup-close-btn" @click="closeBtn2"> |
|
59 |
+ <svg-icon |
|
60 |
+ type="mdi" |
|
61 |
+ :path="mdiWindowClose" |
|
62 |
+ class="close-btn" |
|
63 |
+ ></svg-icon> |
|
64 |
+ </button> |
|
65 |
+ </div> |
|
66 |
+ <div class="board-wrap"> |
|
67 |
+ <div class="flex align-center"> |
|
68 |
+ <label for="" class="title2">{{ boardData.bbsTtl }}</label> |
|
69 |
+ </div> |
|
70 |
+ <hr /> |
|
71 |
+ <textarea readonly name="" id="">{{ boardData.bbsCnt }}</textarea> |
|
72 |
+ </div> |
|
73 |
+ <div class="flex justify-center mt20"> |
|
74 |
+ <button type="button" title="확인" class="new-btn" @click="closeBtn2"> |
|
75 |
+ 확인 |
|
76 |
+ </button> |
|
77 |
+ </div> |
|
78 |
+ </div> |
|
79 |
+ </div> |
|
80 |
+ </div> |
|
51 | 81 |
</template> |
52 | 82 |
|
53 | 83 |
<script> |
54 |
-import SvgIcon from '@jamescoyle/vue-icon'; |
|
55 |
-import { mdiMagnify, mdiWindowClose } from '@mdi/js'; |
|
84 |
+import SvgIcon from "@jamescoyle/vue-icon"; |
|
85 |
+import { mdiMagnify, mdiWindowClose } from "@mdi/js"; |
|
86 |
+import axios from "axios"; |
|
56 | 87 |
export default { |
57 |
- data() { |
|
58 |
- return { |
|
59 |
- mdiWindowClose: mdiWindowClose, |
|
60 |
- showModal: false, |
|
61 |
- searchOpen: false, |
|
62 |
- searchOpen2: false, |
|
63 |
- } |
|
64 |
- }, |
|
65 |
- methods: { |
|
66 |
- closeModal() { |
|
67 |
- this.showModal = false; |
|
68 |
- }, |
|
69 |
- buttonSearch() { |
|
70 |
- this.searchOpen = true; |
|
71 |
- }, |
|
72 |
- buttonSearch2() { |
|
73 |
- this.searchOpen2 = true; |
|
74 |
- }, |
|
75 |
- closeBtn() { |
|
76 |
- this.searchOpen = false; |
|
88 |
+ data() { |
|
89 |
+ return { |
|
90 |
+ mdiWindowClose: mdiWindowClose, |
|
91 |
+ showModal: false, |
|
92 |
+ searchOpen: false, |
|
93 |
+ searchOpen2: false, |
|
77 | 94 |
|
95 |
+ // 게시글 정보 |
|
96 |
+ dataList: [], |
|
97 |
+ totalBoard: null, |
|
98 |
+ selectedRow: "", |
|
99 |
+ unCheck: null, |
|
100 |
+ |
|
101 |
+ boardData: [], |
|
102 |
+ |
|
103 |
+ // 페이징 정보 |
|
104 |
+ page: 1, |
|
105 |
+ pageSize: 3, |
|
106 |
+ totalpages: null, |
|
107 |
+ |
|
108 |
+ // 사용자 정보 |
|
109 |
+ userId: "USID_000000000000002", |
|
110 |
+ stdId: "", |
|
111 |
+ }; |
|
112 |
+ }, |
|
113 |
+ methods: { |
|
114 |
+ closeModal() { |
|
115 |
+ this.showModal = false; |
|
116 |
+ }, |
|
117 |
+ buttonSearch() { |
|
118 |
+ this.searchOpen = true; |
|
119 |
+ }, |
|
120 |
+ buttonSearch2(item) { |
|
121 |
+ const vm = this; |
|
122 |
+ this.searchOpen2 = true; |
|
123 |
+ this.boardData = item; |
|
124 |
+ |
|
125 |
+ axios({ |
|
126 |
+ url: "/board/boardStudentCheck.json", |
|
127 |
+ method: "post", |
|
128 |
+ headers: { |
|
129 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
78 | 130 |
}, |
79 |
- closeBtn2() { |
|
80 |
- this.searchOpen2 = false; |
|
81 |
- |
|
131 |
+ data: { |
|
132 |
+ bbsId: item.bbsId, |
|
133 |
+ stdId: vm.stdId, |
|
82 | 134 |
}, |
135 |
+ }) |
|
136 |
+ .then(function (res) { |
|
137 |
+ vm.boardList(); |
|
138 |
+ }) |
|
139 |
+ .catch(function (error) { |
|
140 |
+ console.log("result - error : ", error); |
|
141 |
+ }); |
|
83 | 142 |
}, |
84 |
- watch: { |
|
143 |
+ closeBtn() { |
|
144 |
+ this.searchOpen = false; |
|
145 |
+ }, |
|
146 |
+ closeBtn2() { |
|
147 |
+ this.searchOpen2 = false; |
|
148 |
+ }, |
|
85 | 149 |
|
150 |
+ // 공지 조회 |
|
151 |
+ boardList() { |
|
152 |
+ const vm = this; |
|
153 |
+ axios({ |
|
154 |
+ url: "/board/boardStudentList.json", |
|
155 |
+ method: "post", |
|
156 |
+ headers: { |
|
157 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
158 |
+ }, |
|
159 |
+ data: { page: vm.page, pageSize: vm.pageSize, userId: vm.userId }, |
|
160 |
+ }) |
|
161 |
+ .then(function (res) { |
|
162 |
+ vm.dataList = res.data.result[0].boardClass[0].board; |
|
163 |
+ vm.userNm = res.data.result[0].userNm; |
|
164 |
+ vm.userId = res.data.result[0].userId; |
|
165 |
+ vm.unCheck = res.data.unCheck; |
|
166 |
+ vm.stdId = |
|
167 |
+ res.data.result[0].boardClass[0].board[0].boardStudent[0].stdId; |
|
168 |
+ vm.totalBoard = res.data.totalBoard; |
|
169 |
+ vm.totalPages = Math.ceil(vm.totalBoard / vm.pageSize); |
|
170 |
+ }) |
|
171 |
+ .catch(function (error) { |
|
172 |
+ console.log("result - error : ", error); |
|
173 |
+ alert("게시물 조회 실패"); |
|
174 |
+ }); |
|
86 | 175 |
}, |
87 |
- computed: { |
|
88 | 176 |
|
177 |
+ previousPage() { |
|
178 |
+ if (this.page > 1) { |
|
179 |
+ this.page -= 1; |
|
180 |
+ this.boardList(); |
|
181 |
+ } |
|
89 | 182 |
}, |
90 |
- components: { |
|
91 |
- SvgIcon |
|
183 |
+ |
|
184 |
+ nextPage() { |
|
185 |
+ if (this.page < this.totalPages) { |
|
186 |
+ this.page += 1; |
|
187 |
+ this.boardList(); |
|
188 |
+ } |
|
92 | 189 |
}, |
93 |
- mounted() { |
|
94 |
- console.log('Header mounted'); |
|
95 |
- } |
|
96 |
-} |
|
190 |
+ }, |
|
191 |
+ watch: {}, |
|
192 |
+ computed: {}, |
|
193 |
+ components: { |
|
194 |
+ SvgIcon, |
|
195 |
+ }, |
|
196 |
+ mounted() { |
|
197 |
+ console.log("Header mounted"); |
|
198 |
+ this.boardList(); |
|
199 |
+ }, |
|
200 |
+}; |
|
97 | 201 |
</script> |
98 | 202 |
<style scoped> |
99 | 203 |
.popup-wrap { |
100 |
- position: fixed; |
|
101 |
- background-color: transparent; |
|
102 |
- width: fit-content; |
|
103 |
- height: fit-content; |
|
104 |
- z-index: 10; |
|
204 |
+ position: fixed; |
|
205 |
+ background-color: transparent; |
|
206 |
+ width: fit-content; |
|
207 |
+ height: fit-content; |
|
208 |
+ z-index: 10; |
|
105 | 209 |
} |
106 | 210 |
|
107 | 211 |
.popup-box { |
108 |
- top: 164px; |
|
109 |
- left: 62%; |
|
212 |
+ top: 164px; |
|
213 |
+ left: 62%; |
|
110 | 214 |
} |
111 | 215 |
|
112 | 216 |
.popup2 .popup-box { |
113 |
- top: 450px; |
|
114 |
- left: 38%; |
|
217 |
+ top: 450px; |
|
218 |
+ left: 38%; |
|
115 | 219 |
} |
116 |
-</style>(No newline at end of file) |
|
220 |
+</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?