Commit 7d081675833f3cefeafcb03654673da2458f3eb3

Authored by Shikha Mishra
1 parent 8c49cf2211

show dashboard while login time of any user and add some another features

... ... @@ -224,7 +224,7 @@ const schoolMenu = [
224 224 {
225 225 title: 'School',
226 226 // group: 'apps',
227   - path: '/school',
  227 + name: 'School',
228 228 icon: '/static/schoolIcons/Dashboard.png',
229 229 }
230 230 ];
... ...
src/components/pageHeader/AppDrawer.vue
... ... @@ -132,7 +132,7 @@
132 132 </template>
133 133 <template
134 134 v-for="(item, i) in menuSchool"
135   - v-if="schoolRole === 'SUPERADMIN' && $route.name === 'School'"
  135 + v-if="schoolRole === 'SUPERADMIN' || $route.name === 'School' || $route.name === 'Dashboard'"
136 136 >
137 137 <!-- {{menus}} -->
138 138 <!--group with subitems-->
... ...
src/components/pageHeader/AppToolbar.vue
... ... @@ -111,6 +111,11 @@ export default {
111 111 this.userData = response.data.data;
112 112 })
113 113 .catch(error => {
  114 + // if (error.response.status === 401) {
  115 + // this.$router.replace({ path: "/" });
  116 + // this.$store.dispatch("setToken", null);
  117 + // this.$store.dispatch("Id", null);
  118 + // }
114 119 });
115 120 }
116 121 }
... ...
src/pages/Authentication/Login.vue
1 1 <template>
2 2 <v-app id="login">
3   - <v-toolbar class="fixcolors">
4   - <v-toolbar-items>
5   - <img src="/static/logoIntrack.png" height="40" width="140" alt="logo" />
6   - <!-- <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> -->
7   - </v-toolbar-items>
8   - </v-toolbar>
9 3 <v-content>
10 4 <v-container fluid fill-height>
11 5 <v-snackbar
... ... @@ -18,22 +12,32 @@
18 12 >{{ text }}</v-snackbar>
19 13 <v-layout align-center justify-center>
20 14 <v-flex xs12 sm10 md6 lg4>
21   - <v-toolbar class="fixcolors" dark>
22   - <v-spacer></v-spacer>
23   - <v-toolbar-title>School Login</v-toolbar-title>
24   - <v-spacer></v-spacer>
  15 + <v-toolbar dense flat class="transparent mb-4">
  16 + <v-toolbar-items class="mx-auto">
  17 + <img src="/static/icon.png" height="40" width="140" alt="logo" class="logo"/>
  18 + <!-- <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> -->
  19 + </v-toolbar-items>
25 20 </v-toolbar>
26 21  
27   - <v-card class="elevation-1 pa-1">
28   - <v-card-text>
  22 + <v-card class="elevation-1 pa-1 card" style="background-color: #7852cc" dark>
  23 + <img
  24 + src="/static/intrackIllustration.png"
  25 + class="mx-auto logoSchool"
  26 + style="display:block"
  27 + width="400"
  28 + />
  29 + <v-card-text align-center justify-center>
  30 + <v-toolbar-title class="text-xs-center my-4 subheadline">SCHOOL LOGIN</v-toolbar-title>
29 31 <v-flex xs12 sm12 md12 lg12>
30 32 <v-form ref="form" v-model="valid" lazy-validation>
  33 + <label class="title">Email</label>
31 34 <v-text-field
32 35 v-model.trim="userLogincredentials.email"
33 36 :rules="nameRules"
34   - label="Username"
  37 + placeholder="Enter your email"
35 38 required
36 39 ></v-text-field>
  40 + <label class="title">Password</label>
37 41 <v-text-field
38 42 :rules="[rules.required]"
39 43 v-model.trim="userLogincredentials.password"
... ... @@ -41,7 +45,7 @@
41 45 :append-icon-cb="() => (e1 = !e1)"
42 46 :type="e1 ? 'password' : 'text'"
43 47 name="input-10-1"
44   - label="Password"
  48 + placeholder="Enter Your password"
45 49 @keyup.enter="login"
46 50 counter
47 51 ></v-text-field>
... ... @@ -52,11 +56,7 @@
52 56 </v-flex>
53 57 <v-flex xs6>
54 58 <h5 class="right mt-4">
55   - <router-link
56   - class="link"
57   - to="/forgetpassword"
58   - style="border-bottom: 2px solid #aaa;"
59   - >Forgot Password</router-link>
  59 + <router-link class="link" to="/forgetpassword">Forgot password</router-link>
