Commit 37150e7c188034358ce05c0f05dfc15ee8b22147
1 parent
ec5677f432
Exists in
master
and in
3 other branches
implement school functionality with role
Showing
12 changed files
with
1456 additions
and
161 deletions
Show diff stats
src/Services/http.js
... | ... | @@ -3,7 +3,7 @@ import store from '@/store/store' |
3 | 3 | |
4 | 4 | export default () => { |
5 | 5 | return axios.create({ |
6 | - // baseURL: 'http://192.168.0.101:3002/v1', | |
6 | + // baseURL: 'http://192.168.2.221:3002/v1', | |
7 | 7 | baseURL: 'http://13.234.251.173:8001/v1', |
8 | 8 | headers: { |
9 | 9 | Authorization: `Bearer ${store.state.token}` | ... | ... |
src/api/menu.js
1 | -const Menu = [ | |
1 | +const adminMenu = [ | |
2 | 2 | // { header: 'Apps' }, |
3 | 3 | { |
4 | 4 | title: 'Dashboard', |
... | ... | @@ -181,16 +181,25 @@ const Menu = [ |
181 | 181 | } |
182 | 182 | ]; |
183 | 183 | |
184 | +const schoolMenu = [ | |
185 | + // { header: 'Apps' }, | |
186 | + { | |
187 | + title: 'School', | |
188 | + // group: 'apps', | |
189 | + path: '/school', | |
190 | + icon: '/static/schoolIcons/Dashboard.png', | |
191 | + }, | |
192 | +]; | |
184 | 193 | |
185 | 194 | // reorder menu |
186 | -Menu.forEach((item) => { | |
187 | - // if (item.items) { | |
188 | - // item.items.sort((x, y) => { | |
189 | - // let textA = x.title.toUpperCase(); | |
190 | - // let textB = y.title.toUpperCase(); | |
191 | - // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; | |
192 | - // }); | |
193 | - // } | |
194 | -}); | |
195 | +// Menu.forEach((item) => { | |
196 | +// if (item.items) { | |
197 | +// item.items.sort((x, y) => { | |
198 | +// let textA = x.title.toUpperCase(); | |
199 | +// let textB = y.title.toUpperCase(); | |
200 | +// return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; | |
201 | +// }); | |
202 | +// } | |
203 | +// }); | |
195 | 204 | |
196 | -export default Menu; | |
197 | 205 | \ No newline at end of file |
206 | +export default { adminMenu, schoolMenu }; | |
198 | 207 | \ No newline at end of file | ... | ... |
src/components/pageHeader/AppDrawer.vue
... | ... | @@ -129,7 +129,7 @@ export default { |
129 | 129 | data: () => ({ |
130 | 130 | mini: false, |
131 | 131 | drawer: true, |
132 | - menus: menu, | |
132 | + menus: [], | |
133 | 133 | scrollSettings: { |
134 | 134 | maxScrollbarLength: 160 |
135 | 135 | } |
... | ... | @@ -147,6 +147,11 @@ export default { |
147 | 147 | } |
148 | 148 | }, |
149 | 149 | created() { |
150 | + if (this.$store.state.role === "ADMIN") { | |
151 | + this.menus = menu.adminMenu; | |
152 | + } else if (this.$store.state.role === "SUPERADMIN") { | |
153 | + this.menus = menu.schoolMenu; | |
154 | + } | |
150 | 155 | window.getApp.$on("APP_DRAWER_TOGGLED", () => { |
151 | 156 | this.drawer = !this.drawer; |
152 | 157 | }); |
... | ... | @@ -177,9 +182,11 @@ export default { |
177 | 182 | overflow: auto; |
178 | 183 | } |
179 | 184 | } |
185 | + | |
180 | 186 | .v-list__group__items--no-action .v-list__tile { |
181 | - padding-left: 72px !important; | |
187 | + padding-left: 72px !important; | |
182 | 188 | } |
189 | + | |
183 | 190 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
184 | 191 | height: 60px; |
185 | 192 | font-size: 17px; | ... | ... |
src/event.js
1 | -export default [ | |
2 | - { | |
3 | - name: 'APP_LOGIN_SUCCESS', | |
4 | - callback: function (e) { | |
5 | - this.$router.push({ path: 'dashboard' }); | |
6 | - } | |
7 | - }, | |
8 | - { | |
9 | - name: 'APP_LOGOUT', | |
10 | - callback: function (e) { | |
11 | - this.snackbar = { | |
12 | - show: true, | |
13 | - color: 'green', | |
14 | - text: 'Logout successfully.' | |
15 | - }; | |
16 | - this.$store.dispatch('setToken', null) | |
17 | - this.$store.dispatch('Id', null) | |
18 | - this.$router.replace({ path: '/' }); | |
19 | - } | |
20 | - }, | |
21 | - { | |
22 | - name: 'APP_CHANGE', | |
23 | - callback: function (e) { | |
24 | - this.snackbar = { | |
25 | - show: true, | |
26 | - color: 'green', | |
27 | - text: 'Logout successfully.' | |
28 | - }; | |
29 | - this.$router.replace({ | |
30 | - path: '/' | |
31 | - }); | |
32 | - } | |
33 | - }, | |
34 | - { | |
35 | - name: 'APP_PAGE_LOADED', | |
36 | - callback: function (e) { | |
37 | - } | |
38 | - }, | |
39 | - { | |
40 | - name: 'APP_AUTH_FAILED', | |
41 | - callback: function (e) { | |
42 | - this.$router.push('/login'); | |
43 | - this.$message.error('Token has expired'); | |
44 | - } | |
45 | - }, | |
46 | - { | |
47 | - name: 'APP_BAD_REQUEST', | |
48 | - // @error api response data | |
49 | - callback: function (msg) { | |
50 | - this.$message.error(msg); | |
51 | - } | |
52 | - }, | |
53 | - { | |
54 | - name: 'APP_ACCESS_DENIED', | |
55 | - // @error api response data | |
56 | - callback: function (msg) { | |
57 | - this.$message.error(msg); | |
58 | - this.$router.push('/forbidden'); | |
59 | - } | |
60 | - }, | |
61 | - { | |
62 | - name: 'APP_RESOURCE_DELETED', | |
63 | - // @error api response data | |
64 | - callback: function (msg) { | |
65 | - this.$message.success(msg); | |
66 | - } | |
67 | - }, | |
68 | - { | |
69 | - name: 'APP_RESOURCE_UPDATED', | |
70 | - // @error api response data | |
71 | - callback: function (msg) { | |
72 | - this.$message.success(msg); | |
73 | - } | |
74 | - }, | |
1 | +export default [{ | |
2 | + name: 'APP_LOGIN_SUCCESS', | |
3 | + callback: function(e) { | |
4 | + this.$router.push({ path: 'dashboard' }); | |
5 | + } | |
6 | + }, | |
7 | + { | |
8 | + name: 'APP_LOGOUT', | |
9 | + callback: function(e) { | |
10 | + this.snackbar = { | |
11 | + show: true, | |
12 | + color: 'green', | |
13 | + text: 'Logout successfully.' | |
14 | + }; | |
15 | + this.$store.dispatch('setToken', null) | |
16 | + this.$store.dispatch('Id', null) | |
17 | + this.$store.dispatch('Role', null) | |
18 | + this.$router.replace({ path: '/' }); | |
19 | + } | |
20 | + }, | |
21 | + { | |
22 | + name: 'APP_CHANGE', | |
23 | + callback: function(e) { | |
24 | + this.snackbar = { | |
25 | + show: true, | |
26 | + color: 'green', | |
27 | + text: 'Logout successfully.' | |
28 | + }; | |
29 | + this.$router.replace({ | |
30 | + path: '/' | |
31 | + }); | |
32 | + } | |
33 | + }, | |
34 | + { | |
35 | + name: 'APP_PAGE_LOADED', | |
36 | + callback: function(e) {} | |
37 | + }, | |
38 | + { | |
39 | + name: 'APP_AUTH_FAILED', | |
40 | + callback: function(e) { | |
41 | + this.$router.push('/login'); | |
42 | + this.$message.error('Token has expired'); | |
43 | + } | |
44 | + }, | |
45 | + { | |
46 | + name: 'APP_BAD_REQUEST', | |
47 | + // @error api response data | |
48 | + callback: function(msg) { | |
49 | + this.$message.error(msg); | |
50 | + } | |
51 | + }, | |
52 | + { | |
53 | + name: 'APP_ACCESS_DENIED', | |
54 | + // @error api response data | |
55 | + callback: function(msg) { | |
56 | + this.$message.error(msg); | |
57 | + this.$router.push('/forbidden'); | |
58 | + } | |
59 | + }, | |
60 | + { | |
61 | + name: 'APP_RESOURCE_DELETED', | |
62 | + // @error api response data | |
63 | + callback: function(msg) { | |
64 | + this.$message.success(msg); | |
65 | + } | |
66 | + }, | |
67 | + { | |
68 | + name: 'APP_RESOURCE_UPDATED', | |
69 | + // @error api response data | |
70 | + callback: function(msg) { | |
71 | + this.$message.success(msg); | |
72 | + } | |
73 | + }, | |
75 | 74 | |
76 | 75 | -]; |
76 | +]; | |
77 | 77 | \ No newline at end of file | ... | ... |
src/pages/Attendence/viewStudentsAttendence.vue
src/pages/Authentication/Login.vue
... | ... | @@ -122,8 +122,14 @@ export default { |
122 | 122 | .then(response => { |
123 | 123 | this.$store.dispatch("setToken", response.data.data.token); |
124 | 124 | this.$store.dispatch("Id", response.data.data.id); |
125 | + this.$store.dispatch("Role", response.data.data.role); | |
125 | 126 | this.loading = false; |
126 | - this.$router.push("/dashboard"); | |
127 | + // console.log("{this.$store.state.state.role}",this.$store.state.role) | |
128 | + if (this.$store.state.role === "ADMIN") { | |
129 | + this.$router.push("/dashboard"); | |
130 | + } else if (this.$store.state.role === "SUPERADMIN") { | |
131 | + this.$router.push("/school"); | |
132 | + } | |
127 | 133 | }) |
128 | 134 | .catch(error => { |
129 | 135 | if (error) { | ... | ... |
src/pages/Mark/viewMark.vue
... | ... | @@ -91,6 +91,11 @@ |
91 | 91 | </v-layout> |
92 | 92 | </v-flex> |
93 | 93 | </v-layout> |
94 | + <v-layout v-if="filterData"> | |
95 | + <v-flex xs12> | |
96 | + <h5 class="text-xs-center pa-3">No Data Found</h5> | |
97 | + </v-flex> | |
98 | + </v-layout> | |
94 | 99 | </v-card> |
95 | 100 | </v-flex> |
96 | 101 | |
... | ... | @@ -177,6 +182,13 @@ |
177 | 182 | </tbody> |
178 | 183 | </table> |
179 | 184 | </v-card> |
185 | + <v-card v-if="filterData === []"> | |
186 | + <v-layout> | |
187 | + <v-flex xs12> | |
188 | + <h5 class="text-xs-center pa-3">No Data Found</h5> | |
189 | + </v-flex> | |
190 | + </v-layout> | |
191 | + </v-card> | |
180 | 192 | </v-flex> |
181 | 193 | </v-layout> |
182 | 194 | </v-flex> |
... | ... | @@ -221,21 +233,14 @@ export default { |
221 | 233 | newData[i].examination = newData[i].examId._id; |
222 | 234 | } |
223 | 235 | this.filterData = _.groupBy(newData, ["examination"]); |
224 | - console.log("check filtered data", this.filterData); | |
225 | 236 | for (let data in this.filterData) { |
226 | - // console.log("this.filterData[data].length", this.filterData[data]); | |
227 | 237 | for (let item in this.filterData[data]) { |
228 | - // console.log("check", this.filterData[data][item].studentsMarks); | |
229 | 238 | var totalMarks = 0; |
230 | 239 | for ( |
231 | 240 | let i = 0; |
232 | 241 | i < this.filterData[data][item].studentsMarks.length; |
233 | 242 | i++ |
234 | 243 | ) { |
235 | - // console.log( | |
236 | - // "check data", | |
237 | - // this.filterData[data][item].studentsMarks[i] | |
238 | - // ); | |
239 | 244 | totalMarks += this.filterData[data][item].studentsMarks[i] |
240 | 245 | .marksScored; |
241 | 246 | } |
... | ... | @@ -247,7 +252,6 @@ export default { |
247 | 252 | // for (let i = 0; i < this.markData.length; i++) { |
248 | 253 | // console.log(this.markData[i].examId.examName); |
249 | 254 | // let index = -1; |
250 | - | |
251 | 255 | // aray.forEach((dat_, k) => { |
252 | 256 | // if (dat_.category == this.markData[i].examId.examName) { |
253 | 257 | // index = k; |
... | ... | @@ -261,40 +265,8 @@ export default { |
261 | 265 | // obj.extraData.push(this.markData[i]); |
262 | 266 | // aray.push(obj); |
263 | 267 | // } else { |
264 | - // console.log("=o", this.markData[i]); | |
265 | - // // aray[index].extraData = | |
266 | - | |
267 | 268 | // aray[index].extraData.push(this.markData[i]); |
268 | 269 | // } |
269 | - // console.log("aray-", aray); | |
270 | - | |
271 | - // for (let j = 0; j < this.markData[i].studentsMarks.length; j++) { | |
272 | - // // console.log("this.studentsMarksSSSSSSSSSSSSS",this.markData[i].studentsMarks[j].marksObtained) | |
273 | - | |
274 | - // this.markDistributions = this.markData[i].studentsMarks[ | |
275 | - // j | |
276 | - // ].marksObtained; | |
277 | - // for ( | |
278 | - // let k = 0; | |
279 | - // k < this.markData[i].studentsMarks[j].marksObtained.length; | |
280 | - // k++ | |
281 | - // ) { | |
282 | - // this.markParticularDistributionData.push( | |
283 | - // this.markData[i].studentsMarks[j].marksObtained[k].marksScored | |
284 | - // ); | |
285 | - // this.markParticularDistributionData.push( | |
286 | - // this.markData[i].studentsMarks[j].marksObtained[k] | |
287 | - // .markDistributionId.markValue | |
288 | - // ); | |
289 | - // // console.log( | |
290 | - // // "this.markParticularDistributionData", | |
291 | - // // this.markParticularDistributionData | |
292 | - // // ); | |
293 | - // } | |
294 | - // } | |
295 | - // } | |
296 | - // this.markData = aray; | |
297 | - // console.log("aray-2", aray); | |
298 | 270 | this.showLoader = false; |
299 | 271 | }) |
300 | 272 | .catch(error => { |
... | ... | @@ -322,10 +294,6 @@ table { |
322 | 294 | border-collapse: collapse; |
323 | 295 | border: 1px solid #e2e7eb; |
324 | 296 | } |
325 | -tbody > tr > td, | |
326 | -.table-bordered { | |
327 | - border: 1px solid #ddd; | |
328 | -} | |
329 | 297 | th, |
330 | 298 | td { |
331 | 299 | border: 1px solid #e2e7eb; | ... | ... |
src/pages/Report/progressCardReport.vue
... | ... | @@ -96,7 +96,6 @@ |
96 | 96 | </v-flex> |
97 | 97 | </v-layout> |
98 | 98 | <v-flex xs12 sm12 id="printMe"> |
99 | - <!-- <v-container fluid grid-list-md> --> | |
100 | 99 | <v-layout wrap> |
101 | 100 | <v-flex xs12 sm12 md3> |
102 | 101 | <v-card class="fixcolors white--text" flat> |
... | ... | @@ -265,7 +264,6 @@ |
265 | 264 | </v-card> |
266 | 265 | </v-flex> |
267 | 266 | </v-layout> |
268 | - <!-- </v-container> --> | |
269 | 267 | </v-flex> |
270 | 268 | </v-container> |
271 | 269 | <div class="loader" v-if="showLoader"> | ... | ... |
src/pages/School/school.vue
... | ... | @@ -0,0 +1,1290 @@ |
1 | +<template> | |
2 | + <div> | |
3 | + <v-tabs grow slider-color="gray"> | |
4 | + <v-tab | |
5 | + ripple | |
6 | + @click="activeTab('existing')" | |
7 | + v-bind:class="{ active: isActive }" | |
8 | + id="tab" | |
9 | + class="subheading" | |
10 | + >Existing School</v-tab> | |
11 | + <v-tab | |
12 | + ripple | |
13 | + @click="activeTab('new')" | |
14 | + v-bind:class="{ active: newActive }" | |
15 | + id="tab1" | |
16 | + User | |
17 | + class="subheading" | |
18 | + >Add New School</v-tab> | |
19 | + | |
20 | + <!-- ****** EDITS STUDENTS DETAILS ****** --> | |
21 | + | |
22 | + <v-tab-item> | |
23 | + <v-snackbar | |
24 | + :timeout="timeout" | |
25 | + :top="y === 'top'" | |
26 | + :right="x === 'right'" | |
27 | + :vertical="mode === 'vertical'" | |
28 | + v-model="snackbar" | |
29 | + color="success" | |
30 | + >{{ text }}</v-snackbar> | |
31 | + <v-dialog v-model="dialog" max-width="1500px" scrollable> | |
32 | + <v-card flat> | |
33 | + <v-toolbar color="grey lighten-2" flat> | |
34 | + <v-spacer></v-spacer> | |
35 | + <v-toolbar-title> | |
36 | + <h3>Edit School</h3> | |
37 | + </v-toolbar-title> | |
38 | + <v-spacer></v-spacer> | |
39 | + </v-toolbar> | |
40 | + <v-card-text style="height: 686px;"> | |
41 | + <v-form ref="form"> | |
42 | + <v-container fluid> | |
43 | + <v-layout> | |
44 | + <v-flex | |
45 | + xs12 | |
46 | + class="text-xs-center text-sm-center text-md-center text-lg-center" | |
47 | + > | |
48 | + <v-avatar size="160px"> | |
49 | + <img | |
50 | + src="/static/icon/user.png" | |
51 | + v-if="!editedItem.schoolLogoUrl && !imageUrl" | |
52 | + /> | |
53 | + <img | |
54 | + :src="editedItem.schoolLogoUrl" | |
55 | + v-else-if="editedItem.schoolLogoUrl && !imageUrl" | |
56 | + /> | |
57 | + <img | |
58 | + v-if="imageUrl" | |
59 | + :src="imageUrl" | |
60 | + height="150" | |
61 | + style="border-radius:50%; width:200px" | |
62 | + /> | |
63 | + </v-avatar> | |
64 | + <input | |
65 | + type="file" | |
66 | + style="display: none" | |
67 | + ref="image" | |
68 | + accept="image/*" | |
69 | + @change="onFilePicked" | |
70 | + /> | |
71 | + </v-flex> | |
72 | + </v-layout> | |
73 | + <v-layout> | |
74 | + <v-flex xs12 sm4> | |
75 | + <v-layout> | |
76 | + <v-flex xs4 class="pt-4 subheading"> | |
77 | + <label class="right hidden-xs-only hidden-sm-only">Full Name:</label> | |
78 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label> | |
79 | + </v-flex> | |
80 | + <v-flex xs8 class="ml-3"> | |
81 | + <v-text-field v-model="editedItem.name" placeholder="fill your full Name"></v-text-field> | |
82 | + </v-flex> | |
83 | + </v-layout> | |
84 | + </v-flex> | |
85 | + <v-flex xs12 sm4> | |
86 | + <v-layout> | |
87 | + <v-flex xs4 class="pt-4 subheading"> | |
88 | + <label class="right hidden-xs-only hidden-sm-only">Email ID:</label> | |
89 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">EmailID:</label> | |
90 | + </v-flex> | |
91 | + <v-flex xs8 class="ml-3"> | |
92 | + <v-text-field placeholder="fill your email" v-model="editedItem.email"></v-text-field> | |
93 | + </v-flex> | |
94 | + </v-layout> | |
95 | + </v-flex> | |
96 | + <v-flex xs12 sm4> | |
97 | + <v-layout> | |
98 | + <v-flex xs4 class="pt-4 subheading"> | |
99 | + <label>Society Name:</label> | |
100 | + </v-flex> | |
101 | + <v-flex xs8 class="ml-3"> | |
102 | + <v-text-field | |
103 | + placeholder="fill your Society Name" | |
104 | + v-model="editedItem.societyName" | |
105 | + ></v-text-field> | |
106 | + </v-flex> | |
107 | + </v-layout> | |
108 | + </v-flex> | |
109 | + </v-layout> | |
110 | + <v-layout> | |
111 | + <v-flex xs12 sm4> | |
112 | + <v-layout> | |
113 | + <v-flex xs4 class="pt-4 subheading"> | |
114 | + <label class="right">City:</label> | |
115 | + </v-flex> | |
116 | + <v-flex xs8 class="ml-3"> | |
117 | + <v-text-field v-model="editedItem.city" placeholder="fill your City Name"></v-text-field> | |
118 | + </v-flex> | |
119 | + </v-layout> | |
120 | + </v-flex> | |
121 | + <v-flex xs12 sm4> | |
122 | + <v-layout> | |
123 | + <v-flex xs4 class="pt-4 subheading"> | |
124 | + <label class="right">State:</label> | |
125 | + </v-flex> | |
126 | + <v-flex xs8 class="ml-3"> | |
127 | + <v-text-field | |
128 | + v-model="editedItem.state" | |
129 | + placeholder="fill your City Name" | |
130 | + ></v-text-field> | |
131 | + </v-flex> | |
132 | + </v-layout> | |
133 | + </v-flex> | |
134 | + <v-flex xs12 sm4> | |
135 | + <v-layout> | |
136 | + <v-flex xs4 class="pt-4 subheading"> | |
137 | + <label class="right">Pincode:</label> | |
138 | + </v-flex> | |
139 | + <v-flex xs8 class="ml-3"> | |
140 | + <v-text-field | |
141 | + v-model="editedItem.pinCode" | |
142 | + placeholder="fill your pincode" | |
143 | + type="number" | |
144 | + ></v-text-field> | |
145 | + </v-flex> | |
146 | + </v-layout> | |
147 | + </v-flex> | |
148 | + </v-layout> | |
149 | + <v-layout> | |
150 | + <v-flex xs12 sm4> | |
151 | + <v-layout> | |
152 | + <v-flex xs4 class="pt-4 subheading"> | |
153 | + <label class="right">Fax No:</label> | |
154 | + </v-flex> | |
155 | + <v-flex xs8 class="ml-3"> | |
156 | + <v-text-field v-model="editedItem.faxNo" placeholder="fill your fax No"></v-text-field> | |
157 | + </v-flex> | |
158 | + </v-layout> | |
159 | + </v-flex> | |
160 | + <v-flex xs12 sm4> | |
161 | + <v-layout> | |
162 | + <v-flex xs4 class="pt-4 subheading"> | |
163 | + <label class="right">Country:</label> | |
164 | + </v-flex> | |
165 | + <v-flex xs8 class="ml-3"> | |
166 | + <v-text-field | |
167 | + v-model="editedItem.country" | |
168 | + placeholder="fill your Country" | |
169 | + ></v-text-field> | |
170 | + </v-flex> | |
171 | + </v-layout> | |
172 | + </v-flex> | |
173 | + <v-flex xs12 sm4> | |
174 | + <v-layout> | |
175 | + <v-flex xs4 class="pt-4 subheading"> | |
176 | + <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label> | |
177 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label> | |
178 | + </v-flex> | |
179 | + <v-flex xs8 class="ml-3"> | |
180 | + <v-text-field | |
181 | + v-model="editedItem.mobile" | |
182 | + placeholder="fill your MobileNo" | |
183 | + name="mobileNo" | |
184 | + ></v-text-field> | |
185 | + </v-flex> | |
186 | + </v-layout> | |
187 | + </v-flex> | |
188 | + </v-layout> | |
189 | + <v-layout> | |
190 | + <v-flex xs12 sm4> | |
191 | + <v-layout> | |
192 | + <v-flex xs4 class="pt-4 subheading"> | |
193 | + <label class="right hidden-xs-only hidden-sm-only">LandLine No:</label> | |
194 | + <label | |
195 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
196 | + >LandLineNo:</label> | |
197 | + </v-flex> | |
198 | + <v-flex xs8 class="ml-3"> | |
199 | + <v-text-field | |
200 | + v-model="editedItem.landLineNo" | |
201 | + placeholder="fill your LandLine No" | |
202 | + type="number" | |
203 | + ></v-text-field> | |
204 | + </v-flex> | |
205 | + </v-layout> | |
206 | + </v-flex> | |
207 | + <v-flex xs12 sm4> | |
208 | + <v-layout> | |
209 | + <v-flex xs4 class="pt-4 subheading"> | |
210 | + <label class="right hidden-xs-only hidden-sm-only">Registration No:</label> | |
211 | + <label | |
212 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
213 | + >Registration-No:</label> | |
214 | + </v-flex> | |
215 | + <v-flex xs8 class="ml-3"> | |
216 | + <v-text-field | |
217 | + v-model="editedItem.registrationNo" | |
218 | + placeholder="fill your Registration No" | |
219 | + type="number" | |
220 | + ></v-text-field> | |
221 | + </v-flex> | |
222 | + </v-layout> | |
223 | + </v-flex> | |
224 | + <v-flex xs12 sm4> | |
225 | + <v-layout> | |
226 | + <v-flex xs4 class="pt-4 subheading"> | |
227 | + <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> | |
228 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod:</label> | |
229 | + </v-flex> | |
230 | + <v-flex xs8 class="ml-3"> | |
231 | + <v-text-field | |
232 | + label="Select Image" | |
233 | + @click="pickFile" | |
234 | + v-model="imageName" | |
235 | + append-icon="attach_file" | |
236 | + ></v-text-field> | |
237 | + </v-flex> | |
238 | + </v-layout> | |
239 | + </v-flex> | |
240 | + </v-layout> | |
241 | + <v-layout> | |
242 | + <v-flex xs12 sm4> | |
243 | + <v-layout> | |
244 | + <v-flex xs4 class="pt-4 subheading"> | |
245 | + <label class="right hidden-xs-only hidden-sm-only">School Details:</label> | |
246 | + <label | |
247 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
248 | + >SchoolDetail:</label> | |
249 | + </v-flex> | |
250 | + <v-flex xs8 class="ml-3"> | |
251 | + <v-text-field | |
252 | + v-model="editedItem.schoolDetails" | |
253 | + placeholder="fill your School Details" | |
254 | + ></v-text-field> | |
255 | + </v-flex> | |
256 | + </v-layout> | |
257 | + </v-flex> | |
258 | + <v-flex xs12 sm4> | |
259 | + <v-layout> | |
260 | + <v-flex xs4 class="pt-4 subheading"> | |
261 | + <label class="right hidden-xs-only hidden-sm-only">Academic Year:</label> | |
262 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Year:</label> | |
263 | + </v-flex> | |
264 | + <v-flex xs8 class="ml-3"> | |
265 | + <v-text-field | |
266 | + v-model="editedItem.establishmentYear" | |
267 | + placeholder="fill your Academic Year" | |
268 | + ></v-text-field> | |
269 | + </v-flex> | |
270 | + </v-layout> | |
271 | + </v-flex> | |
272 | + <v-flex xs12 sm4> | |
273 | + <v-layout> | |
274 | + <v-flex xs4 class="pt-4 subheading"> | |
275 | + <label class="right hidden-xs-only hidden-sm-only">Web Site Url:</label> | |
276 | + <label | |
277 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
278 | + >WebSiteUrl:</label> | |
279 | + </v-flex> | |
280 | + <v-flex xs8 class="ml-3"> | |
281 | + <v-text-field | |
282 | + v-model="editedItem.websiteUrl" | |
283 | + placeholder="fill your MobileNo" | |
284 | + ></v-text-field> | |
285 | + </v-flex> | |
286 | + </v-layout> | |
287 | + </v-flex> | |
288 | + </v-layout> | |
289 | + <v-layout> | |
290 | + <v-flex xs12 sm4> | |
291 | + <v-layout> | |
292 | + <v-flex xs4 class="pt-4 subheading"> | |
293 | + <label class="right">Address:</label> | |
294 | + </v-flex> | |
295 | + <v-flex xs8 class="ml-3"> | |
296 | + <v-text-field | |
297 | + v-model="editedItem.address" | |
298 | + placeholder="Select your Address" | |
299 | + ></v-text-field> | |
300 | + </v-flex> | |
301 | + </v-layout> | |
302 | + </v-flex> | |
303 | + </v-layout> | |
304 | + <v-layout> | |
305 | + <v-flex xs12 sm12> | |
306 | + <v-layout> | |
307 | + <v-flex xs6> | |
308 | + <v-btn round dark @click.native="close">Cancel</v-btn> | |
309 | + </v-flex> | |
310 | + <v-flex xs6> | |
311 | + <v-btn @click="save" round dark :loading="loading" class="right">Save</v-btn> | |
312 | + </v-flex> | |
313 | + </v-layout> | |
314 | + </v-flex> | |
315 | + </v-layout> | |
316 | + </v-container> | |
317 | + </v-form> | |
318 | + </v-card-text> | |
319 | + </v-card> | |
320 | + </v-dialog> | |
321 | + | |
322 | + <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** --> | |
323 | + | |
324 | + <v-dialog v-model="dialog1" max-width="1100px" scrollable> | |
325 | + <v-card> | |
326 | + <v-toolbar color="grey lighten-2" flat> | |
327 | + <v-spacer></v-spacer> | |
328 | + <v-toolbar-title>School</v-toolbar-title> | |
329 | + <v-spacer></v-spacer> | |
330 | + <v-icon @click="close1">close</v-icon> | |
331 | + </v-toolbar> | |
332 | + <v-card-text style="height: 700px;"> | |
333 | + <v-flex align-center justify-center layout text-xs-center class="mt-3"> | |
334 | + <v-avatar size="160px"> | |
335 | + <img src="/static/icon/user.png" v-if="!editedItem.schoolLogoUrl" /> | |
336 | + <img :src="editedItem.schoolLogoUrl" v-else-if="editedItem.schoolLogoUrl" /> | |
337 | + </v-avatar> | |
338 | + </v-flex> | |
339 | + <v-container grid-list-md> | |
340 | + <v-layout wrap> | |
341 | + <v-flex xs12 sm6> | |
342 | + <v-layout> | |
343 | + <v-flex xs6 sm5> | |
344 | + <h5 class="right my-1"> | |
345 | + <b>Full Name:</b> | |
346 | + </h5> | |
347 | + </v-flex> | |
348 | + <v-flex sm7 xs6> | |
349 | + <h5 class="my-1 left">{{ editedItem.name }}</h5> | |
350 | + </v-flex> | |
351 | + </v-layout> | |
352 | + </v-flex> | |
353 | + <v-flex xs12 sm6> | |
354 | + <v-layout> | |
355 | + <v-flex xs6 sm4> | |
356 | + <h5 class="right my-1"> | |
357 | + <b>Email:</b> | |
358 | + </h5> | |
359 | + </v-flex> | |
360 | + <v-flex sm8 xs6> | |
361 | + <h5 class="my-1 left">{{ editedItem.email }}</h5> | |
362 | + </v-flex> | |
363 | + </v-layout> | |
364 | + </v-flex> | |
365 | + </v-layout> | |
366 | + <v-layout wrap> | |
367 | + <v-flex xs12 sm6> | |
368 | + <v-layout> | |
369 | + <v-flex xs6 sm5> | |
370 | + <b> | |
371 | + <h5 class="right my-1"> | |
372 | + <b>Create:</b> | |
373 | + </h5> | |
374 | + </b> | |
375 | + </v-flex> | |
376 | + <v-flex sm7 xs6> | |
377 | + <h5 class="my-1">{{ dates(editedItem.created) }}</h5> | |
378 | + </v-flex> | |
379 | + </v-layout> | |
380 | + </v-flex> | |
381 | + <v-flex xs12 sm6> | |
382 | + <v-layout> | |
383 | + <v-flex xs6 sm4> | |
384 | + <b> | |
385 | + <h5 class="right my-1"> | |
386 | + <b>City:</b> | |
387 | + </h5> | |
388 | + </b> | |
389 | + </v-flex> | |
390 | + <v-flex sm8 xs6> | |
391 | + <h5 class="my-1 left">{{ editedItem.city }}</h5> | |
392 | + </v-flex> | |
393 | + </v-layout> | |
394 | + </v-flex> | |
395 | + </v-layout> | |
396 | + <v-layout wrap> | |
397 | + <v-flex xs12 sm6> | |
398 | + <v-layout> | |
399 | + <v-flex xs6 sm5> | |
400 | + <b> | |
401 | + <h5 class="right my-1"> | |
402 | + <b>State:</b> | |
403 | + </h5> | |
404 | + </b> | |
405 | + </v-flex> | |
406 | + <v-flex sm7 xs6> | |
407 | + <h5 class="my-1 left">{{ editedItem.state }}</h5> | |
408 | + </v-flex> | |
409 | + </v-layout> | |
410 | + </v-flex> | |
411 | + <v-flex xs12 sm6> | |
412 | + <v-layout> | |
413 | + <v-flex xs6 sm4> | |
414 | + <b> | |
415 | + <h5 class="right my-1"> | |
416 | + <b>Pincode:</b> | |
417 | + </h5> | |
418 | + </b> | |
419 | + </v-flex> | |
420 | + <v-flex sm8 xs6> | |
421 | + <h5 class="my-1">{{ editedItem.pinCode }}</h5> | |
422 | + </v-flex> | |
423 | + </v-layout> | |
424 | + </v-flex> | |
425 | + </v-layout> | |
426 | + <v-layout wrap> | |
427 | + <v-flex xs12 sm6> | |
428 | + <v-layout> | |
429 | + <v-flex xs6 sm5> | |
430 | + <b> | |
431 | + <h5 class="right my-1"> | |
432 | + <b>Fax No:</b> | |
433 | + </h5> | |
434 | + </b> | |
435 | + </v-flex> | |
436 | + <v-flex sm7 xs6> | |
437 | + <h5 class="my-1 left">{{ editedItem.faxNo }}</h5> | |
438 | + </v-flex> | |
439 | + </v-layout> | |
440 | + </v-flex> | |
441 | + <v-flex xs12 sm6> | |
442 | + <v-layout> | |
443 | + <v-flex xs6 sm4> | |
444 | + <b> | |
445 | + <h5 class="right my-1"> | |
446 | + <b>Country:</b> | |
447 | + </h5> | |
448 | + </b> | |
449 | + </v-flex> | |
450 | + <v-flex sm8 xs6> | |
451 | + <h5 class="my-1">{{ editedItem.country }}</h5> | |
452 | + </v-flex> | |
453 | + </v-layout> | |
454 | + </v-flex> | |
455 | + </v-layout> | |
456 | + <v-layout wrap> | |
457 | + <v-flex xs12 sm6> | |
458 | + <v-layout> | |
459 | + <v-flex xs6 sm5> | |
460 | + <b> | |
461 | + <h5 class="right my-1"> | |
462 | + <b>Mobile No:</b> | |
463 | + </h5> | |
464 | + </b> | |
465 | + </v-flex> | |
466 | + <v-flex sm7 xs6> | |
467 | + <h5 class="my-1">{{ editedItem.mobile }}</h5> | |
468 | + </v-flex> | |
469 | + </v-layout> | |
470 | + </v-flex> | |
471 | + <v-flex xs12 sm5> | |
472 | + <v-layout> | |
473 | + <v-flex xs6 sm5> | |
474 | + <b> | |
475 | + <h5 class="right my-1"> | |
476 | + <b>Country:</b> | |
477 | + </h5> | |
478 | + </b> | |
479 | + </v-flex> | |
480 | + <v-flex sm7 xs6> | |
481 | + <h5 class="my-1">{{ editedItem.country }}</h5> | |
482 | + </v-flex> | |
483 | + </v-layout> | |
484 | + </v-flex> | |
485 | + </v-layout> | |
486 | + <v-layout wrap> | |
487 | + <v-flex xs12 sm6> | |
488 | + <v-layout> | |
489 | + <v-flex sm5 xs6> | |
490 | + <b> | |
491 | + <h5 class="right my-1"> | |
492 | + <b>LandLine No:</b> | |
493 | + </h5> | |
494 | + </b> | |
495 | + </v-flex> | |
496 | + <v-flex sm6 xs6> | |
497 | + <h5 class="my-1">{{ editedItem.landLineNo }}</h5> | |
498 | + </v-flex> | |
499 | + </v-layout> | |
500 | + </v-flex> | |
501 | + <v-flex xs12 sm6> | |
502 | + <v-layout> | |
503 | + <v-flex xs6 sm4 class="hidden-xs-only hidden-sm-only"> | |
504 | + <b> | |
505 | + <h5 class="right my-1"> | |
506 | + <b>Registration No:</b> | |
507 | + </h5> | |
508 | + </b> | |
509 | + </v-flex> | |
510 | + <v-flex xs6 sm4 class="hidden-lg-only hidden-md-only hidden-xl-only"> | |
511 | + <b> | |
512 | + <h5 class="right my-1"> | |
513 | + <b>RegistrationNo:</b> | |
514 | + </h5> | |
515 | + </b> | |
516 | + </v-flex> | |
517 | + <v-flex sm8 xs6> | |
518 | + <h5 class="my-1">{{ editedItem.registrationNo }}</h5> | |
519 | + </v-flex> | |
520 | + </v-layout> | |
521 | + </v-flex> | |
522 | + </v-layout> | |
523 | + <v-layout wrap> | |
524 | + <v-flex xs12 sm6> | |
525 | + <v-layout> | |
526 | + <v-flex xs6 sm5> | |
527 | + <b> | |
528 | + <h5 class="right my-1"> | |
529 | + <b>School Details:</b> | |
530 | + </h5> | |
531 | + </b> | |
532 | + </v-flex> | |
533 | + <v-flex sm7 xs6> | |
534 | + <h5 class="my-1">{{ editedItem.schoolDetails }}</h5> | |
535 | + </v-flex> | |
536 | + </v-layout> | |
537 | + </v-flex> | |
538 | + <v-flex xs12 sm6> | |
539 | + <v-layout> | |
540 | + <v-flex xs6 sm4> | |
541 | + <b> | |
542 | + <h5 class="right my-1"> | |
543 | + <b>Address:</b> | |
544 | + </h5> | |
545 | + </b> | |
546 | + </v-flex> | |
547 | + <v-flex sm8 xs6> | |
548 | + <h5 class="my-1">{{ editedItem.address }}</h5> | |
549 | + </v-flex> | |
550 | + </v-layout> | |
551 | + </v-flex> | |
552 | + </v-layout> | |
553 | + <v-layout wrap> | |
554 | + <v-flex xs12 sm5> | |
555 | + <v-layout> | |
556 | + <v-flex xs6 sm6 class="hidden-xs-only hidden-sm-only"> | |
557 | + <b> | |
558 | + <h5 class="right my-1"> | |
559 | + <b>Academic Year:</b> | |
560 | + </h5> | |
561 | + </b> | |
562 | + </v-flex> | |
563 | + <v-flex xs6 sm6 class="hidden-lg-only hidden-md-only hidden-xl-only"> | |
564 | + <b> | |
565 | + <h5 class="right my-1"> | |
566 | + <b>AcademicYear:</b> | |
567 | + </h5> | |
568 | + </b> | |
569 | + </v-flex> | |
570 | + <v-flex sm6 xs6> | |
571 | + <h5 class="my-1">{{ editedItem.establishmentYear }}</h5> | |
572 | + </v-flex> | |
573 | + </v-layout> | |
574 | + </v-flex> | |
575 | + </v-layout> | |
576 | + </v-container> | |
577 | + </v-card-text> | |
578 | + </v-card> | |
579 | + </v-dialog> | |
580 | + | |
581 | + <v-snackbar | |
582 | + :timeout="timeout" | |
583 | + :top="y === 'top'" | |
584 | + :right="x === 'right'" | |
585 | + :vertical="mode === 'vertical'" | |
586 | + v-model="snackbar" | |
587 | + color="success" | |
588 | + >{{ text }}</v-snackbar> | |
589 | + | |
590 | + <!-- ****** EXISTING-USERS STUDENTS TABLE ****** --> | |
591 | + <v-data-table | |
592 | + :headers="headers" | |
593 | + :items="schoolList" | |
594 | + :pagination.sync="pagination" | |
595 | + :search="search" | |
596 | + > | |
597 | + <template slot="items" slot-scope="props"> | |
598 | + <td id="td" class="text-xs-center">{{ props.index + 1}}</td> | |
599 | + <td id="td" class="text-xs-center"> | |
600 | + <v-avatar> | |
601 | + <img :src="props.item.schoolLogoUrl" v-if="props.item.schoolLogoUrl" /> | |
602 | + <img src="/static/icon/user.png" v-else-if="!props.item.schoolLogoUrl" /> | |
603 | + </v-avatar> | |
604 | + </td> | |
605 | + <td id="td" class="text-xs-center">{{ props.item.name}}</td> | |
606 | + <td id="td" class="text-xs-center">{{ props.item.email }}</td> | |
607 | + <td id="td" class="text-xs-center">{{ props.item.city }}</td> | |
608 | + <td id="td" class="text-xs-center">{{ props.item.state }}</td> | |
609 | + <td id="td" class="text-xs-center">{{ props.item.mobile}}</td> | |
610 | + <td class="text-xs-center"> | |
611 | + <span> | |
612 | + <v-tooltip top> | |
613 | + <img | |
614 | + slot="activator" | |
615 | + style="cursor:pointer; width:25px; height:18px; " | |
616 | + class="mr5" | |
617 | + @click="profile(props.item)" | |
618 | + src="/static/icon/eye1.png" | |
619 | + /> | |
620 | + <span>View</span> | |
621 | + </v-tooltip> | |
622 | + <v-tooltip top> | |
623 | + <img | |
624 | + slot="activator" | |
625 | + style="cursor:pointer; width:20px; height:18px; " | |
626 | + class="mr5" | |
627 | + @click="editItem(props.item)" | |
628 | + src="/static/icon/edit1.png" | |
629 | + /> | |
630 | + <span>Edit</span> | |
631 | + </v-tooltip> | |
632 | + <!-- <v-tooltip top> | |
633 | + <img | |
634 | + slot="activator" | |
635 | + style="cursor:pointer; width:20px; height:20px; " | |
636 | + class="mr5" | |
637 | + @click="deleteItem(props.item)" | |
638 | + src="/static/icon/delete1.png" | |
639 | + /> | |
640 | + <span>Delete</span> | |
641 | + </v-tooltip>--> | |
642 | + </span> | |
643 | + </td> | |
644 | + </template> | |
645 | + <v-alert | |
646 | + slot="no-results" | |
647 | + :value="true" | |
648 | + color="error" | |
649 | + icon="warning" | |
650 | + >Your search for "{{ search }}" found no results.</v-alert> | |
651 | + </v-data-table> | |
652 | + </v-tab-item> | |
653 | + | |
654 | + <!-- ****** ADD STUDENTS DETAILS****** --> | |
655 | + <v-tab-item> | |
656 | + <v-container fluid> | |
657 | + <v-layout align-center justify-center fill-height> | |
658 | + <v-flex xs12 sm12 md10 lg11> | |
659 | + <!-- <v-container fluid> --> | |
660 | + <v-snackbar | |
661 | + :timeout="timeout" | |
662 | + :top="y === 'top'" | |
663 | + :right="x === 'right'" | |
664 | + :vertical="mode === 'vertical'" | |
665 | + v-model="snackbar" | |
666 | + color="success" | |
667 | + >{{ text }}</v-snackbar> | |
668 | + <v-flex xs12 sm12> | |
669 | + <v-form ref="form" v-model="valid" lazy-validation> | |
670 | + <!-- <v-container fluid> --> | |
671 | + <v-layout> | |
672 | + <v-flex | |
673 | + xs12 | |
674 | + class="text-xs-center text-sm-center text-md-center text-lg-center" | |
675 | + > | |
676 | + <v-avatar size="100px"> | |
677 | + <img src="/static/icon/user.png" v-if="!imageUrl" /> | |
678 | + </v-avatar> | |
679 | + <input | |
680 | + type="file" | |
681 | + style="display: none" | |
682 | + ref="image" | |
683 | + accept="image/*" | |
684 | + @change="onFilePicked" | |
685 | + /> | |
686 | + <img | |
687 | + :src="imageData.imageUrl" | |
688 | + height="150" | |
689 | + v-if="imageUrl" | |
690 | + style="border-radius:50%; width:200px" | |
691 | + /> | |
692 | + </v-flex> | |
693 | + </v-layout> | |
694 | + <v-layout wrap> | |
695 | + <v-flex xs12 sm6> | |
696 | + <v-layout> | |
697 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
698 | + <label class="right hidden-xs-only hidden-sm-only">Full Name:</label> | |
699 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Name:</label> | |
700 | + </v-flex> | |
701 | + <v-flex xs8 sm8 class="ml-3"> | |
702 | + <v-text-field | |
703 | + v-model="addSchool.name" | |
704 | + placeholder="fill your full Name" | |
705 | + name="name" | |
706 | + type="text" | |
707 | + :rules="nameRules" | |
708 | + required | |
709 | + ></v-text-field> | |
710 | + </v-flex> | |
711 | + </v-layout> | |
712 | + </v-flex> | |
713 | + <v-flex xs12 sm6> | |
714 | + <v-layout> | |
715 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
716 | + <label class="right">Email ID:</label> | |
717 | + </v-flex> | |
718 | + <v-flex xs8 sm8 class="ml-3"> | |
719 | + <v-text-field | |
720 | + placeholder="fill your email" | |
721 | + :rules="emailRules" | |
722 | + v-model="addSchool.email" | |
723 | + type="text" | |
724 | + required | |
725 | + ></v-text-field> | |
726 | + </v-flex> | |
727 | + </v-layout> | |
728 | + </v-flex> | |
729 | + </v-layout> | |
730 | + <v-layout wrap> | |
731 | + <v-flex xs12 sm6> | |
732 | + <v-layout> | |
733 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
734 | + <label class="right hidden-sm-only hidden-xs-only">Society Name:</label> | |
735 | + <label | |
736 | + class="right hidden-lg-only hidden-xl-only hidden-md-only" | |
737 | + >SocietyName:</label> | |
738 | + </v-flex> | |
739 | + <v-flex xs8 sm8 class="ml-3"> | |
740 | + <v-text-field | |
741 | + v-model="addSchool.societyName" | |
742 | + placeholder="fill your Society Name" | |
743 | + :rules="cityRules" | |
744 | + required | |
745 | + ></v-text-field> | |
746 | + </v-flex> | |
747 | + </v-layout> | |
748 | + </v-flex> | |
749 | + <v-flex xs12 sm6> | |
750 | + <v-layout> | |
751 | + <v-flex xs4 class="pt-4 subheading"> | |
752 | + <label class="right">City:</label> | |
753 | + </v-flex> | |
754 | + <v-flex xs8 class="ml-3"> | |
755 | + <v-text-field | |
756 | + v-model="addSchool.city" | |
757 | + placeholder="fill your City Name" | |
758 | + name="City" | |
759 | + type="text" | |
760 | + :rules="cityRules" | |
761 | + required | |
762 | + ></v-text-field> | |
763 | + </v-flex> | |
764 | + </v-layout> | |
765 | + </v-flex> | |
766 | + </v-layout> | |
767 | + <v-layout wrap> | |
768 | + <v-flex xs12 sm6> | |
769 | + <v-layout> | |
770 | + <v-flex xs4 class="pt-4 subheading"> | |
771 | + <label class="right">State:</label> | |
772 | + </v-flex> | |
773 | + <v-flex xs8 class="ml-3"> | |
774 | + <v-text-field | |
775 | + v-model="addSchool.state" | |
776 | + placeholder="fill your State Name" | |
777 | + name="state" | |
778 | + type="text" | |
779 | + :rules="stateRules" | |
780 | + required | |
781 | + ></v-text-field> | |
782 | + </v-flex> | |
783 | + </v-layout> | |
784 | + </v-flex> | |
785 | + <v-flex xs12 sm6> | |
786 | + <v-layout> | |
787 | + <v-flex xs4 class="pt-4 subheading"> | |
788 | + <label class="right">Pincode:</label> | |
789 | + </v-flex> | |
790 | + <v-flex xs8 class="ml-3"> | |
791 | + <v-text-field | |
792 | + v-model="addSchool.pinCode" | |
793 | + placeholder="fill your pincode" | |
794 | + name="pincode" | |
795 | + type="number" | |
796 | + :rules="pincode" | |
797 | + required | |
798 | + ></v-text-field> | |
799 | + </v-flex> | |
800 | + </v-layout> | |
801 | + </v-flex> | |
802 | + </v-layout> | |
803 | + <v-layout wrap> | |
804 | + <v-flex xs12 sm6> | |
805 | + <v-layout> | |
806 | + <v-flex xs4 class="pt-4 subheading"> | |
807 | + <label class="right">Fax No:</label> | |
808 | + </v-flex> | |
809 | + <v-flex xs8 class="ml-3"> | |
810 | + <v-text-field v-model="addSchool.faxNo" label="fill your Fax No" required></v-text-field> | |
811 | + </v-flex> | |
812 | + </v-layout> | |
813 | + </v-flex> | |
814 | + <v-flex xs12 sm6> | |
815 | + <v-layout> | |
816 | + <v-flex xs4 class="pt-4 subheading"> | |
817 | + <label class="right hidden-xs-only hidden-sm-only">Country:</label> | |
818 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Country:</label> | |
819 | + </v-flex> | |
820 | + <v-flex xs8 class="ml-3"> | |
821 | + <v-autocomplete | |
822 | + v-model="addSchool.country" | |
823 | + :items="countries" | |
824 | + :rules="country" | |
825 | + placeholder="Select Country Name" | |
826 | + required | |
827 | + ></v-autocomplete> | |
828 | + </v-flex> | |
829 | + </v-layout> | |
830 | + </v-flex> | |
831 | + </v-layout> | |
832 | + <v-layout wrap> | |
833 | + <v-flex xs12 sm6> | |
834 | + <v-layout> | |
835 | + <v-flex xs4 class="pt-4 subheading"> | |
836 | + <label class="right hidden-xs-only hidden-sm-only">Mobile No:</label> | |
837 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Mobile:</label> | |
838 | + </v-flex> | |
839 | + <v-flex xs8 class="ml-3"> | |
840 | + <v-text-field | |
841 | + v-model="addSchool.mobile" | |
842 | + placeholder="fill your MobileNo" | |
843 | + name="mobileNo" | |
844 | + type="number" | |
845 | + :rules="mobileNoRules" | |
846 | + required | |
847 | + ></v-text-field> | |
848 | + </v-flex> | |
849 | + </v-layout> | |
850 | + </v-flex> | |
851 | + <v-flex xs12 sm6> | |
852 | + <v-layout> | |
853 | + <v-flex xs4 class="pt-4 subheading"> | |
854 | + <label class="right hidden-xs-only hidden-sm-only">LandLine No:</label> | |
855 | + <label | |
856 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
857 | + >LandLineNo:</label> | |
858 | + </v-flex> | |
859 | + <v-flex xs8 class="ml-3"> | |
860 | + <v-text-field | |
861 | + v-model="addSchool.landLineNo" | |
862 | + :items="countries" | |
863 | + :rules="landlineNoRule" | |
864 | + placeholder="fill your LandLine No" | |
865 | + type="number" | |
866 | + required | |
867 | + ></v-text-field> | |
868 | + </v-flex> | |
869 | + </v-layout> | |
870 | + </v-flex> | |
871 | + </v-layout> | |
872 | + <v-layout wrap> | |
873 | + <v-flex xs12 sm6> | |
874 | + <v-layout> | |
875 | + <v-flex xs4 class="pt-4 subheading"> | |
876 | + <label class="right hidden-xs-only hidden-sm-only">Registration No:</label> | |
877 | + <label | |
878 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
879 | + >Registration-No:</label> | |
880 | + </v-flex> | |
881 | + <v-flex xs8 class="ml-3"> | |
882 | + <v-text-field | |
883 | + v-model="addSchool.registrationNo" | |
884 | + placeholder="Fill your Registration No" | |
885 | + required | |
886 | + ></v-text-field> | |
887 | + </v-flex> | |
888 | + </v-layout> | |
889 | + </v-flex> | |
890 | + <v-flex xs12 sm6> | |
891 | + <v-layout> | |
892 | + <v-flex xs4 class="pt-4 subheading"> | |
893 | + <label class="right hidden-xs-only hidden-sm-only">School Details:</label> | |
894 | + <label | |
895 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
896 | + >SchoolDetails:</label> | |
897 | + </v-flex> | |
898 | + <v-flex xs8 class="ml-3"> | |
899 | + <v-text-field | |
900 | + v-model="addSchool.schoolDetails" | |
901 | + placeholder="Fill your School Details" | |
902 | + :rules="schoolDetailRule" | |
903 | + required | |
904 | + ></v-text-field> | |
905 | + </v-flex> | |
906 | + </v-layout> | |
907 | + </v-flex> | |
908 | + </v-layout> | |
909 | + <v-layout wrap> | |
910 | + <v-flex xs12 sm6> | |
911 | + <v-layout> | |
912 | + <v-flex xs4 class="pt-4 subheading"> | |
913 | + <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label> | |
914 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod :</label> | |
915 | + </v-flex> | |
916 | + <v-flex xs8 class="ml-3"> | |
917 | + <v-text-field | |
918 | + label="Select Image" | |
919 | + @click="pickFile" | |
920 | + v-model="imageName" | |
921 | + append-icon="attach_file" | |
922 | + ></v-text-field> | |
923 | + </v-flex> | |
924 | + </v-layout> | |
925 | + </v-flex> | |
926 | + <v-flex xs12 sm6> | |
927 | + <v-layout> | |
928 | + <v-flex xs4 class="pt-4 subheading"> | |
929 | + <label class="right hidden-xs-only hidden-sm-only">Academic Year:</label> | |
930 | + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Year:</label> | |
931 | + </v-flex> | |
932 | + <v-flex xs8 class="ml-3"> | |
933 | + <v-text-field | |
934 | + v-model="addSchool.establishmentYear" | |
935 | + placeholder="fill your Academic Year" | |
936 | + :rules="establishmentYearRules" | |
937 | + required | |
938 | + ></v-text-field> | |
939 | + </v-flex> | |
940 | + </v-layout> | |
941 | + </v-flex> | |
942 | + </v-layout> | |
943 | + <v-layout wrap> | |
944 | + <v-flex xs12 sm6> | |
945 | + <v-layout> | |
946 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
947 | + <label class="right hidden-xs-only hidden-sm-only">WebSite Url:</label> | |
948 | + <label | |
949 | + class="right hidden-lg-only hidden-md-only hidden-xl-only" | |
950 | + >WebSiteUrl:</label> | |
951 | + </v-flex> | |
952 | + <v-flex xs8 sm8 class="ml-3"> | |
953 | + <v-text-field | |
954 | + name="input-4-3" | |
955 | + v-model="addSchool.websiteUrl" | |
956 | + :rules="presentAddress" | |
957 | + placeholder="fill Your Address" | |
958 | + required | |
959 | + ></v-text-field> | |
960 | + </v-flex> | |
961 | + </v-layout> | |
962 | + </v-flex> | |
963 | + <v-flex xs12 sm6> | |
964 | + <v-layout> | |
965 | + <v-flex xs4 sm4 class="pt-4 subheading"> | |
966 | + <label class="right">Address:</label> | |
967 | + </v-flex> | |
968 | + <v-flex xs8 sm8 class="ml-3"> | |
969 | + <v-text-field | |
970 | + name="input-4-3" | |
971 | + v-model="addSchool.address" | |
972 | + :rules="presentAddress" | |
973 | + placeholder="fill Your Address" | |
974 | + required | |
975 | + ></v-text-field> | |
976 | + </v-flex> | |
977 | + </v-layout> | |
978 | + </v-flex> | |
979 | + </v-layout> | |
980 | + <v-layout> | |
981 | + <v-flex xs12 sm11 offset-md1> | |
982 | + <v-layout> | |
983 | + <v-flex xs6> | |
984 | + <v-btn round dark @click="clear()">Clear</v-btn> | |
985 | + </v-flex> | |
986 | + <v-flex xs6> | |
987 | + <v-btn @click="submit" round dark :loading="loading" class="right">Add</v-btn> | |
988 | + </v-flex> | |
989 | + </v-layout> | |
990 | + </v-flex> | |
991 | + </v-layout> | |
992 | + </v-form> | |
993 | + </v-flex> | |
994 | + </v-flex> | |
995 | + </v-layout> | |
996 | + </v-container> | |
997 | + </v-tab-item> | |
998 | + </v-tabs> | |
999 | + <div class="loader" v-if="showLoader"> | |
1000 | + <v-progress-circular indeterminate color="white"></v-progress-circular> | |
1001 | + </div> | |
1002 | + </div> | |
1003 | +</template> | |
1004 | + | |
1005 | +<script> | |
1006 | +import http from "@/Services/http.js"; | |
1007 | +import moment from "moment"; | |
1008 | +import countryList from "@/script/country.js"; | |
1009 | + | |
1010 | +export default { | |
1011 | + data: () => ({ | |
1012 | + e2: 0, | |
1013 | + snackbar: false, | |
1014 | + y: "top", | |
1015 | + x: "right", | |
1016 | + mode: "", | |
1017 | + timeout: 3000, | |
1018 | + text: "", | |
1019 | + showLoader: false, | |
1020 | + loading: false, | |
1021 | + date: null, | |
1022 | + search: "", | |
1023 | + menu: false, | |
1024 | + menu1: false, | |
1025 | + dialog: false, | |
1026 | + dialog1: false, | |
1027 | + valid: true, | |
1028 | + isActive: true, | |
1029 | + newActive: false, | |
1030 | + pagination: { | |
1031 | + rowsPerPage: 15 | |
1032 | + }, | |
1033 | + imageData: {}, | |
1034 | + imageName: "", | |
1035 | + imageUrl: "", | |
1036 | + imageFile: "", | |
1037 | + nameRules: [v => !!v || " Full Name is required"], | |
1038 | + dateRules: [v => !!v || " DOB is required"], | |
1039 | + cityRules: [v => !!v || " City Name is required"], | |
1040 | + pincode: [v => !!v || " Pincode is required"], | |
1041 | + country: [v => !!v || " Country Name is required"], | |
1042 | + permanentAddress: [v => !!v || " Permanent Address is requiclearred"], | |
1043 | + presentAddress: [v => !!v || " Present Address is required"], | |
1044 | + landlineNoRule: [v => !!v || " Present Address is required"], | |
1045 | + mobileNoRules: [v => !!v || "Mobile Number is required"], | |
1046 | + stateRules: [v => !!v || "State Name is required"], | |
1047 | + schoolDetailRule: [v => !!v || "school Detail is required"], | |
1048 | + sectionRules: [v => !!v || " Section Name is required"], | |
1049 | + genderRules: [v => !!v || " Select Gender is required"], | |
1050 | + establishmentYearRules: [v => !!v || " Academic Year is required"], | |
1051 | + errorMessages: "", | |
1052 | + emailRules: [ | |
1053 | + v => !!v || "E-mail is required", | |
1054 | + v => | |
1055 | + /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || | |
1056 | + "E-mail must be valid" | |
1057 | + ], | |
1058 | + countries: [], | |
1059 | + headers: [ | |
1060 | + { | |
1061 | + text: "No.", | |
1062 | + align: "center", | |
1063 | + sortable: false, | |
1064 | + value: "rollNo" | |
1065 | + }, | |
1066 | + { | |
1067 | + text: "school Logo", | |
1068 | + value: "schoolLogoUrl", | |
1069 | + sortable: false, | |
1070 | + align: "center" | |
1071 | + }, | |
1072 | + { text: "Name", value: "name", sortable: false, align: "center" }, | |
1073 | + { text: "Email", value: "email", sortable: false, align: "center" }, | |
1074 | + { text: "City", value: "city", sortable: false, align: "center" }, | |
1075 | + { | |
1076 | + text: "State", | |
1077 | + value: "state", | |
1078 | + sortable: false, | |
1079 | + align: "center" | |
1080 | + }, | |
1081 | + { | |
1082 | + text: "Mobile", | |
1083 | + value: "mobile", | |
1084 | + sortable: false, | |
1085 | + align: "center" | |
1086 | + }, | |
1087 | + { text: "Action", value: "", sortable: false, align: "center" } | |
1088 | + ], | |
1089 | + schoolList: [], | |
1090 | + editedIndex: -1, | |
1091 | + addSchool: { | |
1092 | + role: "ADMIN" | |
1093 | + }, | |
1094 | + editedItem: {} | |
1095 | + }), | |
1096 | + // watch: { | |
1097 | + // menu(val) { | |
1098 | + // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); | |
1099 | + // }, | |
1100 | + // menu1(val) { | |
1101 | + // val && this.$nextTick(() => (this.$refs.picker.activePicker = "YEAR")); | |
1102 | + // } | |
1103 | + // }, | |
1104 | + methods: { | |
1105 | + getSchool() { | |
1106 | + this.showLoader = true; | |
1107 | + http() | |
1108 | + .get("/getSchoolList", { | |
1109 | + headers: { Authorization: "Bearer " + this.token } | |
1110 | + }) | |
1111 | + .then(response => { | |
1112 | + this.schoolList = response.data.data; | |
1113 | + this.showLoader = false; | |
1114 | + }) | |
1115 | + .catch(error => { | |
1116 | + console.log("err====>", err); | |
1117 | + this.showLoader = false; | |
1118 | + }); | |
1119 | + }, | |
1120 | + pickFile() { | |
1121 | + this.$refs.image.click(); | |
1122 | + }, | |
1123 | + dates: function(date) { | |
1124 | + return moment(date).format("MMMM DD, YYYY"); | |
1125 | + }, | |
1126 | + onFilePicked(e) { | |
1127 | + // console.log(e) | |
1128 | + const files = e.target.files; | |
1129 | + this.imageData.upload = e.target.files[0]; | |
1130 | + if (files[0] !== undefined) { | |
1131 | + this.imageName = files[0].name; | |
1132 | + if (this.imageName.lastIndexOf(".") <= 0) { | |
1133 | + return; | |
1134 | + } | |
1135 | + const fr = new FileReader(); | |
1136 | + fr.readAsDataURL(files[0]); | |
1137 | + fr.addEventListener("load", () => { | |
1138 | + this.imageUrl = fr.result; | |
1139 | + this.imageFile = files[0]; // this is an image file that can be sent to server... | |
1140 | + this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | |
1141 | + }); | |
1142 | + } else { | |
1143 | + this.imageName = ""; | |
1144 | + this.imageFile = ""; | |
1145 | + this.imageUrl = ""; | |
1146 | + } | |
1147 | + }, | |
1148 | + editItem(item) { | |
1149 | + this.editedIndex = this.schoolList.indexOf(item); | |
1150 | + this.editedItem = Object.assign({}, item); | |
1151 | + // if(this.editedItem.dob != undefined){ | |
1152 | + // this.editedItem.dob = this.editedItem.dob.substring(0, 10) | |
1153 | + // }else if(this.editedItem.dob = undefined){ | |
1154 | + // this.editedItem.dob = '' | |
1155 | + // } | |
1156 | + this.editedItem.dob = | |
1157 | + this.editedItem.dob != undefined | |
1158 | + ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10)) | |
1159 | + : (this.editedItem.dob = ""); | |
1160 | + this.dialog = true; | |
1161 | + }, | |
1162 | + profile(item) { | |
1163 | + console.log("item", item); | |
1164 | + this.editedIndex = this.schoolList.indexOf(item); | |
1165 | + this.editedItem = Object.assign({}, item); | |
1166 | + this.dialog1 = true; | |
1167 | + }, | |
1168 | + // deleteItem(item) { | |
1169 | + // let deleteStudent = { | |
1170 | + // studentId: item._id | |
1171 | + // }; | |
1172 | + // http() | |
1173 | + // .delete( | |
1174 | + // "/deleteStudent", | |
1175 | + // confirm("Are you sure you want to delete this?") && { | |
1176 | + // params: deleteStudent | |
1177 | + // } | |
1178 | + // ) | |
1179 | + // .then(response => { | |
1180 | + // // console.log("deleteUers",deleteStudent) | |
1181 | + // this.snackbar = true; | |
1182 | + // this.text = "Successfully delete Existing Student"; | |
1183 | + // this.getStudentList(); | |
1184 | + // }) | |
1185 | + // .catch(error => { | |
1186 | + // // console.log(error); | |
1187 | + // }); | |
1188 | + // }, | |
1189 | + activeTab(type) { | |
1190 | + switch (type) { | |
1191 | + case "existing": | |
1192 | + this.newActive = false; | |
1193 | + this.isActive = true; | |
1194 | + break; | |
1195 | + | |
1196 | + default: | |
1197 | + this.newActive = true; | |
1198 | + this.isActive = false; | |
1199 | + break; | |
1200 | + } | |
1201 | + }, | |
1202 | + close() { | |
1203 | + this.dialog = false; | |
1204 | + setTimeout(() => { | |
1205 | + this.editedItem = Object.assign({}, this.defaultItem); | |
1206 | + this.editedIndex = -1; | |
1207 | + }, 300); | |
1208 | + }, | |
1209 | + close1() { | |
1210 | + this.dialog1 = false; | |
1211 | + }, | |
1212 | + submit() { | |
1213 | + if (this.$refs.form.validate()) { | |
1214 | + if (this.imageUrl) { | |
1215 | + var str = this.imageUrl; | |
1216 | + const [baseUrl, imageUrl] = str.split(/,/); | |
1217 | + this.addSchool.upload = imageUrl; | |
1218 | + } | |
1219 | + this.loading = true; | |
1220 | + http() | |
1221 | + .post("/createSchool", this.addSchool) | |
1222 | + .then(response => { | |
1223 | + this.snackbar = true; | |
1224 | + this.text = "New School added successfully"; | |
1225 | + this.clear(); | |
1226 | + this.getSchool(); | |
1227 | + this.loading = false; | |
1228 | + }) | |
1229 | + .catch(error => { | |
1230 | + // console.log(error); | |
1231 | + this.snackbar = true; | |
1232 | + this.text = error.response.data.message; | |
1233 | + this.loading = false; | |
1234 | + }); | |
1235 | + } | |
1236 | + }, | |
1237 | + clear() { | |
1238 | + this.$refs.form.reset(); | |
1239 | + this.imageUrl = ""; | |
1240 | + }, | |
1241 | + save() { | |
1242 | + if (this.imageUrl) { | |
1243 | + var str = this.imageUrl; | |
1244 | + const [baseUrl, imageUrl] = str.split(/,/); | |
1245 | + this.editedItem.upload = imageUrl; | |
1246 | + } | |
1247 | + this.editedItem.schoolId = this.editedItem._id; | |
1248 | + http() | |
1249 | + .put("/updateSchool", this.editedItem) | |
1250 | + .then(response => { | |
1251 | + this.snackbar = true; | |
1252 | + this.text = "Successfully School Existing User"; | |
1253 | + this.imageUrl = ""; | |
1254 | + this.getSchool(); | |
1255 | + this.close(); | |
1256 | + }) | |
1257 | + .catch(error => { | |
1258 | + // console.log(error); | |
1259 | + if ((this.snackbar = true)) { | |
1260 | + this.text = error.response.data.statusText; | |
1261 | + } | |
1262 | + }); | |
1263 | + } | |
1264 | + }, | |
1265 | + mounted() { | |
1266 | + const getCountryList = countryList(); | |
1267 | + this.countries = getCountryList; | |
1268 | + this.token = this.$store.state.token; | |
1269 | + this.getSchool(); | |
1270 | + }, | |
1271 | + created() { | |
1272 | + this.$root.$on("app:search", search => { | |
1273 | + this.search = search; | |
1274 | + }); | |
1275 | + }, | |
1276 | + beforeDestroy() { | |
1277 | + // dont forget to remove the listener | |
1278 | + this.$root.$off("app:search"); | |
1279 | + } | |
1280 | +}; | |
1281 | +</script> | |
1282 | +<style scoped> | |
1283 | +.active { | |
1284 | + background-color: gray; | |
1285 | + color: white !important; | |
1286 | +} | |
1287 | +.activebtn { | |
1288 | + color: black !important; | |
1289 | +} | |
1290 | +</style> | |
0 | 1291 | \ No newline at end of file | ... | ... |
src/pages/Section/section.vue
... | ... | @@ -46,14 +46,13 @@ |
46 | 46 | <!-- <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> --> |
47 | 47 | </v-flex> |
48 | 48 | <v-flex xs7 sm8> |
49 | - <v-select | |
49 | + <v-autocomplete | |
50 | 50 | :items="addclass" |
51 | 51 | :label="editedItem.classData.classNum" |
52 | 52 | v-model="editItem.classId" |
53 | 53 | item-text="classNum" |
54 | 54 | item-value="_id" |
55 | - name="Select Class" | |
56 | - ></v-select> | |
55 | + ></v-autocomplete> | |
57 | 56 | </v-flex> |
58 | 57 | </v-layout> |
59 | 58 | <v-layout> |
... | ... | @@ -425,10 +424,9 @@ export default { |
425 | 424 | this.showLoader = false; |
426 | 425 | // console.log("getAllSections=====>",response.data.data) |
427 | 426 | }) |
428 | - .catch(err => { | |
429 | - // console.log("err====>", err); | |
427 | + .catch(error => { | |
430 | 428 | this.showLoader = false; |
431 | - if (error.response.status === 401) { | |
429 | + if (error.response.status === 401 && error.response.status === 401) { | |
432 | 430 | this.$router.replace({ path: "/" }); |
433 | 431 | this.$store.dispatch("setToken", null); |
434 | 432 | this.$store.dispatch("Id", null); | ... | ... |
src/router/paths.js
... | ... | @@ -620,5 +620,18 @@ export default [{ |
620 | 620 | /* webpackMode: "lazy-once" */ |
621 | 621 | `@/pages/generalSetting/generalSetting.vue` |
622 | 622 | ) |
623 | + }, | |
624 | + | |
625 | + { | |
626 | + path: '/school', | |
627 | + meta: {}, | |
628 | + name: 'School', | |
629 | + props: (route) => ({ type: route.query.type }), | |
630 | + component: () => | |
631 | + import ( | |
632 | + /* webpackChunkName: "routes" */ | |
633 | + /* webpackMode: "lazy-once" */ | |
634 | + `@/pages/School/school.vue` | |
635 | + ) | |
623 | 636 | } |
624 | 637 | ]; |
625 | 638 | \ No newline at end of file | ... | ... |
src/store/store.js
... | ... | @@ -5,46 +5,53 @@ import createPersistedState from 'vuex-persistedstate' |
5 | 5 | Vue.use(Vuex) |
6 | 6 | |
7 | 7 | export default new Vuex.Store({ |
8 | - strict:true, | |
9 | - plugins:[ | |
10 | - createPersistedState() | |
8 | + strict: true, | |
9 | + plugins: [ | |
10 | + createPersistedState() | |
11 | 11 | ], |
12 | 12 | state: { |
13 | 13 | token: null, |
14 | 14 | data: null, |
15 | 15 | isUserLoggedIn: false, |
16 | 16 | id: null, |
17 | + role: null | |
17 | 18 | }, |
18 | 19 | // serve as the one and only way to change the state of the data in the state object |
19 | 20 | mutations: { |
20 | - setToken (state, token) { | |
21 | + setToken(state, token) { | |
21 | 22 | state.token = token |
22 | - //state.isUserLoggedIn = !!(token) | |
23 | - if (token != null) { | |
24 | - state.isUserLoggedIn = true | |
25 | - } else { | |
26 | - state.isUserLoggedIn = false | |
27 | - } | |
23 | + //state.isUserLoggedIn = !!(token) | |
24 | + if (token != null) { | |
25 | + state.isUserLoggedIn = true | |
26 | + } else { | |
27 | + state.isUserLoggedIn = false | |
28 | + } | |
28 | 29 | }, |
29 | - setUser (state, data) { | |
30 | + setUser(state, data) { | |
30 | 31 | state.data = data |
31 | 32 | }, |
32 | - Id (state, id) { | |
33 | - state.id = id | |
33 | + Id(state, id) { | |
34 | + state.id = id | |
34 | 35 | }, |
35 | - }, | |
36 | + Role(state, role) { | |
37 | + state.role = role | |
38 | + } | |
39 | + }, | |
36 | 40 | //Action methods are referred to as being "dispatched" |
37 | 41 | actions: { |
38 | - setToken ({commit}, token) { | |
42 | + setToken({ commit }, token) { | |
39 | 43 | commit('setToken', token) |
40 | 44 | }, |
41 | - setUser ({commit}, data) { | |
45 | + setUser({ commit }, data) { | |
42 | 46 | commit('setUser', data) |
43 | 47 | }, |
44 | - Id ({commit}, id) { | |
48 | + Id({ commit }, id) { | |
45 | 49 | commit('Id', id) |
50 | + }, | |
51 | + Role({ commit }, role) { | |
52 | + commit('Role', role) | |
46 | 53 | } |
47 | 54 | |
48 | 55 | } |
49 | - | |
56 | + | |
50 | 57 | }) |
51 | 58 | \ No newline at end of file | ... | ... |