Commit 01d009dde71146c76b27ee5d464fea28849bfdb0
1 parent
fc77c38e04
Exists in
master
and in
3 other branches
fixed Show Notice Board on dashboard above calendar view same as Web School
Showing
1 changed file
with
206 additions
and
29 deletions
Show diff stats
src/pages/Dashboard/dashboard.vue
1 | <template> | 1 | <template> |
2 | <v-app id="pages-dasboard"> | 2 | <v-app id="pages-dasboard" class="dashbaordBackground"> |
3 | <!-- ****** VIEW PROFIL NOTICE BOARD ****** --> | ||
4 | <v-dialog v-model="dialogNotice" max-width="640px" scrollable> | ||
5 | <v-card> | ||
6 | <v-toolbar color="grey lighten-2" flat> | ||
7 | <v-spacer></v-spacer> | ||
8 | <v-toolbar-title> | ||
9 | <h3>Notice Board</h3> | ||
10 | </v-toolbar-title> | ||
11 | <v-spacer></v-spacer> | ||
12 | <v-icon @click="closeNotice">close</v-icon> | ||
13 | </v-toolbar> | ||
14 | <v-card-text> | ||
15 | <v-layout> | ||
16 | <v-flex align-center justify-center layout text-xs-center class="mt-2"> | ||
17 | <img src="/static/icon/user.png" width="70px" /> | ||
18 | </v-flex> | ||
19 | </v-layout> | ||
20 | <v-container grid-list-md> | ||
21 | <v-layout wrap> | ||
22 | <v-flex> | ||
23 | <v-layout> | ||
24 | <v-flex xs5 sm6> | ||
25 | <h5 class="right my-1"> | ||
26 | <b>Title:</b> | ||
27 | </h5> | ||
28 | </v-flex> | ||
29 | <v-flex sm6 xs8> | ||
30 | <h5 class="my-1">{{ editedItem.title }}</h5> | ||
31 | </v-flex> | ||
32 | </v-layout> | ||
33 | <v-layout> | ||
34 | <v-flex xs5 sm6> | ||
35 | <h5 class="right my-1"> | ||
36 | <b>Description:</b> | ||
37 | </h5> | ||
38 | </v-flex> | ||
39 | <v-flex sm6 xs8> | ||
40 | <h5 class="my-1">{{ editedItem.description }}</h5> | ||
41 | </v-flex> | ||
42 | </v-layout> | ||
43 | </v-flex> | ||
44 | </v-layout> | ||
45 | </v-container> | ||
46 | </v-card-text> | ||
47 | </v-card> | ||
48 | </v-dialog> | ||
3 | <v-container fluid grid-list-xl> | 49 | <v-container fluid grid-list-xl> |
4 | <!-- <v-card flat class="dashCard"> --> | ||
5 | <v-layout row wrap class="pt-3"> | 50 | <v-layout row wrap class="pt-3"> |
6 | <!-- ***** Total Students ***** --> | 51 | <!-- ***** Total Students ***** --> |
7 | <v-flex xs12 class="pt-2"> | 52 | <v-flex xs12 class="pt-2"> |
8 | <v-layout row wrap> | 53 | <v-layout row wrap> |
9 | <v-flex xs12 sm12 lg3 md4> | 54 | <v-flex xs12 sm12 lg3 md3> |
10 | <v-card width="90" height="90" class="ml-3 pa-1 white iconCard" dark> | 55 | <v-card width="90" height="90" class="ml-3 pa-1 white iconCard" dark> |
11 | <img | 56 | <img |
12 | src="/static/schoolIcons/Students.png" | 57 | src="/static/schoolIcons/Students.png" |
13 | class="iconOfDashboard" | 58 | class="iconOfDashboard" |
14 | width="80" | 59 | width="80" |
15 | alt="Students" | 60 | alt="Students" |
16 | /> | 61 | /> |
17 | </v-card> | 62 | </v-card> |
18 | <v-card class="pa-3" style="margin-top: -44px;"> | 63 | <v-card class="pa-3" style="margin-top: -44px;"> |
19 | <div class="body-2 grey--text text-xs-right">Students</div> | 64 | <div class="body-2 grey--text text-xs-right">Students</div> |
20 | <br /> | 65 | <br /> |
21 | <h3 class="headline text-xs-right pb-4">{{ students.length }}</h3> | 66 | <h3 class="headline text-xs-right pb-4">{{ students.length }}</h3> |
22 | </v-card> | 67 | </v-card> |
23 | </v-flex> | 68 | </v-flex> |
24 | <!-- ***** Total Parents ***** --> | 69 | <!-- ***** Total Parents ***** --> |
25 | <v-flex xs12 sm12 lg3 md4> | 70 | <v-flex xs12 sm12 lg3 md3> |
26 | <v-card width="90" height="90" class="ml-3 pa-1 white agentIcon" dark> | 71 | <v-card width="90" height="90" class="ml-3 pa-1 white agentIcon" dark> |
27 | <img | 72 | <img |
28 | src="/static/schoolIcons/Parents.png" | 73 | src="/static/schoolIcons/Parents.png" |
29 | width="80" | 74 | width="80" |
30 | class="iconOfDashboard" | 75 | class="iconOfDashboard" |
31 | alt="Parents" | 76 | alt="Parents" |
32 | /> | 77 | /> |
33 | </v-card> | 78 | </v-card> |
34 | <v-card class="pa-3" style="margin-top: -44px;"> | 79 | <v-card class="pa-3" style="margin-top: -44px;"> |
35 | <div class="body-2 grey--text text-xs-right">Parents</div> | 80 | <div class="body-2 grey--text text-xs-right">Parents</div> |
36 | <br /> | 81 | <br /> |
37 | <h3 class="headline text-xs-right pb-4">{{ parents.length }}</h3> | 82 | <h3 class="headline text-xs-right pb-4">{{ parents.length }}</h3> |
38 | </v-card> | 83 | </v-card> |
39 | </v-flex> | 84 | </v-flex> |
40 | <!-- ***** Total Teachers***** --> | 85 | <!-- ***** Total Teachers***** --> |
41 | <v-flex xs12 sm12 lg3 md4> | 86 | <v-flex xs12 sm12 lg3 md3> |
42 | <v-card width="90" height="90" class="ml-3 pa-1 white farmerIcon" dark> | 87 | <v-card width="90" height="90" class="ml-3 pa-1 white farmerIcon" dark> |
43 | <img | 88 | <img |
44 | src="/static/schoolIcons/Teachers.png" | 89 | src="/static/schoolIcons/Teachers.png" |
45 | width="80" | 90 | width="80" |
46 | class="iconOfDashboard" | 91 | class="iconOfDashboard" |
47 | alt="Teachers" | 92 | alt="Teachers" |
48 | /> | 93 | /> |
49 | </v-card> | 94 | </v-card> |
50 | <v-card class="pa-3" style="margin-top: -44px;"> | 95 | <v-card class="pa-3" style="margin-top: -44px;"> |
51 | <div class="body-2 grey--text text-xs-right">Teachers</div> | 96 | <div class="body-2 grey--text text-xs-right">Teachers</div> |
52 | <br /> | 97 | <br /> |
53 | <h3 class="headline text-xs-right pb-4">{{ teachers.length }}</h3> | 98 | <h3 class="headline text-xs-right pb-4">{{ teachers.length }}</h3> |
54 | </v-card> | 99 | </v-card> |
55 | </v-flex> | 100 | </v-flex> |
56 | <!-- ***** Total Class***** --> | 101 | <!-- ***** Total Class***** --> |
57 | <v-flex xs12 sm12 lg3 md4> | 102 | <v-flex xs12 sm12 lg3 md3> |
58 | <v-card width="90" height="90" class="ml-3 pa-1 white khasraIcon" dark> | 103 | <v-card width="90" height="90" class="ml-3 pa-1 white khasraIcon" dark> |
59 | <img | 104 | <img |
60 | src="/static/schoolIcons/Class.png" | 105 | src="/static/schoolIcons/Class.png" |
61 | width="80" | 106 | width="80" |
62 | class="iconOfDashboard" | 107 | class="iconOfDashboard" |
63 | alt="class" | 108 | alt="class" |
64 | /> | 109 | /> |
65 | </v-card> | 110 | </v-card> |
66 | <v-card class="pa-3" style="margin-top: -44px;"> | 111 | <v-card class="pa-3" style="margin-top: -44px;"> |
67 | <div class="body-2 grey--text text-xs-right">Class</div> | 112 | <div class="body-2 grey--text text-xs-right">Class</div> |
68 | <br /> | 113 | <br /> |
69 | <h3 class="headline text-xs-right pb-4">{{ classes.length}}</h3> | 114 | <h3 class="headline text-xs-right pb-4">{{ classes.length}}</h3> |
70 | </v-card> | 115 | </v-card> |
71 | </v-flex> | 116 | </v-flex> |
72 | </v-layout> | 117 | </v-layout> |
73 | </v-flex> | 118 | </v-flex> |
74 | </v-layout> | 119 | </v-layout> |
120 | <v-layout wrap> | ||
121 | <v-flex xs12 sm12 md4> | ||
122 | <v-card> | ||
123 | <v-flex xs12 class="text-xs-center"> | ||
124 | <v-avatar size="60px" class="mx-auto" style="margin: auto;display:block;"> | ||
125 | <img src="/static/icon/user.png" /> | ||
126 | </v-avatar> | ||
127 | <h5 class="pt-1"> | ||
128 | <i>{{ userData.name }}</i> | ||
129 | </h5> | ||
130 | <!-- <p class="grey--text">Student</p> --> | ||
131 | </v-flex> | ||
132 | <table class="feeTypeTable tableRsponsive"> | ||
133 | <tr> | ||
134 | <td> | ||
135 | <v-icon>person</v-icon> | ||
136 | </td> | ||
137 | <td class="fixedSize">Username</td> | ||
138 | <td>{{ userData.name }}</td> | ||
139 | </tr> | ||
140 | <tr> | ||
141 | <td> | ||
142 | <v-icon>mail</v-icon> | ||
143 | </td> | ||
144 | <td class="fixedSize">Email</td> | ||
145 | <td>{{ userData.email }}</td> | ||
146 | </tr> | ||
147 | <tr> | ||
148 | <td> | ||
149 | <v-icon>call</v-icon> | ||
150 | </td> | ||
151 | <td class="fixedSize">Phone</td> | ||
152 | <td>{{ userData.mobile }}</td> | ||
153 | </tr> | ||
154 | <tr> | ||
155 | <td> | ||
156 | <v-icon>home</v-icon> | ||
157 | </td> | ||
158 | <td class="fixedSize">Address</td> | ||
159 | <td>{{ userData.address }}</td> | ||
160 | </tr> | ||
161 | </table> | ||
162 | </v-card> | ||
163 | </v-flex> | ||
164 | <v-flex xs12 sm12 md8> | ||
165 | <v-card> | ||
166 | <v-card-title class="subheading">Notice</v-card-title> | ||
167 | <v-data-table :items="noticeData" class="elevation-1" hide-actions hide-headers> | ||
168 | <template slot="items" slot-scope="props" v-if="props.index < 5"> | ||
169 | <td>{{ props.index + 1}}</td> | ||
170 | <td>{{ props.item.title}}</td> | ||
171 | <td>{{ props.item.description}}</td> | ||
172 | |||
173 | <td class="text-xs-center"> | ||
174 | <span> | ||
175 | <v-tooltip top> | ||
176 | <img | ||
177 | slot="activator" | ||
178 | style="cursor:pointer; width:25px; height:18px; " | ||
179 | @click="profile(props.item)" | ||
180 | src="/static/icon/eye1.png" | ||
181 | /> | ||
182 | <span>View</span> | ||
183 | </v-tooltip> | ||
184 | </span> | ||
185 | </td> | ||
186 | </template> | ||
187 | </v-data-table> | ||
188 | </v-card> | ||
189 | </v-flex> | ||
190 | </v-layout> | ||
75 | <v-card class="pt-4 mt-3" flat> | 191 | <v-card class="pt-4 mt-3" flat> |
76 | <full-calendar | 192 | <full-calendar |
77 | ref="calendar" | 193 | ref="calendar" |
78 | defaultView="month" | 194 | defaultView="month" |
79 | droppable="false" | 195 | droppable="false" |
80 | :events="events" | 196 | :events="events" |
81 | :config="config" | 197 | :config="config" |
82 | ></full-calendar> | 198 | ></full-calendar> |
83 | </v-card> | 199 | </v-card> |
84 | </v-container> | 200 | </v-container> |
85 | <v-dialog v-model="dialog" max-width="500"> | 201 | <v-dialog v-model="dialog" max-width="500"> |
86 | <v-card color="grey lighten-4" flat> | 202 | <v-card color="grey lighten-4" flat> |
87 | <v-toolbar dark color="fixcolors"> | 203 | <v-toolbar dark color="fixcolors"> |
88 | <!-- <v-toolbar-title class="white--text">Title</v-toolbar-title> --> | ||
89 | <v-spacer></v-spacer> | 204 | <v-spacer></v-spacer> |
90 | <v-btn icon @click="dialog= false"> | 205 | <v-btn icon @click="dialog= false"> |
91 | <v-icon>close</v-icon> | 206 | <v-icon>close</v-icon> |
92 | </v-btn> | 207 | </v-btn> |
93 | </v-toolbar> | 208 | </v-toolbar> |
94 | <v-flex class="py-4"> | 209 | <v-flex class="py-4"> |
95 | <v-list-tile> | 210 | <v-list-tile> |
96 | <v-list-tile-action> | 211 | <v-list-tile-action> |
97 | <v-icon>edit</v-icon> | 212 | <v-icon>edit</v-icon> |
98 | </v-list-tile-action> | 213 | </v-list-tile-action> |
99 | <v-list-tile-content> | 214 | <v-list-tile-content> |
100 | <v-list-tile-title>{{ selected.title }}</v-list-tile-title> | 215 | <v-list-tile-title>{{ selected.title }}</v-list-tile-title> |
101 | </v-list-tile-content> | 216 | </v-list-tile-content> |
102 | </v-list-tile> | 217 | </v-list-tile> |
103 | <v-list-tile> | 218 | <v-list-tile> |
104 | <v-list-tile-action> | 219 | <v-list-tile-action> |
105 | <v-icon>access_time</v-icon> | 220 | <v-icon>access_time</v-icon> |
106 | </v-list-tile-action> | 221 | </v-list-tile-action> |
107 | <v-list-tile-content> | 222 | <v-list-tile-content> |
108 | <v-list-tile-title>{{ date(selected.start)}}</v-list-tile-title> | 223 | <v-list-tile-title>{{ date(selected.start)}}</v-list-tile-title> |
109 | <!-- <v-list-tile-sub-title>{{ date(selected.end) }}</v-list-tile-sub-title> --> | ||
110 | </v-list-tile-content> | 224 | </v-list-tile-content> |
111 | </v-list-tile> | 225 | </v-list-tile> |
112 | </v-flex> | 226 | </v-flex> |
113 | </v-card> | 227 | </v-card> |
114 | </v-dialog> | 228 | </v-dialog> |
115 | <div class="loader" v-if="showLoader"> | 229 | <div class="loader" v-if="showLoader"> |
116 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 230 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
117 | </div> | 231 | </div> |
118 | </v-app> | 232 | </v-app> |
119 | </template> | 233 | </template> |
120 | 234 | ||
121 | <script> | 235 | <script> |
122 | import http from "@/Services/http.js"; | 236 | import http from "@/Services/http.js"; |
123 | import Util from "@/util"; | ||
124 | import moment from "moment"; | 237 | import moment from "moment"; |
125 | 238 | ||
126 | export default { | 239 | export default { |
127 | data() { | 240 | data() { |
128 | return { | 241 | return { |
129 | showLoader: false, | 242 | showLoader: false, |
130 | dialog: false, | 243 | dialog: false, |
244 | dialogNotice: false, | ||
131 | HolidaysList: [], | 245 | HolidaysList: [], |
132 | EventsList: [], | 246 | EventsList: [], |
133 | events: [], | 247 | events: [], |
134 | config: { | 248 | config: { |
135 | eventClick: event => { | 249 | eventClick: event => { |
136 | this.selected = event; | 250 | this.selected = event; |
137 | this.dialog = true; | 251 | this.dialog = true; |
138 | } | 252 | } |
139 | }, | 253 | }, |
140 | selected: {}, | 254 | selected: {}, |
255 | editedItem: {}, | ||
256 | userData: {}, | ||
141 | students: "", | 257 | students: "", |
142 | parents: "", | 258 | parents: "", |
143 | teachers: "", | 259 | teachers: "", |
144 | classes: "" | 260 | classes: "", |
261 | noticeData: [] | ||
145 | }; | 262 | }; |
146 | }, | 263 | }, |
147 | mounted() { | 264 | mounted() { |
148 | this.token = this.$store.state.token; | 265 | this.token = this.$store.state.token; |
149 | this.getData(); | 266 | this.getData(); |
150 | this.getStudents(); | 267 | this.getStudents(); |
151 | this.getTeachers(); | 268 | this.getTeachers(); |
152 | this.getParents(); | 269 | this.getParents(); |
153 | this.getClasses(); | 270 | this.getClasses(); |
271 | this.getNoticeData(); | ||
272 | this.getUserData(); | ||
154 | }, | 273 | }, |
155 | methods: { | 274 | methods: { |
275 | closeNotice() { | ||
276 | this.dialogNotice = false; | ||
277 | }, | ||
278 | profile(item) { | ||
279 | // this.editedIndex = this.desserts.indexOf(item); | ||
280 | this.editedItem = Object.assign({}, item); | ||
281 | this.dialogNotice = true; | ||
282 | }, | ||
156 | date: function(date) { | 283 | date: function(date) { |
157 | return moment(date).format("MMMM DD, YYYY HH:mm:ss"); | 284 | return moment(date).format("MMMM DD, YYYY HH:mm:ss"); |
158 | }, | 285 | }, |
159 | refreshEvents() { | 286 | refreshEvents() { |
160 | this.$refs.calendar.$emit("refetch-events"); | 287 | this.$refs.calendar.$emit("refetch-events"); |
161 | }, | 288 | }, |
162 | removeEvent() { | 289 | removeEvent() { |
163 | this.$refs.calendar.$emit("remove-event", this.selected); | 290 | this.$refs.calendar.$emit("remove-event", this.selected); |
164 | this.selected = {}; | 291 | this.selected = {}; |
165 | }, | 292 | }, |
166 | eventSelected(event) { | 293 | eventSelected(event) { |
167 | this.selected = event; | 294 | this.selected = event; |
168 | console.log("this.selected", this.selected); | 295 | console.log("this.selected", this.selected); |
169 | }, | 296 | }, |
170 | // eventDropStart: function(event) { | 297 | // eventDropStart: function(event) { |
171 | // event.editable = false; | 298 | // event.editable = false; |
172 | // }, | 299 | // }, |
173 | eventCreated(...test) { | 300 | eventCreated(...test) { |
174 | console.log(test); | 301 | console.log(test); |
175 | }, | 302 | }, |
176 | getData() { | 303 | getData() { |
177 | this.showLoader = true; | 304 | this.showLoader = true; |
178 | var token = this.$store.state.token; | ||
179 | http() | 305 | http() |
180 | .get("/getHolidaysList", { | 306 | .get("/getHolidaysList", {}) |
181 | headers: { Authorization: "Bearer " + token } | ||
182 | }) | ||
183 | .then(response => { | 307 | .then(response => { |
184 | this.HolidaysList = response.data.data; | 308 | this.HolidaysList = response.data.data; |
185 | // this.events = response.data.data; | 309 | // this.events = response.data.data; |
186 | this.showLoader = false; | 310 | this.showLoader = false; |
187 | }) | 311 | }) |
188 | .catch(err => { | 312 | .catch(err => { |
189 | // console.log("err====>", err); | 313 | // console.log("err====>", err); |
190 | this.showLoader = false; | 314 | this.showLoader = false; |
191 | if (error.response.status === 401) { | 315 | if (error.response.status === 401) { |
192 | this.$router.replace({ path: "/" }); | 316 | this.$router.replace({ path: "/" }); |
193 | this.$store.dispatch("setToken", null); | 317 | this.$store.dispatch("setToken", null); |
194 | this.$store.dispatch("Id", null); | 318 | this.$store.dispatch("Id", null); |
195 | this.$store.dispatch("Role", null); | 319 | this.$store.dispatch("Role", null); |
196 | } | 320 | } |
197 | }); | 321 | }); |
198 | http() | 322 | http() |
199 | .get("/getSchoolEventsList", { | 323 | .get("/getSchoolEventsList") |
200 | headers: { Authorization: "Bearer " + token } | ||
201 | }) | ||
202 | .then(response => { | 324 | .then(response => { |
203 | this.EventsList = response.data.data; | 325 | this.EventsList = response.data.data; |
204 | let allData = []; | 326 | let allData = []; |
205 | allData = this.HolidaysList.concat(this.EventsList); | 327 | allData = this.HolidaysList.concat(this.EventsList); |
206 | this.events = allData; | 328 | this.events = allData; |
207 | this.showLoader = false; | 329 | this.showLoader = false; |
208 | }) | 330 | }) |
209 | .catch(error => { | 331 | .catch(error => { |
210 | // console.log("err====>", err); | 332 | // console.log("err====>", err); |
211 | this.showLoader = false; | 333 | this.showLoader = false; |
212 | if (error.response.status === 401) { | 334 | if (error.response.status === 401) { |
213 | this.$router.replace({ path: "/" }); | 335 | this.$router.replace({ path: "/" }); |
214 | this.$store.dispatch("setToken", null); | 336 | this.$store.dispatch("setToken", null); |
215 | this.$store.dispatch("Id", null); | 337 | this.$store.dispatch("Id", null); |
216 | this.$store.dispatch("Role", null); | 338 | this.$store.dispatch("Role", null); |
217 | } | 339 | } |
218 | }); | 340 | }); |
219 | }, | 341 | }, |
220 | getStudents() { | 342 | getStudents() { |
221 | http() | 343 | http() |
222 | .get("/getStudentsList", { | 344 | .get("/getStudentsList") |
223 | headers: { Authorization: "Bearer " + this.token } | ||
224 | }) | ||
225 | .then(response => { | 345 | .then(response => { |
226 | this.students = response.data.data; | 346 | this.students = response.data.data; |
227 | this.showLoader = false; | 347 | this.showLoader = false; |
228 | }) | 348 | }) |
229 | .catch(error => { | 349 | .catch(error => { |
230 | // console.log("err====>", err); | 350 | // console.log("err====>", err); |
231 | this.showLoader = false; | 351 | this.showLoader = false; |
232 | if (error.response.status === 401) { | 352 | if (error.response.status === 401) { |
233 | this.$router.replace({ path: "/" }); | 353 | this.$router.replace({ path: "/" }); |
234 | this.$store.dispatch("setToken", null); | 354 | this.$store.dispatch("setToken", null); |
235 | this.$store.dispatch("Id", null); | 355 | this.$store.dispatch("Id", null); |
236 | } | 356 | } |
237 | }); | 357 | }); |
238 | }, | 358 | }, |
239 | getParents() { | 359 | getParents() { |
240 | http() | 360 | http() |
241 | .get("/getParentsList", { | 361 | .get("/getParentsList") |
242 | headers: { Authorization: "Bearer " + this.token } | ||
243 | }) | ||
244 | .then(response => { | 362 | .then(response => { |
245 | this.parents = response.data.data; | 363 | this.parents = response.data.data; |
246 | this.showLoader = false; | 364 | this.showLoader = false; |
247 | }) | 365 | }) |
248 | .catch(error => { | 366 | .catch(error => { |
249 | // console.log("err====>", err); | 367 | // console.log("err====>", err); |
250 | this.showLoader = false; | 368 | this.showLoader = false; |
251 | if (error.response.status === 401) { | 369 | if (error.response.status === 401) { |
252 | this.$router.replace({ path: "/" }); | 370 | this.$router.replace({ path: "/" }); |
253 | this.$store.dispatch("setToken", null); | 371 | this.$store.dispatch("setToken", null); |
254 | this.$store.dispatch("Id", null); | 372 | this.$store.dispatch("Id", null); |
255 | } | 373 | } |
256 | }); | 374 | }); |
257 | }, | 375 | }, |
258 | getTeachers() { | 376 | getTeachers() { |
259 | http() | 377 | http() |
260 | .get("/getTeachersList", { | 378 | .get("/getTeachersList") |
261 | headers: { Authorization: "Bearer " + this.token } | ||
262 | }) | ||
263 | .then(response => { | 379 | .then(response => { |
264 | this.teachers = response.data.data; | 380 | this.teachers = response.data.data; |
265 | this.showLoader = false; | 381 | this.showLoader = false; |
266 | }) | 382 | }) |
267 | .catch(error => { | 383 | .catch(error => { |
268 | // console.log("err====>", err); | 384 | // console.log("err====>", err); |
269 | this.showLoader = false; | 385 | this.showLoader = false; |
270 | if (error.response.status === 401) { | 386 | if (error.response.status === 401) { |
271 | this.$router.replace({ path: "/" }); | 387 | this.$router.replace({ path: "/" }); |
272 | this.$store.dispatch("setToken", null); | 388 | this.$store.dispatch("setToken", null); |
273 | this.$store.dispatch("Id", null); | 389 | this.$store.dispatch("Id", null); |
274 | } | 390 | } |
275 | }); | 391 | }); |
276 | }, | 392 | }, |
277 | getClasses() { | 393 | getClasses() { |
278 | http() | 394 | http() |
279 | .get("/getClassesList", { | 395 | .get("/getClassesList") |
280 | headers: { Authorization: "Bearer " + this.token } | ||
281 | }) | ||
282 | .then(response => { | 396 | .then(response => { |
283 | this.classes = response.data.data; | 397 | this.classes = response.data.data; |
284 | this.showLoader = false; | 398 | this.showLoader = false; |
285 | }) | 399 | }) |
286 | .catch(error => { | 400 | .catch(error => { |
287 | this.showLoader = false; | 401 | this.showLoader = false; |
288 | if (error.response.status === 401) { | 402 | if (error.response.status === 401) { |
289 | this.$router.replace({ path: "/" }); | 403 | this.$router.replace({ path: "/" }); |
290 | this.$store.dispatch("setToken", null); | 404 | this.$store.dispatch("setToken", null); |
291 | this.$store.dispatch("Id", null); | 405 | this.$store.dispatch("Id", null); |
292 | this.$store.dispatch("Role", null); | 406 | this.$store.dispatch("Role", null); |
293 | } | 407 | } |
294 | }); | 408 | }); |
409 | }, | ||
410 | getNoticeData() { | ||
411 | this.showLoader = true; | ||
412 | http() | ||
413 | .get("/getEventsList") | ||
414 | .then(response => { | ||
415 | this.noticeData = response.data.data; | ||
416 | this.showLoader = false; | ||
417 | }) | ||
418 | .catch(error => { | ||
419 | this.showLoader = false; | ||
420 | if (error.response.status === 401) { | ||
421 | this.$router.replace({ path: "/" }); | ||
422 | this.$store.dispatch("setToken", null); | ||
423 | this.$store.dispatch("Id", null); | ||
424 | } | ||
425 | }); | ||
426 | }, | ||
427 | getUserData() { | ||
428 | this.showLoader = true; | ||
429 | http() | ||
430 | .get("/getParticularUserDetail") | ||
431 | .then(response => { | ||
432 | this.userData = response.data.data; | ||
433 | this.showLoader = false; | ||
434 | }) | ||
435 | .catch(error => { | ||
436 | this.showLoader = false; | ||
437 | if (error.response.status === 401) { | ||
438 | this.$router.replace({ path: "/" }); | ||
439 | this.$store.dispatch("setToken", null); | ||
440 | this.$store.dispatch("Id", null); | ||
441 | } | ||
442 | }); | ||
295 | } | 443 | } |
296 | // eventSources() { | 444 | // eventSources() { |
297 | // const self = this; | 445 | // const self = this; |
298 | // return [ | 446 | // return [ |
299 | // { | 447 | // { |
300 | // events(start, end, timezone, callback) { | 448 | // events(start, end, timezone, callback) { |
301 | // setTimeout(() => { | 449 | // setTimeout(() => { |
302 | // callback(self.events.filter(() => Math.random() > 0.5)); | 450 | // callback(self.events.filter(() => Math.random() > 0.5)); |
303 | // }, 1000); | 451 | // }, 1000); |
304 | // } | 452 | // } |
305 | // } | 453 | // } |
306 | // ]; | 454 | // ]; |
307 | // } | 455 | // } |
308 | } | 456 | } |
309 | }; | 457 | }; |
310 | </script> | 458 | </script> |
311 | 459 | ||
312 | <style> | 460 | <style> |
313 | @import "fullcalendar/dist/fullcalendar.css"; | 461 | @import "fullcalendar/dist/fullcalendar.css"; |
314 | .fc button { | 462 | .fc button { |
315 | background: grey !important; | 463 | background: grey !important; |
316 | border: none; | 464 | border: none; |
317 | border-radius: 4px; | 465 | border-radius: 4px; |
318 | color: white; | 466 | color: white; |
319 | padding: 6px 32px; | 467 | padding: 6px 32px; |
320 | text-align: center; | 468 | text-align: center; |
321 | text-decoration: none; | 469 | text-decoration: none; |
322 | display: inline-block; | 470 | display: inline-block; |
323 | font-size: 18px; | 471 | font-size: 18px; |
324 | margin: 8px 2px !important; | 472 | margin: 8px 2px !important; |
325 | cursor: pointer; | 473 | cursor: pointer; |
326 | -webkit-transition-duration: 0.4s; | 474 | -webkit-transition-duration: 0.4s; |
327 | transition-duration: 0.4s; | 475 | transition-duration: 0.4s; |
328 | box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | 476 | box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); |
329 | } | 477 | } |
330 | .iconCard { | 478 | .iconCard { |
331 | position: relative !important; | 479 | position: relative !important; |
332 | border-radius: 4px; | 480 | border-radius: 4px; |
333 | z-index: 1; | 481 | z-index: 1; |
334 | } | 482 | } |
335 | .agentIcon { | 483 | .agentIcon { |
336 | position: relative !important; | 484 | position: relative !important; |
337 | border-radius: 4px; | 485 | border-radius: 4px; |
338 | z-index: 1; | 486 | z-index: 1; |
339 | } | 487 | } |
340 | .farmerIcon { | 488 | .farmerIcon { |
341 | position: relative !important; | 489 | position: relative !important; |
342 | border-radius: 4px; | 490 | border-radius: 4px; |
343 | z-index: 1; | 491 | z-index: 1; |
344 | } | 492 | } |
345 | .khasraIcon { | 493 | .khasraIcon { |
346 | position: relative !important; | 494 | position: relative !important; |
347 | border-radius: 4px; | 495 | border-radius: 4px; |
348 | z-index: 1; | 496 | z-index: 1; |
349 | } | 497 | } |
350 | .maleFarmerIcon { | 498 | .maleFarmerIcon { |
351 | position: relative !important; | 499 | position: relative !important; |
352 | border-radius: 4px; | 500 | border-radius: 4px; |
353 | z-index: 1; | 501 | z-index: 1; |
354 | } | 502 | } |
503 | |||
504 | .dashbaordBackground { | ||
505 | background: #f1f2f7 !important; | ||
506 | } | ||
507 | table { | ||
508 | border-collapse: collapse; | ||
509 | border: 1px solid #e2e7eb; | ||
510 | } | ||
511 | tr { | ||
512 | border: 1px solid #e2e7eb; | ||
513 | /* text-align: center; */ | ||
514 | } | ||
515 | td { |