60 60 </h5>
61 61 </v-flex>
62 62 </v-layout>
... ... @@ -65,11 +65,9 @@
65 65 <v-layout>
66 66 <v-flex sm12 class="my-3">
67 67 <v-btn
68   - style="margin: auto;display: block;b"
69   - class="fixcolors"
70   - round
  68 + style="margin: auto;display: block;background-color: #71d9ea; color: #0c0754;"
71 69 dark
72   - large
  70 + flat
73 71 @click="login"
74 72 :loading="loading"
75 73 >Login</v-btn>
... ... @@ -81,7 +79,6 @@
81 79 </v-layout>
82 80 </v-container>
83 81 </v-content>
84   - <v-footer class="pa-4 fixcolors"></v-footer>
85 82 </v-app>
86 83 </template>
87 84  
... ... @@ -128,17 +125,17 @@ export default {
128 125 } else if (response.data.data.role === "SUPERADMIN") {
129 126 this.$store.dispatch("setSchoolRole", response.data.data.role);
130 127 this.$store.dispatch("setSchoolToken", response.data.data.token);
131   - this.$router.push("/school");
  128 + this.$router.push("/dashboard");
132 129 } else if (response.data.data.role === "LIBRARIAN") {
133 130 this.$store.dispatch("setToken", response.data.data.token);
134 131 this.$store.dispatch("Id", response.data.data.id);
135 132 this.$store.dispatch("Role", response.data.data.role);
136   - this.$router.push("/libraryMember");
  133 + this.$router.push("/dashboard");
137 134 } else if (response.data.data.role === "ACCOUNTANT") {
138 135 this.$store.dispatch("setToken", response.data.data.token);
139 136 this.$store.dispatch("Id", response.data.data.id);
140 137 this.$store.dispatch("Role", response.data.data.role);
141   - this.$router.push("/feeTypes");
  138 + this.$router.push("/dashboard");
142 139 }
143 140 })
144 141 .catch(error => {
... ... @@ -158,7 +155,7 @@ export default {
158 155 mounted() {
159 156 if (this.$store.state.isUserLoggedIn == true) {
160 157 this.$router.push("/dashboard");
161   - }
  158 + }
162 159 // else if (this.$store.state.isSchoolLoggedIn == true) {
163 160 // this.$router.push("/school");
164 161 // }
... ... @@ -182,11 +179,15 @@ export default {
182 179 }
183 180 </style>
184 181 <style scoped>
185   -img {
  182 +.schoolLogo {
  183 + height: 60%;
  184 + padding-left: 31%;
  185 +}
  186 +/* img {
186 187 position: absolute;
187 188 top: 13px;
188 189 left: 8px;
189   -}
  190 +} */
190 191 .v-btn--large {
191 192 padding: 0px 84px;
192 193 }
... ... @@ -194,30 +195,26 @@ img {
194 195 text-decoration: none;
195 196 }
196 197 a {
197   - color: #696969;
198   -}
199   -.forget {
200   - margin-top: 20px;
  198 + color: #fff;
201 199 }
202 200 .mt-4 {
203 201 margin-top: 21px !important;
204 202 }
205 203 @media screen and (max-width: 600px) {
206   - .forget {
207   - margin-top: none;
208   - margin-left: 18px;
209   - }
210 204 img {
211 205 left: 10px;
212 206 height: 34px;
213 207 width: 120px;
214 208 }
215   - .logoSchool {
216   - font-size: 18px;
217   - margin-top: 20px !important;
  209 + .logo {
  210 + height: 56px;
  211 + left: 10px;
  212 + width: 120px;
218 213 }
219   - h5 {
220   - font-size: 14px !important;
  214 + .logoSchool {
  215 + height: 87px;
  216 + left: 10px;
  217 + width: 120px;
221 218 }
222 219 }
223 220 </style>
224 221 \ No newline at end of file
... ...
src/pages/Dashboard/dashboard.vue
... ... @@ -60,12 +60,7 @@
60 60 <router-link :to="{ name:'Students' }">
61 61 <v-card class="card pink-bgcolor">
62 62 <v-card-title primary-title class="titleCard white--text py-3">Students</v-card-title>
63   - <img
64   - src="/static/icon/student.png"
65   - class="ml-2"
66   - width="40"
67   - alt="icons"
68   - />
  63 + <img src="/static/icon/student.png" class="ml-2" width="40" alt="icons" />
69 64 <v-card-title class="headline py-1 white--text">{{ students.length }}</v-card-title>
70 65 </v-card>
71 66 </router-link>
... ... @@ -75,12 +70,7 @@
75 70 <router-link :to="{ name:'Teachers' }">
76 71 <v-card flat class="card elevation-2 firozi-bgcolor">
77 72 <v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title>
78   - <img
79   - src="/static/icon/teacher.png"
80   - class="ml-2"
81   - width="40"
82   - alt="icons"
83   - />
  73 + <img src="/static/icon/teacher.png" class="ml-2" width="40" alt="icons" />
84 74  
85 75 <v-card-title class="headline py-1 white--text">{{ teachers.length }}</v-card-title>
86 76 </v-card>
... ... @@ -91,12 +81,7 @@
91 81 <router-link :to="{ name:'Parents' }">
92 82 <v-card flat class="card yellow darken-3">
93 83 <v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title>
94   - <img
95   - src="/static/icon/parents.png"
96   - class="ml-3"
97   - width="40px"
98   - alt="icons"
99   - />
  84 + <img src="/static/icon/parents.png" class="ml-3" width="40px" alt="icons" />
100 85 <v-card-title class="headline py-1 white--text">{{ parents.length }}</v-card-title>
101 86 </v-card>
102 87 </router-link>
... ... @@ -106,12 +91,7 @@
106 91 <router-link :to="{ name:'Class' }">
107 92 <v-card flat class="card darkBlue-bgcolor">
108 93 <v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title>
109   - <img
110   - src="/static/icon/class.png"
111   - width="40"
112   - alt="icons"
113   - class="ml-2"
114   - />
  94 + <img src="/static/icon/class.png" width="40" alt="icons" class="ml-2" />
115 95 <v-card-title class="headline py-1 white--text">{{ classes.length }}</v-card-title>
116 96 </v-card>
117 97 </router-link>
... ... @@ -439,6 +419,7 @@ export default {
439 419 },
440 420 mounted() {
441 421 this.token = this.$store.state.token;
  422 + // console.log("this.$store.state.role", this.$store.state.schoolRole);
442 423 // this.getData();
443 424 this.getStudents();
444 425 this.getTeachers();
... ... @@ -480,7 +461,10 @@ export default {
480 461 },
481 462 getStudents() {
482 463 http()
483   - .get("/getStudentsList")
  464 + .get("/getStudentsList", {
  465 + headers: { Authorization: "Bearer " + token }
  466 +
  467 + })
484 468 .then(response => {
485 469 this.students = response.data.data;
486 470 this.showLoader = false;
... ... @@ -514,7 +498,10 @@ export default {
514 498 },
515 499 getTeachers() {
516 500 http()
517   - .get("/getTeachersList")
  501 + .get("/getTeachersList", {
  502 + headers: { Authorization: "Bearer " + token }
  503 +
  504 + })
518 505 .then(response => {
519 506 this.teachers = response.data.data;
520 507 this.showLoader = false;
... ... @@ -573,11 +560,11 @@ export default {
573 560 })
574 561 .catch(error => {
575 562 this.showLoader = false;
576   - if (error.response.status === 401) {
577   - this.$router.replace({ path: "/" });
578   - this.$store.dispatch("setToken", null);
579   - this.$store.dispatch("Id", null);
580   - }
  563 + // if (error.response.status === 401) {
  564 + // this.$router.replace({ path: "/" });
  565 + // this.$store.dispatch("setToken", null);
  566 + // this.$store.dispatch("Id", null);
  567 + // }
581 568 });
582 569 }
583 570 }
... ...
src/pages/School/school.vue
... ... @@ -335,51 +335,53 @@
335 335 :search="search"
336 336 >
337 337 <template slot="items" slot-scope="props">
338   - <td id="td" class="text-xs-center">{{ props.index + 1}}</td>
339   - <td id="td" class="text-xs-center">
340   - <v-avatar>
341   - <img :src="props.item.schoolLogoUrl" v-if="props.item.schoolLogoUrl" />
342   - <img src="/static/icon/user.png" v-else-if="!props.item.schoolLogoUrl" />
343   - </v-avatar>
344   - </td>
345   - <td id="td" class="text-xs-center">{{ props.item.name}}</td>
346   - <td id="td" class="text-xs-center">{{ props.item.email }}</td>
347   - <td id="td" class="text-xs-center">{{ props.item.city }}</td>
348   - <td id="td" class="text-xs-center">{{ props.item.state }}</td>
349   - <td id="td" class="text-xs-center">{{ props.item.mobile}}</td>
350   - <td id="td">
351   - <v-switch
352   - class="pl-3"
353   - v-model="props.item.status"
354   - @change="suspendSchoolStatus(props.item.status,props.item._id)"
355   - ></v-switch>
356   - </td>
357   - <td class="text-xs-center">
358   - <span>
359   - <!-- <router-link :to="{ name:'viewSchoolDashboard',params: { schoolId:props.item._id } }"> -->
360   - <v-tooltip top>
361   - <img
362   - slot="activator"
363   - style="cursor:pointer; width:25px; height:18px; "
364   - class="mr5"
365   - src="/static/icon/eye1.png"
366   - @click="adminAccess(props.item)"
367   - />
368   - <span>View</span>
369   - </v-tooltip>
370   - <!-- </router-link> -->
371   - <v-tooltip top>
372   - <img
373   - slot="activator"
374   - style="cursor:pointer; width:20px; height:18px; "
375   - class="mr5"
376   - @click="editItem(props.item)"
377   - src="/static/icon/edit1.png"
378   - />
379   - <span>Edit</span>
380   - </v-tooltip>
381   - </span>
382   - </td>
  338 + <tr class="tr">
  339 + <td class="td td-row text-xs-center">{{ props.index + 1}}</td>
  340 + <td class="td td-row text-xs-center">
  341 + <v-avatar>
  342 + <img :src="props.item.schoolLogoUrl" v-if="props.item.schoolLogoUrl" />
  343 + <img src="/static/icon/user.png" v-else-if="!props.item.schoolLogoUrl" />
  344 + </v-avatar>
  345 + </td>
  346 + <td class="td td-row text-xs-center">{{ props.item.name}}</td>
  347 + <td class="td td-row text-xs-center">{{ props.item.email }}</td>
  348 + <td class="td td-row text-xs-center">{{ props.item.city }}</td>
  349 + <td class="td td-row text-xs-center">{{ props.item.state }}</td>
  350 + <td class="td td-row text-xs-center">{{ props.item.mobile}}</td>
  351 + <td class="td td-row text-xs-center">
  352 + <v-switch
  353 + class="pl-3"
  354 + v-model="props.item.status"
  355 + @change="suspendSchoolStatus(props.item.status,props.item._id)"
  356 + ></v-switch>
  357 + </td>
  358 + <td class="td td-row text-xs-center">
  359 + <span>
  360 + <!-- <router-link :to="{ name:'viewSchoolDashboard',params: { schoolId:props.item._id } }"> -->
  361 + <v-tooltip top>
  362 + <img
  363 + slot="activator"
  364 + style="cursor:pointer; width:25px; height:18px; "
  365 + class="mr5"
  366 + src="/static/icon/eye1.png"
  367 + @click="adminAccess(props.item)"
  368 + />
  369 + <span>View</span>
  370 + </v-tooltip>
  371 + <!-- </router-link> -->
  372 + <v-tooltip top>
  373 + <img
  374 + slot="activator"
  375 + style="cursor:pointer; width:20px; height:18px; "
  376 + class="mr5"
  377 + @click="editItem(props.item)"
  378 + src="/static/icon/edit1.png"
  379 + />
  380 + <span>Edit</span>
  381 + </v-tooltip>
  382 + </span>
  383 + </td>
  384 + </tr>
383 385 </template>
384 386 <v-alert
385 387 slot="no-results"
... ... @@ -840,12 +842,12 @@ export default {
840 842 })
841 843 .catch(error => {
842 844 this.showLoader = false;
843   - if (error.response.status === 401) {
844   - this.$router.replace({ path: "/" });
845   - this.$store.dispatch("setToken", null);
846   - this.$store.dispatch("Id", null);
847   - this.$store.dispatch("Role", null);
848   - }
  845 + // if (error.response.status === 401) {
  846 + // this.$router.replace({ path: "/" });
  847 + // this.$store.dispatch("setToken", null);
  848 + // this.$store.dispatch("Id", null);
  849 + // this.$store.dispatch("Role", null);
  850 + // }
849 851 });
850 852 },
851 853 pickFile() {
... ... @@ -910,7 +912,10 @@ export default {
910 912 }
911 913 this.loading = true;
912 914 http()
913   - .post("/createSchool", this.addSchool)
  915 + .post("/createSchool", this.addSchool, {
  916 + headers: { Authorization: "Bearer " + this.schoolToken }
  917 +
  918 + })
914 919 .then(response => {
915 920 this.snackbar = true;
916 921 this.text = "New School added successfully";
... ...
static/intrackIllustration.png

104 KB