Commit be1fe29bb9a17ef337903e30d3db447b7459846a

Authored by Neeraj Sharma
1 parent 6c05a9f840

implement number of student data card in dashboard

1 const Menu = [ 1 const Menu = [
2 // { header: 'Apps' }, 2 // { header: 'Apps' },
3 { 3 {
4 title: 'Dashboard', 4 title: 'Dashboard',
5 // group: 'apps', 5 // group: 'apps',
6 path: '/dashboard', 6 path: '/dashboard',
7 icon: '/static/schoolIcons/Dashboard.png', 7 icon: '/static/schoolIcons/Dashboard.png',
8 }, 8 },
9 { 9 {
10 title: 'Class', 10 title: 'Class',
11 // group: 'apps', 11 // group: 'apps',
12 path: '/addclass', 12 path: '/addclass',
13 icon: '/static/schoolIcons/Class.png', 13 icon: '/static/schoolIcons/Class.png',
14 }, 14 },
15 { 15 {
16 title: 'Section', 16 title: 'Section',
17 // group: 'apps', 17 // group: 'apps',
18 path: '/section', 18 path: '/section',
19 icon: '/static/schoolIcons/Section.png', 19 icon: '/static/schoolIcons/Section.png',
20 }, 20 },
21 { 21 {
22 title: 'Subjects', 22 title: 'Subjects',
23 path: '/subject', 23 path: '/subject',
24 icon: '/static/schoolIcons/Subjects.png', 24 icon: '/static/schoolIcons/Subjects.png',
25 }, 25 },
26 { 26 {
27 title: 'Parents', 27 title: 'Parents',
28 // group: 'apps', 28 // group: 'apps',
29 path: '/parents', 29 path: '/parents',
30 icon: '/static/schoolIcons/Parents.png', 30 icon: '/static/schoolIcons/Parents.png',
31 }, 31 },
32 { 32 {
33 title: 'Teachers', 33 title: 'Teachers',
34 // group: '', 34 // group: '',
35 path: 'teachers', 35 path: 'teachers',
36 icon: '/static/schoolIcons/Teachers.png', 36 icon: '/static/schoolIcons/Teachers.png',
37 }, 37 },
38 { 38 {
39 title: 'Students', 39 title: 'Students',
40 // group: 'apps', 40 // group: 'apps',
41 path: '/Students', 41 path: '/Students',
42 icon: '/static/schoolIcons/Students.png', 42 icon: '/static/schoolIcons/Students.png',
43 }, 43 },
44 { 44 {
45 title: 'User', 45 title: 'User',
46 path: '/User', 46 path: '/User',
47 icon: '/static/schoolIcons/User.png', 47 icon: '/static/schoolIcons/User.png',
48 }, 48 },
49 { 49 {
50 title: 'Attendance', 50 title: 'Attendance',
51 group: 'Attendance', 51 group: 'Attendance',
52 component: 'Attendance', 52 component: 'Attendance',
53 icon: '/static/schoolIcons/Attendance.png', 53 icon: '/static/schoolIcons/Attendance.png',
54 items: [ 54 items: [
55 { name: 'studentAttendence', title: 'Student Attendance', component: 'studentAttendence', action: '', }, 55 { name: 'studentAttendence', title: 'Student Attendance', component: 'studentAttendence', action: '', },
56 // { name: 'teacherAttendence', title: 'Teacher Attendance', component: 'teacherAttendence', action: '', }, 56 // { name: 'teacherAttendence', title: 'Teacher Attendance', component: 'teacherAttendence', action: '', },
57 // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', }, 57 // { name: 'userAttendence', title: 'User Attendance', component: 'userAttendence', action: '', },
58 ] 58 ]
59 }, 59 },
60 { 60 {
61 title: 'Notice Board', 61 title: 'Notice Board',
62 path: '/NoticeBoard', 62 path: '/NoticeBoard',
63 icon: '/static/schoolIcons/Notice_board.png', 63 icon: '/static/schoolIcons/Notice_board.png',
64 }, 64 },
65 { 65 {
66 title: 'News', 66 title: 'News',
67 path: '/news', 67 path: '/news',
68 icon: '/static/schoolIcons/News.png', 68 icon: '/static/schoolIcons/News.png',
69 }, 69 },
70 // { 70 // {
71 // title: 'Reminder', 71 // title: 'Reminder',
72 // name: 'reminder', 72 // name: 'reminder',
73 // icon: 'alarm_add', 73 // icon: 'alarm_add',
74 // }, 74 // },
75 { 75 {
76 title: 'Time Table', 76 title: 'Time Table',
77 path: '/timeTable', 77 path: '/timeTable',
78 icon: '/static/schoolIcons/Time_table.png', 78 icon: '/static/schoolIcons/Time_table.png',
79 }, 79 },
80 { 80 {
81 title: 'Library', 81 title: 'Library',
82 group: 'Library', 82 group: 'Library',
83 component: 'Library', 83 component: 'Library',
84 icon: '/static/schoolIcons/Library.png', 84 icon: '/static/schoolIcons/Library.png',
85 items: [ 85 items: [
86 { name: 'libraryMember', title: ' Library Member', component: 'libraryMember', action: '', }, 86 { name: 'libraryMember', title: ' Library Member', component: 'libraryMember', action: '', },
87 { name: 'Books', title: 'Books', component: 'Books', action: '', }, 87 { name: 'Books', title: 'Books', component: 'Books', action: '', },
88 // { name: 'Issue', title: ' Issue', component: 'Issue', action: '', }, 88 { name: 'Issue', title: ' Issue', component: 'Issue', action: '', },
89 { name: 'eBooks', title: 'E-Books', component: 'eBooks', action: '', } 89 { name: 'eBooks', title: 'E-Books', component: 'eBooks', action: '', }
90 90
91 ] 91 ]
92 }, 92 },
93 { 93 {
94 title: 'Notification', 94 title: 'Notification',
95 path: '/notification', 95 path: '/notification',
96 icon: '/static/schoolIcons/Notification.png', 96 icon: '/static/schoolIcons/Notification.png',
97 }, 97 },
98 { 98 {
99 title: 'Social Media', 99 title: 'Social Media',
100 path: '/SocialMedia', 100 path: '/SocialMedia',
101 icon: '/static/schoolIcons/Social_Media.png', 101 icon: '/static/schoolIcons/Social_Media.png',
102 }, 102 },
103 { 103 {
104 title: 'Gallery', 104 title: 'Gallery',
105 path: '/Gallery', 105 path: '/Gallery',
106 icon: '/static/schoolIcons/Gallery.png', 106 icon: '/static/schoolIcons/Gallery.png',
107 }, 107 },
108 { 108 {
109 title: 'Event', 109 title: 'Event',
110 path: '/Event', 110 path: '/Event',
111 icon: '/static/schoolIcons/Events.png', 111 icon: '/static/schoolIcons/Events.png',
112 }, 112 },
113 { 113 {
114 title: 'Holiday', 114 title: 'Holiday',
115 path: '/Holiday', 115 path: '/Holiday',
116 icon: '/static/schoolIcons/Holidays.png', 116 icon: '/static/schoolIcons/Holidays.png',
117 }, 117 },
118 { 118 {
119 title: 'Account', 119 title: 'Account',
120 group: 'Account', 120 group: 'Account',
121 component: 'Account', 121 component: 'Account',
122 icon: '/static/schoolIcons/Account.png', 122 icon: '/static/schoolIcons/Account.png',
123 items: [ 123 items: [
124 { name: 'feeTypes', title: 'Fee Types', component: 'feeTypes', action: '', }, 124 { name: 'feeTypes', title: 'Fee Types', component: 'feeTypes', action: '', },
125 { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', }, 125 { name: 'Invoice', title: 'Invoice', component: 'Invoice', action: '', },
126 { name: 'paymentHistory', title: 'Payment History', component: 'paymentHistory', action: '', }, 126 { name: 'paymentHistory', title: 'Payment History', component: 'paymentHistory', action: '', },
127 { name: 'Expense', title: 'Expense', component: 'Expense', action: '', }, 127 { name: 'Expense', title: 'Expense', component: 'Expense', action: '', },
128 { name: 'Income', title: 'Income', component: 'Income', action: '', }, 128 { name: 'Income', title: 'Income', component: 'Income', action: '', },
129 ] 129 ]
130 } 130 }
131 ]; 131 ];
132 132
133 133
134 // reorder menu 134 // reorder menu
135 Menu.forEach((item) => { 135 Menu.forEach((item) => {
136 // if (item.items) { 136 // if (item.items) {
137 // item.items.sort((x, y) => { 137 // item.items.sort((x, y) => {
138 // let textA = x.title.toUpperCase(); 138 // let textA = x.title.toUpperCase();
139 // let textB = y.title.toUpperCase(); 139 // let textB = y.title.toUpperCase();
140 // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; 140 // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
141 // }); 141 // });
142 // } 142 // }
143 }); 143 });
144 144
145 export default Menu; 145 export default Menu;
src/pages/Authentication/Login.vue
1 <template> 1 <template>
2 <v-app id="login"> 2 <v-app id="login">
3 <v-toolbar class="fixcolors"> 3 <v-toolbar class="fixcolors">
4 <v-toolbar-items> 4 <v-toolbar-items>
5 <img src="/static/logoIntrack.png" height="40" width="140" alt="logo" /> 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> --> 6 <!-- <h3 class="white--text my-3 ml-5 logoSchool">School-Management</h3> -->
7 </v-toolbar-items> 7 </v-toolbar-items>
8 </v-toolbar> 8 </v-toolbar>
9 <v-content> 9 <v-content>
10 <v-container fluid fill-height> 10 <v-container fluid fill-height>
11 <v-snackbar 11 <v-snackbar
12 :timeout="timeout" 12 :timeout="timeout"
13 :top="y === 'top'" 13 :top="y === 'top'"
14 :right="x === 'right'" 14 :right="x === 'right'"
15 :vertical="mode === 'vertical'" 15 :vertical="mode === 'vertical'"
16 v-model="snackbar" 16 v-model="snackbar"
17 :color="color" 17 :color="color"
18 >{{ text }}</v-snackbar> 18 >{{ text }}</v-snackbar>
19 <v-layout align-center justify-center> 19 <v-layout align-center justify-center>
20 <v-flex xs12 sm10 md6 lg4> 20 <v-flex xs12 sm10 md6 lg4>
21 <v-toolbar class="fixcolors" dark> 21 <v-toolbar class="fixcolors" dark>
22 <v-spacer></v-spacer> 22 <v-spacer></v-spacer>
23 <v-toolbar-title>School Login</v-toolbar-title> 23 <v-toolbar-title>School Login</v-toolbar-title>
24 <v-spacer></v-spacer> 24 <v-spacer></v-spacer>
25 </v-toolbar> 25 </v-toolbar>
26 26
27 <v-card class="elevation-1 pa-1"> 27 <v-card class="elevation-1 pa-1">
28 <v-card-text> 28 <v-card-text>
29 <v-flex xs12 sm12 md12 lg12> 29 <v-flex xs12 sm12 md12 lg12>
30 <v-form ref="form" v-model="valid" lazy-validation> 30 <v-form ref="form" v-model="valid" lazy-validation>
31 <v-text-field 31 <v-text-field
32 v-model="userLogincredentials.email" 32 v-model="userLogincredentials.email"
33 :rules="nameRules" 33 :rules="nameRules"
34 label="Username" 34 label="Username"
35 required 35 required
36 ></v-text-field> 36 ></v-text-field>
37 <v-text-field 37 <v-text-field
38 :rules="[rules.required]" 38 :rules="[rules.required]"
39 v-model="userLogincredentials.password" 39 v-model="userLogincredentials.password"
40 :append-icon="e1 ? 'visibility_off' : 'visibility'" 40 :append-icon="e1 ? 'visibility_off' : 'visibility'"
41 :append-icon-cb="() => (e1 = !e1)" 41 :append-icon-cb="() => (e1 = !e1)"
42 :type="e1 ? 'password' : 'text'" 42 :type="e1 ? 'password' : 'text'"
43 name="input-10-1" 43 name="input-10-1"
44 label="Password" 44 label="Password"
45 @keyup.enter="login" 45 @keyup.enter="login"
46 counter 46 counter
47 ></v-text-field> 47 ></v-text-field>
48 </v-form> 48 </v-form>
49 <v-layout row wrap> 49 <v-layout row wrap>
50 <v-flex xs6> 50 <v-flex xs6>
51 <!-- <v-checkbox :label="`Remember me`" v-model="remember"></v-checkbox> --> 51 <!-- <v-checkbox :label="`Remember me`" v-model="remember"></v-checkbox> -->
52 </v-flex> 52 </v-flex>
53 <v-flex xs6> 53 <v-flex xs6>
54 <h5 class="right mt-4"> 54 <h5 class="right mt-4">
55 <router-link 55 <router-link
56 class="link" 56 class="link"
57 to="/forgetpassword" 57 to="/forgetpassword"
58 style="border-bottom: 2px solid #aaa;" 58 style="border-bottom: 2px solid #aaa;"
59 >Forgot Password</router-link> 59 >Forgot Password</router-link>
60 </h5> 60 </h5>
61 </v-flex> 61 </v-flex>
62 </v-layout> 62 </v-layout>
63 </v-flex> 63 </v-flex>
64 </v-card-text> 64 </v-card-text>
65 <v-layout> 65 <v-layout>
66 <v-flex sm12 class="my-3"> 66 <v-flex sm12 class="my-3">
67 <v-btn 67 <v-btn
68 style="margin: auto;display: block;b" 68 style="margin: auto;display: block;b"
69 class="fixcolors" 69 class="fixcolors"
70 round 70 round
71 dark 71 dark
72 large 72 large
73 @click="login" 73 @click="login"
74 :loading="loading" 74 :loading="loading"
75 >Login</v-btn> 75 >Login</v-btn>
76 </v-flex> 76 </v-flex>
77 </v-layout> 77 </v-layout>
78 <v-layout></v-layout> 78 <v-layout></v-layout>
79 </v-card> 79 </v-card>
80 </v-flex> 80 </v-flex>
81 </v-layout> 81 </v-layout>
82 </v-container> 82 </v-container>
83 </v-content> 83 </v-content>
84 <v-footer class="pa-4 fixcolors"></v-footer> 84 <v-footer class="pa-4 fixcolors"></v-footer>
85 </v-app> 85 </v-app>
86 </template> 86 </template>
87 87
88 <script> 88 <script>
89 import http from "@/Services/http.js"; 89 import http from "@/Services/http.js";
90 export default { 90 export default {
91 data() { 91 data() {
92 return { 92 return {
93 snackbar: false, 93 snackbar: false,
94 y: "top", 94 y: "top",
95 x: "right", 95 x: "right",
96 mode: "", 96 mode: "",
97 timeout: 3000, 97 timeout: 3000,
98 text: "", 98 text: "",
99 e1: true, 99 e1: true,
100 loading: false, 100 loading: false,
101 remember: false, 101 remember: false,
102 valid: false, 102 valid: false,
103 userLogincredentials: {}, 103 userLogincredentials: {},
104 nameRules: [v => !!v || "Username is required"], 104 nameRules: [v => !!v || "Username is required"],
105 password: "", 105 password: "",
106 email: "", 106 email: "",
107 rules: { 107 rules: {
108 required: value => !!value || "password is Required." 108 required: value => !!value || "password is Required."
109 } 109 }
110 }; 110 };
111 }, 111 },
112 methods: { 112 methods: {
113 login() { 113 login() {
114 this.loading = true; 114 this.loading = true;
115 var userdata = { 115 var userdata = {
116 email: this.userLogincredentials.email, 116 email: this.userLogincredentials.email,
117 password: this.userLogincredentials.password, 117 password: this.userLogincredentials.password,
118 role: "ADMIN" 118 role: "ADMIN"
119 }; 119 };
120 http() 120 http()
121 .post("/schoolLogin", userdata) 121 .post("/schoolLogin", userdata)
122 .then(response => { 122 .then(response => {
123 this.$store.dispatch("setToken", response.data.data.token); 123 this.$store.dispatch("setToken", response.data.data.token);
124 this.$store.dispatch("Id", response.data.data.id); 124 this.$store.dispatch("Id", response.data.data.id);
125 this.loading = false; 125 this.loading = false;
126 this.$router.push("/teachers"); 126 this.$router.push("/dashboard");
127 }) 127 })
128 .catch(error => { 128 .catch(error => {
129 if (error) { 129 if (error) {
130 this.text = "Server appears to be offline"; 130 this.text = "Server appears to be offline";
131 this.snackbar = true; 131 this.snackbar = true;
132 this.loading = false; 132 this.loading = false;
133 } 133 }
134 if (error.response.data.message) { 134 if (error.response.data.message) {
135 this.text = error.response.data.message; 135 this.text = error.response.data.message;
136 this.snackbar = true; 136 this.snackbar = true;
137 } 137 }
138 this.loading = false; 138 this.loading = false;
139 }); 139 });
140 } 140 }
141 }, 141 },
142 mounted() { 142 mounted() {
143 if (this.$store.state.isUserLoggedIn == true) { 143 if (this.$store.state.isUserLoggedIn == true) {
144 this.$router.push("/teachers"); 144 this.$router.push("/dashboard");
145 } 145 }
146 }, 146 },
147 computed: { 147 computed: {
148 color() { 148 color() {
149 return this.loading ? "success" : "error"; 149 return this.loading ? "success" : "error";
150 } 150 }
151 } 151 }
152 }; 152 };
153 </script> 153 </script>
154 154
155 <style scoped lang="css"> 155 <style scoped lang="css">
156 #login { 156 #login {
157 width: 100%; 157 width: 100%;
158 position: absolute; 158 position: absolute;
159 top: 0; 159 top: 0;
160 left: 0; 160 left: 0;
161 content: ""; 161 content: "";
162 z-index: 0; 162 z-index: 0;
163 } 163 }
164 </style> 164 </style>
165 <style scoped> 165 <style scoped>
166 img { 166 img {
167 position: absolute; 167 position: absolute;
168 top: 13px; 168 top: 13px;
169 left: 8px; 169 left: 8px;
170 } 170 }
171 .v-btn--large { 171 .v-btn--large {
172 padding: 0px 84px; 172 padding: 0px 84px;
173 } 173 }
174 .link { 174 .link {
175 text-decoration: none; 175 text-decoration: none;
176 } 176 }
177 a { 177 a {
178 color: #696969; 178 color: #696969;
179 } 179 }
180 .forget { 180 .forget {
181 margin-top: 20px; 181 margin-top: 20px;
182 } 182 }
183 .mt-4 { 183 .mt-4 {
184 margin-top: 21px !important; 184 margin-top: 21px !important;
185 } 185 }
186 @media screen and (max-width: 600px) { 186 @media screen and (max-width: 600px) {
187 .forget { 187 .forget {
188 margin-top: none; 188 margin-top: none;
189 margin-left: 18px; 189 margin-left: 18px;
190 } 190 }
191 img { 191 img {
192 left: 10px; 192 left: 10px;
193 height: 34px; 193 height: 34px;
194 width: 120px; 194 width: 120px;
195 } 195 }
196 .logoSchool { 196 .logoSchool {
197 font-size: 18px; 197 font-size: 18px;
198 margin-top: 20px !important; 198 margin-top: 20px !important;
199 } 199 }
200 h5 { 200 h5 {
201 font-size: 14px !important; 201 font-size: 14px !important;
202 } 202 }
203 } 203 }
204 </style> 204 </style>