Commit 506be6fd74389ddd3cb2501eb54ed5a87ebc4544
1 parent
2b0e316eeb
Exists in
master
and in
3 other branches
implemet dyamic image api in news and new design implemented, added dyamic selec…
…tion for showig data of students and timetable, implememted notification apis
Showing
22 changed files
with
1698 additions
and
1460 deletions
Show diff stats
index.html
... | ... | @@ -3,7 +3,8 @@ |
3 | 3 | <head> |
4 | 4 | <meta charset="utf-8"> |
5 | 5 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
6 | - <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700%7CMaterial+Icons' rel="stylesheet"> | |
6 | + <!-- <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700%7CMaterial+Icons' rel="stylesheet"> --> | |
7 | + <link href="https://fonts.googleapis.com/css?family=Nunito,700%7CMaterial+Icons" rel="stylesheet"> | |
7 | 8 | <!-- <script src="https://cdn.bootcss.com/echarts/4.0.4/echarts-en.min.js"></script> --> |
8 | 9 | <title>School Management</title> |
9 | 10 | <link rel="shortcut icon" href="/static/icon.jpeg" type="image/x-icon"> | ... | ... |
package-lock.json
1 | 1 | { |
2 | - "name": "ana-admin", | |
2 | + "name": "schoolmanagement", | |
3 | 3 | "version": "1.0.0", |
4 | 4 | "lockfileVersion": 1, |
5 | 5 | "requires": true, |
... | ... | @@ -9295,6 +9295,11 @@ |
9295 | 9295 | "node-walkdir": "^0.1.0" |
9296 | 9296 | } |
9297 | 9297 | }, |
9298 | + "moment": { | |
9299 | + "version": "2.24.0", | |
9300 | + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", | |
9301 | + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" | |
9302 | + }, | |
9298 | 9303 | "morgan": { |
9299 | 9304 | "version": "1.9.0", |
9300 | 9305 | "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", | ... | ... |
package.json
src/App.vue
... | ... | @@ -78,3 +78,11 @@ export default { |
78 | 78 | min-height:calc(1200px - 64px - 50px - 81px ) |
79 | 79 | |
80 | 80 | </style> |
81 | +<style> | |
82 | + | |
83 | +body{ | |
84 | + font-family: 'Nunito', sans-serif !important; | |
85 | + -webkit-font-smoothing: antialiased; | |
86 | + -moz-osx-font-smoothing: grayscale; | |
87 | +} | |
88 | +</style> | ... | ... |
src/Services/http.js
... | ... | @@ -3,12 +3,10 @@ import store from '@/store/store' |
3 | 3 | |
4 | 4 | export default () => { |
5 | 5 | return axios.create({ |
6 | - // baseURL:'http://d246be2d.ngrok.io/v1', | |
7 | - baseURL:'http://192.168.4.220:3002/v1', | |
8 | - // baseURL:'http://139.59.58.160:8001/v1', | |
6 | + baseURL:'http://192.168.2.221:3002/v1', | |
7 | + // baseURL:'http://139.59.58.160:8001' | |
9 | 8 | headers: { |
10 | 9 | Authorization: `Bearer ${store.state.token}` |
11 | - // Authorization:"Basic YWRtaW46b2ZiaXo=" | |
12 | 10 | } |
13 | 11 | }) |
14 | 12 | } | ... | ... |
src/api/menu.js
src/components/pageHeader/AppDrawer.vue
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | > |
11 | 11 | <v-toolbar style="background:#39b982" > |
12 | 12 | <img v-bind:src="computeLogo" height="30" class="imgLogo" alt="ana"> |
13 | - <h5 class="white--text my-3 ml-2">Technology Succes</h5> | |
13 | + <h5 class="white--text my-3 ml-2">School Management</h5> | |
14 | 14 | <v-toolbar-title class="ml-0 pl-3" > |
15 | 15 | </v-toolbar-title> |
16 | 16 | </v-toolbar> | ... | ... |
src/pages/Authentication/Login.vue
1 | 1 | <template> |
2 | 2 | <v-app id="login"> |
3 | - <v-toolbar class="fixcolor"> | |
3 | + <v-toolbar class="fixcolors"> | |
4 | 4 | <v-toolbar-items> |
5 | 5 | <img src="/static/icon.jpeg" height="36" alt="logo"> |
6 | - <h3 class="white--text my-3 ml-5 logoSchool">School-Maagement</h3> | |
6 | + <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> | |
7 | 7 | </v-toolbar-items> |
8 | 8 | </v-toolbar> |
9 | 9 | <v-content> |
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | >{{ text }}</v-snackbar> |
19 | 19 | <v-layout align-center justify-center> |
20 | 20 | <v-flex xs12 sm10 md6 lg4> |
21 | - <v-toolbar class="fixcolor" dark> | |
21 | + <v-toolbar class="fixcolors" dark> | |
22 | 22 | <v-spacer></v-spacer> |
23 | 23 | <v-toolbar-title>School Login</v-toolbar-title> |
24 | 24 | <v-spacer></v-spacer> |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | </v-card-text> |
58 | 58 | <v-layout> |
59 | 59 | <v-flex sm12 class="my-3"> |
60 | - <v-btn style="margin: auto;display: block;b" class="fixcolor" round dark large @click="login" :loading="loading">Login</v-btn> | |
60 | + <v-btn style="margin: auto;display: block;b" class="fixcolors" round dark large @click="login" :loading="loading">Login</v-btn> | |
61 | 61 | </v-flex> |
62 | 62 | </v-layout> |
63 | 63 | <v-layout> |
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | </v-layout> |
68 | 68 | </v-container> |
69 | 69 | </v-content> |
70 | - <v-footer class="pa-4" style="background:linear-gradient(90deg,#f58753 30%,#f15e5f 110%)"></v-footer> | |
70 | + <v-footer class="pa-4 fixcolors"></v-footer> | |
71 | 71 | </v-app> |
72 | 72 | </template> |
73 | 73 | |
... | ... | @@ -110,8 +110,7 @@ export default { |
110 | 110 | var userdata = { |
111 | 111 | email: this.userLogincredentials.email, |
112 | 112 | password: this.userLogincredentials.password, |
113 | - role:"ADMIN" | |
114 | - | |
113 | + role:"ADMIN" | |
115 | 114 | }; |
116 | 115 | http() |
117 | 116 | .post("/schoolLogin", userdata) |
... | ... | @@ -126,7 +125,6 @@ export default { |
126 | 125 | this.snackbar = true; |
127 | 126 | this.loading = false; |
128 | 127 | }); |
129 | - this.$router.push("/teachers"); | |
130 | 128 | } |
131 | 129 | }, |
132 | 130 | computed: { | ... | ... |
src/pages/Authentication/forgetpassword.vue
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | <v-toolbar class="fixcolors"> |
4 | 4 | <v-toolbar-items> |
5 | 5 | <img src="/static/icon.jpeg" height="36" alt="logo"> |
6 | - <h3 class="white--text my-3 ml-5 logoSchool">Technology Succes</h3> | |
6 | + <h3 class="white--text my-3 ml-5 logoSchool">School Management</h3> | |
7 | 7 | </v-toolbar-items> |
8 | 8 | </v-toolbar> |
9 | 9 | <v-container fluid> | ... | ... |
src/pages/Class/addclass.vue
... | ... | @@ -73,9 +73,9 @@ |
73 | 73 | color="success" |
74 | 74 | >{{ text }}</v-snackbar> |
75 | 75 | <v-dialog v-model="dialog" max-width="500px"> |
76 | - <v-toolbar color="white"> | |
76 | + <v-toolbar color="grey lighten-2"> | |
77 | 77 | <v-spacer></v-spacer> |
78 | - <v-toolbar-title>Edit Class</v-toolbar-title> | |
78 | + <v-toolbar-title><h3>Edit Class</h3></v-toolbar-title> | |
79 | 79 | <v-spacer></v-spacer> |
80 | 80 | </v-toolbar> |
81 | 81 | <v-card> |
... | ... | @@ -86,16 +86,15 @@ |
86 | 86 | <v-form ref="form" v-model="valid" lazy-validation> |
87 | 87 | <v-layout style="position:relative;"> |
88 | 88 | <v-flex xs4 class="pt-4 subheading"> |
89 | - <label>Class Name:</label> | |
89 | + <label>Class:</label> | |
90 | 90 | </v-flex> |
91 | 91 | <v-flex xs8> |
92 | - <v-text-field | |
92 | + <v-autocomplete | |
93 | 93 | v-model="editedItem.classNum" |
94 | - v-validate="'required'" | |
94 | + :placeholder ="editedItem.classNum" | |
95 | + :items = "classList" | |
95 | 96 | :rules="nameRules" |
96 | - data-vv-name="Name" | |
97 | - required | |
98 | - ></v-text-field> | |
97 | + ></v-autocomplete> | |
99 | 98 | </v-flex> |
100 | 99 | </v-layout> |
101 | 100 | <v-card-actions> |
... | ... | @@ -113,9 +112,9 @@ |
113 | 112 | |
114 | 113 | <!-- ****** PROFILE VIEW STUDENTS ****** --> |
115 | 114 | <v-dialog v-model="dialog1" max-width="600px"> |
116 | - <v-toolbar color="white"> | |
115 | + <v-toolbar color="grey lighten-2"> | |
117 | 116 | <v-spacer></v-spacer> |
118 | - <v-toolbar-title>Profile</v-toolbar-title> | |
117 | + <v-toolbar-title><h3>Class Profile</h3></v-toolbar-title> | |
119 | 118 | <v-spacer></v-spacer> |
120 | 119 | <v-icon @click="close1">close</v-icon> |
121 | 120 | </v-toolbar> |
... | ... | @@ -163,8 +162,8 @@ |
163 | 162 | :search="search" |
164 | 163 | > |
165 | 164 | <template slot="items" slot-scope="props"> |
166 | - <td id="td" class="text-xs-center">{{ props.index}}</td> | |
167 | - <td id="td" class="text-xs-center">{{ props.item.classNum}}</td> | |
165 | + <td>{{ props.index}}</td> | |
166 | + <td class="text-xs-center">{{ props.item.classNum}}</td> | |
168 | 167 | <td class="text-xs-center"> |
169 | 168 | <span> |
170 | 169 | <img |
... | ... | @@ -221,17 +220,17 @@ |
221 | 220 | <v-form ref="form" v-model="valid" lazy-validation> |
222 | 221 | <v-layout> |
223 | 222 | <v-flex xs4 class="pt-4 subheading"> |
224 | - <label class="right">Class Name:</label> | |
223 | + <label class="right">Class :</label> | |
225 | 224 | </v-flex> |
226 | 225 | <v-flex xs6 class="ml-3"> |
227 | - <v-text-field | |
226 | + <v-autocomplete | |
228 | 227 | v-model="addclasses.classNum" |
229 | 228 | placeholder="fill your class Name" |
230 | - name="name" | |
231 | 229 | type="text" |
230 | + :items="classList" | |
232 | 231 | :rules="nameRules" |
233 | 232 | required |
234 | - ></v-text-field> | |
233 | + ></v-autocomplete> | |
235 | 234 | </v-flex> |
236 | 235 | </v-layout> |
237 | 236 | <v-layout> |
... | ... | @@ -287,7 +286,7 @@ export default { |
287 | 286 | headers: [ |
288 | 287 | { |
289 | 288 | text: "No", |
290 | - align: "center", | |
289 | + align: "left", | |
291 | 290 | sortable: false, |
292 | 291 | value: "No" |
293 | 292 | }, |
... | ... | @@ -296,6 +295,20 @@ export default { |
296 | 295 | { text: "Action", value: "", sortable: false, align: "center" } |
297 | 296 | ], |
298 | 297 | desserts: [], |
298 | + classList:[ | |
299 | + "1", | |
300 | + "2", | |
301 | + "3", | |
302 | + "4", | |
303 | + "5", | |
304 | + "6", | |
305 | + "7", | |
306 | + "8", | |
307 | + "9", | |
308 | + "10", | |
309 | + "11", | |
310 | + "12" | |
311 | + ], | |
299 | 312 | editedIndex: -1, |
300 | 313 | editedItem: { |
301 | 314 | classNum: "" |
... | ... | @@ -452,8 +465,6 @@ export default { |
452 | 465 | }, |
453 | 466 | mounted() { |
454 | 467 | this.getClassList(); |
455 | - // console.log("Id",this.$store.state.id) | |
456 | - // console.log("token",this.$store.state.token) | |
457 | 468 | }, |
458 | 469 | computed: { |
459 | 470 | toolbarColor() { |
... | ... | @@ -462,7 +473,7 @@ export default { |
462 | 473 | } |
463 | 474 | }; |
464 | 475 | </script> |
465 | -<style scoped> | |
476 | +<style> | |
466 | 477 | .v-tabs__div { |
467 | 478 | text-transform: none; |
468 | 479 | } |
... | ... | @@ -522,6 +533,9 @@ h4 { |
522 | 533 | height: 17px; |
523 | 534 | cursor: pointer; |
524 | 535 | } |
536 | +#indexId{ | |
537 | + padding: 0 0px !important; | |
538 | +} | |
525 | 539 | #td { |
526 | 540 | border: 1px solid #dddddd; |
527 | 541 | text-align: left; | ... | ... |
src/pages/Event/event.vue
... | ... | @@ -76,9 +76,9 @@ |
76 | 76 | >{{ text }}</v-snackbar> |
77 | 77 | <v-dialog v-model="dialog" max-width="600px"> |
78 | 78 | <v-flex xs12 sm12 class> |
79 | - <v-toolbar color="white"> | |
79 | + <v-toolbar color="v-toolbar"> | |
80 | 80 | <v-spacer></v-spacer> |
81 | - <v-toolbar-title>Edit Event</v-toolbar-title> | |
81 | + <v-toolbar-title><h3>Edit Event</h3></v-toolbar-title> | |
82 | 82 | <v-spacer></v-spacer> |
83 | 83 | </v-toolbar> |
84 | 84 | <v-card flat> |
... | ... | @@ -156,9 +156,9 @@ |
156 | 156 | <!-- ****** VIEW PROFIL EVENTS ****** --> |
157 | 157 | |
158 | 158 | <v-dialog v-model="dialog1" max-width="600px"> |
159 | - <v-toolbar color="white"> | |
159 | + <v-toolbar color="v-toolbar"> | |
160 | 160 | <v-spacer></v-spacer> |
161 | - <v-toolbar-title>Profile</v-toolbar-title> | |
161 | + <v-toolbar-title><h3>Event Profile</h3></v-toolbar-title> | |
162 | 162 | <v-spacer></v-spacer> |
163 | 163 | <v-icon @click="close1">close</v-icon> |
164 | 164 | </v-toolbar> | ... | ... |
src/pages/News/news.vue
... | ... | @@ -5,13 +5,14 @@ |
5 | 5 | <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon> |
6 | 6 | </v-toolbar-title> |
7 | 7 | <!-- ****** SEARCH ALL EXISTING NEWS ****** --> |
8 | - <v-flex xs7 sm3 class="userSearch ml-3"> | |
8 | + <v-flex xs7 sm3 class="userSearch"> | |
9 | 9 | <v-text-field |
10 | 10 | flat |
11 | 11 | append-icon="search" |
12 | 12 | label="Find your News" |
13 | 13 | v-model="search" |
14 | 14 | color="white" |
15 | + class="pa-3" | |
15 | 16 | dark |
16 | 17 | ></v-text-field> |
17 | 18 | </v-flex> |
... | ... | @@ -73,10 +74,10 @@ |
73 | 74 | color="success" |
74 | 75 | >{{ text }}</v-snackbar> |
75 | 76 | <v-dialog v-model="dialog" max-width="1000px"> |
76 | - <v-flex xs12 sm12 class> | |
77 | - <v-toolbar color="white"> | |
77 | + <v-flex xs12 sm12> | |
78 | + <v-toolbar class="grey lighten-2"> | |
78 | 79 | <v-spacer></v-spacer> |
79 | - <v-toolbar-title>Edit News</v-toolbar-title> | |
80 | + <v-toolbar-title > <h3>Edit News</h3></v-toolbar-title> | |
80 | 81 | <v-spacer></v-spacer> |
81 | 82 | </v-toolbar> |
82 | 83 | <v-card flat> |
... | ... | @@ -87,11 +88,14 @@ |
87 | 88 | xs12 |
88 | 89 | class="text-xs-center text-sm-center text-md-center text-lg-center mr-4" |
89 | 90 | > |
90 | - <v-avatar size="100px"> | |
91 | - <img src="/static/icon/user.png" v-if="!imageUrl"> | |
91 | + <v-avatar size="150px"> | |
92 | + <img src="/static/icon/user.png" v-if="!editedItem.newsImageUrl"> | |
93 | + <span v-for = "image in editedItem.newsImageUrl"> | |
94 | + <img :src="image" alt="newsImage" v-if="editedItem.newsImageUrl"> | |
95 | + </span> | |
92 | 96 | </v-avatar> |
93 | 97 | <input |
94 | - type="file" | |
98 | + type = "file" | |
95 | 99 | style="display: none" |
96 | 100 | ref="image" |
97 | 101 | accept="image/*" |
... | ... | @@ -106,12 +110,12 @@ |
106 | 110 | </v-flex> |
107 | 111 | </v-layout> |
108 | 112 | <v-layout> |
109 | - <v-flex xs12 sm6> | |
113 | + <v-flex xs12 sm12> | |
110 | 114 | <v-layout> |
111 | 115 | <v-flex xs4 class="pt-4 subheading"> |
112 | 116 | <label class="right">Select Class:</label> |
113 | 117 | </v-flex> |
114 | - <v-flex xs8 class="ml-3"> | |
118 | + <v-flex xs5 class="ml-3"> | |
115 | 119 | <v-select |
116 | 120 | :items="addclass" |
117 | 121 | label="Select Class" |
... | ... | @@ -125,12 +129,12 @@ |
125 | 129 | </v-flex> |
126 | 130 | </v-layout> |
127 | 131 | </v-flex> |
128 | - <v-flex xs12 sm6> | |
132 | + <v-flex xs12 sm12> | |
129 | 133 | <v-layout> |
130 | 134 | <v-flex xs4 class="pt-4 subheading"> |
131 | 135 | <label class="right">Select Section:</label> |
132 | 136 | </v-flex> |
133 | - <v-flex xs8 class="ml-3"> | |
137 | + <v-flex xs5 class="ml-3"> | |
134 | 138 | <v-select |
135 | 139 | :items="addSection" |
136 | 140 | label="Select Section" |
... | ... | @@ -145,12 +149,12 @@ |
145 | 149 | </v-flex> |
146 | 150 | </v-layout> |
147 | 151 | <v-layout> |
148 | - <v-flex xs12 sm6> | |
152 | + <v-flex xs12 sm12> | |
149 | 153 | <v-layout> |
150 | 154 | <v-flex xs4 class="pt-4 subheading"> |
151 | 155 | <label class="right">Title:</label> |
152 | 156 | </v-flex> |
153 | - <v-flex xs8 class="ml-3"> | |
157 | + <v-flex xs5 class="ml-3"> | |
154 | 158 | <v-text-field |
155 | 159 | v-model="editedItem.title" |
156 | 160 | placeholder="fill your Title" |
... | ... | @@ -161,12 +165,12 @@ |
161 | 165 | </v-flex> |
162 | 166 | </v-layout> |
163 | 167 | </v-flex> |
164 | - <v-flex xs12 sm6> | |
168 | + <v-flex xs12 sm12> | |
165 | 169 | <v-layout> |
166 | 170 | <v-flex xs4 class="pt-4 subheading"> |
167 | 171 | <label class="right">Description:</label> |
168 | 172 | </v-flex> |
169 | - <v-flex xs8 class="ml-3"> | |
173 | + <v-flex xs5 class="ml-3"> | |
170 | 174 | <v-text-field |
171 | 175 | placeholder="fill your Description" |
172 | 176 | v-model="editedItem.description" |
... | ... | @@ -177,9 +181,25 @@ |
177 | 181 | </v-flex> |
178 | 182 | </v-layout> |
179 | 183 | </v-flex> |
184 | + <v-flex xs12> | |
185 | + <v-layout> | |
186 | + <v-flex xs4 class="pt-4 subheading"> | |
187 | + <label class="right">Uplaod Image:</label> | |
188 | + </v-flex> | |
189 | + <v-flex xs5 class="ml-3"> | |
190 | + <v-text-field | |
191 | + label="Select Image" | |
192 | + @click="pickFile" | |
193 | + v-model="imageName" | |
194 | + append-icon="attach_file" | |
195 | + multiple | |
196 | + ></v-text-field> | |
197 | + </v-flex> | |
198 | + </v-layout> | |
199 | + </v-flex> | |
180 | 200 | </v-layout> |
181 | 201 | <v-layout> |
182 | - <v-flex xs12 sm12> | |
202 | + <v-flex xs12 sm8 offset-sm2> | |
183 | 203 | <v-card-actions> |
184 | 204 | <v-btn round dark @click.native="close">Cancel</v-btn> |
185 | 205 | <v-spacer></v-spacer> |
... | ... | @@ -194,28 +214,30 @@ |
194 | 214 | </v-dialog> |
195 | 215 | |
196 | 216 | <!-- ****** PROFILE VIEW ALL NEWS DEATILS ****** --> |
197 | - <v-dialog v-model="dialog1" max-width="600px"> | |
198 | - <v-toolbar color="white"> | |
217 | + | |
218 | + <v-dialog v-model="dialog1" max-width="800px"> | |
219 | + <v-toolbar color="grey lighten-2"> | |
199 | 220 | <v-spacer></v-spacer> |
200 | - <v-toolbar-title>Profile</v-toolbar-title> | |
221 | + <v-toolbar-title><h3>News</h3></v-toolbar-title> | |
201 | 222 | <v-spacer></v-spacer> |
202 | 223 | <v-icon @click="close1">close</v-icon> |
203 | 224 | </v-toolbar> |
204 | 225 | <v-card> |
205 | - <v-flex align-center justify-center layout text-xs-center> | |
206 | - <v-avatar size="50px" style="position:absolute; top:20px;"> | |
226 | + <v-flex align-center justify-center layout text-xs-center > | |
227 | + <!-- <v-avatar size="50px" style="position:absolute; top:20px;"> | |
207 | 228 | <img src="/static/icon/user.png"> |
208 | - </v-avatar> | |
229 | + </v-avatar> --> | |
230 | + <span v-for = "image in editedItem.newsImageUrl" class="mt-4 pa-2"> | |
231 | + <img :src="image" alt="News" width="240" height="180"> | |
232 | + </span> | |
209 | 233 | </v-flex> |
210 | 234 | <v-card-text> |
211 | 235 | <v-container grid-list-md> |
212 | 236 | <v-layout wrap> |
213 | 237 | <v-flex> |
214 | - <br> | |
215 | - <br> | |
216 | 238 | <v-layout> |
217 | 239 | <v-flex xs5 sm6> |
218 | - <h5 class="right my-1">Title:</h5> | |
240 | + <h5 class = "right my-1"><b>Title:</b></h5> | |
219 | 241 | </v-flex> |
220 | 242 | <v-flex sm6 xs8> |
221 | 243 | <h5 class="my-1">{{ editedItem.title }}</h5> |
... | ... | @@ -223,7 +245,7 @@ |
223 | 245 | </v-layout> |
224 | 246 | <v-layout> |
225 | 247 | <v-flex xs5 sm6> |
226 | - <h5 class="right my-1">Description:</h5> | |
248 | + <h5 class="right my-1"><b>Description:</b></h5> | |
227 | 249 | </v-flex> |
228 | 250 | <v-flex sm6 xs8> |
229 | 251 | <h5 class="my-1">{{ editedItem.description }}</h5> |
... | ... | @@ -253,7 +275,14 @@ |
253 | 275 | :search="search" |
254 | 276 | > |
255 | 277 | <template slot="items" slot-scope="props"> |
256 | - <td id="td" class="text-xs-center">{{ props.index}}</td> | |
278 | + <td class="text-xs-center">{{ props.index}}</td> | |
279 | + <td id="td"class="text-xs-center"> | |
280 | + <span v-for = "image in props.item.newsImageUrl" class="pa-2"> | |
281 | + <v-avatar size = "70"> | |
282 | + <img :src="image" alt=""> | |
283 | + </v-avatar> | |
284 | + </span> | |
285 | + </td> | |
257 | 286 | <td id="td" class="text-xs-center">{{ props.item.title}}</td> |
258 | 287 | <td id="td" class="text-xs-center">{{ props.item.description}}</td> |
259 | 288 | |
... | ... | @@ -307,30 +336,22 @@ |
307 | 336 | <v-container fluid> |
308 | 337 | <v-layout> |
309 | 338 | <v-flex |
310 | - xs12 | |
339 | + xs6 offset-sm3 | |
311 | 340 | class="text-xs-center text-sm-center text-md-center text-lg-center my-4 mr-4" |
312 | 341 | > |
313 | - <v-avatar size="100px"> | |
314 | - <img src="/static/icon/user.png" v-if="!imageUrl"> | |
315 | - </v-avatar> | |
316 | 342 | <input |
317 | 343 | type="file" |
318 | - style="display: none" | |
344 | + style = "display: none" | |
319 | 345 | ref="image" |
320 | 346 | accept="image/*" |
321 | 347 | multiple |
322 | 348 | @change="onFilePicked" |
323 | 349 | > |
324 | - <img | |
325 | - :src="imageUrl" | |
326 | - height="150" | |
327 | - v-if="imageUrl" | |
328 | - style="border-radius:50%; width:200px" | |
329 | - > | |
330 | 350 | <v-layout> |
331 | - <v-flex | |
332 | - xs4 v-for="(file, index) in files" :key="index"> | |
333 | - <img :src="file.url" height="200" width="320px;"> | |
351 | + <v-flex v-for="(file, index) in files" :key="index"> | |
352 | + <v-avatar size="140"> | |
353 | + <img :src = "file.url" height="200" width="320px;"> | |
354 | + </v-avatar> | |
334 | 355 | </v-flex> |
335 | 356 | </v-layout> |
336 | 357 | </v-flex> |
... | ... | @@ -444,16 +465,22 @@ export default { |
444 | 465 | descriptionRules: [v => !!v || " Description is required"], |
445 | 466 | headers: [ |
446 | 467 | { |
447 | - text: "No", | |
448 | 468 | align: "center", |
469 | + text: "No", | |
449 | 470 | sortable: false, |
450 | 471 | value: "No" |
451 | 472 | }, |
473 | + { text: "Image", vaue: "image",sortable: false, align: "center"}, | |
452 | 474 | { text: "Title", value: "title", sortable: false, align: "center" }, |
453 | 475 | { text: "Description", value: "description", sortable: false, align: "center" }, |
454 | 476 | { text: "Action", value: "", sortable: false, align: "center" } |
455 | 477 | ], |
456 | - desserts: [], | |
478 | + desserts: [{ | |
479 | + image:"https://picsum.photos/500/300?image", | |
480 | + title:"title", | |
481 | + description:"description", | |
482 | + | |
483 | + }], | |
457 | 484 | editedIndex: -1, |
458 | 485 | addNews: { |
459 | 486 | title: "", |
... | ... | @@ -461,7 +488,8 @@ export default { |
461 | 488 | }, |
462 | 489 | editedItem: { |
463 | 490 | title: "", |
464 | - description: "" | |
491 | + description: "", | |
492 | + | |
465 | 493 | }, |
466 | 494 | defaultItem: { |
467 | 495 | title: "", |
... | ... | @@ -509,7 +537,6 @@ export default { |
509 | 537 | pickFile() { |
510 | 538 | this.$refs.image.click(); |
511 | 539 | }, |
512 | - | |
513 | 540 | onFilePicked(e) { |
514 | 541 | // console.log(e) |
515 | 542 | const files = e.target.files; |
... | ... | @@ -624,6 +651,7 @@ export default { |
624 | 651 | }, |
625 | 652 | submit() { |
626 | 653 | console.log("===========>",this.image) |
654 | + this.loading = true; | |
627 | 655 | if (this.$refs.form.validate()) { |
628 | 656 | let newsData = new FormData(); |
629 | 657 | for( var i = 0; i < this.imageFile.length; i++ ){ |
... | ... | @@ -642,6 +670,7 @@ export default { |
642 | 670 | this.text = "New user added successfully"; |
643 | 671 | } |
644 | 672 | this.getNewsList(); |
673 | + this.loading = false; | |
645 | 674 | this.clear(); |
646 | 675 | }) |
647 | 676 | .catch(error => { |
... | ... | @@ -657,15 +686,22 @@ export default { |
657 | 686 | this.$refs.form.reset(); |
658 | 687 | }, |
659 | 688 | save() { |
660 | - let imageData = new FormData(); | |
661 | - imageData.append("upload", this.imageFile); | |
662 | - console.log(imageData); | |
663 | - let editNews = { | |
664 | - newsId: this.editedItem._id, | |
665 | - title: this.editedItem.title, | |
666 | - description: this.editedItem.description, | |
667 | - // imageData | |
668 | - }; | |
689 | + // let imageData = new FormData(); | |
690 | + // imageData.append("upload", this.imageFile); | |
691 | + // console.log(imageData); | |
692 | + // let editNews = { | |
693 | + // newsId: this.editedItem._id, | |
694 | + // title: this.editedItem.title, | |
695 | + // description: this.editedItem.description, | |
696 | + // // imageData | |
697 | + // }; | |
698 | + let newsData = new FormData(); | |
699 | + for( var i = 0; i < this.imageFile.length; i++ ){ | |
700 | + let file = this.imageFile[i]; | |
701 | + newsData.append("upload", file ); | |
702 | + } | |
703 | + newsData.append("title",this.editedItem.title); | |
704 | + newsData.append("description",this.editedItem.description); | |
669 | 705 | http() |
670 | 706 | .put("/updateNews", editNews) |
671 | 707 | .then(response => { |
... | ... | @@ -700,8 +736,8 @@ export default { |
700 | 736 | }) |
701 | 737 | .catch(err => { |
702 | 738 | // console.log("err====>", err); |
703 | - this.$router.replace({ path: "/" }); | |
704 | 739 | }); |
740 | + this.editItem | |
705 | 741 | }, |
706 | 742 | computed: { |
707 | 743 | toolbarColor() { |
... | ... | @@ -797,6 +833,9 @@ h4 { |
797 | 833 | .v-tabs__item a { |
798 | 834 | font-size: 16px !important; |
799 | 835 | } |
836 | +.list{ | |
837 | + padding: 0 0px !important; | |
838 | +} | |
800 | 839 | @media screen and (max-width: 769px) { |
801 | 840 | .top { |
802 | 841 | margin-top: 0 !important; | ... | ... |
src/pages/Notification/notification.vue
... | ... | @@ -75,10 +75,10 @@ |
75 | 75 | color="success" |
76 | 76 | >{{ text }}</v-snackbar> |
77 | 77 | <v-dialog v-model="dialog" max-width="600px"> |
78 | - <v-flex xs12 sm12 class=""> | |
79 | - <v-toolbar color="white"> | |
78 | + <v-flex xs12 sm12> | |
79 | + <v-toolbar color="v-toolbar"> | |
80 | 80 | <v-spacer></v-spacer> |
81 | - <v-toolbar-title>Edit Notifictaion</v-toolbar-title> | |
81 | + <v-toolbar-title><h3>Edit Notifictaion</h3></v-toolbar-title> | |
82 | 82 | <v-spacer></v-spacer> |
83 | 83 | </v-toolbar> |
84 | 84 | <v-card flat> |
... | ... | @@ -156,7 +156,7 @@ |
156 | 156 | <v-dialog v-model="dialog1" max-width="600px"> |
157 | 157 | <v-toolbar color="white"> |
158 | 158 | <v-spacer></v-spacer> |
159 | - <v-toolbar-title>Notification</v-toolbar-title> | |
159 | + <v-toolbar-title><h3>Notification</h3></v-toolbar-title> | |
160 | 160 | <v-spacer></v-spacer> |
161 | 161 | <v-icon @click="close1">close</v-icon> |
162 | 162 | </v-toolbar> | ... | ... |
src/pages/Section/section.vue
... | ... | @@ -66,9 +66,9 @@ |
66 | 66 | color="success" |
67 | 67 | >{{ text }}</v-snackbar> |
68 | 68 | <v-dialog v-model="dialog" max-width="600px"> |
69 | - <v-toolbar color="white"> | |
69 | + <v-toolbar color="grey lighten-2"> | |
70 | 70 | <v-spacer></v-spacer> |
71 | - <v-toolbar-title>Edit Section</v-toolbar-title> | |
71 | + <v-toolbar-title><h3>Edit Section</h3></v-toolbar-title> | |
72 | 72 | <v-spacer></v-spacer> |
73 | 73 | </v-toolbar> |
74 | 74 | <v-card> |
... | ... | @@ -98,12 +98,11 @@ |
98 | 98 | <label>Section Name:</label> |
99 | 99 | </v-flex> |
100 | 100 | <v-flex xs8> |
101 | - <v-text-field | |
101 | + <v-autocomplete | |
102 | 102 | v-model="editedItem.name" |
103 | 103 | placeholder="fill your Section Name" |
104 | - type="text" | |
105 | - required | |
106 | - ></v-text-field> | |
104 | + :items="SectionName" | |
105 | + ></v-autocomplete> | |
107 | 106 | </v-flex> |
108 | 107 | |
109 | 108 | </v-layout> |
... | ... | @@ -123,9 +122,9 @@ |
123 | 122 | <!-- ****** PROFILE VIEW SECTION DATA ****** --> |
124 | 123 | |
125 | 124 | <v-dialog v-model="dialog1" max-width="600px"> |
126 | - <v-toolbar color="white"> | |
125 | + <v-toolbar color="grey lighten-2"> | |
127 | 126 | <v-spacer></v-spacer> |
128 | - <v-toolbar-title>Section</v-toolbar-title> | |
127 | + <v-toolbar-title><h3>Section</h3></v-toolbar-title> | |
129 | 128 | <v-spacer></v-spacer> |
130 | 129 | <v-icon @click="close1">close</v-icon> |
131 | 130 | </v-toolbar> |
... | ... | @@ -243,14 +242,13 @@ |
243 | 242 | <label class="right">Section Name:</label> |
244 | 243 | </v-flex> |
245 | 244 | <v-flex xs6 class="ml-3"> |
246 | - <v-text-field | |
245 | + <v-autocomplete | |
247 | 246 | v-model="add.name" |
248 | 247 | placeholder="fill your Section Name" |
249 | - name="name" | |
250 | - type="text" | |
248 | + :items = "SectionName" | |
251 | 249 | :rules="nameRules" |
252 | 250 | required |
253 | - ></v-text-field> | |
251 | + ></v-autocomplete> | |
254 | 252 | </v-flex> |
255 | 253 | </v-layout> |
256 | 254 | <v-layout> |
... | ... | @@ -339,6 +337,9 @@ export default { |
339 | 337 | nameRules: [v => !!v || " Section Name is required"], |
340 | 338 | classRules: [v => !!v || " Class Name is required"], |
341 | 339 | sessionRules: [v => !!v || " Session is required"], |
340 | + SectionName:[ | |
341 | + "A","B","C","D","E","F" | |
342 | + ], | |
342 | 343 | headers: [ |
343 | 344 | { |
344 | 345 | text: "No", | ... | ... |
src/pages/Students/students.vue
... | ... | @@ -72,11 +72,11 @@ |
72 | 72 | v-model="snackbar" |
73 | 73 | color="success" |
74 | 74 | >{{ text }}</v-snackbar> |
75 | - <v-dialog v-model="dialog" max-width="1000px"> | |
75 | + <v-dialog v-model="dialog" max-width="1300px"> | |
76 | 76 | <v-flex xs12 sm12 class=""> |
77 | - <v-toolbar color="white"> | |
77 | + <v-toolbar color="grey lighten-2"> | |
78 | 78 | <v-spacer></v-spacer> |
79 | - <v-toolbar-title>Edit Student Profile</v-toolbar-title> | |
79 | + <v-toolbar-title><h3>Edit Student Profile</h3></v-toolbar-title> | |
80 | 80 | <v-spacer></v-spacer> |
81 | 81 | </v-toolbar> |
82 | 82 | <v-card flat> |
... | ... | @@ -106,7 +106,7 @@ |
106 | 106 | </v-flex> |
107 | 107 | </v-layout> |
108 | 108 | <v-layout> |
109 | - <v-flex xs12 sm6> | |
109 | + <v-flex xs12 sm4> | |
110 | 110 | <v-layout> |
111 | 111 | <v-flex xs4 class="pt-4 subheading"> |
112 | 112 | <label class="right">Select Class:</label> |
... | ... | @@ -125,7 +125,7 @@ |
125 | 125 | </v-flex> |
126 | 126 | </v-layout> |
127 | 127 | </v-flex> |
128 | - <v-flex xs12 sm6> | |
128 | + <v-flex xs12 sm4> | |
129 | 129 | <v-layout> |
130 | 130 | <v-flex xs4 class="pt-4 subheading"> |
131 | 131 | <label class="right">Select Section:</label> |
... | ... | @@ -143,9 +143,7 @@ |
143 | 143 | </v-flex> |
144 | 144 | </v-layout> |
145 | 145 | </v-flex> |
146 | - </v-layout> | |
147 | - <v-layout> | |
148 | - <v-flex xs12 sm6> | |
146 | + <v-flex xs12 sm4> | |
149 | 147 | <v-layout> |
150 | 148 | <v-flex xs4 class="pt-4 subheading"> |
151 | 149 | <label class="right">Full Name:</label> |
... | ... | @@ -161,7 +159,9 @@ |
161 | 159 | </v-flex> |
162 | 160 | </v-layout> |
163 | 161 | </v-flex> |
164 | - <v-flex xs12 sm6> | |
162 | + </v-layout> | |
163 | + <v-layout> | |
164 | + <v-flex xs12 sm4> | |
165 | 165 | <v-layout> |
166 | 166 | <v-flex xs4 class="pt-4 subheading"> |
167 | 167 | <label class="right">Email ID:</label> |
... | ... | @@ -177,9 +177,7 @@ |
177 | 177 | </v-flex> |
178 | 178 | </v-layout> |
179 | 179 | </v-flex> |
180 | - </v-layout> | |
181 | - <v-layout> | |
182 | - <v-flex xs12 sm6> | |
180 | + <v-flex xs12 sm4> | |
183 | 181 | <v-layout> |
184 | 182 | <v-flex xs4 class="pt-4 subheading"> |
185 | 183 | <label class="right">Date of Birth:</label> |
... | ... | @@ -198,12 +196,12 @@ |
198 | 196 | > |
199 | 197 | <v-text-field |
200 | 198 | slot="activator" |
201 | - v-model="editedItem.date" | |
202 | - placeholder="Select date" | |
199 | + v-model="editedItem.dob" | |
200 | + placeholder="Select Dob" | |
203 | 201 | ></v-text-field> |
204 | 202 | <v-date-picker |
205 | 203 | ref="picker" |
206 | - v-model="editedItem.date" | |
204 | + v-model="editedItem.dob" | |
207 | 205 | :max="new Date().toISOString().substr(0, 10)" |
208 | 206 | min="1950-01-01" |
209 | 207 | @input="menu1 = false" |
... | ... | @@ -212,7 +210,7 @@ |
212 | 210 | </v-flex> |
213 | 211 | </v-layout> |
214 | 212 | </v-flex> |
215 | - <v-flex xs12 sm6> | |
213 | + <v-flex xs12 sm4> | |
216 | 214 | <v-layout> |
217 | 215 | <v-flex xs4 class="pt-4 subheading"> |
218 | 216 | <label class="right">City:</label> |
... | ... | @@ -230,7 +228,7 @@ |
230 | 228 | </v-flex> |
231 | 229 | </v-layout> |
232 | 230 | <v-layout> |
233 | - <v-flex xs12 sm6> | |
231 | + <v-flex xs12 sm4> | |
234 | 232 | <v-layout> |
235 | 233 | <v-flex xs4 class="pt-4 subheading"> |
236 | 234 | <label class="right">State:</label> |
... | ... | @@ -246,7 +244,7 @@ |
246 | 244 | </v-flex> |
247 | 245 | </v-layout> |
248 | 246 | </v-flex> |
249 | - <v-flex xs12 sm6> | |
247 | + <v-flex xs12 sm4> | |
250 | 248 | <v-layout> |
251 | 249 | <v-flex xs4 class="pt-4 subheading"> |
252 | 250 | <label class="right">Pincode:</label> |
... | ... | @@ -262,9 +260,7 @@ |
262 | 260 | </v-flex> |
263 | 261 | </v-layout> |
264 | 262 | </v-flex> |
265 | - </v-layout> | |
266 | - <v-layout> | |
267 | - <v-flex xs12 sm6> | |
263 | + <v-flex xs12 sm4> | |
268 | 264 | <v-layout> |
269 | 265 | <v-flex xs4 class="pt-4 subheading"> |
270 | 266 | <label class="right">Mobile No:</label> |
... | ... | @@ -280,7 +276,9 @@ |
280 | 276 | </v-flex> |
281 | 277 | </v-layout> |
282 | 278 | </v-flex> |
283 | - <v-flex xs12 sm6> | |
279 | + </v-layout> | |
280 | + <v-layout> | |
281 | + <v-flex xs12 sm4> | |
284 | 282 | <v-layout> |
285 | 283 | <v-flex xs4 class="pt-4 subheading"> |
286 | 284 | <label class="right">Select Country:</label> |
... | ... | @@ -295,9 +293,7 @@ |
295 | 293 | </v-flex> |
296 | 294 | </v-layout> |
297 | 295 | </v-flex> |
298 | - </v-layout> | |
299 | - <v-layout> | |
300 | - <v-flex xs12 sm6> | |
296 | + <v-flex xs12 sm4> | |
301 | 297 | <v-layout> |
302 | 298 | <v-flex xs4 class="pt-4 subheading"> |
303 | 299 | <label class="right">Gender:</label> |
... | ... | @@ -306,13 +302,13 @@ |
306 | 302 | <v-select |
307 | 303 | :items="gender" |
308 | 304 | v-model="editedItem.gender" |
309 | - label="Select Gender" | |
305 | + placeholder="Select Gender" | |
310 | 306 | required |
311 | 307 | ></v-select> |
312 | 308 | </v-flex> |
313 | 309 | </v-layout> |
314 | 310 | </v-flex> |
315 | - <v-flex xs12 sm6> | |
311 | + <v-flex xs12 sm4> | |
316 | 312 | <v-layout> |
317 | 313 | <v-flex xs4 class="pt-4 subheading"> |
318 | 314 | <label class="right">Father Name:</label> |
... | ... | @@ -329,7 +325,7 @@ |
329 | 325 | </v-flex> |
330 | 326 | </v-layout> |
331 | 327 | <v-layout> |
332 | - <v-flex xs12 sm6> | |
328 | + <v-flex xs12 sm4> | |
333 | 329 | <v-layout> |
334 | 330 | <v-flex xs4 class="pt-4 subheading"> |
335 | 331 | <label class="right">Father Cell No:</label> |
... | ... | @@ -345,7 +341,7 @@ |
345 | 341 | </v-flex> |
346 | 342 | </v-layout> |
347 | 343 | </v-flex> |
348 | - <v-flex xs12 sm6> | |
344 | + <v-flex xs12 sm4> | |
349 | 345 | <v-layout> |
350 | 346 | <v-flex xs4 class="pt-4 subheading"> |
351 | 347 | <label class="right">Mother Name:</label> |
... | ... | @@ -361,9 +357,7 @@ |
361 | 357 | </v-flex> |
362 | 358 | </v-layout> |
363 | 359 | </v-flex> |
364 | - </v-layout> | |
365 | - <v-layout> | |
366 | - <v-flex xs12 sm6> | |
360 | + <v-flex xs12 sm4> | |
367 | 361 | <v-layout> |
368 | 362 | <v-flex xs4 class="pt-4 subheading"> |
369 | 363 | <label class="right">Mother Cell No:</label> |
... | ... | @@ -379,7 +373,9 @@ |
379 | 373 | </v-flex> |
380 | 374 | </v-layout> |
381 | 375 | </v-flex> |
382 | - <v-flex xs12 sm6> | |
376 | + </v-layout> | |
377 | + <v-layout> | |
378 | + <v-flex xs12 sm4> | |
383 | 379 | <v-layout> |
384 | 380 | <v-flex xs4 class="pt-4 subheading"> |
385 | 381 | <label class="right">Academic Year:</label> |
... | ... | @@ -395,9 +391,8 @@ |
395 | 391 | </v-flex> |
396 | 392 | </v-layout> |
397 | 393 | </v-flex> |
398 | - </v-layout> | |
399 | - <v-layout> | |
400 | - <v-flex xs12 sm6> | |
394 | + | |
395 | + <v-flex xs12 sm4> | |
401 | 396 | <v-layout> |
402 | 397 | <v-flex xs4 class="pt-4 subheading"> |
403 | 398 | <label class="right">Uplaod Image:</label> |
... | ... | @@ -412,7 +407,7 @@ |
412 | 407 | </v-flex> |
413 | 408 | </v-layout> |
414 | 409 | </v-flex> |
415 | - <v-flex xs12 sm6> | |
410 | + <v-flex xs12 sm4> | |
416 | 411 | <v-layout> |
417 | 412 | <v-flex xs4 class="pt-4 subheading"> |
418 | 413 | <label class="right">Present Address:</label> |
... | ... | @@ -427,12 +422,11 @@ |
427 | 422 | </v-layout> |
428 | 423 | </v-flex> |
429 | 424 | </v-layout> |
430 | - <v-flex xs12 sm12> | |
431 | 425 | <v-layout> |
432 | - <v-flex xs3 class="pt-4 subheading" style="max-width: 17%;"> | |
426 | + <v-flex xs3 class="pt-4 subheading"> | |
433 | 427 | <label>Permanent Address:</label> |
434 | 428 | </v-flex> |
435 | - <v-flex xs12> | |
429 | + <v-flex xs9> | |
436 | 430 | <v-text-field |
437 | 431 | name="input-4-3" |
438 | 432 | v-model="editedItem.permanentAddress" |
... | ... | @@ -441,8 +435,6 @@ |
441 | 435 | ></v-text-field> |
442 | 436 | </v-flex> |
443 | 437 | </v-layout> |
444 | - </v-flex> | |
445 | - </v-layout> | |
446 | 438 | <v-layout> |
447 | 439 | <v-flex xs12 sm12> |
448 | 440 | <v-card-actions> |
... | ... | @@ -460,9 +452,9 @@ |
460 | 452 | |
461 | 453 | <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** --> |
462 | 454 | <v-dialog v-model="dialog1" max-width="600px"> |
463 | - <v-toolbar color="white"> | |
455 | + <v-toolbar color="grey lighten-2"> | |
464 | 456 | <v-spacer></v-spacer> |
465 | - <v-toolbar-title>Profile</v-toolbar-title> | |
457 | + <v-toolbar-title>Student Profile</v-toolbar-title> | |
466 | 458 | <v-spacer></v-spacer> |
467 | 459 | <v-icon @click="close1">close</v-icon> |
468 | 460 | </v-toolbar> |
... | ... | @@ -587,7 +579,7 @@ |
587 | 579 | <h5 class="right my-1">Date Of Birth:</h5> |
588 | 580 | </v-flex> |
589 | 581 | <v-flex sm6 xs8> |
590 | - <h5 class="my-1">{{ editedItem.dob }}</h5> | |
582 | + <h5 class="my-1">{{ dates(editedItem.dob) }}</h5> | |
591 | 583 | </v-flex> |
592 | 584 | </v-layout> |
593 | 585 | <v-layout> |
... | ... | @@ -623,6 +615,39 @@ |
623 | 615 | >{{ text }}</v-snackbar> |
624 | 616 | |
625 | 617 | <!-- ****** EXISTING-USERS STUDENTS TABLE ****** --> |
618 | + <v-card flat> | |
619 | + <v-card-actions> | |
620 | + <v-layout> | |
621 | + <label class = "right mt-4 ml-5 ">Select Class:</label> | |
622 | + <v-select | |
623 | + :items="addclass" | |
624 | + label="Select Class" | |
625 | + v-model="addStudents.select" | |
626 | + item-text="classNum" | |
627 | + item-value="_id" | |
628 | + name="Select Class" | |
629 | + :rules="classRules" | |
630 | + @change="getSections(addStudents.select)" | |
631 | + class="px-4" | |
632 | + required | |
633 | + ></v-select> | |
634 | + <label class="right mt-4">Select Section:</label> | |
635 | + <v-select | |
636 | + :items="addSection" | |
637 | + label="Select Section" | |
638 | + v-model="addStudents.selectSection" | |
639 | + item-text="name" | |
640 | + item-value="_id" | |
641 | + name="Select Section" | |
642 | + :rules="sectionRules" | |
643 | + class="pl-3" | |
644 | + required | |
645 | + ></v-select> | |
646 | + </v-layout> | |
647 | + <v-spacer></v-spacer> | |
648 | + <v-btn @click="findStudents()" round dark :loading="loading" class= "left">Find</v-btn> | |
649 | + </v-card-actions> | |
650 | + </v-card> | |
626 | 651 | <v-data-table |
627 | 652 | :headers="headers" |
628 | 653 | :items="desserts" |
... | ... | @@ -633,7 +658,7 @@ |
633 | 658 | <td id="td" class="text-xs-center">{{ props.index}}</td> |
634 | 659 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> |
635 | 660 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> |
636 | - <td id="td" class="text-xs-center">{{ props.item.dob }}</td> | |
661 | + <td id="td" class="text-xs-center">{{ dates(props.item.dob) }}</td> | |
637 | 662 | <td id="td" class="text-xs-center">{{ props.item.gender }}</td> |
638 | 663 | <td id="td" class="text-xs-center">{{ props.item.fatherName }}</td> |
639 | 664 | <td id="td" class="text-xs-center">{{ props.item.motherName }}</td> |
... | ... | @@ -745,7 +770,7 @@ |
745 | 770 | item-text="name" |
746 | 771 | item-value="_id" |
747 | 772 | name="Select Section" |
748 | - :rules="classRules" | |
773 | + :rules="sectionRules" | |
749 | 774 | required |
750 | 775 | ></v-select> |
751 | 776 | </v-flex> |
... | ... | @@ -1094,6 +1119,7 @@ |
1094 | 1119 | <script> |
1095 | 1120 | import http from "@/Services/http.js"; |
1096 | 1121 | import Util from "@/util"; |
1122 | +import moment from "moment"; | |
1097 | 1123 | |
1098 | 1124 | export default { |
1099 | 1125 | data: () => ({ |
... | ... | @@ -1135,6 +1161,7 @@ export default { |
1135 | 1161 | mobileNoRules: [v => !!v || "Mobile Number is required"], |
1136 | 1162 | stateRules: [v => !!v || "State Name is required"], |
1137 | 1163 | classRules: [v => !!v || " Class Name is required"], |
1164 | + sectionRules:[v => !!v || " Section Name is required"], | |
1138 | 1165 | genderRules: [v => !!v || " Select Gender is required"], |
1139 | 1166 | fatherNameRules: [v => !!v || " Father Name is required"], |
1140 | 1167 | fatheCellNoRules: [v => !!v || " father Cell Number is required"], |
... | ... | @@ -1400,7 +1427,7 @@ export default { |
1400 | 1427 | role: "STUDENT", |
1401 | 1428 | name: "", |
1402 | 1429 | email: "", |
1403 | - date: "", | |
1430 | + dob: "", | |
1404 | 1431 | city: "", |
1405 | 1432 | pincode: "", |
1406 | 1433 | country: "", |
... | ... | @@ -1449,6 +1476,23 @@ export default { |
1449 | 1476 | } |
1450 | 1477 | }, |
1451 | 1478 | methods: { |
1479 | + findStudents(){ | |
1480 | + this.showLoader = true; | |
1481 | + http() | |
1482 | + .get( | |
1483 | + "/getStudentWithClass", | |
1484 | + { params: { classId: this.addStudents.select,sectionId: this.addStudents.selectSection,} } | |
1485 | + ) | |
1486 | + .then(response => { | |
1487 | + this.desserts = response.data.data; | |
1488 | + this.showLoader = false; | |
1489 | + console.log("getSectionsList=====>", this.addSection); | |
1490 | + }) | |
1491 | + .catch(err => { | |
1492 | + console.log("err====>", err); | |
1493 | + this.showLoader = false; | |
1494 | + }); | |
1495 | + }, | |
1452 | 1496 | getSections(_id) { |
1453 | 1497 | var token = this.$store.state.token; |
1454 | 1498 | http() |
... | ... | @@ -1471,7 +1515,9 @@ export default { |
1471 | 1515 | pickFile() { |
1472 | 1516 | this.$refs.image.click(); |
1473 | 1517 | }, |
1474 | - | |
1518 | + dates: function(date) { | |
1519 | + return moment(date).format("MMMM DD, YYYY"); | |
1520 | + }, | |
1475 | 1521 | onFilePicked(e) { |
1476 | 1522 | // console.log(e) |
1477 | 1523 | const files = e.target.files; |
... | ... | @@ -1496,27 +1542,28 @@ export default { |
1496 | 1542 | this.imageUrl = ""; |
1497 | 1543 | } |
1498 | 1544 | }, |
1499 | - getStudentList() { | |
1500 | - this.showLoader = true; | |
1501 | - var token = this.$store.state.token; | |
1502 | - http() | |
1503 | - .get("/getStudentsList", { | |
1504 | - headers: { Authorization: "Bearer " + token } | |
1505 | - }) | |
1506 | - .then(response => { | |
1507 | - this.desserts = response.data.data; | |
1508 | - this.showLoader = false; | |
1509 | - // console.log("getStudentList=====>",this.desserts) | |
1510 | - }) | |
1511 | - .catch(err => { | |
1512 | - // console.log("err====>", err); | |
1513 | - this.showLoader = false; | |
1514 | - this.$router.replace({ path: "/" }); | |
1515 | - }); | |
1516 | - }, | |
1545 | + // getStudentList() { | |
1546 | + // this.showLoader = true; | |
1547 | + // var token = this.$store.state.token; | |
1548 | + // http() | |
1549 | + // .get("/getStudentsList", { | |
1550 | + // headers: { Authorization: "Bearer " + token } | |
1551 | + // }) | |
1552 | + // .then(response => { | |
1553 | + // this.desserts = response.data.data; | |
1554 | + // this.showLoader = false; | |
1555 | + // // console.log("getStudentList=====>",this.desserts) | |
1556 | + // }) | |
1557 | + // .catch(err => { | |
1558 | + // // console.log("err====>", err); | |
1559 | + // this.showLoader = false; | |
1560 | + // this.$router.replace({ path: "/" }); | |
1561 | + // }); | |
1562 | + // }, | |
1517 | 1563 | editItem(item) { |
1518 | 1564 | this.editedIndex = this.desserts.indexOf(item); |
1519 | 1565 | this.editedItem = Object.assign({}, item); |
1566 | + this.editedItem.dob = this.editedItem.dob.substring(0, 10) | |
1520 | 1567 | this.dialog = true; |
1521 | 1568 | }, |
1522 | 1569 | profile(item) { |
... | ... | @@ -1613,7 +1660,7 @@ export default { |
1613 | 1660 | if ((this.snackbar = true)) { |
1614 | 1661 | this.text = "New user added successfully"; |
1615 | 1662 | } |
1616 | - this.getStudentList(); | |
1663 | + // this.getStudentList(); | |
1617 | 1664 | this.clear(); |
1618 | 1665 | }) |
1619 | 1666 | .catch(error => { |
... | ... | @@ -1638,7 +1685,7 @@ export default { |
1638 | 1685 | name: this.editedItem.name, |
1639 | 1686 | email: this.editedItem.email, |
1640 | 1687 | role: this.editedItem.role, |
1641 | - dob: this.editedItem.date, | |
1688 | + dob: this.editedItem.dob, | |
1642 | 1689 | city: this.editedItem.city, |
1643 | 1690 | pincode: this.editedItem.pincode, |
1644 | 1691 | country: this.editedItem.country, |
... | ... | @@ -1663,7 +1710,7 @@ export default { |
1663 | 1710 | if ((this.snackbar = true)) { |
1664 | 1711 | this.text = "Successfully Edit Existing User"; |
1665 | 1712 | } |
1666 | - this.getStudentList(); | |
1713 | + this.findStudents(); | |
1667 | 1714 | }) |
1668 | 1715 | .catch(error => { |
1669 | 1716 | // console.log(error); |
... | ... | @@ -1678,7 +1725,7 @@ export default { |
1678 | 1725 | } |
1679 | 1726 | }, |
1680 | 1727 | mounted() { |
1681 | - this.getStudentList(); | |
1728 | + // this.getStudentList(); | |
1682 | 1729 | var token = this.$store.state.token; |
1683 | 1730 | http() |
1684 | 1731 | .get("/getClassesList", { | ... | ... |
src/pages/Teachers/teachers.vue
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | >{{ text }}</v-snackbar> |
73 | 73 | <v-dialog v-model="dialog" max-width="1100px"> |
74 | 74 | <v-flex xs12 sm12 class="my-4"> |
75 | - <v-toolbar color="white"> | |
75 | + <v-toolbar color="grey lighten-2"> | |
76 | 76 | <v-spacer></v-spacer> |
77 | 77 | <v-toolbar-title>Edit Teacher Profile</v-toolbar-title> |
78 | 78 | <v-spacer></v-spacer> |
... | ... | @@ -355,9 +355,9 @@ |
355 | 355 | <!-- ****** PROFILE VIEW TEACHERS DETAILS ****** --> |
356 | 356 | |
357 | 357 | <v-dialog v-model="dialog1" max-width="600px"> |
358 | - <v-toolbar color="white"> | |
358 | + <v-toolbar color="grey lighten-2"> | |
359 | 359 | <v-spacer></v-spacer> |
360 | - <v-toolbar-title>Profile</v-toolbar-title> | |
360 | + <v-toolbar-title><h3>Teacher Profile</h3></v-toolbar-title> | |
361 | 361 | <v-spacer></v-spacer> |
362 | 362 | <v-icon @click="close1">close</v-icon> |
363 | 363 | </v-toolbar> |
... | ... | @@ -434,7 +434,7 @@ |
434 | 434 | <h5 class="right my-1">Join Date:</h5> |
435 | 435 | </v-flex> |
436 | 436 | <v-flex sm6 xs8> |
437 | - <h5 class="my-1">{{ editedItem.joinDate }}</h5> | |
437 | + <h5 class="my-1">{{ dates(editedItem.joinDate) }}</h5> | |
438 | 438 | </v-flex> |
439 | 439 | </v-layout> |
440 | 440 | <v-layout> |
... | ... | @@ -442,7 +442,7 @@ |
442 | 442 | <h5 class="right my-1">Date Of Birth:</h5> |
443 | 443 | </v-flex> |
444 | 444 | <v-flex sm6 xs8> |
445 | - <h5 class="my-1">{{ editedItem.dob }}</h5> | |
445 | + <h5 class="my-1">{{ dates(editedItem.dob) }}</h5> | |
446 | 446 | </v-flex> |
447 | 447 | </v-layout> |
448 | 448 | <v-layout> |
... | ... | @@ -487,8 +487,8 @@ |
487 | 487 | <td id="td" class="text-xs-center">{{ props.index}}</td> |
488 | 488 | <td id="td" class="text-xs-center">{{ props.item.name}}</td> |
489 | 489 | <td id="td" class="text-xs-center">{{ props.item.email }}</td> |
490 | - <td id="td" class="text-xs-center">{{ props.item.dob }}</td> | |
491 | - <td id="td" class="text-xs-center">{{ props.item.joinDate}}</td> | |
490 | + <td id="td" class="text-xs-center">{{ dates(props.item.dob) }}</td> | |
491 | + <td id="td" class="text-xs-center">{{ dates(props.item.joinDate)}}</td> | |
492 | 492 | <td id="td" class="text-xs-center">{{ props.item.mobileNo }}</td> |
493 | 493 | <td class="text-xs-center"> |
494 | 494 | <span> |
... | ... | @@ -838,6 +838,7 @@ |
838 | 838 | // import AppToolbar from '@/components/AppToolbar'; |
839 | 839 | import http from "@/Services/http.js"; |
840 | 840 | import Util from "@/util"; |
841 | +import moment from "moment"; | |
841 | 842 | |
842 | 843 | export default { |
843 | 844 | components: { |
... | ... | @@ -1207,6 +1208,9 @@ export default { |
1207 | 1208 | this.imageUrl = ""; |
1208 | 1209 | } |
1209 | 1210 | }, |
1211 | + dates: function(date) { | |
1212 | + return moment(date).format("MMMM DD, YYYY"); | |
1213 | + }, | |
1210 | 1214 | getTeacherList() { |
1211 | 1215 | this.showLoader = true; |
1212 | 1216 | var token = this.$store.state.token; |
... | ... | @@ -1223,12 +1227,14 @@ export default { |
1223 | 1227 | .catch(err => { |
1224 | 1228 | // console.log("err====>", err); |
1225 | 1229 | this.showLoader = false; |
1226 | - this.$router.replace({ path: "/" }); | |
1230 | + // this.$router.replace({ path: "/" }); | |
1227 | 1231 | }); |
1228 | 1232 | }, |
1229 | 1233 | editItem(item) { |
1230 | 1234 | this.editedIndex = this.desserts.indexOf(item); |
1231 | 1235 | this.editedItem = Object.assign({}, item); |
1236 | + this.editedItem.dob = this.editedItem.dob.substring(0, 10) | |
1237 | + this.editedItem.joinDate = this.editedItem.joinDate.substring(0, 10) | |
1232 | 1238 | this.dialog = true; |
1233 | 1239 | }, |
1234 | 1240 | profile(item) { | ... | ... |
src/pages/TimeTable/timeTable.vue
1 | 1 | <template> |
2 | - <v-app id="pages-dasboard"> | |
3 | - <v-toolbar class="fixcolors" fixed app> | |
4 | - <v-toolbar-title class="ml-0 pl-3"> | |
5 | - <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon> | |
6 | - </v-toolbar-title> | |
7 | - <!-- ****** SEARCH ALL EXISTING TIME-TABLE ****** --> | |
8 | - <v-flex xs7 sm3 class="userSearch"> | |
9 | - <v-text-field | |
10 | - flat | |
11 | - append-icon="search" | |
12 | - label="Find your Time Talbe" | |
13 | - v-model="search" | |
14 | - color="white" | |
15 | - dark | |
16 | - ></v-text-field> | |
17 | - </v-flex> | |
18 | - <v-spacer></v-spacer> | |
19 | - <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> | |
20 | - <v-btn icon large flat slot="activator"> | |
21 | - <v-avatar size="40px"> | |
22 | - <img src="/static/icon/user.png"> | |
23 | - </v-avatar> | |
24 | - </v-btn> | |
25 | - <v-list class="pa-0"> | |
26 | - <v-list-tile | |
27 | - v-for="(item,index) in items" | |
28 | - :to="!item.href ? { name: item.name } : null" | |
29 | - :href="item.href" | |
30 | - @click="item.click" | |
31 | - ripple="ripple" | |
32 | - :disabled="item.disabled" | |
33 | - :target="item.target" | |
34 | - rel="noopener" | |
35 | - :key="index" | |
36 | - > | |
37 | - <v-list-tile-action v-if="item.icon"> | |
38 | - <v-icon>{{ item.icon }}</v-icon> | |
39 | - </v-list-tile-action> | |
40 | - <v-list-tile-content> | |
41 | - <v-list-tile-title>{{ item.title }}</v-list-tile-title> | |
42 | - </v-list-tile-content> | |
43 | - </v-list-tile> | |
44 | - </v-list> | |
45 | - </v-menu> | |
46 | - </v-toolbar> | |
47 | - <v-tabs grow slider-color="black"> | |
48 | - <v-tab | |
49 | - ripple | |
50 | - @click="activeTab('existing')" | |
51 | - v-bind:class="{ active: isActive }" | |
52 | - id="tab" | |
53 | - class="subheading" | |
54 | - >Existing Time Table</v-tab> | |
55 | - <v-tab | |
56 | - ripple | |
57 | - @click="activeTab('new')" | |
58 | - v-bind:class="{ active: newActive }" | |
59 | - id="tab1" | |
60 | - User | |
61 | - class="subheading" | |
62 | - >Add New Time Table</v-tab> | |
2 | + <v-app id="pages-dasboard"> | |
3 | + <v-toolbar class="fixcolors" fixed app> | |
4 | + <v-toolbar-title class="ml-0 pl-3"> | |
5 | + <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon> | |
6 | + </v-toolbar-title> | |
7 | + <!-- ****** SEARCH ALL EXISTING TIME-TABLE ****** --> | |
8 | + <v-flex xs7 sm3 class="userSearch"> | |
9 | + <v-text-field | |
10 | + flat | |
11 | + append-icon="search" | |
12 | + label="Find your Time Talbe" | |
13 | + v-model="search" | |
14 | + color="white" | |
15 | + dark | |
16 | + ></v-text-field> | |
17 | + </v-flex> | |
18 | + <v-spacer></v-spacer> | |
19 | + <v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> | |
20 | + <v-btn icon large flat slot="activator"> | |
21 | + <v-avatar size="40px"> | |
22 | + <img src="/static/icon/user.png"> | |
23 | + </v-avatar> | |
24 | + </v-btn> | |
25 | + <v-list class="pa-0"> | |
26 | + <v-list-tile | |
27 | + v-for="(item,index) in items" | |
28 | + :to="!item.href ? { name: item.name } : null" | |
29 | + :href="item.href" | |
30 | + @click="item.click" | |
31 | + ripple="ripple" | |
32 | + :disabled="item.disabled" | |
33 | + :target="item.target" | |
34 | + rel="noopener" | |
35 | + :key="index" | |
36 | + > | |
37 | + <v-list-tile-action v-if="item.icon"> | |
38 | + <v-icon>{{ item.icon }}</v-icon> | |
39 | + </v-list-tile-action> | |
40 | + <v-list-tile-content> | |
41 | + <v-list-tile-title>{{ item.title }}</v-list-tile-title> | |
42 | + </v-list-tile-content> | |
43 | + </v-list-tile> | |
44 | + </v-list> | |
45 | + </v-menu> | |
46 | + </v-toolbar> | |
47 | + <v-tabs grow slider-color="black"> | |
48 | + <v-tab | |
49 | + ripple | |
50 | + @click="activeTab('existing')" | |
51 | + v-bind:class="{ active: isActive }" | |
52 | + id="tab" | |
53 | + class="subheading" | |
54 | + >Existing Time Table</v-tab> | |
55 | + <v-tab | |
56 | + ripple | |
57 | + @click="activeTab('new')" | |
58 | + v-bind:class="{ active: newActive }" | |
59 | + id="tab1" | |
60 | + User | |
61 | + class="subheading" | |
62 | + >Add New Time Table</v-tab> | |
63 | 63 | |
64 | - <!-- ****** EDITS TIME-TABLE****** --> | |
64 | + <!-- ****** EDITS TIME-TABLE****** --> | |
65 | 65 | |
66 | - <v-tab-item> | |
67 | - <v-snackbar | |
68 | - :timeout="timeout" | |
69 | - :top="y === 'top'" | |
70 | - :right="x === 'right'" | |
71 | - :vertical="mode === 'vertical'" | |
72 | - v-model="snackbar" | |
73 | - color="success" | |
74 | - >{{ text }}</v-snackbar> | |
75 | - <v-dialog v-model="dialog" max-width="1000px"> | |
76 | - <v-flex xs12 sm12 class> | |
77 | - <v-toolbar color="white"> | |
78 | - <v-spacer></v-spacer> | |
79 | - <v-toolbar-title>Edit Time Table</v-toolbar-title> | |
80 | - <v-spacer></v-spacer> | |
81 | - </v-toolbar> | |
82 | - <v-card flat> | |
83 | - <v-form ref="form"> | |
84 | - <v-container fluid> | |
85 | - <v-layout> | |
86 | - <v-flex | |
87 | - xs12 | |
88 | - class="text-xs-center text-sm-center text-md-center text-lg-center mr-4" | |
89 | - > | |
90 | - <v-avatar size="100px"> | |
91 | - <img src="/static/icon/user.png" v-if="!imageUrl"> | |
92 | - </v-avatar> | |
93 | - <input | |
94 | - type="file" | |
95 | - style="display: none" | |
96 | - ref="image" | |
97 | - accept="image/*" | |
98 | - @change="onFilePicked" | |
99 | - > | |
100 | - <img | |
101 | - :src="imageData.imageUrl" | |
102 | - height="150" | |
103 | - v-if="imageUrl" | |
104 | - style="border-radius:50%; width:200px" | |
105 | - > | |
106 | - </v-flex> | |
107 | - </v-layout> | |
108 | - <v-flex xs12 sm12> | |
109 | - <v-layout> | |
110 | - <v-flex xs4 class="pt-4 subheading"> | |
111 | - <label class="right">class No:</label> | |
112 | - </v-flex> | |
113 | - <v-flex xs12 sm5 class="ml-3"> | |
114 | - <v-select | |
115 | - :items="addclass" | |
116 | - label="Select Class" | |
117 | - v-model="editedItem.classNum" | |
118 | - item-text="classNum" | |
119 | - item-value="_id" | |
120 | - @change="getSections(editedItem.classNum)" | |
121 | - ></v-select> | |
122 | - </v-flex> | |
123 | - </v-layout> | |
124 | - </v-flex> | |
125 | - <v-flex xs12 sm12> | |
126 | - <v-layout> | |
127 | - <v-flex xs4 class="pt-4 subheading"> | |
128 | - <label class="right">Section Name:</label> | |
129 | - </v-flex> | |
130 | - <v-flex xs5 class="ml-3"> | |
131 | - <v-select | |
132 | - :items="addSection" | |
133 | - label="Select Section" | |
134 | - v-model="editedItem.selectSection" | |
135 | - item-text="name" | |
136 | - item-value="_id" | |
137 | - ></v-select> | |
138 | - </v-flex> | |
139 | - </v-layout> | |
140 | - </v-flex> | |
141 | - <v-layout> | |
142 | - <v-flex xs12 sm8 offset-sm2> | |
143 | - <v-card-actions> | |
144 | - <v-btn round dark @click.native="close">Cancel</v-btn> | |
145 | - <v-spacer></v-spacer> | |
146 | - <v-btn round dark @click="save">Save</v-btn> | |
147 | - </v-card-actions> | |
148 | - </v-flex> | |
149 | - </v-layout> | |
150 | - </v-container> | |
151 | - </v-form> | |
152 | - </v-card> | |
153 | - </v-flex> | |
154 | - </v-dialog> | |
66 | + <v-tab-item> | |
67 | + <v-snackbar | |
68 | + :timeout="timeout" | |
69 | + :top="y === 'top'" | |
70 | + :right="x === 'right'" | |
71 | + :vertical="mode === 'vertical'" | |
72 | + v-model="snackbar" | |
73 | + color="success" | |
74 | + >{{ text }}</v-snackbar> | |
75 | + <v-dialog v-model="dialog" max-width="1000px"> | |
76 | + <v-flex xs12 sm12 class> | |
77 | + <v-toolbar color="grey lighten-2"> | |
78 | + <v-spacer></v-spacer> | |
79 | + <v-toolbar-title> | |
80 | + <h3>Edit Time Table</h3> | |
81 | + </v-toolbar-title> | |
82 | + <v-spacer></v-spacer> | |
83 | + </v-toolbar> | |
84 | + <v-card flat> | |
85 | + <v-form ref="form"> | |
86 | + <v-container fluid> | |
87 | + <v-layout> | |
88 | + <v-flex | |
89 | + xs12 | |
90 | + class="text-xs-center text-sm-center text-md-center text-lg-center mr-4" | |
91 | + > | |
92 | + <v-avatar size="100px"> | |
93 | + <img src="/static/icon/user.png" v-if="!imageUrl"> | |
94 | + </v-avatar> | |
95 | + <input | |
96 | + type="file" | |
97 | + style="display: none" | |
98 | + ref="image" | |
99 | + accept="image/*" | |
100 | + @change="onFilePicked" | |
101 | + > | |
102 | + <img | |
103 | + :src="imageData.imageUrl" | |
104 | + height="150" | |
105 | + v-if="imageUrl" | |
106 | + style="border-radius:50%; width:200px" | |
107 | + > | |
108 | + </v-flex> | |
109 | + </v-layout> | |
110 | + <v-flex xs12 sm12> | |
111 | + <v-layout> | |
112 | + <v-flex xs4 class="pt-4 subheading"> | |
113 | + <label class="right">class No:</label> | |
114 | + </v-flex> | |
115 | + <v-flex xs12 sm5 class="ml-3"> | |
116 | + <v-select | |
117 | + :items="addclass" | |
118 | + label="Select Class" | |
119 | + v-model="editedItem.classNum" | |
120 | + item-text="classNum" | |
121 | + item-value="_id" | |
122 | + @change="getSections(editedItem.classNum)" | |
123 | + ></v-select> | |
124 | + </v-flex> | |
125 | + </v-layout> | |
126 | + </v-flex> | |
127 | + <v-flex xs12 sm12> | |
128 | + <v-layout> | |
129 | + <v-flex xs4 class="pt-4 subheading"> | |
130 | + <label class="right">Section Name:</label> | |
131 | + </v-flex> | |
132 | + <v-flex xs5 class="ml-3"> | |
133 | + <v-select | |
134 | + :items="addSection" | |
135 | + label="Select Section" | |
136 | + v-model="editedItem.selectSection" | |
137 | + item-text="name" | |
138 | + item-value="_id" | |
139 | + ></v-select> | |
140 | + </v-flex> | |
141 | + </v-layout> | |
142 | + </v-flex> | |
143 | + <v-layout> | |
144 | + <v-flex xs12 sm8 offset-sm2> | |
145 | + <v-card-actions> | |
146 | + <v-btn round dark @click.native="close">Cancel</v-btn> | |
147 | + <v-spacer></v-spacer> | |
148 | + <v-btn round dark @click="save">Save</v-btn> | |
149 | + </v-card-actions> | |
150 | + </v-flex> | |
151 | + </v-layout> | |
152 | + </v-container> | |
153 | + </v-form> | |
154 | + </v-card> | |
155 | + </v-flex> | |
156 | + </v-dialog> | |
155 | 157 | |
156 | - <!-- ****** ADD LECTURES TIME-TABLE ****** --> | |
158 | + <!-- ****** ADD LECTURES IN TIME-TABLE ****** --> | |
157 | 159 | |
158 | - <v-dialog v-model="dialogAddLecture" max-width="1000px"> | |
159 | - <v-flex xs12 sm12 class> | |
160 | - <v-toolbar color="white"> | |
161 | - <v-spacer></v-spacer> | |
162 | - <v-toolbar-title>Add Lecture</v-toolbar-title> | |
163 | - <v-spacer></v-spacer> | |
164 | - </v-toolbar> | |
165 | - <v-card flat> | |
166 | - <v-form ref="form" v-model="valid" lazy-validation> | |
167 | - <v-container fluid> | |
168 | - <v-flex xs12 sm12> | |
169 | - <v-layout> | |
170 | - <v-flex xs4 class="pt-4 subheading"> | |
171 | - <label class="right">Subject Name:</label> | |
172 | - </v-flex> | |
173 | - <v-flex xs5 class="ml-3"> | |
174 | - <v-text-field | |
175 | - v-model="addlectures.subjectName" | |
176 | - :rules="subjectNameRules" | |
177 | - placeholder="fill your Subject Name" | |
178 | - type="text" | |
179 | - ></v-text-field> | |
180 | - </v-flex> | |
181 | - </v-layout> | |
182 | - </v-flex> | |
183 | - <v-flex xs12 sm12> | |
184 | - <v-layout> | |
185 | - <v-flex xs4 class="pt-4 subheading"> | |
186 | - <label class="right">Time In:</label> | |
187 | - </v-flex> | |
188 | - <v-flex xs5 class="ml-3"> | |
189 | - <v-text-field | |
190 | - v-model="addlectures.timeIn" | |
191 | - :rules="timeInRules" | |
192 | - placeholder="fill your Time In" | |
193 | - type="text" | |
194 | - ></v-text-field> | |
195 | - </v-flex> | |
196 | - </v-layout> | |
197 | - </v-flex> | |
198 | - <v-flex xs12 sm12> | |
199 | - <v-layout> | |
200 | - <v-flex xs4 class="pt-4 subheading"> | |
201 | - <label class="right">Time Out:</label> | |
202 | - </v-flex> | |
203 | - <v-flex xs5 class="ml-3"> | |
204 | - <v-text-field | |
205 | - v-model="addlectures.timeOut" | |
206 | - :rules="timeOutRules" | |
207 | - placeholder="fill your Time Out" | |
208 | - type="text" | |
209 | - ></v-text-field> | |
210 | - </v-flex> | |
211 | - </v-layout> | |
212 | - </v-flex> | |
213 | - <v-flex xs12 sm12> | |
214 | - <v-layout> | |
215 | - <v-flex xs4 class="pt-4 subheading"> | |
216 | - <label class="right">Select Teacher:</label> | |
217 | - </v-flex> | |
218 | - <v-flex xs5 class="ml-3"> | |
219 | - <v-select | |
220 | - :items="addTeachers" | |
221 | - label="Select Teacher" | |
222 | - v-model="addlectures.teacherId" | |
223 | - :rules="subjectNameRules" | |
224 | - item-text="name" | |
225 | - item-value="_id" | |
226 | - required | |
227 | - ></v-select> | |
228 | - </v-flex> | |
229 | - </v-layout> | |
230 | - </v-flex> | |
231 | - <v-layout> | |
232 | - <v-flex xs12 sm8 offset-sm2> | |
233 | - <v-card-actions> | |
234 | - <v-btn round dark @click.native="closedialogLecture">Cancel</v-btn> | |
235 | - <v-spacer></v-spacer> | |
236 | - <!-- <v-btn round dark @click="updateParticularTable">Save</v-btn> --> | |
237 | - <v-btn round dark @click="AddLecture">Save</v-btn> | |
238 | - </v-card-actions> | |
239 | - </v-flex> | |
240 | - </v-layout> | |
241 | - </v-container> | |
242 | - </v-form> | |
243 | - </v-card> | |
244 | - </v-flex> | |
245 | - </v-dialog> | |
160 | + <v-dialog v-model="dialogAddLecture" max-width="1000px"> | |
161 | + <v-flex xs12 sm12> | |
162 | + <v-toolbar color="grey lighten-2"> | |
163 | + <v-spacer></v-spacer> | |
164 | + <v-toolbar-title> | |
165 | + <h3>Add Lecture</h3> | |
166 | + </v-toolbar-title> | |
167 | + <v-spacer></v-spacer> | |
168 | + </v-toolbar> | |
169 | + <v-card flat> | |
170 | + <v-form ref="form" v-model="valid" lazy-validation> | |
171 | + <v-container fluid> | |
172 | + <v-flex xs12 sm12> | |
173 | + <v-layout> | |
174 | + <v-flex xs4 class="pt-4 subheading"> | |
175 | + <label class="right">Subject Name:</label> | |
176 | + </v-flex> | |
177 | + <v-flex xs5 class="ml-3"> | |
178 | + <v-text-field | |
179 | + v-model="addlectures.subjectName" | |
180 | + :rules="subjectNameRules" | |
181 | + placeholder="fill your Subject Name" | |
182 | + type="text" | |
183 | + ></v-text-field> | |
184 | + </v-flex> | |
185 | + </v-layout> | |
186 | + </v-flex> | |
187 | + <v-flex xs12 sm12> | |
188 | + <v-layout> | |
189 | + <v-flex xs4 class="pt-4 subheading"> | |
190 | + <label class="right">Time In:</label> | |
191 | + </v-flex> | |
192 | + <v-flex xs5 class="ml-3"> | |
193 | + <v-menu | |
194 | + ref="menuD" | |
195 | + :close-on-content-click="false" | |
196 | + v-model="menu5" | |
197 | + :nudge-right="40" | |
198 | + :return-value.sync="addlectures.timeIn" | |
199 | + lazy | |
200 | + transition="scale-transition" | |
201 | + offset-y | |
202 | + full-width | |
203 | + max-width="290px" | |
204 | + min-width="290px" | |
205 | + > | |
206 | + <v-text-field | |
207 | + slot="activator" | |
208 | + v-model="addlectures.timeIn" | |
209 | + label="Select your Time Out" | |
210 | + append-icon="access_time" | |
211 | + :rules="timeInRules" | |
212 | + ></v-text-field> | |
213 | + <v-time-picker v-model="addlectures.timeIn" @change="$refs.menuD.save(addlectures.timeIn)"></v-time-picker> | |
214 | + </v-menu> | |
215 | + </v-flex> | |
216 | + </v-layout> | |
217 | + </v-flex> | |
218 | + <v-flex xs12 sm12> | |
219 | + <v-layout> | |
220 | + <v-flex xs4 class="pt-4 subheading"> | |
221 | + <label class="right">Time Out:</label> | |
222 | + </v-flex> | |
223 | + <v-flex xs5 class="ml-3"> | |
224 | + <v-menu | |
225 | + ref="menuE" | |
226 | + :close-on-content-click="false" | |
227 | + v-model="menu6" | |
228 | + :nudge-right="40" | |
229 | + :return-value.sync="addlectures.timeOut" | |
230 | + lazy | |
231 | + transition="scale-transition" | |
232 | + offset-y | |
233 | + full-width | |
234 | + max-width="290px" | |
235 | + min-width="290px" | |
236 | + > | |
237 | + <v-text-field | |
238 | + slot="activator" | |
239 | + :rules="timeOutRules" | |
240 | + v-model="addlectures.timeOut" | |
241 | + label="Select your Time Out" | |
242 | + append-icon="access_time" | |
243 | + ></v-text-field> | |
244 | + <v-time-picker v-model="addlectures.timeOut" @change="$refs.menuE.save(addlectures.timeOut)"></v-time-picker> | |
245 | + </v-menu> | |
246 | + </v-flex> | |
247 | + </v-layout> | |
248 | + </v-flex> | |
249 | + <v-flex xs12 sm12> | |
250 | + <v-layout> | |
251 | + <v-flex xs4 class="pt-4 subheading"> | |
252 | + <label class="right">Select Teacher:</label> | |
253 | + </v-flex> | |
254 | + <v-flex xs5 class="ml-3"> | |
255 | + <v-select | |
256 | + :items="addTeachers" | |
257 | + v-model="addlectures.teacherId" | |
258 | + :rules="subjectNameRules" | |
259 | + item-text="name" | |
260 | + item-value="_id" | |
261 | + required | |
262 | + ></v-select> | |
263 | + </v-flex> | |
264 | + </v-layout> | |
265 | + </v-flex> | |
266 | + <v-layout> | |
267 | + <v-flex xs12 sm8 offset-sm2> | |
268 | + <v-card-actions> | |
269 | + <v-btn round dark @click.native="closedialogLecture">Cancel</v-btn> | |
270 | + <v-spacer></v-spacer> | |
271 | + <v-btn round dark @click="AddLecture">Save</v-btn> | |
272 | + </v-card-actions> | |
273 | + </v-flex> | |
274 | + </v-layout> | |
275 | + </v-container> | |
276 | + </v-form> | |
277 | + </v-card> | |
278 | + </v-flex> | |
279 | + </v-dialog> | |
246 | 280 | |
247 | - <!-- ****** EDIT LECTURES TIME-TABLE ****** --> | |
281 | + <!-- ****** EDIT PARTICULAR LECTURES TIME-TABLE ****** --> | |
248 | 282 | |
249 | - <v-dialog v-model="dialogUpdateLectures" max-width="1000px"> | |
250 | - <v-flex xs12 sm12 class> | |
251 | - <v-toolbar color="white"> | |
252 | - <v-spacer></v-spacer> | |
253 | - <v-toolbar-title>Edit Lecture</v-toolbar-title> | |
254 | - <v-spacer></v-spacer> | |
255 | - </v-toolbar> | |
256 | - <v-card flat> | |
257 | - <v-form ref="form"> | |
258 | - <v-container fluid> | |
259 | - <v-flex xs12 sm12> | |
260 | - <v-layout> | |
261 | - <v-flex xs4 class="pt-4 subheading"> | |
262 | - <label class="right">Subject Name:</label> | |
263 | - </v-flex> | |
264 | - <v-flex xs5 class="ml-3"> | |
265 | - <v-text-field | |
266 | - v-model="updateLectures.subjectName" | |
267 | - placeholder="fill your Subject Name" | |
268 | - type="text" | |
269 | - ></v-text-field> | |
270 | - </v-flex> | |
271 | - </v-layout> | |
272 | - </v-flex> | |
273 | - <v-flex xs12 sm12> | |
274 | - <v-layout> | |
275 | - <v-flex xs4 class="pt-4 subheading"> | |
276 | - <label class="right">Time In:</label> | |
277 | - </v-flex> | |
278 | - <v-flex xs5 class="ml-3"> | |
279 | - <v-text-field | |
280 | - v-model="updateLectures.timeIn" | |
281 | - placeholder="fill your Time In" | |
282 | - type="text" | |
283 | - ></v-text-field> | |
284 | - </v-flex> | |
285 | - </v-layout> | |
286 | - </v-flex> | |
287 | - <v-flex xs12 sm12> | |
288 | - <v-layout> | |
289 | - <v-flex xs4 class="pt-4 subheading"> | |
290 | - <label class="right">Time Out:</label> | |
291 | - </v-flex> | |
292 | - <v-flex xs5 class="ml-3"> | |
293 | - <v-text-field | |
294 | - v-model="updateLectures.timeOut" | |
295 | - placeholder="fill your Time Out" | |
296 | - type="text" | |
297 | - ></v-text-field> | |
298 | - </v-flex> | |
299 | - </v-layout> | |
300 | - </v-flex> | |
301 | - <v-flex xs12 sm12> | |
302 | - <v-layout> | |
303 | - <v-flex xs4 class="pt-4 subheading"> | |
304 | - <label class="right">Select Teacher:</label> | |
305 | - </v-flex> | |
306 | - <v-flex xs5 class="ml-3"> | |
307 | - <v-select | |
308 | - :items="addTeachers" | |
309 | - label="Select Teacher" | |
310 | - v-model="updateLectures.teacherId" | |
311 | - item-text="name" | |
312 | - item-value="_id" | |
313 | - required | |
314 | - ></v-select> | |
315 | - </v-flex> | |
316 | - </v-layout> | |
317 | - </v-flex> | |
318 | - <v-layout> | |
319 | - <v-flex xs12 sm8 offset-sm2> | |
320 | - <v-card-actions> | |
321 | - <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> | |
322 | - <v-spacer></v-spacer> | |
323 | - <v-btn round dark @click="updateParticularTable">Save</v-btn> | |
324 | - </v-card-actions> | |
325 | - </v-flex> | |
326 | - </v-layout> | |
327 | - </v-container> | |
328 | - </v-form> | |
329 | - </v-card> | |
330 | - </v-flex> | |
331 | - </v-dialog> | |
332 | - | |
333 | - <v-snackbar | |
334 | - :timeout="timeout" | |
335 | - :top="y === 'top'" | |
336 | - :right="x === 'right'" | |
337 | - :vertical="mode === 'vertical'" | |
338 | - v-model="snackbar" | |
339 | - color="success" | |
340 | - >{{ text }}</v-snackbar> | |
283 | + <v-dialog v-model="dialogUpdateLectures" max-width="1000px"> | |
284 | + <v-flex xs12 sm12 class> | |
285 | + <v-toolbar color="white"> | |
286 | + <v-spacer></v-spacer> | |
287 | + <v-toolbar-title>Edit Lecture</v-toolbar-title> | |
288 | + <v-spacer></v-spacer> | |
289 | + </v-toolbar> | |
290 | + <v-card flat> | |
291 | + <v-form ref="form"> | |
292 | + <v-container fluid> | |
293 | + <v-flex xs12 sm12> | |
294 | + <v-layout> | |
295 | + <v-flex xs4 class="pt-4 subheading"> | |
296 | + <label class="right">Subject Name:</label> | |
297 | + </v-flex> | |
298 | + <v-flex xs5 class="ml-3"> | |
299 | + <v-text-field | |
300 | + v-model="updateLectures.subjectName" | |
301 | + placeholder="fill your Subject Name" | |
302 | + type="text" | |
303 | + ></v-text-field> | |
304 | + </v-flex> | |
305 | + </v-layout> | |
306 | + </v-flex> | |
307 | + <v-flex xs12 sm12> | |
308 | + <v-layout> | |
309 | + <v-flex xs4 class="pt-4 subheading"> | |
310 | + <label class="right">Time In:</label> | |
311 | + </v-flex> | |
312 | + <v-flex xs5 class="ml-3"> | |
313 | + <v-menu | |
314 | + ref="menuC" | |
315 | + :close-on-content-click="false" | |
316 | + v-model="menu4" | |
317 | + :nudge-right="40" | |
318 | + :return-value.sync="updateLectures.timeIn" | |
319 | + lazy | |
320 | + transition="scale-transition" | |
321 | + offset-y | |
322 | + full-width | |
323 | + max-width="290px" | |
324 | + min-width="290px" | |
325 | + > | |
326 | + <v-text-field | |
327 | + slot="activator" | |
328 | + v-model="updateLectures.timeIn" | |
329 | + placeholder="Select your Time In" | |
330 | + append-icon="access_time" | |
331 | + ></v-text-field> | |
332 | + <v-time-picker v-model="updateLectures.timeIn" @change="$refs.menuC.save(updateLectures.timeIn)"></v-time-picker> | |
333 | + </v-menu> | |
334 | + </v-flex> | |
335 | + </v-layout> | |
336 | + </v-flex> | |
337 | + <v-flex xs12 sm12> | |
338 | + <v-layout> | |
339 | + <v-flex xs4 class="pt-4 subheading"> | |
340 | + <label class="right">Time Out:</label> | |
341 | + </v-flex> | |
342 | + <v-flex xs5 class="ml-3"> | |
343 | + <v-menu | |
344 | + ref="menuB" | |
345 | + :close-on-content-click="false" | |
346 | + v-model="menu3" | |
347 | + :nudge-right="40" | |
348 | + :return-value.sync="updateLectures.timeOut" | |
349 | + lazy | |
350 | + transition="scale-transition" | |
351 | + offset-y | |
352 | + full-width | |
353 | + max-width="290px" | |
354 | + min-width="290px" | |
355 | + > | |
356 | + <v-text-field | |
357 | + slot="activator" | |
358 | + v-model="updateLectures.timeOut" | |
359 | + placeholder="Select your Time Out" | |
360 | + append-icon="access_time" | |
361 | + ></v-text-field> | |
362 | + <v-time-picker v-model="updateLectures.timeOut" @change="$refs.menuB.save(updateLectures.timeOut)"></v-time-picker> | |
363 | + </v-menu> | |
364 | + </v-flex> | |
365 | + </v-layout> | |
366 | + </v-flex> | |
367 | + <v-flex xs12 sm12> | |
368 | + <v-layout> | |
369 | + <v-flex xs4 class="pt-4 subheading"> | |
370 | + <label class="right">Select Teacher:</label> | |
371 | + </v-flex> | |
372 | + <v-flex xs5 class="ml-3"> | |
373 | + <v-select | |
374 | + :items="addTeachers" | |
375 | + label="Select Teacher" | |
376 | + v-model="updateLectures.teacherId" | |
377 | + item-text="name" | |
378 | + item-value="_id" | |
379 | + required | |
380 | + ></v-select> | |
381 | + </v-flex> | |
382 | + </v-layout> | |
383 | + </v-flex> | |
384 | + <v-layout> | |
385 | + <v-flex xs12 sm8 offset-sm2> | |
386 | + <v-card-actions> | |
387 | + <v-btn round dark @click.native="closeUpdateLectures">Cancel</v-btn> | |
388 | + <v-spacer></v-spacer> | |
389 | + <v-btn round dark @click="updateParticularTable(updateLectures.timeIn,updateLectures.timeOut)">Save</v-btn> | |
390 | + </v-card-actions> | |
391 | + </v-flex> | |
392 | + </v-layout> | |
393 | + </v-container> | |
394 | + </v-form> | |
395 | + </v-card> | |
396 | + </v-flex> | |
397 | + </v-dialog> | |
398 | + <v-snackbar | |
399 | + :timeout="timeout" | |
400 | + :top="y === 'top'" | |
401 | + :right="x === 'right'" | |
402 | + :vertical="mode === 'vertical'" | |
403 | + v-model="snackbar" | |
404 | + color="success" | |
405 | + >{{ text }}</v-snackbar> | |
341 | 406 | |
342 | - <!-- ****** EXISTING-USERS TIME-TABLE ****** --> | |
343 | - <v-flex xs12> | |
344 | - <v-data-table | |
345 | - :headers="headers" | |
346 | - :items="desserts" | |
347 | - :pagination.sync="pagination" | |
348 | - :search="search" | |
349 | - item-key="_id" | |
350 | - > | |
351 | - <template slot="items" slot-scope="props"> | |
352 | - <tr | |
353 | - style="cursor: pointer;" | |
354 | - @click="getTimeTable(props.item), props.expanded = !props.expanded" | |
355 | - > | |
356 | - <td class="text-xs-center">{{ props.index }}</td> | |
357 | - <td class="text-xs-center">{{ props.item.classData.classNum}}</td> | |
358 | - <td class="text-xs-center">{{ props.item.sectionData.name }}</td> | |
359 | - <td class="text-xs-center"> | |
360 | - <span> | |
361 | - <img | |
362 | - style="cursor:pointer; width:20px; height:18px; " | |
363 | - class="mr-5" | |
364 | - @click="editItem(props.item)" | |
365 | - src="/static/icon/edit1.png" | |
366 | - > | |
367 | - <img | |
368 | - style="cursor:pointer; height:20px; " | |
369 | - class="mr-5" | |
370 | - @click="deleteItem(props.item)" | |
371 | - src="/static/icon/delete1.png" | |
372 | - > | |
373 | - </span> | |
374 | - </td> | |
375 | - </tr> | |
376 | - </template> | |
377 | - <template slot="expand" slot-scope="props"> | |
378 | - <v-data-table | |
379 | - :items="timeTableList.schedule" | |
380 | - hide-actions | |
381 | - item-key="title" | |
382 | - style="width: auto;" | |
383 | - > | |
384 | - <template slot="items" slot-scope="props"> | |
385 | - <tr> | |
386 | - <td class="text-xs-left subheading"> | |
387 | - <b>{{ props.item.day }}</b> | |
388 | - </td> | |
389 | - <td> | |
390 | - <b>Subject</b> | |
391 | - <br> | |
392 | - <b>Time In</b> | |
393 | - <br> | |
394 | - <b>Time Out</b> | |
395 | - </td> | |
396 | - <td v-for="list in props.item.lectures"> | |
397 | - <b>{{ list.subjectName }}</b> | |
398 | - <img | |
399 | - style="cursor:pointer; width:20px; height:18px; " | |
400 | - class="mr-2 ml-2" | |
401 | - src="/static/icon/edit1.png" | |
402 | - @click="updateTimeTable(list, timeTableList)" | |
403 | - > | |
404 | - <img | |
405 | - style="cursor:pointer; height:20px; " | |
406 | - src="/static/icon/delete1.png" | |
407 | - @click="deleteTimeTable(list, timeTableList)" | |
408 | - > | |
409 | - <br> | |
410 | - {{list.timeIn.slice(0,16)}} | |
411 | - <br> | |
412 | - {{list.timeOut.slice(0,16)}} | |
413 | - </td> | |
414 | - <td> | |
415 | - <v-icon | |
416 | - color="black" | |
417 | - @click="addLecture(props.item._id, timeTableList._id)" | |
418 | - >add_circle_outline</v-icon> | |
419 | - </td> | |
420 | - </tr> | |
421 | - </template> | |
422 | - </v-data-table> | |
423 | - </template> | |
424 | - <v-alert | |
425 | - slot="no-results" | |
426 | - :value="true" | |
427 | - color="error" | |
428 | - icon="warning" | |
429 | - >Your search for "{{ search }}" found no results.</v-alert> | |
430 | - </v-data-table> | |
431 | - <br> | |
432 | - <br> | |
433 | - </v-flex> | |
434 | - </v-tab-item> | |
407 | + <!-- ****** EXISTING-USERS TIME-TABLE ****** --> | |
435 | 408 | |
436 | - <!-- ****** ADD MULTIPLE TIME-TABLE ****** --> | |
437 | - | |
438 | - <v-tab-item> | |
439 | - <v-container> | |
440 | - <v-snackbar | |
441 | - :timeout="timeout" | |
442 | - :top="y === 'top'" | |
443 | - :right="x === 'right'" | |
444 | - :vertical="mode === 'vertical'" | |
445 | - v-model="snackbar" | |
446 | - color="success" | |
447 | - >{{ text }}</v-snackbar> | |
448 | - <v-flex xs12 sm12 class="my-4"> | |
449 | 409 | <v-card flat> |
450 | - <v-form ref="form" v-model="valid" lazy-validation> | |
451 | - <v-container fluid> | |
410 | + <v-card-actions> | |
452 | 411 | <v-layout> |
453 | - <v-flex | |
454 | - xs12 | |
455 | - class="text-xs-center text-sm-center text-md-center text-lg-center my-4 mr-4" | |
456 | - > | |
457 | - <v-avatar size="100px"> | |
458 | - <img src="/static/icon/user.png" v-if="!imageUrl"> | |
459 | - </v-avatar> | |
460 | - <input | |
461 | - type="file" | |
462 | - style="display: none" | |
463 | - ref="image" | |
464 | - accept="image/*" | |
465 | - @change="onFilePicked" | |
466 | - > | |
467 | - <img | |
468 | - :src="imageData.imageUrl" | |
469 | - height="150" | |
470 | - v-if="imageUrl" | |
471 | - style="border-radius:50%; width:200px" | |
472 | - > | |
473 | - </v-flex> | |
474 | - </v-layout> | |
475 | - <v-flex xs12> | |
476 | - <v-layout> | |
477 | - <v-flex xs4 class="pt-4 subheading"> | |
478 | - <label class="right">Select Class:</label> | |
479 | - </v-flex> | |
480 | - <v-flex xs4 class="ml-3"> | |
481 | - <v-select | |
482 | - :items="addclass" | |
483 | - label="Select Class" | |
484 | - v-model="timeTable.select" | |
485 | - item-text="classNum" | |
486 | - item-value="_id" | |
487 | - @change="getSections(timeTable.select)" | |
488 | - required | |
489 | - ></v-select> | |
490 | - </v-flex> | |
491 | - </v-layout> | |
492 | - </v-flex> | |
493 | - <v-flex xs12> | |
494 | - <v-layout> | |
495 | - <v-flex xs4 class="pt-4 subheading"> | |
496 | - <label class="right">Select Section:</label> | |
497 | - </v-flex> | |
498 | - <v-flex xs4 class="ml-3"> | |
499 | - <v-select | |
500 | - :items="addSection" | |
501 | - label="Select Section" | |
502 | - v-model="timeTable.selectSection" | |
503 | - item-text="name" | |
504 | - item-value="_id" | |
505 | - required | |
412 | + <label class = "right mt-4 ml-5 ">Select Class:</label> | |
413 | + <v-select | |
414 | + :items="addclass" | |
415 | + label="Select Class" | |
416 | + v-model="selectTimeTable.select" | |
417 | + item-text="classNum" | |
418 | + item-value="_id" | |
419 | + name="Select Class" | |
420 | + @change="getSections(selectTimeTable.select)" | |
421 | + class="px-4" | |
422 | + required | |
506 | 423 | ></v-select> |
507 | - </v-flex> | |
508 | - </v-layout> | |
509 | - </v-flex> | |
510 | - <v-flex xs12> | |
511 | - <v-layout> | |
512 | - <v-flex xs4 class="pt-4 subheading"> | |
513 | - <label class="right">Select Teacher:</label> | |
514 | - </v-flex> | |
515 | - <v-flex xs4 class="ml-3"> | |
516 | - <v-select | |
517 | - :items="addTeachers" | |
518 | - label="Select Teacher" | |
519 | - v-model="timeTable.selectTeacher" | |
520 | - item-text="name" | |
521 | - item-value="_id" | |
522 | - required | |
424 | + <label class="right mt-4">Select Section:</label> | |
425 | + <v-select | |
426 | + :items="addSection" | |
427 | + label="Select Section" | |
428 | + v-model="selectTimeTable.selectSection" | |
429 | + item-text="name" | |
430 | + item-value="_id" | |
431 | + name="Select Section" | |
432 | + class="pl-3" | |
433 | + required | |
523 | 434 | ></v-select> |
524 | - </v-flex> | |
525 | - </v-layout> | |
526 | - </v-flex> | |
527 | - <v-flex xs12> | |
528 | - <v-layout> | |
529 | - <v-flex xs4 class="pt-4 subheading"> | |
530 | - <label class="right">Select Day:</label> | |
531 | - </v-flex> | |
532 | - <v-flex xs4 class="ml-3"> | |
533 | - <v-select | |
534 | - :items="addOneDay" | |
535 | - label="Select Day" | |
536 | - v-model="timeTable.selectDay" | |
537 | - item-text="name" | |
538 | - item-value="_id" | |
539 | - required | |
540 | - ></v-select> | |
541 | - </v-flex> | |
542 | - </v-layout> | |
543 | - </v-flex> | |
544 | - <v-flex xs12> | |
545 | - <v-layout> | |
546 | - <v-flex xs4 class="pt-4 subheading"> | |
547 | - <label class="right">Time In:</label> | |
548 | - </v-flex> | |
549 | - <v-flex xs4 class="ml-3"> | |
550 | - <v-text-field | |
551 | - v-model="timeTable.timeIn" | |
552 | - placeholder="fill your Time In" | |
553 | - type="text" | |
554 | - :rules="timeInRules" | |
555 | - required | |
556 | - ></v-text-field> | |
557 | - </v-flex> | |
558 | - </v-layout> | |
559 | - </v-flex> | |
560 | - <v-flex xs12> | |
561 | - <v-layout> | |
562 | - <v-flex xs4 class="pt-4 subheading"> | |
563 | - <label class="right">Time Out:</label> | |
564 | - </v-flex> | |
565 | - <v-flex xs4 class="ml-3"> | |
566 | - <v-text-field | |
567 | - placeholder="fill your Time Out" | |
568 | - :rules="timeOutRules" | |
569 | - v-model="timeTable.timeOut" | |
570 | - type="text" | |
571 | - required | |
572 | - ></v-text-field> | |
573 | - </v-flex> | |
574 | - </v-layout> | |
575 | - </v-flex> | |
576 | - <v-flex xs12> | |
577 | - <v-layout> | |
578 | - <v-flex xs4 class="pt-4 subheading"> | |
579 | - <label class="right">Lecture No:</label> | |
580 | - </v-flex> | |
581 | - <v-flex xs4 class="ml-3"> | |
582 | - <v-text-field | |
583 | - placeholder="fill your Lecture No" | |
584 | - :rules="lectureRules" | |
585 | - v-model="timeTable.lectureNum" | |
586 | - type="number" | |
587 | - required | |
588 | - ></v-text-field> | |
589 | - </v-flex> | |
590 | - </v-layout> | |
591 | - </v-flex> | |
592 | - <v-flex xs12> | |
593 | - <v-layout> | |
594 | - <v-flex xs4 class="pt-4 subheading"> | |
595 | - <label class="right">Subject Name:</label> | |
596 | - </v-flex> | |
597 | - <v-flex xs4 class="ml-3"> | |
598 | - <v-text-field | |
599 | - placeholder="fill your Subject Name" | |
600 | - :rules="subjectNameRules" | |
601 | - v-model="timeTable.subjectName" | |
602 | - type="text" | |
603 | - required | |
604 | - ></v-text-field> | |
605 | - </v-flex> | |
606 | - </v-layout> | |
607 | - </v-flex> | |
608 | - <v-layout> | |
609 | - <v-flex xs12 sm6 offset-sm3> | |
610 | - <v-card-actions> | |
611 | - <v-btn @click="clear" round dark>clear</v-btn> | |
612 | - <v-spacer></v-spacer> | |
613 | - <v-btn @click="submit" round dark :loading="loading">Add</v-btn> | |
614 | - </v-card-actions> | |
615 | - </v-flex> | |
616 | 435 | </v-layout> |
617 | - </v-container> | |
618 | - </v-form> | |
436 | + <v-spacer></v-spacer> | |
437 | + <v-btn @click="findTimeTable()" round dark :loading="loading" class= "left">Find</v-btn> | |
438 | + </v-card-actions> | |
619 | 439 | </v-card> |
620 | - </v-flex> | |
621 | - </v-container> | |
622 | - </v-tab-item> | |
623 | - </v-tabs> | |
624 | - <div class="loader" v-if="showLoader"> | |
625 | - <v-progress-circular indeterminate color="white"></v-progress-circular> | |
626 | - </div> | |
627 | - </v-app> | |
628 | -</template> | |
440 | + <v-flex xs12> | |
441 | + <v-data-table | |
442 | + :headers="headers" | |
443 | + :items="desserts" | |
444 | + :pagination.sync="pagination" | |
445 | + :search="search" | |
446 | + item-key="_id" | |
447 | + > | |
448 | + <template slot="items" slot-scope="props"> | |
449 | + <tr | |
450 | + style="cursor: pointer;" | |
451 | + @click="getTimeTable(props.item), props.expanded = !props.expanded" | |
452 | + > | |
453 | + <td class="text-xs-center">{{ props.index }}</td> | |
454 | + <td class="text-xs-center">{{ props.item.classData.classNum}}</td> | |
455 | + <td class="text-xs-center">{{ props.item.sectionData.name }}</td> | |
456 | + <td class="text-xs-center"> | |
457 | + <span> | |
458 | + <img | |
459 | + style="cursor:pointer; width:20px; height:18px; " | |
460 | + class="mr-5" | |
461 | + @click="editItem(props.item)" | |
462 | + src="/static/icon/edit1.png" | |
463 | + > | |
464 | + <img | |
465 | + style="cursor:pointer; height:20px; " | |
466 | + class="mr-5" | |
467 | + @click="deleteItem(props.item)" | |
468 | + src="/static/icon/delete1.png" | |
469 | + > | |
470 | + </span> | |
471 | + </td> | |
472 | + </tr> | |
473 | + </template> | |
474 | + <template slot="expand" slot-scope="props"> | |
475 | + <v-data-table | |
476 | + :items="timeTableList.schedule" | |
477 | + hide-actions | |
478 | + item-key="title" | |
479 | + style="width: auto;" | |
480 | + > | |
481 | + <template slot="items" slot-scope="props"> | |
482 | + <tr> | |
483 | + <td class="text-xs-left subheading"> | |
484 | + <b>{{ props.item.day }}</b> | |
485 | + </td> | |
486 | + <td> | |
487 | + <b>Subject</b> | |
488 | + <br> | |
489 | + <b>Time In</b> | |
490 | + <br> | |
491 | + <b>Time Out</b> | |
492 | + </td> | |
493 | + <td v-for="list in props.item.lectures"> | |
494 | + <b>{{ list.subjectName }}</b> | |
495 | + <img | |
496 | + style="cursor:pointer; width:20px; height:18px; " | |
497 | + class="mr-2 ml-2" | |
498 | + src="/static/icon/edit1.png" | |
499 | + @click="updateTimeTable(list, timeTableList)" | |
500 | + > | |
501 | + <img | |
502 | + style="cursor:pointer; height:20px; " | |
503 | + src="/static/icon/delete1.png" | |
504 | + @click="deleteTimeTable(list, timeTableList)" | |
505 | + > | |
506 | + <br> | |
507 | + {{list.timeIn.slice(0,16)}} | |
508 | + <br> | |
509 | + {{list.timeOut.slice(0,16)}} | |
510 | + </td> | |
511 | + <td> | |
512 | + <v-icon | |
513 | + color="black" | |
514 | + @click="addLecture(props.item._id, timeTableList._id)" | |
515 | + >add_circle_outline</v-icon> | |
516 | + </td> | |
517 | + </tr> | |
518 | + </template> | |
519 | + </v-data-table> | |
520 | + </template> | |
521 | + <v-alert | |
522 | + slot="no-results" | |
523 | + :value="true" | |
524 | + color="error" | |
525 | + icon="warning" | |
526 | + >Your search for "{{ search }}" found no results.</v-alert> | |
527 | + </v-data-table> | |
528 | + <br> | |
529 | + <br> | |
530 | + </v-flex> | |
531 | + </v-tab-item> | |
629 | 532 | |
630 | -<script> | |
631 | -import http from "@/Services/http.js"; | |
632 | -import Util from "@/util"; | |
533 | + <!-- ****** ADD MULTIPLE TIME-TABLE ****** --> | |
633 | 534 | |
634 | -export default { | |
635 | - data: () => ({ | |
636 | - y: "top", | |
637 | - x: "right", | |
638 | - mode: "", | |
639 | - timeout: 3000, | |
640 | - text: "", | |
641 | - search: "", | |
642 | - snackbar: false, | |
643 | - loading: false, | |
644 | - showLoader: false, | |
645 | - dialog: false, | |
646 | - dialogAddLecture: false, | |
647 | - dialogUpdateLectures: false, | |
648 | - dialog1: false, | |
649 | - valid: true, | |
650 | - // validLeacture:true, | |
651 | - isActive: true, | |
652 | - newActive: false, | |
653 | - addclass: [], | |
654 | - addSection: [], | |
655 | - addTeachers: [], | |
656 | - gender: ["Male", "Female"], | |
657 | - AddUsercredentials: {}, | |
658 | - pagination: { | |
659 | - rowsPerPage: 15 | |
660 | - }, | |
661 | - imageData: {}, | |
662 | - imageName: "", | |
663 | - imageUrl: "", | |
664 | - imageFile: "", | |
665 | - timeInRules: [v => !!v || "Time In is required"], | |
666 | - timeOutRules: [v => !!v || "Time Out is required"], | |
667 | - lectureRules: [v => !!v || "Lecture No is required"], | |
668 | - subjectNameRules: [v => !!v || "Subject Name is required"], | |
669 | - headers: [ | |
670 | - { | |
671 | - text: "No", | |
672 | - align: "center", | |
673 | - sortable: false, | |
674 | - value: "No" | |
675 | - }, | |
676 | - { | |
677 | - text: "Class Name", | |
678 | - value: "classData.classNum", | |
679 | - sortable: false, | |
680 | - align: "center" | |
681 | - }, | |
682 | - { | |
683 | - text: "Section Name", | |
684 | - value: "sectionData.name", | |
685 | - sortable: false, | |
686 | - align: "center" | |
687 | - }, | |
688 | - { text: "Action", value: "", sortable: false, align: "center" } | |
689 | - ], | |
690 | - daysHeaders: [ | |
691 | - { text: "Day", value: "dayday", sortable: false, align: "center" }, | |
692 | - { | |
693 | - text: "Subject Name", | |
694 | - value: "subjectName", | |
695 | - sortable: false, | |
696 | - align: "center" | |
697 | - }, | |
698 | - { text: "Time In", value: "timeIn", sortable: false, align: "center" }, | |
699 | - { text: "Time Out", value: "timeOut", sortable: false, align: "center" } | |
700 | - ], | |
701 | - addOneDay: [ | |
702 | - "Monday", | |
703 | - "Tuesday", | |
704 | - "Wednesday", | |
705 | - "Thursday", | |
706 | - "Friday", | |
707 | - "Saturday", | |
708 | - "Sunday" | |
709 | - ], | |
710 | - desserts: [], | |
711 | - timeTableList: [], | |
712 | - editedIndex: -1, | |
713 | - timeTable: { | |
714 | - select: "", | |
715 | - selectSection: "", | |
716 | - selectDay: "", | |
717 | - timeIn: "", | |
718 | - timeOut: "", | |
719 | - lectureNum: "", | |
720 | - subjectName: "", | |
721 | - selectTeacher: "" | |
722 | - }, | |
723 | - editedItem: { | |
724 | - classNum: "", | |
725 | - selectSection: "" | |
726 | - }, | |
727 | - addlectures: { | |
728 | - timeIn: "", | |
729 | - timeOut: "", | |
730 | - subjectName: "", | |
731 | - teacherId: "", | |
732 | - scheduleId: "", | |
733 | - timeTableId: "" | |
734 | - }, | |
735 | - updateLectures: { | |
736 | - timeIn: "", | |
737 | - timeOut: "", | |
738 | - subjectName: "", | |
739 | - teacherId: "", | |
740 | - lectureId: "", | |
741 | - scheduleId: "" | |
742 | - }, | |
743 | - items: [ | |
744 | - { | |
745 | - href: "/changepassword", | |
746 | - title: "Change Password", | |
747 | - click: e => { | |
748 | - console.log(e); | |
749 | - } | |
750 | - }, | |
751 | - { | |
752 | - href: "#", | |
753 | - title: "Logout", | |
754 | - click: e => { | |
755 | - window.getApp.$emit("APP_LOGOUT"); | |
756 | - } | |
757 | - } | |
758 | - ] | |
759 | - }), | |
760 | - methods: { | |
761 | - getSections(_id) { | |
762 | - var token = this.$store.state.token; | |
763 | - http() | |
764 | - .get( | |
765 | - "/getSectionsList", | |
766 | - { params: { classId: _id } }, | |
767 | - { | |
768 | - headers: { Authorization: "Bearer " + token } | |
769 | - } | |
770 | - ) | |
771 | - .then(response => { | |
772 | - this.addSection = response.data.data; | |
773 | - // console.log("getSectionsList=====>", this.addSection); | |
774 | - }) | |
775 | - .catch(err => { | |
776 | - // console.log("err====>", err); | |
777 | - }); | |
778 | - }, | |
779 | - getTimeTable(item) { | |
780 | - this.showLoader = true; | |
781 | - var token = this.$store.state.token; | |
782 | - http() | |
783 | - .get( | |
784 | - "/getParticularTimeTable", | |
785 | - { params: { timeTableId: item._id } }, | |
786 | - { | |
787 | - headers: { Authorization: "Bearer " + token } | |
788 | - } | |
789 | - ) | |
790 | - .then(response => { | |
791 | - this.timeTableList = response.data.data; | |
792 | - this.showLoader = false; | |
793 | - // console.log("getParticularTimeTable=====>", this.timeTableList); | |
794 | - }) | |
795 | - .catch(err => { | |
796 | - this.showLoader = false; | |
797 | - // console.log("err====>", err); | |
798 | - }); | |
799 | - }, | |
800 | - pickFile() { | |
801 | - this.$refs.image.click(); | |
802 | - }, | |
803 | - | |
804 | - onFilePicked(e) { | |
805 | - // console.log(e) | |
806 | - const files = e.target.files; | |
807 | - this.imageData.upload = e.target.files[0]; | |
808 | - if (files[0] !== undefined) { | |
809 | - this.imageName = files[0].name; | |
810 | - if (this.imageName.lastIndexOf(".") <= 0) { | |
811 | - return; | |
812 | - } | |
813 | - const fr = new FileReader(); | |
814 | - fr.readAsDataURL(files[0]); | |
815 | - fr.addEventListener("load", () => { | |
816 | - this.imageUrl = fr.result; | |
817 | - this.imageFile = files[0]; // this is an image file that can be sent to server... | |
818 | - this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | |
819 | - // console.log("upload=======>", this.imageData.imageUrl); | |
820 | - // console.log("imageFile", this.imageFile); | |
821 | - }); | |
822 | - } else { | |
823 | - this.imageName = ""; | |
824 | - this.imageFile = ""; | |
825 | - this.imageUrl = ""; | |
826 | - } | |
827 | - }, | |
828 | - getTimeTableList() { | |
829 | - this.showLoader = true; | |
830 | - var token = this.$store.state.token; | |
831 | - http() | |
832 | - .get("/getTimeTablesList", { | |
833 | - headers: { Authorization: "Bearer " + token } | |
834 | - }) | |
835 | - .then(response => { | |
836 | - this.desserts = response.data.data; | |
837 | - this.showLoader = false; | |
838 | - // console.log("getTimeTableList=====>", response.data.data); | |
839 | - }) | |
840 | - .catch(err => { | |
841 | - // console.log("err====>", err); | |
842 | - this.showLoader = false; | |
843 | - this.$router.replace({ path: "/" }); | |
844 | - }); | |
845 | - }, | |
846 | - editItem(item) { | |
847 | - this.editedIndex = this.desserts.indexOf(item); | |
848 | - this.editedItem = Object.assign({}, item); | |
849 | - this.dialog = true; | |
850 | - }, | |
851 | - updateTimeTable(timeToUpdate, classToUpdate) { | |
852 | - console.log( | |
853 | - "timeToUpdate, classToUpdate", | |
854 | - timeToUpdate._id, | |
855 | - classToUpdate.schedule | |
856 | - ); | |
857 | - for (let i = 0; i < classToUpdate.schedule.length; i++) { | |
858 | - this.updateLectures.scheduleId = classToUpdate.schedule[i]._id; | |
859 | - } | |
860 | - (this.updateLectures.lectureId = timeToUpdate._id), | |
861 | - (this.updateLectures = timeToUpdate); | |
862 | - this.dialogUpdateLectures = true; | |
863 | - }, | |
864 | - addLecture(scheduleId, timeTableId) { | |
865 | - // console.log('timeToAdd, classToAdd', scheduleId, timeTableId); | |
866 | - this.addlectures.scheduleId = scheduleId; | |
867 | - this.addlectures.timeTableId = timeTableId; | |
868 | - this.dialogAddLecture = true; | |
869 | - }, | |
870 | - AddLecture() { | |
871 | - if (this.$refs.form.validate()) { | |
872 | - http() | |
873 | - .post("/addLecture", this.addlectures) | |
874 | - .then(response => { | |
875 | - // console.log("addTimeTable=====>", this.addlectures); | |
876 | - if ((this.snackbar = true)) { | |
877 | - this.text = "New Add Lecture successfully"; | |
878 | - } | |
879 | - this.closedialogLecture(); | |
880 | - }) | |
881 | - .catch(error => { | |
882 | - if ((this.snackbar = true)) { | |
883 | - this.text = error.response.data.message; | |
884 | - } | |
885 | - }); | |
886 | - } | |
887 | - }, | |
888 | - updateParticularTable() { | |
889 | - let EditLecture = { | |
890 | - lectureId: this.updateLectures.lectureId, | |
891 | - scheduleId: this.updateLectures.scheduleId, | |
892 | - updatedLecture: { | |
893 | - timeIn: this.updateLectures.timeIn, | |
894 | - timeOut: this.updateLectures.timeOut, | |
895 | - subjectName: this.updateLectures.subjectName, | |
896 | - teacherId: this.updateLectures.teacherId | |
897 | - } | |
898 | - }; | |
899 | - console.log("updateLecture", EditLecture); | |
900 | - http() | |
901 | - .put("/updateLecture", EditLecture) | |
902 | - .then(response => { | |
903 | - console.log("updateLecture", EditLecture); | |
904 | - if ((this.snackbar = true)) { | |
905 | - this.text = "Successfully Edit Update Lecture"; | |
906 | - } | |
907 | - this.$router.go(0); | |
908 | - }) | |
909 | - .catch(error => { | |
910 | - // console.log(error); | |
911 | - }); | |
912 | - this.closeUpdateLectures(); | |
913 | - }, | |
914 | - deleteItem(item) { | |
915 | - let deleteTimeTable = { | |
916 | - timeTableId: item._id | |
917 | - }; | |
918 | - http() | |
919 | - .delete( | |
920 | - "/deleteTimeTable", | |
921 | - confirm("Are you sure you want to delete this?") && { | |
922 | - params: deleteTimeTable | |
923 | - } | |
924 | - ) | |
925 | - .then(response => { | |
926 | - // console.log("deleteUers",deleteTimeTable) | |
927 | - if ((this.snackbar = true)) { | |
928 | - this.text = "Successfully delete Existing User"; | |
929 | - } | |
930 | - this.getTimeTableList(); | |
931 | - }) | |
932 | - .catch(error => { | |
933 | - // console.log(error); | |
934 | - }); | |
935 | - }, | |
936 | - activeTab(type) { | |
937 | - switch (type) { | |
938 | - case "existing": | |
939 | - this.newActive = false; | |
940 | - this.isActive = true; | |
941 | - break; | |
535 | + <v-tab-item> | |
536 | + <v-container> | |
537 | + <v-snackbar | |
538 | + :timeout="timeout" | |
539 | + :top="y === 'top'" | |
540 | + :right="x === 'right'" | |
541 | + :vertical="mode === 'vertical'" | |
542 | + v-model="snackbar" | |
543 | + color="success" | |
544 | + >{{ text }}</v-snackbar> | |
545 | + <v-flex xs12 sm12 class="my-4"> | |
546 | + <v-card flat> | |
547 | + <v-form ref="form" v-model="valid" lazy-validation> | |
548 | + <v-container fluid> | |
549 | + <v-layout> | |
550 | + <v-flex | |
551 | + xs12 | |
552 | + class="text-xs-center text-sm-center text-md-center text-lg-center my-4 mr-4" | |
553 | + > | |
554 | + <v-avatar size="100px"> | |
555 | + <img src="/static/icon/user.png" v-if="!imageUrl"> | |
556 | + </v-avatar> | |
557 | + <input | |
558 | + type="file" | |
559 | + style="display: none" | |
560 | + ref="image" | |
561 | + accept="image/*" | |
562 | + @change="onFilePicked" | |
563 | + > | |
564 | + <img | |
565 | + :src="imageData.imageUrl" | |
566 | + height="150" | |
567 | + v-if="imageUrl" | |
568 | + style="border-radius:50%; width:200px" | |
569 | + > | |
570 | + </v-flex> | |
571 | + </v-layout> | |
572 | + <v-flex xs12> | |
573 | + <v-layout> | |
574 | + <v-flex xs4 class="pt-4 subheading"> | |
575 | + <label class="right">Select Class:</label> | |
576 | + </v-flex> | |
577 | + <v-flex xs4 class="ml-3"> | |
578 | + <v-select | |
579 | + :items="addclass" | |
580 | + label="Select Class" | |
581 | + v-model="timeTable.select" | |
582 | + item-text="classNum" | |
583 | + item-value="_id" | |
584 | + @change="getSections(timeTable.select)" | |
585 | + required | |
586 | + ></v-select> | |
587 | + </v-flex> | |
588 | + </v-layout> | |
589 | + </v-flex> | |
590 | + <v-flex xs12> | |
591 | + <v-layout> | |
592 | + <v-flex xs4 class="pt-4 subheading"> | |
593 | + <label class="right">Select Section:</label> | |
594 | + </v-flex> | |
595 | + <v-flex xs4 class="ml-3"> | |
596 | + <v-select | |
597 | + :items="addSection" | |
598 | + label="Select Section" | |
599 | + v-model="timeTable.selectSection" | |
600 | + item-text="name" | |
601 | + item-value="_id" | |
602 | + required | |
603 | + ></v-select> | |
604 | + </v-flex> | |
605 | + </v-layout> | |
606 | + </v-flex> | |
607 | + <v-flex xs12> | |
608 | + <v-layout> | |
609 | + <v-flex xs4 class="pt-4 subheading"> | |
610 | + <label class="right">Select Teacher:</label> | |
611 | + </v-flex> | |
612 | + <v-flex xs4 class="ml-3"> | |
613 | + <v-select | |
614 | + :items="addTeachers" | |
615 | + label="Select Teacher" | |
616 | + v-model="timeTable.selectTeacher" | |
617 | + item-text="name" | |
618 | + item-value="_id" | |
619 | + required | |
620 | + ></v-select> | |
621 | + </v-flex> | |
622 | + </v-layout> | |
623 | + </v-flex> | |
624 | + <v-flex xs12> | |
625 | + <v-layout> | |
626 | + <v-flex xs4 class="pt-4 subheading"> | |
627 | + <label class="right">Select Day:</label> | |
628 | + </v-flex> | |
629 | + <v-flex xs4 class="ml-3"> | |
630 | + <v-select | |
631 | + :items="addOneDay" | |
632 | + label="Select Day" | |
633 | + v-model="timeTable.selectDay" | |
634 | + item-text="name" | |
635 | + item-value="_id" | |
636 | + required | |
637 | + ></v-select> | |
638 | + </v-flex> | |
639 | + </v-layout> | |
640 | + </v-flex> | |
641 | + <v-flex xs12> | |
642 | + <v-layout> | |
643 | + <v-flex xs4 class="pt-4 subheading"> | |
644 | + <label class="right">Subject Name:</label> | |
645 | + </v-flex> | |
646 | + <v-flex xs4 class="ml-3"> | |
647 | + <v-text-field | |
648 | + placeholder="fill your Subject Name" | |
649 | + :rules="subjectNameRules" | |
650 | + v-model="timeTable.subjectName" | |
651 | + type="text" | |
652 | + required | |
653 | + ></v-text-field> | |
654 | + </v-flex> | |
655 | + </v-layout> | |
656 | + </v-flex> | |
657 | + <v-flex xs12> | |
658 | + <v-layout> | |
659 | + <v-flex xs4 class="pt-4 subheading"> | |
660 | + <label class="right">Time In:</label> | |
661 | + </v-flex> | |
662 | + <v-flex xs4 class="ml-3"> | |
663 | + <v-menu | |
664 | + ref="menuA" | |
665 | + :close-on-content-click="false" | |
666 | + v-model="menu2" | |
667 | + :nudge-right="40" | |
668 | + :return-value.sync="timeTable.timeIn" | |
669 | + lazy | |
670 | + transition="scale-transition" | |
671 | + offset-y | |
672 | + full-width | |
673 | + max-width="290px" | |
674 | + min-width="290px" | |
675 | + > | |
676 | + <v-text-field | |
677 | + slot="activator" | |
678 | + v-model="timeTable.timeIn" | |
679 | + label="Select your timeIn" | |
680 | + append-icon="access_time" | |
681 | + ></v-text-field> | |
682 | + <v-time-picker v-model="timeTable.timeIn" @change="$refs.menuA.save(timeTable.timeIn)"></v-time-picker> | |
683 | + </v-menu> | |
684 | + </v-flex> | |
685 | + </v-layout> | |
686 | + </v-flex> | |
687 | + <v-flex xs12> | |
688 | + <v-layout> | |
689 | + <v-flex xs4 class="pt-4 subheading"> | |
690 | + <label class="right">Time Out:</label> | |
691 | + </v-flex> | |
692 | + <v-flex xs4 class="ml-3"> | |
693 | + <v-menu | |
694 | + ref="menu" | |
695 | + :close-on-content-click="false" | |
696 | + v-model="menu1" | |
697 | + :nudge-right="40" | |
698 | + :return-value.sync="timeTable.timeOut" | |
699 | + lazy | |
700 | + transition="scale-transition" | |
701 | + offset-y | |
702 | + full-width | |
703 | + max-width="290px" | |
704 | + min-width="290px" | |
705 | + > | |
706 | + <v-text-field | |
707 | + slot="activator" | |
708 | + v-model="timeTable.timeOut" | |
709 | + label="Select your Time Out" | |
710 | + append-icon="access_time" | |
711 | + ></v-text-field> | |
712 | + <v-time-picker v-model="timeTable.timeOut" @change="$refs.menu.save(timeTable.timeOut)"></v-time-picker> | |
713 | + </v-menu> | |
714 | + </v-flex> | |
715 | + </v-layout> | |
716 | + </v-flex> | |
717 | + <v-layout> | |
718 | + <v-flex xs12 sm6 offset-sm3> | |
719 | + <v-card-actions> | |
720 | + <v-btn @click="clear" round dark>clear</v-btn> | |
721 | + <v-spacer></v-spacer> | |
722 | + <v-btn @click="submit" round dark :loading="loading">Add</v-btn> | |
723 | + </v-card-actions> | |
724 | + </v-flex> | |
725 | + </v-layout> | |
726 | + </v-container> | |
727 | + </v-form> | |
728 | + </v-card> | |
729 | + </v-flex> | |
730 | + </v-container> | |
731 | + </v-tab-item> | |
732 | + </v-tabs> | |
733 | + <div class="loader" v-if="showLoader"> | |
734 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
735 | + </div> | |
736 | + </v-app> | |
737 | +</template> | |
738 | +<script> | |
739 | + import http from "@/Services/http.js"; | |
740 | + import Util from "@/util"; | |
741 | + | |
742 | + export default { | |
743 | + data: () => ({ | |
744 | + y: "top", | |
745 | + x: "right", | |
746 | + mode: "", | |
747 | + timeout: 3000, | |
748 | + text: "", | |
749 | + search: "", | |
750 | + snackbar: false, | |
751 | + loading: false, | |
752 | + showLoader: false, | |
753 | + dialog: false, | |
754 | + dialogAddLecture: false, | |
755 | + dialogUpdateLectures: false, | |
756 | + dialog1: false, | |
757 | + valid: true, | |
758 | + // validLeacture:true, | |
759 | + isActive: true, | |
760 | + newActive: false, | |
761 | + addclass: [], | |
762 | + addSection: [], | |
763 | + addTeachers: [], | |
764 | + gender: ["Male", "Female"], | |
765 | + AddUsercredentials: {}, | |
766 | + pagination: { | |
767 | + rowsPerPage: 15 | |
768 | + }, | |
769 | + imageData: {}, | |
770 | + imageName: "", | |
771 | + imageUrl: "", | |
772 | + imageFile: "", | |
773 | + timeInRules: [v => !!v || "Time In is required"], | |
774 | + timeOutRules: [v => !!v || "Time Out is required"], | |
775 | + lectureRules: [v => !!v || "Lecture No is required"], | |
776 | + subjectNameRules: [v => !!v || "Subject Name is required"], | |
777 | + headers: [ | |
778 | + { | |
779 | + text: "No", | |
780 | + align: "center", | |
781 | + sortable: false, | |
782 | + value: "No" | |
783 | + }, | |
784 | + { | |
785 | + text: "Class Name", | |
786 | + value: "classData.classNum", | |
787 | + sortable: false, | |
788 | + align: "center" | |
789 | + }, | |
790 | + { | |
791 | + text: "Section Name", | |
792 | + value: "sectionData.name", | |
793 | + sortable: false, | |
794 | + align: "center" | |
795 | + }, | |
796 | + { text: "Action", value: "", sortable: false, align: "center" } | |
797 | + ], | |
798 | + daysHeaders: [ | |
799 | + { text: "Day", value: "dayday", sortable: false, align: "center" }, | |
800 | + { | |
801 | + text: "Subject Name", | |
802 | + value: "subjectName", | |
803 | + sortable: false, | |
804 | + align: "center" | |
805 | + }, | |
806 | + { text: "Time In", value: "timeIn", sortable: false, align: "center" }, | |
807 | + { text: "Time Out", value: "timeOut", sortable: false, align: "center" } | |
808 | + ], | |
809 | + addOneDay: [ | |
810 | + "Monday", | |
811 | + "Tuesday", | |
812 | + "Wednesday", | |
813 | + "Thursday", | |
814 | + "Friday", | |
815 | + "Saturday", | |
816 | + "Sunday" | |
817 | + ], | |
818 | + desserts: [], | |
819 | + timeTableList: [], | |
820 | + editedIndex: -1, | |
821 | + selectTimeTable: { | |
822 | + select: "", | |
823 | + selectSection: "", | |
824 | + }, | |
825 | + timeTable: { | |
826 | + select: "", | |
827 | + selectSection: "", | |
828 | + selectDay: "", | |
829 | + timeIn: null, | |
830 | + timeOut: null, | |
831 | + subjectName: "", | |
832 | + selectTeacher: "" | |
833 | + }, | |
834 | + editedItem: { | |
835 | + classNum: "", | |
836 | + selectSection: "" | |
837 | + }, | |
838 | + addlectures: { | |
839 | + timeIn: null, | |
840 | + timeOut: null, | |
841 | + subjectName: "", | |
842 | + teacherId: "", | |
843 | + scheduleId: "", | |
844 | + timeTableId: "" | |
845 | + }, | |
846 | + updateLectures: { | |
847 | + timeIn: null, | |
848 | + timeOut: null, | |
849 | + subjectName: "", | |
850 | + teacherId: "", | |
851 | + lectureId: "", | |
852 | + scheduleId: "" | |
853 | + }, | |
854 | + menu1: false, | |
855 | + menu2: false, | |
856 | + menu3: false, | |
857 | + menu4: false, | |
858 | + menu5: false, | |
859 | + menu6: false, | |
942 | 860 | |
943 | - default: | |
944 | - this.newActive = true; | |
945 | - this.isActive = false; | |
946 | - break; | |
947 | - } | |
948 | - }, | |
949 | - close() { | |
950 | - this.dialog = false; | |
951 | - setTimeout(() => { | |
952 | - this.editedItem = Object.assign({}, this.defaultItem); | |
953 | - this.editedIndex = -1; | |
954 | - }, 300); | |
955 | - }, | |
956 | - close1() { | |
957 | - this.dialog1 = false; | |
958 | - }, | |
959 | - closedialogLecture() { | |
960 | - this.dialogAddLecture = false; | |
961 | - this.$router.go(0); | |
962 | - }, | |
963 | - closeUpdateLectures() { | |
964 | - this.dialogUpdateLectures = false; | |
965 | - }, | |
966 | - submit() { | |
967 | - if (this.$refs.form.validate()) { | |
968 | - let imageData = new FormData(); | |
969 | - imageData.append("upload", this.imageFile); | |
970 | - // console.log(imageData); | |
971 | - let addTimeTable = { | |
972 | - sectionId: this.timeTable.selectSection, | |
973 | - classId: this.timeTable.select, | |
974 | - schedule: [ | |
975 | - { | |
976 | - day: this.timeTable.selectDay, | |
977 | - lectures: [ | |
978 | - { | |
979 | - timeIn: this.timeTable.timeIn, | |
980 | - timeOut: this.timeTable.timeOut, | |
981 | - lectureNum: this.timeTable.lectureNum, | |
982 | - subjectName: this.timeTable.subjectName, | |
983 | - teacherId: this.timeTable.selectTeacher | |
984 | - } | |
985 | - ] | |
986 | - } | |
987 | - ] | |
988 | - }; | |
989 | - http() | |
990 | - .post("/createTimeTable", addTimeTable) | |
991 | - .then(response => { | |
992 | - // console.log("addTimeTable=====>", addTimeTable); | |
993 | - if ((this.snackbar = true)) { | |
994 | - this.text = "New Time Table added successfully"; | |
995 | - } | |
996 | - this.getTimeTableList(); | |
997 | - this.clear(); | |
998 | - }) | |
999 | - .catch(error => { | |
1000 | - // console.log(error); | |
1001 | - if ((this.snackbar = true)) { | |
1002 | - this.text = error.response.data.message; | |
1003 | - } | |
1004 | - }); | |
1005 | - } | |
1006 | - }, | |
1007 | - mail() {}, | |
1008 | - download() {}, | |
1009 | - clear() { | |
1010 | - this.$refs.form.reset(); | |
1011 | - }, | |
1012 | - save() { | |
1013 | - let imageData = new FormData(); | |
1014 | - imageData.append("upload", this.imageFile); | |
1015 | - // console.log(imageData); | |
1016 | - let editTimeTable = { | |
1017 | - timeTableId: this.editedItem._id, | |
1018 | - classId: this.editedItem.classNum, | |
1019 | - sectionId: this.editedItem.selectSection | |
1020 | - // imageData | |
1021 | - }; | |
1022 | - http() | |
1023 | - .put("/updateTimeTable", editTimeTable) | |
1024 | - .then(response => { | |
1025 | - console.log("editTimeTable", editTimeTable); | |
1026 | - if ((this.snackbar = true)) { | |
1027 | - this.text = "Successfully Edit Existing User"; | |
1028 | - } | |
1029 | - this.getTimeTableList(); | |
1030 | - }) | |
1031 | - .catch(error => { | |
1032 | - // console.log(error); | |
1033 | - }); | |
1034 | - this.close(); | |
1035 | - }, | |
1036 | - handleDrawerToggle() { | |
1037 | - window.getApp.$emit("APP_DRAWER_TOGGLED"); | |
1038 | - }, | |
1039 | - handleFullScreen() { | |
1040 | - Util.toggleFullScreen(); | |
1041 | - }, | |
1042 | - deleteTimeTable(timeToDelete) { | |
1043 | - // console.log('timeToUpdate', timeToDelete._id); | |
1044 | - let deleteLecture = { | |
1045 | - lectureId: timeToDelete._id | |
1046 | - }; | |
1047 | - http() | |
1048 | - .delete( | |
1049 | - "/deleteLecture", | |
1050 | - confirm("Are you sure you want to delete this?") && { | |
1051 | - params: deleteLecture | |
1052 | - } | |
1053 | - ) | |
1054 | - .then(response => { | |
1055 | - // console.log("deleteLecture",deleteLecture) | |
1056 | - if ((this.snackbar = true)) { | |
1057 | - this.text = "Successfully delete Existing User"; | |
1058 | - } | |
1059 | - this.$router.go(0); | |
1060 | - // this.getTimeTable(); | |
1061 | - }) | |
1062 | - .catch(error => { | |
1063 | - console.log(error); | |
1064 | - }); | |
1065 | - } | |
1066 | - }, | |
1067 | - mounted() { | |
1068 | - this.getTimeTableList(); | |
1069 | - var token = this.$store.state.token; | |
1070 | - http() | |
1071 | - .get("/getClassesList", { | |
1072 | - headers: { Authorization: "Bearer " + token } | |
1073 | - }) | |
1074 | - .then(response => { | |
1075 | - this.addclass = response.data.data; | |
1076 | - // console.log("getClassesList=====>",this.addclass) | |
1077 | - }) | |
1078 | - .catch(err => { | |
1079 | - // console.log("err====>", err); | |
1080 | - }); | |
861 | + items: [ | |
862 | + { | |
863 | + href: "/changepassword", | |
864 | + title: "Change Password", | |
865 | + click: e => { | |
866 | + console.log(e); | |
867 | + } | |
868 | + }, | |
869 | + { | |
870 | + href: "#", | |
871 | + title: "Logout", | |
872 | + click: e => { | |
873 | + window.getApp.$emit("APP_LOGOUT"); | |
874 | + } | |
875 | + } | |
876 | + ] | |
877 | + }), | |
878 | + methods: { | |
879 | + findTimeTable(){ | |
880 | + http().get( | |
881 | + "/getParticularClassTimeTable", | |
882 | + { params: { sectionId: this.selectTimeTable.selectSection, classId: this.selectTimeTable.select} }, | |
883 | + ) | |
884 | + .then(response => { | |
885 | + this.desserts = response.data.data; | |
886 | + // console.log("findTimeTable=====>", this.desserts); | |
887 | + }) | |
888 | + .catch(error => { | |
889 | + console.log("err====>", error); | |
890 | + if ((this.snackbar = true)) { | |
891 | + this.text = error.response.data.message; | |
892 | + this.text = error.response.data.statusText; | |
893 | + } | |
894 | + }); | |
895 | + }, | |
896 | + getSections(_id) { | |
897 | + var token = this.$store.state.token; | |
898 | + http() | |
899 | + .get( | |
900 | + "/getSectionsList", | |
901 | + { params: { classId: _id } }, | |
902 | + { | |
903 | + headers: { Authorization: "Bearer " + token } | |
904 | + } | |
905 | + ) | |
906 | + .then(response => { | |
907 | + this.addSection = response.data.data; | |
908 | + // console.log("getSectionsList=====>", this.addSection); | |
909 | + }) | |
910 | + .catch(err => { | |
911 | + // console.log("err====>", err); | |
912 | + }); | |
913 | + }, | |
914 | + getTimeTable(item) { | |
915 | + this.showLoader = true; | |
916 | + var token = this.$store.state.token; | |
917 | + http() | |
918 | + .get( | |
919 | + "/getParticularTimeTable", | |
920 | + { params: { timeTableId: item._id } }, | |
921 | + { | |
922 | + headers: { Authorization: "Bearer " + token } | |
923 | + } | |
924 | + ) | |
925 | + .then(response => { | |
926 | + this.timeTableList = response.data.data; | |
927 | + this.showLoader = false; | |
928 | + // console.log("getParticularTimeTable=====>", this.timeTableList); | |
929 | + }) | |
930 | + .catch(err => { | |
931 | + this.showLoader = false; | |
932 | + // console.log("err====>", err); | |
933 | + }); | |
934 | + }, | |
935 | + pickFile() { | |
936 | + this.$refs.image.click(); | |
937 | + }, | |
938 | + | |
939 | + onFilePicked(e) { | |
940 | + // console.log(e) | |
941 | + const files = e.target.files; | |
942 | + this.imageData.upload = e.target.files[0]; | |
943 | + if (files[0] !== undefined) { | |
944 | + this.imageName = files[0].name; | |
945 | + if (this.imageName.lastIndexOf(".") <= 0) { | |
946 | + return; | |
947 | + } | |
948 | + const fr = new FileReader(); | |
949 | + fr.readAsDataURL(files[0]); | |
950 | + fr.addEventListener("load", () => { | |
951 | + this.imageUrl = fr.result; | |
952 | + this.imageFile = files[0]; // this is an image file that can be sent to server... | |
953 | + this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | |
954 | + // console.log("upload=======>", this.imageData.imageUrl); | |
955 | + // console.log("imageFile", this.imageFile); | |
956 | + }); | |
957 | + } else { | |
958 | + this.imageName = ""; | |
959 | + this.imageFile = ""; | |
960 | + this.imageUrl = ""; | |
961 | + } | |
962 | + }, | |
963 | + // getTimeTableList() { | |
964 | + // this.showLoader = true; | |
965 | + // var token = this.$store.state.token; | |
966 | + // http() | |
967 | + // .get("/getTimeTablesList", { | |
968 | + // headers: { Authorization: "Bearer " + token } | |
969 | + // }) | |
970 | + // .then(response => { | |
971 | + // this.desserts = response.data.data; | |
972 | + // this.showLoader = false; | |
973 | + // // console.log("getTimeTableList=====>", response.data.data); | |
974 | + // }) | |
975 | + // .catch(err => { | |
976 | + // // console.log("err====>", err); | |
977 | + // this.showLoader = false; | |
978 | + // this.$router.replace({ path: "/" }); | |
979 | + // }); | |
980 | + // }, | |
981 | + editItem(item) { | |
982 | + this.editedIndex = this.desserts.indexOf(item); | |
983 | + this.editedItem = Object.assign({}, item); | |
984 | + this.dialog = true; | |
985 | + }, | |
986 | + updateTimeTable(timeToUpdate, classToUpdate) { | |
987 | + console.log( | |
988 | + "timeToUpdate, classToUpdate", | |
989 | + timeToUpdate._id, | |
990 | + classToUpdate.schedule | |
991 | + ); | |
992 | + for (let i = 0; i < classToUpdate.schedule.length; i++) { | |
993 | + this.updateLectures.scheduleId = classToUpdate.schedule[i]._id; | |
994 | + } | |
995 | + (this.updateLectures.lectureId = timeToUpdate._id), | |
996 | + (this.updateLectures = timeToUpdate); | |
997 | + this.updateLectures.timeIn = this.updateLectures.timeIn.substring(11,15) | |
998 | + this.updateLectures.timeOut = this.updateLectures.timeOut.substring(11,15) | |
999 | + // console.log("updateLectures",this.updateLectures) | |
1000 | + this.dialogUpdateLectures = true; | |
1001 | + }, | |
1002 | + addLecture(scheduleId, timeTableId) { | |
1003 | + // console.log('timeToAdd, classToAdd', scheduleId, timeTableId); | |
1004 | + this.addlectures.scheduleId = scheduleId; | |
1005 | + this.addlectures.timeTableId = timeTableId; | |
1006 | + this.dialogAddLecture = true; | |
1007 | + }, | |
1008 | + AddLecture() { | |
1009 | + // console.log("add") | |
1010 | + // if (this.$refs.form.validate()) { | |
1011 | + http() | |
1012 | + .post("/addLecture", this.addlectures) | |
1013 | + .then(response => { | |
1014 | + // console.log("addTimeTable=====>", this.addlectures); | |
1015 | + if ((this.snackbar = true)) { | |
1016 | + this.text = "New Add Lecture successfully"; | |
1017 | + } | |
1018 | + this.closedialogLecture(); | |
1019 | + }) | |
1020 | + .catch(error => { | |
1021 | + if ((this.snackbar = true)) { | |
1022 | + this.text = error.response.data.message; | |
1023 | + this.text = error.response.data.statusText; | |
1081 | 1024 | |
1082 | - http() | |
1083 | - .get("/getTeachersList", { | |
1084 | - headers: { Authorization: "Bearer " + token } | |
1085 | - }) | |
1086 | - .then(response => { | |
1087 | - this.addTeachers = response.data.data; | |
1088 | - // console.log("getClassesList=====>",this.addTeachers) | |
1089 | - }) | |
1090 | - .catch(err => { | |
1091 | - // console.log("err====>", err); | |
1092 | - }); | |
1093 | - }, | |
1094 | - computed: { | |
1095 | - toolbarColor() { | |
1096 | - return this.$vuetify.options.extra.mainNav; | |
1097 | - } | |
1098 | - } | |
1099 | -}; | |
1025 | + } | |
1026 | + }); | |
1027 | + // } | |
1028 | + }, | |
1029 | + updateParticularTable() { | |
1030 | + let EditLecture = { | |
1031 | + lectureId: this.updateLectures.lectureId, | |
1032 | + scheduleId: this.updateLectures.scheduleId, | |
1033 | + updatedLecture: { | |
1034 | + timeIn: this.updateLectures.timeIn, | |
1035 | + timeOut: this.updateLectures.timeOut, | |
1036 | + subjectName: this.updateLectures.subjectName, | |
1037 | + teacherId: this.updateLectures.teacherId | |
1038 | + } | |
1039 | + }; | |
1040 | + console.log("updateLecture", EditLecture); | |
1041 | + http() | |
1042 | + .put("/updateLecture", EditLecture) | |
1043 | + .then(response => { | |
1044 | + console.log("updateLecture", EditLecture); | |
1045 | + if ((this.snackbar = true)) { | |
1046 | + this.text = "Successfully Edit Update Lecture"; | |
1047 | + } | |
1048 | + this.closeUpdateLectures(); | |
1049 | + this.$router.go(0); | |
1050 | + }) | |
1051 | + .catch(error => { | |
1052 | + // console.log(error); | |
1053 | + if ((this.snackbar = true)) { | |
1054 | + this.text = error.response.data.message; | |
1055 | + this.text = error.response.data.statusText; | |
1056 | + } | |
1057 | + }); | |
1058 | + }, | |
1059 | + deleteItem(item) { | |
1060 | + let deleteTimeTable = { | |
1061 | + timeTableId: item._id | |
1062 | + }; | |
1063 | + http() | |
1064 | + .delete( | |
1065 | + "/deleteTimeTable", | |
1066 | + confirm("Are you sure you want to delete this?") && { | |
1067 | + params: deleteTimeTable | |
1068 | + } | |
1069 | + ) | |
1070 | + .then(response => { | |
1071 | + // console.log("deleteUers",deleteTimeTable) | |
1072 | + if ((this.snackbar = true)) { | |
1073 | + this.text = "Successfully delete Existing User"; | |
1074 | + } | |
1075 | + this.findTimeTable(); | |
1076 | + }) | |
1077 | + .catch(error => { | |
1078 | + // console.log(error); | |
1079 | + }); | |
1080 | + }, | |
1081 | + activeTab(type) { | |
1082 | + switch (type) { | |
1083 | + case "existing": | |
1084 | + this.newActive = false; | |
1085 | + this.isActive = true; | |
1086 | + break; | |
1087 | + | |
1088 | + default: | |
1089 | + this.newActive = true; | |
1090 | + this.isActive = false; | |
1091 | + break; | |
1092 | + } | |
1093 | + }, | |
1094 | + close() { | |
1095 | + this.dialog = false; | |
1096 | + setTimeout(() => { | |
1097 | + this.editedItem = Object.assign({}, this.defaultItem); | |
1098 | + this.editedIndex = -1; | |
1099 | + }, 300); | |
1100 | + }, | |
1101 | + close1() { | |
1102 | + this.dialog1 = false; | |
1103 | + }, | |
1104 | + closedialogLecture() { | |
1105 | + this.dialogAddLecture = false; | |
1106 | + }, | |
1107 | + closeUpdateLectures() { | |
1108 | + this.dialogUpdateLectures = false; | |
1109 | + }, | |
1110 | + submit() { | |
1111 | + if (this.$refs.form.validate()) { | |
1112 | + let imageData = new FormData(); | |
1113 | + imageData.append("upload", this.imageFile); | |
1114 | + // console.log(imageData); | |
1115 | + let addTimeTable = { | |
1116 | + sectionId: this.timeTable.selectSection, | |
1117 | + classId: this.timeTable.select, | |
1118 | + schedule: [ | |
1119 | + { | |
1120 | + day: this.timeTable.selectDay, | |
1121 | + lectures: [ | |
1122 | + { | |
1123 | + timeIn: this.timeTable.timeIn, | |
1124 | + timeOut: this.timeTable.timeOut, | |
1125 | + subjectName: this.timeTable.subjectName, | |
1126 | + teacherId: this.timeTable.selectTeacher | |
1127 | + } | |
1128 | + ] | |
1129 | + } | |
1130 | + ] | |
1131 | + }; | |
1132 | + http() | |
1133 | + .post("/createTimeTable", addTimeTable) | |
1134 | + .then(response => { | |
1135 | + // console.log("addTimeTable=====>", addTimeTable); | |
1136 | + if ((this.snackbar = true)) { | |
1137 | + this.text = "New Time Table added successfully"; | |
1138 | + } | |
1139 | + this.clear(); | |
1140 | + }) | |
1141 | + .catch(error => { | |
1142 | + // console.log(error); | |
1143 | + if ((this.snackbar = true)) { | |
1144 | + this.text = error.response.data.message; | |
1145 | + } | |
1146 | + }); | |
1147 | + } | |
1148 | + }, | |
1149 | + mail() {}, | |
1150 | + download() {}, | |
1151 | + clear() { | |
1152 | + this.$refs.form.reset(); | |
1153 | + }, | |
1154 | + save() { | |
1155 | + let imageData = new FormData(); | |
1156 | + imageData.append("upload", this.imageFile); | |
1157 | + // console.log(imageData); | |
1158 | + let editTimeTable = { | |
1159 | + timeTableId: this.editedItem._id, | |
1160 | + classId: this.editedItem.classNum, | |
1161 | + sectionId: this.editedItem.selectSection | |
1162 | + // imageData | |
1163 | + }; | |
1164 | + http() | |
1165 | + .put("/updateTimeTable", editTimeTable) | |
1166 | + .then(response => { | |
1167 | + console.log("editTimeTable", editTimeTable); | |
1168 | + if ((this.snackbar = true)) { | |
1169 | + this.text = "Successfully Edit Existing User"; | |
1170 | + } | |
1171 | + this.findTimeTable(); | |
1172 | + }) | |
1173 | + .catch(error => { | |
1174 | + // console.log(error); | |
1175 | + if ((this.snackbar = true)) { | |
1176 | + this.text = error.response.data.message; | |
1177 | + } | |
1178 | + }); | |
1179 | + this.close(); | |
1180 | + }, | |
1181 | + handleDrawerToggle() { | |
1182 | + window.getApp.$emit("APP_DRAWER_TOGGLED"); | |
1183 | + }, | |
1184 | + handleFullScreen() { | |
1185 | + Util.toggleFullScreen(); | |
1186 | + }, | |
1187 | + deleteTimeTable(timeToDelete) { | |
1188 | + // console.log('timeToUpdate', timeToDelete._id); | |
1189 | + let deleteLecture = { | |
1190 | + lectureId: timeToDelete._id | |
1191 | + }; | |
1192 | + http() | |
1193 | + .delete( | |
1194 | + "/deleteLecture", | |
1195 | + confirm("Are you sure you want to delete this?") && { | |
1196 | + params: deleteLecture | |
1197 | + } | |
1198 | + ) | |
1199 | + .then(response => { | |
1200 | + // console.log("deleteLecture",deleteLecture) | |
1201 | + if ((this.snackbar = true)) { | |
1202 | + this.text = "Successfully delete Existing User"; | |
1203 | + } | |
1204 | + this.$router.go(0); | |
1205 | + // this.getTimeTable(); | |
1206 | + }) | |
1207 | + .catch(error => { | |
1208 | + console.log(error); | |
1209 | + }); | |
1210 | + } | |
1211 | + }, | |
1212 | + mounted() { | |
1213 | + // this.getTimeTableList(); | |
1214 | + var token = this.$store.state.token; | |
1215 | + http() | |
1216 | + .get("/getClassesList", { | |
1217 | + headers: { Authorization: "Bearer " + token } | |
1218 | + }) | |
1219 | + .then(response => { | |
1220 | + this.addclass = response.data.data; | |
1221 | + // console.log("getClassesList=====>",this.addclass) | |
1222 | + }) | |
1223 | + .catch(err => { | |
1224 | + // console.log("err====>", err); | |
1225 | + }); | |
1226 | + | |
1227 | + http() | |
1228 | + .get("/getTeachersList", { | |
1229 | + headers: { Authorization: "Bearer " + token } | |
1230 | + }) | |
1231 | + .then(response => { | |
1232 | + this.addTeachers = response.data.data; | |
1233 | + // console.log("getClassesList=====>",this.addTeachers) | |
1234 | + }) | |
1235 | + .catch(err => { | |
1236 | + // console.log("err====>", err); | |
1237 | + }); | |
1238 | + }, | |
1239 | + computed: { | |
1240 | + toolbarColor() { | |
1241 | + return this.$vuetify.options.extra.mainNav; | |
1242 | + } | |
1243 | + } | |
1244 | + }; | |
1100 | 1245 | </script> |
1101 | 1246 | <style scoped> |
1102 | -.theme--light .v-label, | |
1103 | -.application .theme--light.v-label { | |
1104 | - color: black; | |
1105 | -} | |
1106 | -.v-tabs__div { | |
1107 | - text-transform: none; | |
1108 | -} | |
1109 | -.v-input__prepend-outer { | |
1110 | - margin-right: 0px !important; | |
1111 | -} | |
1112 | -.v-card__actions .v-btn { | |
1113 | - margin: 0 15px; | |
1114 | - min-width: 120px; | |
1115 | -} | |
1116 | -.primary { | |
1117 | - background-color: #aaa !important; | |
1118 | - border-color: #aaa !important; | |
1119 | -} | |
1120 | -h4 { | |
1121 | - background-repeat: no-repeat; | |
1122 | - padding: 8px; | |
1123 | - margin: auto; | |
1124 | - font-size: 25px; | |
1125 | -} | |
1126 | -#name { | |
1127 | - position: absolute; | |
1128 | - left: 100px; | |
1129 | - top: 17px; | |
1130 | -} | |
1131 | -#icon { | |
1132 | - position: absolute; | |
1133 | - right: 8px; | |
1134 | - top: 8px; | |
1135 | -} | |
1136 | -#m { | |
1137 | - position: relative; | |
1138 | - left: 135px; | |
1139 | - top: -15px; | |
1140 | -} | |
1141 | -#G { | |
1142 | - position: absolute; | |
1143 | - top: 38px; | |
1144 | - color: white; | |
1145 | -} | |
1146 | -#bt { | |
1147 | - position: relative; | |
1148 | - top: -20px; | |
1149 | - left: 115px; | |
1150 | -} | |
1151 | -#e { | |
1152 | - position: relative; | |
1153 | - top: 5px; | |
1154 | - right: -30px; | |
1155 | - height: 17px; | |
1156 | - cursor: pointer; | |
1157 | -} | |
1158 | -#d { | |
1159 | - position: relative; | |
1160 | - top: 5px; | |
1161 | - right: -70px; | |
1162 | - height: 17px; | |
1163 | - cursor: pointer; | |
1164 | -} | |
1165 | -#td { | |
1166 | - border: 1px solid #dddddd; | |
1167 | - text-align: left; | |
1168 | - padding: 8px; | |
1169 | -} | |
1170 | -#dialog { | |
1171 | - height: 550px; | |
1172 | -} | |
1173 | -.active { | |
1174 | - background-color: black; | |
1175 | - color: white !important; | |
1176 | -} | |
1177 | -.activebtn { | |
1178 | - color: black !important; | |
1179 | -} | |
1180 | -#flex { | |
1181 | - height: 300px; | |
1182 | -} | |
1183 | -.top { | |
1184 | - margin-top: 100px; | |
1185 | -} | |
1186 | -.v-tabs__item a { | |
1187 | - font-size: 16px !important; | |
1188 | -} | |
1189 | -@media screen and (max-width: 769px) { | |
1190 | - .top { | |
1191 | - margin-top: 0 !important; | |
1192 | - } | |
1193 | - .userSearch .v-icon { | |
1194 | - font-size: 20px !important; | |
1195 | - margin-left: 20px; | |
1196 | - } | |
1197 | -} | |
1198 | -@media screen and (max-width: 380px) { | |
1199 | - .pl-3 { | |
1247 | + .theme--light .v-label, | |
1248 | + .application .theme--light.v-label { | |
1249 | + color: black; | |
1250 | + } | |
1251 | + .v-tabs__div { | |
1252 | + text-transform: none; | |
1253 | + } | |
1254 | + .v-input__prepend-outer { | |
1255 | + margin-right: 0px !important; | |
1256 | + } | |
1257 | + .v-card__actions .v-btn { | |
1258 | + margin: 0 15px; | |
1259 | + min-width: 120px; | |
1260 | + } | |
1261 | + .primary { | |
1262 | + background-color: #aaa !important; | |
1263 | + border-color: #aaa !important; | |
1264 | + } | |
1265 | + h4 { | |
1266 | + background-repeat: no-repeat; | |
1267 | + padding: 8px; | |
1268 | + margin: auto; | |
1269 | + font-size: 25px; | |
1270 | + } | |
1271 | + #name { | |
1272 | + position: absolute; | |
1273 | + left: 100px; | |
1274 | + top: 17px; | |
1275 | + } | |
1276 | + #icon { | |
1277 | + position: absolute; | |
1278 | + right: 8px; | |
1279 | + top: 8px; | |
1280 | + } | |
1281 | + #m { | |
1282 | + position: relative; | |
1283 | + left: 135px; | |
1284 | + top: -15px; | |
1285 | + } | |
1286 | + #G { | |
1287 | + position: absolute; | |
1288 | + top: 38px; | |
1289 | + color: white; | |
1290 | + } | |
1291 | + #bt { | |
1292 | + position: relative; | |
1293 | + top: -20px; | |
1294 | + left: 115px; | |
1295 | + } | |
1296 | + #e { | |
1297 | + position: relative; | |
1298 | + top: 5px; | |
1299 | + right: -30px; | |
1300 | + height: 17px; | |
1301 | + cursor: pointer; | |
1302 | + } | |
1303 | + #d { | |
1304 | + position: relative; | |
1305 | + top: 5px; | |
1306 | + right: -70px; | |
1307 | + height: 17px; | |
1308 | + cursor: pointer; | |
1309 | + } | |
1310 | + #td { | |
1311 | + border: 1px solid #dddddd; | |
1312 | + text-align: left; | |
1313 | + padding: 8px; | |
1314 | + } | |
1315 | + #dialog { | |
1316 | + height: 550px; | |
1317 | + } | |
1318 | + .active { | |
1319 | + background-color: black; | |
1320 | + color: white !important; | |
1321 | + } | |
1322 | + .activebtn { | |
1323 | + color: black !important; | |
1324 | + } | |
1325 | + #flex { | |
1326 | + height: 300px; | |
1327 | + } | |
1328 | + .top { | |
1329 | + margin-top: 100px; | |
1330 | + } | |
1331 | + .v-tabs__item a { | |
1332 | + font-size: 16px !important; | |
1333 | + } | |
1334 | + @media screen and (max-width: 769px) { | |
1335 | + .top { | |
1336 | + margin-top: 0 !important; | |
1337 | + } | |
1338 | + .userSearch .v-icon { | |
1339 | + font-size: 20px !important; | |
1340 | + margin-left: 20px; | |
1341 | + } | |
1342 | + } | |
1343 | + @media screen and (max-width: 380px) { | |
1344 | + .pl-3 { | |
1200 | 1345 | padding-left: 0px !important; |
1201 | - } | |
1202 | - .right { | |
1203 | - float: none !important; | |
1204 | - } | |
1205 | - .subheading { | |
1206 | - font-size: 14px !important; | |
1207 | - } | |
1208 | - .v-card__actions .v-btn { | |
1209 | - margin: 0 0px; | |
1210 | - min-width: 100px; | |
1211 | - } | |
1212 | - /* .searchIcon .v-icon { | |
1213 | - font-size: 20px; | |
1214 | - margin-left: 20px; | |
1215 | -} */ | |
1216 | - .subheading { | |
1217 | - font-size: 12px !important; | |
1218 | - } | |
1219 | - h5 { | |
1220 | - font-size: 13px; | |
1221 | - } | |
1222 | -} | |
1223 | -.v-icon { | |
1224 | - font-size: 30px; | |
1225 | -} | |
1226 | -@media screen and (min-width: 1270px) { | |
1227 | - .hide { | |
1228 | - display: none; | |
1229 | - } | |
1230 | - /* } | |
1231 | -@media screen and (max-width: 962px) { | |
1232 | -.imglogo{ | |
1233 | - position: absolute; | |
1234 | - top: 13px; | |
1235 | - left: 13px !important; | |
1236 | - width: 70px; | |
1237 | - height: 24px; | |
1238 | -} */ | |
1239 | -} | |
1240 | -@media screen and (max-width: 420px) { | |
1241 | - .userSearch .v-text-field .v-label { | |
1242 | - line-height: 24px !important; | |
1243 | - } | |
1244 | - .userSearch .v-label { | |
1245 | - font-size: 13px !important; | |
1246 | - } | |
1247 | - .v-list__tile { | |
1248 | - font-size: 14px; | |
1249 | - padding: 0 10px; | |
1250 | - } | |
1251 | - .name { | |
1252 | - font-size: 15px; | |
1253 | - } | |
1254 | -} | |
1346 | + } | |
1347 | + .right { | |
1348 | + float: none !important; | |
1349 | + } | |
1350 | + .subheading { | |
1351 | + font-size: 14px !important; | |
1352 | + } | |
1353 | + .v-card__actions .v-btn { | |
1354 | + margin: 0 0px; | |
1355 | + min-width: 100px; | |
1356 | + } | |
1357 | + /* .searchIcon .v-icon { | |
1358 | + font-size: 20px; | |
1359 | + margin-left: 20px; | |
1360 | + } */ | |
1361 | + .subheading { | |
1362 | + font-size: 12px !important; | |
1363 | + } | |
1364 | + h5 { | |
1365 | + font-size: 13px; | |
1366 | + } | |
1367 | + } | |
1368 | + .v-icon { | |
1369 | + font-size: 30px; | |
1370 | + } | |
1371 | + @media screen and (min-width: 1270px) { | |
1372 | + .hide { | |
1373 | + display: none; | |
1374 | + } | |
1375 | + } | |
1376 | + @media screen and (max-width: 420px) { | |
1377 | + .userSearch .v-text-field .v-label { | |
1378 | + line-height: 24px !important; | |
1379 | + } | |
1380 | + .userSearch .v-label { | |
1381 | + font-size: 13px !important; | |
1382 | + } | |
1383 | + .v-list__tile { | |
1384 | + font-size: 14px; | |
1385 | + padding: 0 10px; | |
1386 | + } | |
1387 | + .name { | |
1388 | + font-size: 15px; | |
1389 | + } | |
1390 | + } | |
1255 | 1391 | </style> |
1256 | 1392 | \ No newline at end of file | ... | ... |
src/router/paths.js
... | ... | @@ -34,16 +34,6 @@ export default [ |
34 | 34 | ) |
35 | 35 | }, |
36 | 36 | { |
37 | - path: '/dashboard', | |
38 | - meta: {}, | |
39 | - name: 'dashboard', | |
40 | - component: () => import( | |
41 | - /* webpackChunkName: "routes" */ | |
42 | - /* webpackMode: "lazy-once" */ | |
43 | - `@/pages/Dasboard/dashbord` | |
44 | - ) | |
45 | - }, | |
46 | - { | |
47 | 37 | path: '/changepassword', |
48 | 38 | meta: { }, |
49 | 39 | name: 'changepassword', |
... | ... | @@ -121,17 +111,17 @@ export default [ |
121 | 111 | `@/pages/Section/section.vue` |
122 | 112 | ) |
123 | 113 | }, |
124 | - { | |
125 | - path: '/event', | |
126 | - meta: { }, | |
127 | - name: 'event', | |
128 | - props: (route) => ({ type: route.query.type }), | |
129 | - component: () => import( | |
130 | - /* webpackChunkName: "routes" */ | |
131 | - /* webpackMode: "lazy-once" */ | |
132 | - `@/pages/Event/event.vue` | |
133 | - ) | |
134 | - }, | |
114 | + // { | |
115 | + // path: '/event', | |
116 | + // meta: { }, | |
117 | + // name: 'event', | |
118 | + // props: (route) => ({ type: route.query.type }), | |
119 | + // component: () => import( | |
120 | + // /* webpackChunkName: "routes" */ | |
121 | + // /* webpackMode: "lazy-once" */ | |
122 | + // `@/pages/Event/event.vue` | |
123 | + // ) | |
124 | + // }, | |
135 | 125 | { |
136 | 126 | path: '/news', |
137 | 127 | meta: { }, |
... | ... | @@ -143,17 +133,17 @@ export default [ |
143 | 133 | `@/pages/News/news.vue` |
144 | 134 | ) |
145 | 135 | }, |
146 | - { | |
147 | - path: '/reminder', | |
148 | - meta: { }, | |
149 | - name: 'reminder', | |
150 | - props: (route) => ({ type: route.query.type }), | |
151 | - component: () => import( | |
152 | - /* webpackChunkName: "routes" */ | |
153 | - /* webpackMode: "lazy-once" */ | |
154 | - `@/pages/Reminder/reminder.vue` | |
155 | - ) | |
156 | - }, | |
136 | + // { | |
137 | + // path: '/reminder', | |
138 | + // meta: { }, | |
139 | + // name: 'reminder', | |
140 | + // props: (route) => ({ type: route.query.type }), | |
141 | + // component: () => import( | |
142 | + // /* webpackChunkName: "routes" */ | |
143 | + // /* webpackMode: "lazy-once" */ | |
144 | + // `@/pages/Reminder/reminder.vue` | |
145 | + // ) | |
146 | + // }, | |
157 | 147 | { |
158 | 148 | path: '/timeTable', |
159 | 149 | meta: { }, | ... | ... |
static/icon/google.png
12.4 KB
static/icon/hangouts.png
14.9 KB
static/icon/inbox.png
21.9 KB
static/icon/keep.png
2.1 KB