PsHooN7979
08-09
240809 박세훈 반 아이디 세션 스토리지로 전달기능 추가
@22fc379acf4ea671be86a6fa7c8bce6a1a21f77a
--- client/views/pages/teacher/Board.vue
+++ client/views/pages/teacher/Board.vue
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 |
<td>{{ item.bbsTtl }}</td> |
45 | 45 |
<td>{{ item.bbsCls }}</td> |
46 | 46 |
<td>{{ userNm }}</td> |
47 |
- <td>{{ item.bbsTm }}</td> |
|
47 |
+ <td>{{ item.bbsTm.substr(0, 16) }}</td> |
|
48 | 48 |
</tr> |
49 | 49 |
</tbody> |
50 | 50 |
</table> |
... | ... | @@ -94,13 +94,14 @@ |
94 | 94 |
dataList: [], |
95 | 95 |
totalPosts: 0, |
96 | 96 |
selectedRow: "", |
97 |
+ bbsTm: "", |
|
97 | 98 |
|
98 | 99 |
// 페이징 |
99 | 100 |
currentPage: 0, |
100 | 101 |
itemsPerPage: 8, |
101 | 102 |
|
102 | 103 |
// 반 아이디 (추후 세션에서 받는걸로 수정) |
103 |
- sclsId: "1", |
|
104 |
+ sclsId: "", |
|
104 | 105 |
classList: [], |
105 | 106 |
|
106 | 107 |
userId: "", |
... | ... | @@ -133,6 +134,7 @@ |
133 | 134 |
// 게시글 전체 조회 |
134 | 135 |
boardList() { |
135 | 136 |
const vm = this; |
137 |
+ vm.sclsId = JSON.parse(sessionStorage.getItem("sclsId")); |
|
136 | 138 |
axios({ |
137 | 139 |
url: "/board/findAll.json", |
138 | 140 |
method: "post", |
... | ... | @@ -155,6 +157,7 @@ |
155 | 157 |
vm.selectClass(); |
156 | 158 |
sessionStorage.removeItem("selectedBoardList"); |
157 | 159 |
sessionStorage.removeItem("file"); |
160 |
+ |
|
158 | 161 |
console.log(vm.userId); |
159 | 162 |
}) |
160 | 163 |
.catch(function (error) { |
... | ... | @@ -168,9 +171,6 @@ |
168 | 171 |
}, |
169 | 172 |
|
170 | 173 |
// 반 아이디 세션에 저장 |
171 |
- setClassId() { |
|
172 |
- sessionStorage.setItem("sclsId", JSON.stringify(this.sclsId)); |
|
173 |
- }, |
|
174 | 174 |
|
175 | 175 |
// 게시글 검색 |
176 | 176 |
boardDataSearch() { |
--- client/views/pages/teacher/ClassDetail.vue
+++ client/views/pages/teacher/ClassDetail.vue
... | ... | @@ -1,153 +1,161 @@ |
1 | 1 |
<template> |
2 |
- <div class="title-box flex justify-between mb40"> |
|
3 |
- <p class="title">반 관리</p> |
|
2 |
+ <div class="title-box flex justify-between mb40"> |
|
3 |
+ <p class="title">반 관리</p> |
|
4 |
+ </div> |
|
5 |
+ <div class="wrap mb30"> |
|
6 |
+ <div class="flex justify-between mb30 align-center"> |
|
7 |
+ <label for="" class="title1">학습 현황</label> |
|
8 |
+ <div class="look-btn flex align-center" @click="goToPage('Board')"> |
|
9 |
+ <p>자세히 보기</p> |
|
10 |
+ <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon> |
|
11 |
+ </div> |
|
12 |
+ </div> |
|
13 |
+ <div class="table-wrap"> |
|
14 |
+ <table> |
|
15 |
+ <thead> |
|
16 |
+ <td>No.</td> |
|
17 |
+ <td>제목</td> |
|
18 |
+ <td>내용</td> |
|
19 |
+ <td>작성자</td> |
|
20 |
+ <td>등록일</td> |
|
21 |
+ </thead> |
|
22 |
+ <tbody> |
|
23 |
+ <tr> |
|
24 |
+ <td></td> |
|
25 |
+ <td></td> |
|
26 |
+ <td></td> |
|
27 |
+ <td></td> |
|
28 |
+ <td></td> |
|
29 |
+ </tr> |
|
30 |
+ </tbody> |
|
31 |
+ </table> |
|
32 |
+ </div> |
|
33 |
+ </div> |
|
34 |
+ <div class="flex justify-between" style="gap: 30px"> |
|
35 |
+ <div class="wrap mb30"> |
|
36 |
+ <div class="flex justify-between mb30 align-center"> |
|
37 |
+ <label for="" class="title1">학생 목록</label> |
|
38 |
+ <div class="look-btn align-center flex"> |
|
39 |
+ <p>자세히 보기</p> |
|
40 |
+ <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon> |
|
41 |
+ </div> |
|
42 |
+ </div> |
|
43 |
+ <div class="table-wrap"> |
|
44 |
+ <table> |
|
45 |
+ <thead> |
|
46 |
+ <td>No.</td> |
|
47 |
+ <td>이름</td> |
|
48 |
+ <td>학년</td> |
|
49 |
+ <td>반</td> |
|
50 |
+ </thead> |
|
51 |
+ <tbody> |
|
52 |
+ <tr> |
|
53 |
+ <td></td> |
|
54 |
+ <td></td> |
|
55 |
+ <td></td> |
|
56 |
+ <td></td> |
|
57 |
+ </tr> |
|
58 |
+ </tbody> |
|
59 |
+ </table> |
|
60 |
+ </div> |
|
4 | 61 |
</div> |
5 | 62 |
<div class="wrap mb30"> |
6 |
- <div class="flex justify-between mb30 align-center"> |
|
7 |
- <label for="" class="title1">학습 현황</label> |
|
8 |
- <div class="look-btn flex align-center"> |
|
9 |
- <p>자세히 보기 </p> |
|
10 |
- <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon> |
|
63 |
+ <div class="flex justify-between mb30 align-center"> |
|
64 |
+ <label for="" class="title1">책 </label> |
|
65 |
+ <div class="align-center flex look-btn"> |
|
66 |
+ <p>자세히 보기</p> |
|
67 |
+ <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon> |
|
68 |
+ </div> |
|
69 |
+ </div> |
|
70 |
+ <div class="flex" style="gap: 50px"> |
|
71 |
+ <div class="textbook"> |
|
72 |
+ <div class="box" style="gap: 10px"></div> |
|
73 |
+ <div class="text"> |
|
74 |
+ <p class="title1" style="color: #fff">A 교재</p> |
|
75 |
+ <div |
|
76 |
+ class="btnGroup mt15 flex align-center justify-end" |
|
77 |
+ style="gap: 10px" |
|
78 |
+ > |
|
79 |
+ <button>수정</button> |
|
80 |
+ <p>|</p> |
|
81 |
+ <button @click="showConfirm('delete')">삭제</button> |
|
11 | 82 |
</div> |
83 |
+ </div> |
|
12 | 84 |
</div> |
13 |
- <div class="table-wrap"> |
|
14 |
- <table> |
|
15 |
- <thead> |
|
16 |
- <td>No.</td> |
|
17 |
- <td>제목</td> |
|
18 |
- <td>내용</td> |
|
19 |
- <td>작성자</td> |
|
20 |
- <td>등록일</td> |
|
21 |
- </thead> |
|
22 |
- <tbody> |
|
23 |
- <tr> |
|
24 |
- <td></td> |
|
25 |
- <td></td> |
|
26 |
- <td></td> |
|
27 |
- <td></td> |
|
28 |
- <td></td> |
|
29 |
- </tr> |
|
30 |
- </tbody> |
|
31 |
- </table> |
|
85 |
+ <div class="textbook"> |
|
86 |
+ <div class="box" style="gap: 10px"></div> |
|
87 |
+ <div class="text"> |
|
88 |
+ <p class="title1" style="color: #fff">A 교재</p> |
|
89 |
+ <div |
|
90 |
+ class="btnGroup mt15 flex align-center justify-end" |
|
91 |
+ style="gap: 10px" |
|
92 |
+ > |
|
93 |
+ <button>수정</button> |
|
94 |
+ <p>|</p> |
|
95 |
+ <button @click="showConfirm('delete')">삭제</button> |
|
96 |
+ </div> |
|
97 |
+ </div> |
|
32 | 98 |
</div> |
99 |
+ </div> |
|
33 | 100 |
</div> |
34 |
- <div class="flex justify-between" style="gap: 30px;"> |
|
35 |
- <div class="wrap mb30"> |
|
36 |
- <div class="flex justify-between mb30 align-center"> |
|
37 |
- <label for="" class="title1">학생 목록</label> |
|
38 |
- <div class="look-btn align-center flex"> |
|
39 |
- <p>자세히 보기 </p> |
|
40 |
- <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon> |
|
41 |
- </div> |
|
42 |
- </div> |
|
43 |
- <div class="table-wrap"> |
|
44 |
- <table> |
|
45 |
- <thead> |
|
46 |
- <td>No.</td> |
|
47 |
- <td>이름</td> |
|
48 |
- <td>학년</td> |
|
49 |
- <td>반</td> |
|
50 |
- </thead> |
|
51 |
- <tbody> |
|
52 |
- <tr> |
|
53 |
- <td></td> |
|
54 |
- <td></td> |
|
55 |
- <td></td> |
|
56 |
- <td></td> |
|
57 |
- </tr> |
|
58 |
- </tbody> |
|
59 |
- </table> |
|
60 |
- </div> |
|
61 |
- </div> |
|
62 |
- <div class="wrap mb30"> |
|
63 |
- <div class="flex justify-between mb30 align-center"> |
|
64 |
- <label for="" class="title1">책 </label> |
|
65 |
- <div class="align-center flex look-btn"><p>자세히 보기 </p><svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon></div> |
|
66 |
- </div> |
|
67 |
- <div class=" flex " style="gap: 50px;"> |
|
68 |
- <div class="textbook"> |
|
69 |
- <div class="box " style="gap: 10px;"> |
|
70 |
- </div> |
|
71 |
- <div class="text "> |
|
72 |
- <p class="title1" style="color: #fff;">A 교재</p> |
|
73 |
- <div class="btnGroup mt15 flex align-center justify-end" style="gap: 10px;"> |
|
74 |
- <button>수정</button><p>|</p> |
|
75 |
- <button @click="showConfirm('delete')">삭제</button> |
|
76 |
- </div> |
|
77 |
- </div> |
|
78 |
- </div> |
|
79 |
- <div class="textbook"> |
|
80 |
- <div class="box " style="gap: 10px;"> |
|
81 |
- </div> |
|
82 |
- <div class="text "> |
|
83 |
- <p class="title1" style="color: #fff;">A 교재</p> |
|
84 |
- <div class="btnGroup mt15 flex align-center justify-end" style="gap: 10px;"> |
|
85 |
- <button>수정</button><p>|</p> |
|
86 |
- <button @click="showConfirm('delete')">삭제</button> |
|
87 |
- </div> |
|
88 |
- </div> |
|
89 |
- </div> |
|
90 |
- </div> |
|
91 |
- </div> |
|
92 |
- </div> |
|
101 |
+ </div> |
|
93 | 102 |
</template> |
94 | 103 |
|
95 | 104 |
<script> |
96 |
-import SvgIcon from '@jamescoyle/vue-icon'; |
|
97 |
-import { mdiMagnify, } from '@mdi/js'; |
|
98 |
-import { mdilArrowRight } from '@mdi/light-js'; |
|
99 |
-import ProgressBar from '../../component/ProgressBar.vue'; |
|
100 |
- |
|
105 |
+import SvgIcon from "@jamescoyle/vue-icon"; |
|
106 |
+import { mdiMagnify } from "@mdi/js"; |
|
107 |
+import { mdilArrowRight } from "@mdi/light-js"; |
|
108 |
+import ProgressBar from "../../component/ProgressBar.vue"; |
|
101 | 109 |
|
102 | 110 |
export default { |
103 |
- data() { |
|
104 |
- return { |
|
105 |
- mdiMagnify: mdiMagnify, |
|
106 |
- mdilArrowRight: mdilArrowRight, |
|
107 |
- timer: "00:00", |
|
108 |
- progress: 20, |
|
111 |
+ data() { |
|
112 |
+ return { |
|
113 |
+ mdiMagnify: mdiMagnify, |
|
114 |
+ mdilArrowRight: mdilArrowRight, |
|
115 |
+ timer: "00:00", |
|
116 |
+ progress: 20, |
|
109 | 117 |
|
110 |
- // 교사 홈페이지에서 쿼리 파라미터로부터 전달받은 선택된 반의 아이디 |
|
111 |
- selectedClassId : this.$route.query.sclsId |
|
112 |
- } |
|
118 |
+ // 교사 홈페이지에서 쿼리 파라미터로부터 전달받은 선택된 반의 아이디 |
|
119 |
+ selectedClassId: this.$route.query.sclsId, |
|
120 |
+ }; |
|
121 |
+ }, |
|
122 |
+ methods: { |
|
123 |
+ goToPage(page) { |
|
124 |
+ this.$router.push({ name: page }); |
|
113 | 125 |
}, |
114 |
- methods: { |
|
115 |
- goToPage(page) { |
|
116 |
- this.$router.push({ name: page }); |
|
117 |
- }, |
|
118 |
- increaseProgress() { |
|
119 |
- if (this.progress < 100) { |
|
120 |
- this.progress += 10; |
|
121 |
- } |
|
122 |
- }, |
|
123 |
- showConfirm(type) { |
|
124 |
- let message = ''; |
|
125 |
- if (type === 'cancel') { |
|
126 |
- message = '삭제하시겠습니까?'; |
|
127 |
- } else if (type === 'reset') { |
|
128 |
- message = '초기화하시겠습니까?'; |
|
129 |
- } else if (type === 'save') { |
|
130 |
- message = '등록하시겠습니까?'; |
|
131 |
- } |
|
126 |
+ increaseProgress() { |
|
127 |
+ if (this.progress < 100) { |
|
128 |
+ this.progress += 10; |
|
129 |
+ } |
|
130 |
+ }, |
|
131 |
+ showConfirm(type) { |
|
132 |
+ let message = ""; |
|
133 |
+ if (type === "cancel") { |
|
134 |
+ message = "삭제하시겠습니까?"; |
|
135 |
+ } else if (type === "reset") { |
|
136 |
+ message = "초기화하시겠습니까?"; |
|
137 |
+ } else if (type === "save") { |
|
138 |
+ message = "등록하시겠습니까?"; |
|
139 |
+ } |
|
132 | 140 |
|
133 |
- if (confirm(message)) { |
|
134 |
- this.goBack(); |
|
135 |
- } |
|
136 |
- }, |
|
141 |
+ if (confirm(message)) { |
|
142 |
+ this.goBack(); |
|
143 |
+ } |
|
137 | 144 |
}, |
138 |
- watch: { |
|
139 |
- |
|
145 |
+ setClassId() { |
|
146 |
+ sessionStorage.setItem("sclsId", JSON.stringify(this.selectedClassId)); |
|
140 | 147 |
}, |
141 |
- computed: { |
|
142 |
- |
|
143 |
- }, |
|
144 |
- components: { |
|
145 |
- SvgIcon, |
|
146 |
- ProgressBar |
|
147 |
- }, |
|
148 |
- mounted() { |
|
149 |
- console.log('Main2 mounted'); |
|
150 |
- //console.log(`반 페이지 sclsId(반 아이디) 확인 : ${this.selectedClassId}`); |
|
151 |
- } |
|
152 |
-} |
|
153 |
-</script>(파일 끝에 줄바꿈 문자 없음) |
|
148 |
+ }, |
|
149 |
+ watch: {}, |
|
150 |
+ computed: {}, |
|
151 |
+ components: { |
|
152 |
+ SvgIcon, |
|
153 |
+ ProgressBar, |
|
154 |
+ }, |
|
155 |
+ mounted() { |
|
156 |
+ console.log("Main2 mounted"); |
|
157 |
+ //console.log(`반 페이지 sclsId(반 아이디) 확인 : ${this.selectedClassId}`); |
|
158 |
+ this.setClassId(); |
|
159 |
+ }, |
|
160 |
+}; |
|
161 |
+</script> |
--- client/views/pages/teacher/Home.vue
+++ client/views/pages/teacher/Home.vue
... | ... | @@ -1,268 +1,289 @@ |
1 | 1 |
<template> |
2 |
- <div class="title-box flex justify-between mb40"> |
|
3 |
- <p class="title">홈</p> |
|
4 |
- </div> |
|
5 |
- <div class="content-t"> |
|
6 |
- <div class=" flex " style="gap: 50px;" :style="{flexWrap: 'wrap'}"> |
|
7 |
- <div class="class" v-for="classItem in classesList" :key="classItem.sclsId"> |
|
8 |
- <div class="box gd-col2" style="gap: 10px;" @click="goToPage('ClassDetail', classItem.sclsId)"> |
|
9 |
- <div><img src="../../../resources/img/img176_82t.png" alt=""></div> |
|
10 |
- <div><img src="../../../resources/img/img176_82t.png" alt=""></div> |
|
11 |
- <div><img src="../../../resources/img/img176_82t.png" alt=""></div> |
|
12 |
- <div><img src="../../../resources/img/img176_82t.png" alt=""></div> |
|
13 |
- </div> |
|
14 |
- <div class="text flex justify-between mt20"> |
|
15 |
- <p class="title1">{{ classItem.sclsNm }}</p> |
|
16 |
- <span class="member">{{ classItem. studentCount}}</span> |
|
17 |
- </div> |
|
18 |
- <div class="btnGroup mt15 flex align-center justify-end" style="gap: 10px;"> |
|
19 |
- <button @click="editModeModal(classItem.sclsId)">수정</button> |
|
20 |
- <p>|</p> |
|
21 |
- <button @click="deleteClass(classItem.sclsId)">삭제</button> |
|
22 |
- </div> |
|
23 |
- </div> |
|
24 |
- <div class="textbook-add"> |
|
25 |
- <button @click="addModeModal"><img src="../../../resources/img/btn32_98t_normal.png" alt=""></button> |
|
26 |
- |
|
27 |
- </div> |
|
28 |
- <!-- 팝업창 --> |
|
29 |
- <div v-show="searchOpen" class="popup-wrap"> |
|
30 |
- <div class="popup-box "> |
|
31 |
- <div class="flex justify-between mb30"> |
|
32 |
- <p class="popup-title">반 이름</p> |
|
33 |
- <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
34 |
- <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon> |
|
35 |
- |
|
36 |
- </button> |
|
37 |
- </div> |
|
38 |
- <div class="search-wrap mb30"> |
|
39 |
- <input type="text" v-model="createClassName" class="data-wrap" placeholder=""> |
|
40 |
- <!-- <button type="button" > |
|
2 |
+ <div class="title-box flex justify-between mb40"> |
|
3 |
+ <p class="title">홈</p> |
|
4 |
+ </div> |
|
5 |
+ <div class="content-t"> |
|
6 |
+ <div class="flex" style="gap: 50px" :style="{ flexWrap: 'wrap' }"> |
|
7 |
+ <div |
|
8 |
+ class="class" |
|
9 |
+ v-for="classItem in classesList" |
|
10 |
+ :key="classItem.sclsId" |
|
11 |
+ > |
|
12 |
+ <div |
|
13 |
+ class="box gd-col2" |
|
14 |
+ style="gap: 10px" |
|
15 |
+ @click="goToPage('ClassDetail', classItem.sclsId)" |
|
16 |
+ > |
|
17 |
+ <div><img src="../../../resources/img/img176_82t.png" alt="" /></div> |
|
18 |
+ <div><img src="../../../resources/img/img176_82t.png" alt="" /></div> |
|
19 |
+ <div><img src="../../../resources/img/img176_82t.png" alt="" /></div> |
|
20 |
+ <div><img src="../../../resources/img/img176_82t.png" alt="" /></div> |
|
21 |
+ </div> |
|
22 |
+ <div class="text flex justify-between mt20"> |
|
23 |
+ <p class="title1">{{ classItem.sclsNm }}</p> |
|
24 |
+ <span class="member">{{ classItem.studentCount }}</span> |
|
25 |
+ </div> |
|
26 |
+ <div |
|
27 |
+ class="btnGroup mt15 flex align-center justify-end" |
|
28 |
+ style="gap: 10px" |
|
29 |
+ > |
|
30 |
+ <button @click="editModeModal(classItem.sclsId)">수정</button> |
|
31 |
+ <p>|</p> |
|
32 |
+ <button @click="deleteClass(classItem.sclsId)">삭제</button> |
|
33 |
+ </div> |
|
34 |
+ </div> |
|
35 |
+ <div class="textbook-add"> |
|
36 |
+ <button @click="addModeModal"> |
|
37 |
+ <img src="../../../resources/img/btn32_98t_normal.png" alt="" /> |
|
38 |
+ </button> |
|
39 |
+ </div> |
|
40 |
+ <!-- 팝업창 --> |
|
41 |
+ <div v-show="searchOpen" class="popup-wrap"> |
|
42 |
+ <div class="popup-box"> |
|
43 |
+ <div class="flex justify-between mb30"> |
|
44 |
+ <p class="popup-title">반 이름</p> |
|
45 |
+ <button type="button" class="popup-close-btn" @click="closeBtn"> |
|
46 |
+ <svg-icon |
|
47 |
+ type="mdi" |
|
48 |
+ :path="mdiWindowClose" |
|
49 |
+ class="close-btn" |
|
50 |
+ ></svg-icon> |
|
51 |
+ </button> |
|
52 |
+ </div> |
|
53 |
+ <div class="search-wrap mb30"> |
|
54 |
+ <input |
|
55 |
+ type="text" |
|
56 |
+ v-model="createClassName" |
|
57 |
+ class="data-wrap" |
|
58 |
+ placeholder="" |
|
59 |
+ /> |
|
60 |
+ <!-- <button type="button" > |
|
41 | 61 |
<img src="../../../resources/img/look_t.png" alt=""> |
42 | 62 |
</button> --> |
43 |
- </div> |
|
44 |
- <div class="flex justify-center "> |
|
45 |
- <button type="button" title="글쓰기" class="new-btn mr10" @click="closeBtn"> |
|
46 |
- 취소 |
|
47 |
- </button> |
|
48 |
- <button type="button" title="등록" class="new-btn" @click="isEditMode ? updateClass() : insertClass()"> |
|
49 |
- {{ isEditMode ? '수정' : '등록' }} |
|
50 |
- </button> |
|
51 |
- </div> |
|
52 |
- </div> |
|
53 |
- </div> |
|
63 |
+ </div> |
|
64 |
+ <div class="flex justify-center"> |
|
65 |
+ <button |
|
66 |
+ type="button" |
|
67 |
+ title="글쓰기" |
|
68 |
+ class="new-btn mr10" |
|
69 |
+ @click="closeBtn" |
|
70 |
+ > |
|
71 |
+ 취소 |
|
72 |
+ </button> |
|
73 |
+ <button |
|
74 |
+ type="button" |
|
75 |
+ title="등록" |
|
76 |
+ class="new-btn" |
|
77 |
+ @click="isEditMode ? updateClass() : insertClass()" |
|
78 |
+ > |
|
79 |
+ {{ isEditMode ? "수정" : "등록" }} |
|
80 |
+ </button> |
|
81 |
+ </div> |
|
54 | 82 |
</div> |
83 |
+ </div> |
|
55 | 84 |
</div> |
85 |
+ </div> |
|
56 | 86 |
</template> |
57 | 87 |
|
58 | 88 |
<script> |
59 |
-import axios from 'axios'; |
|
60 |
-import SvgIcon from '@jamescoyle/vue-icon'; |
|
61 |
-import { mdiMagnify, mdiWindowClose } from '@mdi/js'; |
|
89 |
+import axios from "axios"; |
|
90 |
+import SvgIcon from "@jamescoyle/vue-icon"; |
|
91 |
+import { mdiMagnify, mdiWindowClose } from "@mdi/js"; |
|
62 | 92 |
export default { |
63 |
- data() { |
|
64 |
- return { |
|
65 |
- mdiWindowClose: mdiWindowClose, |
|
66 |
- showModal: false, |
|
67 |
- searchOpen: false, |
|
93 |
+ data() { |
|
94 |
+ return { |
|
95 |
+ mdiWindowClose: mdiWindowClose, |
|
96 |
+ showModal: false, |
|
97 |
+ searchOpen: false, |
|
68 | 98 |
|
69 |
- classesList : [], // 불러온 반 정보 |
|
70 |
- user_id : '2', //유저 아이디 : 현재는 고정 |
|
71 |
- createClassName : "", // 생성 또는 수정할 반 이름 |
|
99 |
+ classesList: [], // 불러온 반 정보 |
|
100 |
+ user_id: "2", //유저 아이디 : 현재는 고정 |
|
101 |
+ createClassName: "", // 생성 또는 수정할 반 이름 |
|
72 | 102 |
|
73 |
- isEditMode: false, // 추가 모드인지 수정 모드인지 구분하는 변수 |
|
74 |
- current_editId : '', // 현재 수정할 반 id |
|
75 |
- } |
|
103 |
+ isEditMode: false, // 추가 모드인지 수정 모드인지 구분하는 변수 |
|
104 |
+ current_editId: "", // 현재 수정할 반 id |
|
105 |
+ }; |
|
106 |
+ }, |
|
107 |
+ methods: { |
|
108 |
+ goToPage(page, sclsId) { |
|
109 |
+ //console.log(`sclsId : ${sclsId}`); // 쿼리 확인 |
|
110 |
+ this.$router.push({ name: page, query: { sclsId: sclsId } }); |
|
76 | 111 |
}, |
77 |
- methods: { |
|
78 |
- |
|
79 |
- goToPage(page, sclsId) { |
|
80 |
- //console.log(`sclsId : ${sclsId}`); // 쿼리 확인 |
|
81 |
- this.$router.push({ name: page , query : {sclsId : sclsId}}); |
|
82 |
- }, |
|
83 |
- closeModal() { |
|
84 |
- this.showModal = false; |
|
85 |
- }, |
|
86 |
- editModeModal(sclsId) { |
|
87 |
- this.searchOpen = true; |
|
88 |
- this.isEditMode = true; // 수정 모드로 설정 |
|
89 |
- this.current_editId = sclsId |
|
90 |
- }, |
|
91 |
- addModeModal() { |
|
92 |
- this.searchOpen = true; |
|
93 |
- this.isEditMode = false; // 추가 모드로 설정 |
|
94 |
- }, |
|
95 |
- closeBtn() { |
|
96 |
- this.searchOpen = false; |
|
97 |
- this.createClassName = ""; // 팝업 닫을 때 반 이름 초기화 |
|
112 |
+ closeModal() { |
|
113 |
+ this.showModal = false; |
|
114 |
+ }, |
|
115 |
+ editModeModal(sclsId) { |
|
116 |
+ this.searchOpen = true; |
|
117 |
+ this.isEditMode = true; // 수정 모드로 설정 |
|
118 |
+ this.current_editId = sclsId; |
|
119 |
+ }, |
|
120 |
+ addModeModal() { |
|
121 |
+ this.searchOpen = true; |
|
122 |
+ this.isEditMode = false; // 추가 모드로 설정 |
|
123 |
+ }, |
|
124 |
+ closeBtn() { |
|
125 |
+ this.searchOpen = false; |
|
126 |
+ this.createClassName = ""; // 팝업 닫을 때 반 이름 초기화 |
|
127 |
+ }, |
|
128 |
+ showConfirm(type, callback) { |
|
129 |
+ let message = ""; |
|
130 |
+ if (type === "delete") { |
|
131 |
+ message = "삭제하시겠습니까?"; |
|
132 |
+ } else if (type === "reset") { |
|
133 |
+ message = "초기화하시겠습니까?"; |
|
134 |
+ } else if (type === "save") { |
|
135 |
+ message = "등록하시겠습니까?"; |
|
136 |
+ } else if (type === "edit") { |
|
137 |
+ message = "수정하시겠습니까?"; |
|
138 |
+ } |
|
98 | 139 |
|
140 |
+ if (confirm(message)) { |
|
141 |
+ if (callback) callback(); // 콜백 함수 호출 |
|
142 |
+ } |
|
143 |
+ }, |
|
144 |
+ // 조회 |
|
145 |
+ selectClass() { |
|
146 |
+ sessionStorage.removeItem("sclsId"); |
|
147 |
+ axios({ |
|
148 |
+ url: "/classes/selectClass.json", |
|
149 |
+ method: "post", |
|
150 |
+ headers: { |
|
151 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
99 | 152 |
}, |
100 |
- showConfirm(type, callback) { |
|
101 |
- let message = ''; |
|
102 |
- if (type === 'delete') { |
|
103 |
- message = '삭제하시겠습니까?'; |
|
104 |
- } else if (type === 'reset') { |
|
105 |
- message = '초기화하시겠습니까?'; |
|
106 |
- } else if (type === 'save') { |
|
107 |
- message = '등록하시겠습니까?'; |
|
108 |
- } else if (type === 'edit'){ |
|
109 |
- message = '수정하시겠습니까?'; |
|
110 |
- } |
|
111 |
- |
|
112 |
- |
|
113 |
- if (confirm(message)) { |
|
114 |
- if (callback) callback(); // 콜백 함수 호출 |
|
115 |
- } |
|
153 |
+ data: { |
|
154 |
+ userId: this.user_id, |
|
116 | 155 |
}, |
117 |
- // 조회 |
|
118 |
- selectClass() { |
|
119 |
- axios({ |
|
120 |
- url: "/classes/selectClass.json", |
|
121 |
- method: "post", |
|
122 |
- headers: { |
|
123 |
- "Content-Type": "application/json; charset=UTF-8", |
|
124 |
- }, |
|
125 |
- data: { |
|
126 |
- userId: this.user_id |
|
127 |
- }, |
|
128 |
- }) |
|
156 |
+ }) |
|
157 |
+ .then((res) => { |
|
158 |
+ if (res.data.status === "success") { |
|
159 |
+ console.log("classesList - response(조회) : ", res.data.data); |
|
160 |
+ this.classesList = res.data.data; |
|
161 |
+ } else { |
|
162 |
+ console.log("조회에 실패했습니다: ", res.data); |
|
163 |
+ alert("조회에 실패했습니다."); |
|
164 |
+ } |
|
165 |
+ }) |
|
166 |
+ .catch((err) => { |
|
167 |
+ console.log("classesList - error(조회) : ", err); |
|
168 |
+ alert("조회에 오류가 발생했습니다."); |
|
169 |
+ }); |
|
170 |
+ }, |
|
171 |
+ // 추가 |
|
172 |
+ insertClass() { |
|
173 |
+ if (this.createClassName.trim() === "") { |
|
174 |
+ alert("반 이름을 입력해주세요"); |
|
175 |
+ } else { |
|
176 |
+ this.showConfirm("save", () => { |
|
177 |
+ axios({ |
|
178 |
+ url: "/classes/insertClass.json", |
|
179 |
+ method: "post", |
|
180 |
+ headers: { |
|
181 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
182 |
+ }, |
|
183 |
+ data: { |
|
184 |
+ userId: this.user_id, |
|
185 |
+ sclsNm: this.createClassName, |
|
186 |
+ }, |
|
187 |
+ }) |
|
129 | 188 |
.then((res) => { |
130 |
- if (res.data.status === "success") { |
|
131 |
- console.log("classesList - response(조회) : ", res.data.data); |
|
132 |
- this.classesList = res.data.data; |
|
133 |
- } else { |
|
134 |
- console.log("조회에 실패했습니다: ", res.data); |
|
135 |
- alert("조회에 실패했습니다."); |
|
136 |
- } |
|
189 |
+ if (res.data.status === "success") { |
|
190 |
+ console.log("classesList - response(추가) : ", res.data.data); |
|
191 |
+ this.selectClass(); |
|
192 |
+ this.createClassName = ""; // 반 이름 초기화 |
|
193 |
+ this.closeBtn(); // 생성 모달 닫기 |
|
194 |
+ } else { |
|
195 |
+ console.log("추가에 실패했습니다: ", res.data); |
|
196 |
+ alert("추가에 실패했습니다."); |
|
197 |
+ } |
|
137 | 198 |
}) |
138 | 199 |
.catch((err) => { |
139 |
- console.log("classesList - error(조회) : ", err); |
|
140 |
- alert("조회에 오류가 발생했습니다."); |
|
200 |
+ console.log("classesList - error(추가) : ", err); |
|
201 |
+ alert("추가에 오류가 발생했습니다."); |
|
141 | 202 |
}); |
142 |
- }, |
|
143 |
- // 추가 |
|
144 |
- insertClass() { |
|
145 |
- if(this.createClassName.trim() === ""){ |
|
146 |
- alert("반 이름을 입력해주세요"); |
|
203 |
+ }); |
|
204 |
+ } |
|
205 |
+ }, |
|
206 |
+ // 삭제 |
|
207 |
+ deleteClass(sclsId) { |
|
208 |
+ this.showConfirm("delete", () => { |
|
209 |
+ axios({ |
|
210 |
+ url: "/classes/deleteClass.json", |
|
211 |
+ method: "post", |
|
212 |
+ headers: { |
|
213 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
214 |
+ }, |
|
215 |
+ data: { |
|
216 |
+ sclsId: sclsId, |
|
217 |
+ }, |
|
218 |
+ }) |
|
219 |
+ .then((res) => { |
|
220 |
+ if (res.data.status === "success") { |
|
221 |
+ console.log("classesList - response(삭제) : ", res.data.data); |
|
222 |
+ this.selectClass(); |
|
223 |
+ } else { |
|
224 |
+ console.log("삭제에 실패했습니다: ", res.data); |
|
225 |
+ alert("삭제에 실패했습니다."); |
|
147 | 226 |
} |
148 |
- else{ |
|
149 |
- this.showConfirm('save', () => { |
|
150 |
- axios({ |
|
151 |
- url: "/classes/insertClass.json", |
|
152 |
- method: "post", |
|
153 |
- headers: { |
|
154 |
- "Content-Type": "application/json; charset=UTF-8", |
|
155 |
- }, |
|
156 |
- data: { |
|
157 |
- userId: this.user_id, |
|
158 |
- sclsNm: this.createClassName |
|
159 |
- }, |
|
160 |
- }) |
|
161 |
- .then((res) => { |
|
162 |
- if (res.data.status === "success") { |
|
163 |
- console.log("classesList - response(추가) : ", res.data.data); |
|
164 |
- this.selectClass(); |
|
165 |
- this.createClassName = ""; // 반 이름 초기화 |
|
166 |
- this.closeBtn(); // 생성 모달 닫기 |
|
167 |
- } else { |
|
168 |
- console.log("추가에 실패했습니다: ", res.data); |
|
169 |
- alert("추가에 실패했습니다."); |
|
170 |
- } |
|
171 |
- }) |
|
172 |
- .catch((err) => { |
|
173 |
- console.log("classesList - error(추가) : ", err); |
|
174 |
- alert("추가에 오류가 발생했습니다."); |
|
175 |
- }); |
|
176 |
- }); |
|
177 |
- } |
|
178 |
- |
|
179 |
- }, |
|
180 |
- // 삭제 |
|
181 |
- deleteClass(sclsId) { |
|
182 |
- this.showConfirm('delete', () => { |
|
183 |
- axios({ |
|
184 |
- url: "/classes/deleteClass.json", |
|
185 |
- method: "post", |
|
186 |
- headers: { |
|
187 |
- "Content-Type": "application/json; charset=UTF-8", |
|
188 |
- }, |
|
189 |
- data: { |
|
190 |
- sclsId: sclsId |
|
191 |
- }, |
|
192 |
- }) |
|
193 |
- .then((res) => { |
|
194 |
- if (res.data.status === "success") { |
|
195 |
- console.log("classesList - response(삭제) : ", res.data.data); |
|
196 |
- this.selectClass(); |
|
197 |
- } else { |
|
198 |
- console.log("삭제에 실패했습니다: ", res.data); |
|
199 |
- alert("삭제에 실패했습니다."); |
|
200 |
- } |
|
201 |
- }) |
|
202 |
- .catch((err) => { |
|
203 |
- console.log("classesList - error(삭제) : ", err); |
|
204 |
- alert("삭제에 오류가 발생했습니다."); |
|
205 |
- }); |
|
227 |
+ }) |
|
228 |
+ .catch((err) => { |
|
229 |
+ console.log("classesList - error(삭제) : ", err); |
|
230 |
+ alert("삭제에 오류가 발생했습니다."); |
|
231 |
+ }); |
|
232 |
+ }); |
|
233 |
+ }, |
|
234 |
+ // 수정 |
|
235 |
+ updateClass() { |
|
236 |
+ if (this.createClassName.trim() === "") { |
|
237 |
+ alert("반 이름을 입력해주세요"); |
|
238 |
+ } else { |
|
239 |
+ this.showConfirm("edit", () => { |
|
240 |
+ axios({ |
|
241 |
+ url: "/classes/updateClass.json", |
|
242 |
+ method: "post", |
|
243 |
+ headers: { |
|
244 |
+ "Content-Type": "application/json; charset=UTF-8", |
|
245 |
+ }, |
|
246 |
+ data: { |
|
247 |
+ sclsId: this.current_editId, |
|
248 |
+ sclsNm: this.createClassName, |
|
249 |
+ }, |
|
250 |
+ }) |
|
251 |
+ .then((res) => { |
|
252 |
+ if (res.data.status === "success") { |
|
253 |
+ console.log("classesList - response(수정) : ", res.data.data); |
|
254 |
+ this.selectClass(); |
|
255 |
+ this.createClassName = ""; // 반 이름 초기화 |
|
256 |
+ this.current_editId = ""; // 반 Id 초기화 |
|
257 |
+ this.closeBtn(); // 팝업 닫기 |
|
258 |
+ } else { |
|
259 |
+ console.log("수정에 실패했습니다: ", res.data); |
|
260 |
+ alert("수정에 실패했습니다."); |
|
261 |
+ } |
|
262 |
+ }) |
|
263 |
+ .catch((err) => { |
|
264 |
+ console.log("classesList - error(수정) : ", err); |
|
265 |
+ alert("수정에 오류가 발생했습니다."); |
|
206 | 266 |
}); |
207 |
- }, |
|
208 |
- // 수정 |
|
209 |
- updateClass() { |
|
210 |
- if(this.createClassName.trim() === ""){ |
|
211 |
- alert("반 이름을 입력해주세요"); |
|
212 |
- } |
|
213 |
- else{ |
|
214 |
- this.showConfirm('edit', () => { |
|
215 |
- axios({ |
|
216 |
- url: "/classes/updateClass.json", |
|
217 |
- method: "post", |
|
218 |
- headers: { |
|
219 |
- "Content-Type": "application/json; charset=UTF-8", |
|
220 |
- }, |
|
221 |
- data: { |
|
222 |
- sclsId: this.current_editId, |
|
223 |
- sclsNm: this.createClassName |
|
224 |
- }, |
|
225 |
- }) |
|
226 |
- .then((res) => { |
|
227 |
- if (res.data.status === "success") { |
|
228 |
- console.log("classesList - response(수정) : ", res.data.data); |
|
229 |
- this.selectClass(); |
|
230 |
- this.createClassName = ""; // 반 이름 초기화 |
|
231 |
- this.current_editId = ""; // 반 Id 초기화 |
|
232 |
- this.closeBtn(); // 팝업 닫기 |
|
233 |
- } else { |
|
234 |
- console.log("수정에 실패했습니다: ", res.data); |
|
235 |
- alert("수정에 실패했습니다."); |
|
236 |
- } |
|
237 |
- }) |
|
238 |
- .catch((err) => { |
|
239 |
- console.log("classesList - error(수정) : ", err); |
|
240 |
- alert("수정에 오류가 발생했습니다."); |
|
241 |
- }); |
|
242 |
- }); |
|
243 |
- } |
|
244 |
- } |
|
267 |
+ }); |
|
268 |
+ } |
|
245 | 269 |
}, |
246 |
- watch: { |
|
247 |
- |
|
248 |
- }, |
|
249 |
- computed: { |
|
250 |
- |
|
251 |
- }, |
|
252 |
- components: { |
|
253 |
- SvgIcon |
|
254 |
- }, |
|
255 |
- mounted() { |
|
256 |
- console.log('Main2 mounted'); |
|
257 |
- this.selectClass(); |
|
258 |
- } |
|
259 |
-} |
|
270 |
+ }, |
|
271 |
+ watch: {}, |
|
272 |
+ computed: {}, |
|
273 |
+ components: { |
|
274 |
+ SvgIcon, |
|
275 |
+ }, |
|
276 |
+ mounted() { |
|
277 |
+ console.log("Main2 mounted"); |
|
278 |
+ this.selectClass(); |
|
279 |
+ }, |
|
280 |
+}; |
|
260 | 281 |
</script> |
261 | 282 |
|
262 | 283 |
<style> |
263 | 284 |
.content-t { |
264 |
- flex-wrap: wrap; |
|
265 |
- height: 90%; |
|
266 |
- overflow-y: scroll; |
|
285 |
+ flex-wrap: wrap; |
|
286 |
+ height: 90%; |
|
287 |
+ overflow-y: scroll; |
|
267 | 288 |
} |
268 |
-</style>(파일 끝에 줄바꿈 문자 없음) |
|
289 |
+</style> |
--- client/views/pages/teacher/noticeDetail.vue
+++ client/views/pages/teacher/noticeDetail.vue
... | ... | @@ -75,6 +75,7 @@ |
75 | 75 |
content: "", |
76 | 76 |
category: "", |
77 | 77 |
file: "", |
78 |
+ time: "", |
|
78 | 79 |
user: "", |
79 | 80 |
}; |
80 | 81 |
}, |
... | ... | @@ -94,6 +95,7 @@ |
94 | 95 |
vm.title = vm.dataList.bbsTtl; |
95 | 96 |
vm.content = vm.dataList.bbsCnt; |
96 | 97 |
vm.category = vm.dataList.bbsCls; |
98 |
+ vm.time = vm.dataList.bbsTm; |
|
97 | 99 |
}, |
98 | 100 |
|
99 | 101 |
findFile() { |
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?