Blame view

src/pages/Dashboard/dashboard.vue 38.6 KB
a17c68a03   Neeraj Sharma   implement two rou...
1
  <template>
68d742034   Neeraj Sharma   implement new des...
2
    <v-app id="pages-dasboard">
01d009dde   Neeraj Sharma   fixed Show Notice...
3
      <!-- ****** VIEW PROFIL NOTICE BOARD ******  -->
68d742034   Neeraj Sharma   implement new des...
4
      <!-- <v-dialog v-model="dialogNotice" max-width="940px" scrollable>
01d009dde   Neeraj Sharma   fixed Show Notice...
5
6
7
8
9
10
11
12
13
14
15
16
        <v-card>
          <v-toolbar color="grey lighten-2" flat>
            <v-spacer></v-spacer>
            <v-toolbar-title>
              <h3>Notice Board</h3>
            </v-toolbar-title>
            <v-spacer></v-spacer>
            <v-icon @click="closeNotice">close</v-icon>
          </v-toolbar>
          <v-card-text>
            <v-layout>
              <v-flex align-center justify-center layout text-xs-center class="mt-2">
088d91b5f   Neeraj Sharma   fixed notice boar...
17
18
                <img src="/static/icon/user.png" width="70px" v-if="!notice.eventImageUrl" />
                <img :src="notice.eventImageUrl" width="280px" v-else-if="notice.eventImageUrl" />
01d009dde   Neeraj Sharma   fixed Show Notice...
19
20
21
22
23
24
25
26
27
28
29
30
              </v-flex>
            </v-layout>
            <v-container grid-list-md>
              <v-layout wrap>
                <v-flex>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Title:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
088d91b5f   Neeraj Sharma   fixed notice boar...
31
                      <h5 class="my-1">{{ notice.title }}</h5>
01d009dde   Neeraj Sharma   fixed Show Notice...
32
33
34
35
36
37
38
39
40
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs5 sm6>
                      <h5 class="right my-1">
                        <b>Description:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
088d91b5f   Neeraj Sharma   fixed notice boar...
41
                      <h5 class="my-1">{{ notice.description }}</h5>
01d009dde   Neeraj Sharma   fixed Show Notice...
42
43
44
45
46
47
48
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
            </v-container>
          </v-card-text>
        </v-card>
68d742034   Neeraj Sharma   implement new des...
49
50
      </v-dialog>-->
      <!-- <v-container fluid grid-list-xl> -->
6f7cf8cf5   Amber Dev   added discussion ...
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  
      <!-- LOADER -->
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
  
      <!-- SNACKBAR -->
      <v-snackbar
        :timeout="timeout"
        :top="y === 'top'"
        :right="x === 'right'"
        :vertical="mode === 'vertical'"
        v-model="snackbar"
        :color="snackbarColor"
      >
        {{ text }}
        <v-spacer></v-spacer>
        <v-btn flat text @click="snackbar = false">X</v-btn>
      </v-snackbar>
a26ba60ed   Amber Dev   Added event dialo...
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
      <!-- DIALOG BOX EVENT DETAILS -->
      <v-dialog v-model="viewEventDetails" max-width="500">
        <v-card flat class="card-style pa-2" dark>
          <!-- TITLE -->
          <v-layout>
            <v-layout>
              <v-flex xs12>
                <label class="title text-xs-center">{{particularEvent.title}}</label>
                <v-icon size="24" class="right" @click="viewEventDetails = false">cancel</v-icon>
              </v-flex>
            </v-layout>
          </v-layout>
  
          <v-card-text>
            <v-list dark class="card-style">
              <v-list-tile>
                <v-list-tile-content>
                  <v-list-tile-title>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</v-list-tile-title>
                </v-list-tile-content>
              </v-list-tile>
58f2330d2   Amber Dev   added event dialo...
90
91
              <v-list-tile>
                <v-list-tile-content>
3f8187137   Shikha Mishra   Added functionali...
92
93
94
95
96
                  <v-list-tile-title>Start Time : {{particularEvent.startTime}}</v-list-tile-title>
                </v-list-tile-content>
              </v-list-tile>
              <v-list-tile>
                <v-list-tile-content>
58f2330d2   Amber Dev   added event dialo...
97
98
99
                  <v-list-tile-title>Duration : {{particularEvent.duration}}</v-list-tile-title>
                </v-list-tile-content>
              </v-list-tile>
3f8187137   Shikha Mishra   Added functionali...
100
101
              <v-list-tile>
                <v-list-tile-content>
bbd60612f   Amber Dev   apis to admin
102
103
104
105
                  <v-list-tile-title>
                    Link :
                    <a :href="particularEvent.link">{{particularEvent.link}}</a>
                  </v-list-tile-title>
3f8187137   Shikha Mishra   Added functionali...
106
107
                </v-list-tile-content>
              </v-list-tile>
a26ba60ed   Amber Dev   Added event dialo...
108
109
110
111
            </v-list>
          </v-card-text>
        </v-card>
      </v-dialog>
3f7b85167   Amber Dev   added announcements
112
113
114
      <v-layout wrap row>
        <v-flex xs12 sm12 md9>
          <v-container fluid grid-list-xl>
68d742034   Neeraj Sharma   implement new des...
115
            <!-- ***** Total Students ***** -->
ac24ec07a   Amber Dev   added live online
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
            <v-layout wrap class v-if="$store.state.role != 'PARENT' ">
              <v-flex xs12 sm12 md3>
                <router-link :to="{ name:'Students' }">
                  <v-card class="card pink-bgcolor">
                    <v-card-title primary-title class="titleCard white--text py-3">Students</v-card-title>
                    <img src="/static/icon/student.png" class="ml-2" width="40" alt="icons" />
                    <v-card-title class="headline py-1 white--text">{{ students.length }}</v-card-title>
                  </v-card>
                </router-link>
              </v-flex>
              <!-- ***** Total Teachers***** -->
              <v-flex xs12 sm12 md3>
                <router-link :to="{ name:'Teachers' }">
                  <v-card flat class="card elevation-2 firozi-bgcolor">
                    <v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title>
                    <img src="/static/icon/teacher.png" class="ml-2" width="40" alt="icons" />
  
                    <v-card-title class="headline py-1 white--text">{{ teachers.length }}</v-card-title>
                  </v-card>
                </router-link>
              </v-flex>
              <!-- ***** Total Parents ***** -->
              <v-flex xs12 sm12 md3>
                <router-link :to="{ name:'Parents' }">
                  <v-card flat class="card yellow darken-3">
                    <v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title>
                    <img src="/static/icon/parents.png" class="ml-3" width="40px" alt="icons" />
                    <v-card-title class="headline py-1 white--text">{{ parents.length }}</v-card-title>
                  </v-card>
                </router-link>
              </v-flex>
              <!-- ***** Total Class***** -->
              <v-flex xs12 sm12 md3>
                <router-link :to="{ name:'Class' }">
                  <v-card flat class="card darkBlue-bgcolor">
                    <v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title>
                    <img src="/static/icon/class.png" width="40" alt="icons" class="ml-2" />
                    <v-card-title class="headline py-1 white--text">{{ classes.length }}</v-card-title>
                  </v-card>
                </router-link>
              </v-flex>
            </v-layout>
68d742034   Neeraj Sharma   implement new des...
158

3f7b85167   Amber Dev   added announcements
159
160
161
162
            <p
              v-if="studentsData.length === 0 && role == 'PARENT'"
              class="text-center title grey lighten-4 error--text"
            >You have no student registered with school</p>
2d3a8e9c3   Amber Dev   added pdf link
163
            <!-- ACCOUNT -->
edfe025fa   Amber Dev   added jitsi meet
164
            <v-layout v-if="role == 'SUPERADMIN'|| role == 'ADMIN'">
3f7b85167   Amber Dev   added announcements
165
166
167
168
169
170
              <v-flex xs12>
                <v-card class="card mt-2 account-Card">
                  <h4>
                    <b>Account</b>
                  </h4>
                  <v-layout wrap>
68d742034   Neeraj Sharma   implement new des...
171
                    <v-flex xs12 sm12 md3>
3f7b85167   Amber Dev   added announcements
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
                      <v-list two-line>
                        <template>
                          <v-list-tile>
                            <v-list-tile-avatar>
                              <v-icon class="account-circle darkBlue-color">panorama_fish_eye</v-icon>
                            </v-list-tile-avatar>
                            <v-list-tile-content>
                              <v-list-tile-title class="mt-2">
                                <p class="subheading font-color">Fees</p>
                              </v-list-tile-title>
                              <v-list-tile-title>Rs. {{ feeData.totalFees }}</v-list-tile-title>
                            </v-list-tile-content>
                          </v-list-tile>
                          <v-list-tile>
                            <v-list-tile-avatar>
                              <v-icon class="account-circle yellowDark-color">panorama_fish_eye</v-icon>
                            </v-list-tile-avatar>
                            <v-list-tile-content>
                              <v-list-tile-title class="mt-2">
                                <p class="subheading font-color">Collection</p>
                              </v-list-tile-title>
                              <v-list-tile-title>Rs. {{ feeData.totalCollection }}</v-list-tile-title>
                            </v-list-tile-content>
                          </v-list-tile>
                          <v-list-tile>
                            <v-list-tile-avatar>
                              <v-icon class="account-circle pink-color">panorama_fish_eye</v-icon>
                            </v-list-tile-avatar>
                            <v-list-tile-content>
                              <v-list-tile-title class="mt-2">
                                <p class="subheading font-color">Expences</p>
                              </v-list-tile-title>
                              <v-list-tile-title>Rs. {{ expenseData.sum }}</v-list-tile-title>
                            </v-list-tile-content>
                          </v-list-tile>
                        </template>
                      </v-list>
68d742034   Neeraj Sharma   implement new des...
209
                    </v-flex>
3f7b85167   Amber Dev   added announcements
210
211
                    <v-flex xs12 sm12 md9 lg9>
                      <div id="chart">
4e37936da   Shikha Mishra   make clickable ic...
212
                        <div v-if="showChart">
3f7b85167   Amber Dev   added announcements
213
214
215
216
217
218
                          <apexchart
                            type="bar"
                            height="250"
                            style="max-width: 800px !important"
                            :options="chartOptions"
                            :series="series"
3f7b85167   Amber Dev   added announcements
219
220
221
                          ></apexchart>
                        </div>
                      </div>
68d742034   Neeraj Sharma   implement new des...
222
223
                    </v-flex>
                  </v-layout>
3f7b85167   Amber Dev   added announcements
224
225
                </v-card>
              </v-flex>
edfe025fa   Amber Dev   added jitsi meet
226
            </v-layout>
2d3a8e9c3   Amber Dev   added pdf link
227

3f8187137   Shikha Mishra   Added functionali...
228
229
            <!-- FOR ADMIN ROLE  -->
            <v-card class="mt-2 card" v-if="role == 'ADMIN'">
3f7b85167   Amber Dev   added announcements
230
              <!-- <full-calendar
68d742034   Neeraj Sharma   implement new des...
231
232
233
234
235
                    ref="calendar"
                    defaultView="month"
                    droppable="false"
                    :events="events"
                    :config="config"
3f7b85167   Amber Dev   added announcements
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
              ></full-calendar>-->
              <h4 class="pa-3">
                <b>Notice</b>
              </h4>
  
              <v-data-table
                :items="noticeData"
                class="elevation-0"
                flat
                hide-actions
                hide-headers
                style="border-spacing: 0 !important;"
              >
                <template
                  slot="items"
                  slot-scope="props"
                  v-if="props.index < 5"
                  style="border-spacing: 0 !important;"
                >
                  <tr class="td-notice">
                    <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
                    <td>
                      <span class="grey--text caption">{{ date(props.item.created) }}</span>
                      <br />
                      <span class="body-2">{{ props.item.title}}</span>
                    </td>
b0f5f6684   Shikha Mishra   Conditionally sho...
262
                    <td class="grey--text mt-2">{{ props.item.description}}</td>
3f7b85167   Amber Dev   added announcements
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
  
                    <td class="text-xs-center">
                      <span>
                        <v-tooltip top>
                          <img
                            slot="activator"
                            style="cursor:pointer; width:25px; height:25px; "
                            @click="profile"
                            src="/static/icon/view.png"
                          />
                          <span>View</span>
                        </v-tooltip>
                      </span>
                    </td>
                  </tr>
                </template>
              </v-data-table>
            </v-card>
3f8187137   Shikha Mishra   Added functionali...
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
  
            <!-- FOR TEACHER ROLE  -->
            <v-card class="mt-2 card" v-if="role == 'TEACHER'">
              <v-layout>
                <v-flex xs6 sm6 md6>
                  <h4 class="pa-3">
                    <b>Notice</b>
                  </h4>
                  <v-data-table
                    :items="noticeData"
                    class="elevation-0"
                    flat
                    hide-actions
                    hide-headers
                    style="border-spacing: 0 !important;"
                  >
                    <template
                      slot="items"
                      slot-scope="props"
                      v-if="props.index < 5"
                      style="border-spacing: 0 !important;"
                    >
                      <tr class="td-notice">
                        <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
                        <td>
                          <span class="grey--text caption">{{ date(props.item.created) }}</span>
                          <br />
                          <span class="body-2">{{ props.item.title}}</span>
                        </td>
b0f5f6684   Shikha Mishra   Conditionally sho...
310
                        <td class="grey--text mt-2">{{ props.item.description}}</td>
3f8187137   Shikha Mishra   Added functionali...
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
  
                        <td class="text-xs-center">
                          <span>
                            <v-tooltip top>
                              <img
                                slot="activator"
                                style="cursor:pointer; width:25px; height:25px; "
                                @click="profile"
                                src="/static/icon/view.png"
                              />
                              <span>View</span>
                            </v-tooltip>
                          </span>
                        </td>
                      </tr>
                    </template>
                  </v-data-table>
                </v-flex>
bbd60612f   Amber Dev   apis to admin
329
                <v-flex xs6 sm6 md6>
3f8187137   Shikha Mishra   Added functionali...
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
                  <v-card-text>
                    <v-card-title class="justify-center subheading font-weight-bold">Latest Events</v-card-title>
                    <div
                      v-for="(activity,index) in activityList"
                      :key="index"
                      class="mt-2"
                      style="cursor: pointer;"
                      @click="seeEventDetails(activity)"
                    >
                      <span
                        :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
                        style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
                      ></span>
                      <div style="display: inline-block;" class="ml-2">
                        <div>
                          <div
                            class="grey--text lighten-1 caption"
                            v-if="activity.dateOfEvent"
                          >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                          <div class="body-2" v-if="activity.title">{{activity.title}}</div>
                        </div>
                      </div>
                    </div>
                    <div v-if="activityList.length == 0">
                      <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
                    </div>
                  </v-card-text>
                </v-flex>
              </v-layout>
            </v-card>
3f7b85167   Amber Dev   added announcements
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
            <!-- COURSES -->
            <v-layout v-if="role == 'PARENT'">
              <v-flex xs12>
                <v-card class="card mt-2 account-Card">
                  <h4>
                    <b>My Courses</b>
                  </h4>
                  <v-layout wrap>
                    <v-flex xs12 sm12>
                      <v-list two-line>
                        <template>
                          <v-list-tile v-for="(course,i) in courseData" :key="i">
                            <v-list-tile-avatar>
                              <v-icon
                                class="account-circle darkBlue-color"
                                style="cursor: pointer;"
4e37936da   Shikha Mishra   make clickable ic...
376
                                @click="routeToCourseDetails(course._id)"
3f7b85167   Amber Dev   added announcements
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
                              >panorama_fish_eye</v-icon>
                            </v-list-tile-avatar>
                            <v-list-tile-content>
                              <v-list-tile-title
                                style="cursor: pointer;"
                                @click="routeToCourseDetails(course._id)"
                              >{{ course.courseName }}</v-list-tile-title>
                            </v-list-tile-content>
                          </v-list-tile>
                        </template>
                      </v-list>
                    </v-flex>
                  </v-layout>
                </v-card>
              </v-flex>
            </v-layout>
            <v-layout v-if="role == 'PARENT'">
              <v-flex xs6>
                <v-card class="mt-2 card">
68d742034   Neeraj Sharma   implement new des...
396
                  <h4 class="pa-3">
3f7b85167   Amber Dev   added announcements
397
                    <b>Latest Annoucements</b>
68d742034   Neeraj Sharma   implement new des...
398
                  </h4>
01d009dde   Neeraj Sharma   fixed Show Notice...
399

68d742034   Neeraj Sharma   implement new des...
400
                  <v-data-table
3f7b85167   Amber Dev   added announcements
401
                    :items="annoucementData"
68d742034   Neeraj Sharma   implement new des...
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
                    class="elevation-0"
                    flat
                    hide-actions
                    hide-headers
                    style="border-spacing: 0 !important;"
                  >
                    <template
                      slot="items"
                      slot-scope="props"
                      v-if="props.index < 5"
                      style="border-spacing: 0 !important;"
                    >
                      <tr class="td-notice">
                        <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
                        <td>
                          <span class="grey--text caption">{{ date(props.item.created) }}</span>
                          <br />
3f7b85167   Amber Dev   added announcements
419
                          <span class="body-2">{{ props.item.discussionType}}</span>
68d742034   Neeraj Sharma   implement new des...
420
                        </td>
68d742034   Neeraj Sharma   implement new des...
421
422
423
424
425
426
                        <td class="text-xs-center">
                          <span>
                            <v-tooltip top>
                              <img
                                slot="activator"
                                style="cursor:pointer; width:25px; height:25px; "
aa310d61a   Shikha Mishra   added functionali...
427
                                src="/static/icon/view.png"
68d742034   Neeraj Sharma   implement new des...
428
429
430
431
432
433
434
435
436
                              />
                              <span>View</span>
                            </v-tooltip>
                          </span>
                        </td>
                      </tr>
                    </template>
                  </v-data-table>
                </v-card>
3f7b85167   Amber Dev   added announcements
437
438
439
440
441
442
              </v-flex>
              <v-flex xs6>
                <v-card class="mt-2 card">
                  <h4 class="pa-3">
                    <b>Online User</b>
                  </h4>
11d037abe   Neeraj Sharma   commit code
443

3f7b85167   Amber Dev   added announcements
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
                  <v-data-table
                    :items="onlineUser"
                    class="elevation-0"
                    flat
                    hide-actions
                    hide-headers
                    style="border-spacing: 0 !important;"
                  >
                    <template
                      slot="items"
                      slot-scope="props"
                      v-if="props.index < 5"
                      style="border-spacing: 0 !important;"
                    >
                      <tr class="td-notice">
                        <td class="grey--text" style="width:18px">{{ props.index + 1}}</td>
                        <td>
                          <span class="body-2">{{ props.item.user }}</span>
                        </td>
                        <td class="text-xs-center">
                          <span>
                            <v-tooltip top>
                              <img
                                slot="activator"
                                style="cursor:pointer; width:25px; height:25px; "
                                src="/static/icon/view.png"
                              />
                              <span>View</span>
                            </v-tooltip>
                          </span>
                        </td>
                      </tr>
                    </template>
                  </v-data-table>
                </v-card>
              </v-flex>
            </v-layout>
          </v-container>
        </v-flex>
        <v-spacer></v-spacer>
        <!-- SIDE BAR -->
        <v-flex xs12 sm12 md3>
          <v-card height="100%" class="elevation-0 mt-3 profileDasboard">
            <v-card-text class="px-2">
              <h4 class="text-xs-center py-3">
                <b>Profile</b>
              </h4>
              <v-flex xs12 class="py-3">
                <v-layout wrap>
                  <v-flex xs12 sm12 md4>
bbd60612f   Amber Dev   apis to admin
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
                    <img
                      src="/static/icon/user.png"
                      v-if="!userData.profilePicUrl && !userData.schoolLogoUrl"
                      width="80"
                    />
                    <img
                      :src="userData.profilePicUrl"
                      onerror="this.src='/static/icon/user.png';"
                      v-if="userData.profilePicUrl"
                      width="80"
                    />
                    <img
                      :src="userData.schoolLogoUrl"
                      onerror="this.src='/static/icon/user.png';"
                      v-if="userData.schoolLogoUrl"
                      width="80"
                    />
11d037abe   Neeraj Sharma   commit code
511
                  </v-flex>
3f7b85167   Amber Dev   added announcements
512
513
514
515
516
517
518
                  <v-flex xs12 sm12 md6>
                    <p class="mb-0 body-1">
                      <i>{{ userData.name }}</i>
                    </p>
                    <p class="mb-0 caption grey--text">{{ userData.email }}</p>
                    <p class="mb-0 caption grey--text">{{ userData.mobile }}</p>
                    <address class="caption grey--text mb-3">{{ userData.address }}</address>
11d037abe   Neeraj Sharma   commit code
519
520
                  </v-flex>
                </v-layout>
3f7b85167   Amber Dev   added announcements
521
522
523
              </v-flex>
              <hr />
              <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div>
852713654   Amber Dev   added live class ...
524

a26ba60ed   Amber Dev   Added event dialo...
525
              <vue-event-calendar :events="activityEvents" @day-changed="handleDayChanged($event)"></vue-event-calendar>
1dea1c0ef   Amber Dev   solved bugs
526
527
  
              <!-- LATEST EVENTS -->
3f8187137   Shikha Mishra   Added functionali...
528
              <v-card class="my-3 elevation-0" v-if="role != 'TEACHER'">
68d742034   Neeraj Sharma   implement new des...
529
                <v-card-text>
8b184d484   Amber Dev   added events to t...
530
                  <v-card-title class="justify-center subheading font-weight-bold">Latest Events</v-card-title>
a26ba60ed   Amber Dev   Added event dialo...
531
532
533
534
535
                  <div
                    v-for="(activity,index) in activityList"
                    :key="index"
                    class="mt-2"
                    style="cursor: pointer;"
8b184d484   Amber Dev   added events to t...
536
                    @click="seeEventDetails(activity)"
a26ba60ed   Amber Dev   Added event dialo...
537
                  >
3f7b85167   Amber Dev   added announcements
538
539
540
541
542
                    <span
                      :style="{ 'background-color': colorsArray[index%colorsArray.length] }"
                      style="height: 12px;width: 12px;border-radius: 50%;display: inline-block;vertical-align: top;"
                    ></span>
                    <div style="display: inline-block;" class="ml-2">
1dea1c0ef   Amber Dev   solved bugs
543
                      <!-- LATEST EVENTS FOR PARENT -->
8b184d484   Amber Dev   added events to t...
544
545
546
547
548
549
550
551
552
553
                      <div v-if="$store.state.role === 'PARENT' ">
                        <div
                          class="grey--text lighten-1 caption"
                          v-if="activity.meetingEvent"
                        >{{moment(activity.meetingEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                        <div
                          class="body-2"
                          v-if="activity.meetingEvent"
                        >{{activity.meetingEvent.title}}</div>
                      </div>
02dca9d60   Amber Dev   teacher activity ...
554

8b184d484   Amber Dev   added events to t...
555
                      <!-- LATEST EVENTS FOR TEACHER -->
3311ad345   Neeraj Sharma   add event list in...
556
557
558
559
560
561
562
                      <div v-if="role == 'TEACHER'">
                        <div
                          class="grey--text lighten-1 caption"
                          v-if="activity.dateOfEvent"
                        >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                        <div class="body-2" v-if="activity.title">{{activity.title}}</div>
                      </div>
3f7b85167   Amber Dev   added announcements
563
564
                    </div>
                  </div>
3311ad345   Neeraj Sharma   add event list in...
565
566
567
                  <div v-if="activityList.length == 0">
                    <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
                  </div>
68d742034   Neeraj Sharma   implement new des...
568
569
                </v-card-text>
              </v-card>
3f7b85167   Amber Dev   added announcements
570
571
            </v-card-text>
          </v-card>
68d742034   Neeraj Sharma   implement new des...
572
573
        </v-flex>
      </v-layout>
3f7b85167   Amber Dev   added announcements
574

a17c68a03   Neeraj Sharma   implement two rou...
575
576
577
      <v-dialog v-model="dialog" max-width="500">
        <v-card color="grey lighten-4" flat>
          <v-toolbar dark color="fixcolors">
a17c68a03   Neeraj Sharma   implement two rou...
578
579
580
581
582
583
584
585
586
            <v-spacer></v-spacer>
            <v-btn icon @click="dialog= false">
              <v-icon>close</v-icon>
            </v-btn>
          </v-toolbar>
          <v-flex class="py-4">
            <v-list-tile>
              <v-list-tile-action>
                <v-icon>edit</v-icon>
8bb178441   Neeraj Sharma   implemnt api in s...
587
588
              </v-list-tile-action>
              <v-list-tile-content>
a17c68a03   Neeraj Sharma   implement two rou...
589
                <v-list-tile-title>{{ selected.title }}</v-list-tile-title>
8bb178441   Neeraj Sharma   implemnt api in s...
590
591
              </v-list-tile-content>
            </v-list-tile>
a17c68a03   Neeraj Sharma   implement two rou...
592
593
594
595
596
597
            <v-list-tile>
              <v-list-tile-action>
                <v-icon>access_time</v-icon>
              </v-list-tile-action>
              <v-list-tile-content>
                <v-list-tile-title>{{ date(selected.start)}}</v-list-tile-title>
a17c68a03   Neeraj Sharma   implement two rou...
598
599
600
601
602
              </v-list-tile-content>
            </v-list-tile>
          </v-flex>
        </v-card>
      </v-dialog>
8bb178441   Neeraj Sharma   implemnt api in s...
603
604
605
606
607
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
a17c68a03   Neeraj Sharma   implement two rou...
608
  import moment from "moment";
6f7cf8cf5   Amber Dev   added discussion ...
609
  import AllApiCalls from "@/Services/AllApiCalls.js";
68d742034   Neeraj Sharma   implement new des...
610
  // import { FunctionalCalendar } from "vue-functional-calendar";
8bb178441   Neeraj Sharma   implemnt api in s...
611
612
  
  export default {
68d742034   Neeraj Sharma   implement new des...
613
614
615
    components: {
      // FunctionalCalendar
    },
6f7cf8cf5   Amber Dev   added discussion ...
616
    mixins: [AllApiCalls],
a17c68a03   Neeraj Sharma   implement two rou...
617
618
    data() {
      return {
68d742034   Neeraj Sharma   implement new des...
619
620
621
622
623
624
        // data: {
        //   clieckedToday: false
        // },
        // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"],
        // calendarData: {},
        // calendar: {},
6f7cf8cf5   Amber Dev   added discussion ...
625

a26ba60ed   Amber Dev   Added event dialo...
626
627
        // DIALOG BOX EVENT DETAILS
        viewEventDetails: false,
0a5256600   Amber Dev   added events
628
629
630
        // CALENDER
        moment: moment,
        activityEvents: [],
11d037abe   Neeraj Sharma   commit code
631
632
        onlineUser: [
          {
bbd60612f   Amber Dev   apis to admin
633
            user: "Student Demo",
11d037abe   Neeraj Sharma   commit code
634
635
          },
          {
bbd60612f   Amber Dev   apis to admin
636
            user: "Teacher Demo",
11d037abe   Neeraj Sharma   commit code
637
638
          },
          {
bbd60612f   Amber Dev   apis to admin
639
            user: "Priyansh Gupta",
11d037abe   Neeraj Sharma   commit code
640
641
          },
          {
bbd60612f   Amber Dev   apis to admin
642
            user: "Gaurav Aggarwal",
11d037abe   Neeraj Sharma   commit code
643
644
          },
          {
bbd60612f   Amber Dev   apis to admin
645
646
            user: "Approve Arorra",
          },
11d037abe   Neeraj Sharma   commit code
647
        ],
a17c68a03   Neeraj Sharma   implement two rou...
648
        showLoader: false,
68d742034   Neeraj Sharma   implement new des...
649
        calendarData: {},
a17c68a03   Neeraj Sharma   implement two rou...
650
        dialog: false,
01d009dde   Neeraj Sharma   fixed Show Notice...
651
        dialogNotice: false,
b28a5f17d   Neeraj Sharma   fixed events and ...
652
653
        HolidaysList: [],
        EventsList: [],
ceb43037a   Neeraj Sharma   fix bugs
654
        events: [],
a17c68a03   Neeraj Sharma   implement two rou...
655
        config: {
bbd60612f   Amber Dev   apis to admin
656
          eventClick: (event) => {
a17c68a03   Neeraj Sharma   implement two rou...
657
658
            this.selected = event;
            this.dialog = true;
bbd60612f   Amber Dev   apis to admin
659
          },
8bb178441   Neeraj Sharma   implemnt api in s...
660
        },
6c05a9f84   Neeraj Sharma   add functionalit ...
661
        selected: {},
01b56330e   Shikha Mishra   add api of fee an...
662
        barGraph: [],
68d742034   Neeraj Sharma   implement new des...
663
        // notice: {},
01d009dde   Neeraj Sharma   fixed Show Notice...
664
        userData: {},
68d742034   Neeraj Sharma   implement new des...
665
666
667
        dated: new Date(2018, 0, 9),
        userList: [],
        sectionList: [],
6c05a9f84   Neeraj Sharma   add functionalit ...
668
669
670
        students: "",
        parents: "",
        teachers: "",
01d009dde   Neeraj Sharma   fixed Show Notice...
671
        classes: "",
68d742034   Neeraj Sharma   implement new des...
672
        noticeData: [],
65d5475b6   Shikha Mishra   changes in api an...
673
        expenseData: [],
01b56330e   Shikha Mishra   add api of fee an...
674
675
        feeData: [],
        collectionData: [],
11d037abe   Neeraj Sharma   commit code
676
677
678
679
        courseData: [],
        studentsData: [],
        annoucementData: [],
        role: "",
68d742034   Neeraj Sharma   implement new des...
680
681
682
683
        attrs: [
          {
            key: "today",
            highlight: true,
bbd60612f   Amber Dev   apis to admin
684
685
            dates: new Date(),
          },
68d742034   Neeraj Sharma   implement new des...
686
687
688
689
        ],
        drawer: true,
        items: [
          { title: "Home", icon: "dashboard" },
bbd60612f   Amber Dev   apis to admin
690
          { title: "About", icon: "question_answer" },
68d742034   Neeraj Sharma   implement new des...
691
692
693
694
695
696
        ],
        right: null,
  
        series: [
          {
            name: "Total",
bbd60612f   Amber Dev   apis to admin
697
698
            data: [],
          },
68d742034   Neeraj Sharma   implement new des...
699
        ],
4e37936da   Shikha Mishra   make clickable ic...
700
        showChart: false,
68d742034   Neeraj Sharma   implement new des...
701
702
703
704
        chartOptions: {
          chart: {
            type: "bar",
            height: 150,
bbd60612f   Amber Dev   apis to admin
705
            stacked: true,
68d600c97   Shikha Mishra   improve dashboard...
706
707
708
709
710
711
712
713
714
715
716
717
718
            // animations: {
            //   enabled: true,
            //   easing: "easeinout",
            //   speed: 1200,
            //   animateGradually: {
            //     enabled: true,
            //     delay: 450
            //   },
            //   dynamicAnimation: {
            //     enabled: true,
            //     speed: 450
            //   }
            // }
68d742034   Neeraj Sharma   implement new des...
719
720
721
722
723
724
          },
          plotOptions: {
            bar: {
              horizontal: false,
              columnWidth: "25%",
              // endingShape: "rounded",
bbd60612f   Amber Dev   apis to admin
725
726
              distributed: true,
            },
68d742034   Neeraj Sharma   implement new des...
727
          },
68d600c97   Shikha Mishra   improve dashboard...
728
729
730
731
732
733
734
          responsive: [
            {
              breakpoint: 480,
              options: {
                legend: {
                  position: "bottom",
                  offsetX: -10,
bbd60612f   Amber Dev   apis to admin
735
736
737
738
                  offsetY: 0,
                },
              },
            },
68d600c97   Shikha Mishra   improve dashboard...
739
          ],
68d742034   Neeraj Sharma   implement new des...
740
          legend: {
bbd60612f   Amber Dev   apis to admin
741
            show: false,
68d742034   Neeraj Sharma   implement new des...
742
743
744
          },
          colors: ["#7852cc", "#f9a825", "#ff8a89"],
          dataLabels: {
bbd60612f   Amber Dev   apis to admin
745
            enabled: false,
68d742034   Neeraj Sharma   implement new des...
746
747
748
749
          },
          stroke: {
            show: true,
            width: 2,
bbd60612f   Amber Dev   apis to admin
750
            colors: ["transparent"],
68d742034   Neeraj Sharma   implement new des...
751
752
          },
          xaxis: {
bbd60612f   Amber Dev   apis to admin
753
            categories: ["Fee", "Collections", "Expences"],
68d742034   Neeraj Sharma   implement new des...
754
755
756
          },
          yaxis: {
            title: {
bbd60612f   Amber Dev   apis to admin
757
758
              text: "",
            },
68d742034   Neeraj Sharma   implement new des...
759
760
          },
          fill: {
bbd60612f   Amber Dev   apis to admin
761
            opacity: 1,
68d742034   Neeraj Sharma   implement new des...
762
763
764
          },
          tooltip: {
            y: {
bbd60612f   Amber Dev   apis to admin
765
              formatter: function (val, opts) {
68d742034   Neeraj Sharma   implement new des...
766
                return "" + val + " ";
bbd60612f   Amber Dev   apis to admin
767
768
769
              },
            },
          },
0a5256600   Amber Dev   added events
770
771
772
773
        },
  
        // LATEST ACTIVITY
        colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"],
bbd60612f   Amber Dev   apis to admin
774
        activityList: [],
a17c68a03   Neeraj Sharma   implement two rou...
775
776
      };
    },
32fcd6960   Amber Dev   added logout if a...
777
778
  
    
8bb178441   Neeraj Sharma   implemnt api in s...
779
    methods: {
852713654   Amber Dev   added live class ...
780
781
782
      test(e) {
        console.log(" test - ", e);
      },
a26ba60ed   Amber Dev   Added event dialo...
783
      async handleDayChanged(e) {
a26ba60ed   Amber Dev   Added event dialo...
784
        await this.getParticularMeetingEvent({
bbd60612f   Amber Dev   apis to admin
785
          meetingEventId: e.events[0]._id,
a26ba60ed   Amber Dev   Added event dialo...
786
787
788
        });
        this.viewEventDetails = true;
      },
8b184d484   Amber Dev   added events to t...
789
790
791
792
793
794
795
      async seeEventDetails(activity) {
        if (this.$store.state.role === "TEACHER") {
          await this.getParticularMeetingEvent({ meetingEventId: activity._id });
          this.viewEventDetails = true;
        }
        if (this.$store.state.role === "PARENT") {
          await this.getParticularMeetingEvent({
bbd60612f   Amber Dev   apis to admin
796
            meetingEventId: activity.meetingEvent._id,
8b184d484   Amber Dev   added events to t...
797
798
799
          });
          this.viewEventDetails = true;
        }
a26ba60ed   Amber Dev   Added event dialo...
800
      },
6f7cf8cf5   Amber Dev   added discussion ...
801
802
803
804
805
806
807
808
      async routeToCourseDetails(courseId) {
        /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/
        let response = await this.getParticularCourseDetail(courseId);
  
        /* If the response is null then dont route */
        if (response.data.data.length > 0) {
          this.$router.push({
            name: "Course Details",
bbd60612f   Amber Dev   apis to admin
809
            query: { courseId: courseId },
6f7cf8cf5   Amber Dev   added discussion ...
810
811
812
813
814
          });
        } else {
          this.seeSnackbar("No Data Available", "warning");
        }
      },
0a5256600   Amber Dev   added events
815

01d009dde   Neeraj Sharma   fixed Show Notice...
816
817
818
      closeNotice() {
        this.dialogNotice = false;
      },
68d742034   Neeraj Sharma   implement new des...
819
      profile() {
01d009dde   Neeraj Sharma   fixed Show Notice...
820
        // this.editedIndex = this.desserts.indexOf(item);
68d742034   Neeraj Sharma   implement new des...
821
822
        // this.notice = Object.assign({}, item);
        // this.dialogNotice = true;
3f8187137   Shikha Mishra   Added functionali...
823
        this.$router.push("/noticeBoard");
01d009dde   Neeraj Sharma   fixed Show Notice...
824
      },
bbd60612f   Amber Dev   apis to admin
825
      date: function (date) {
68d742034   Neeraj Sharma   implement new des...
826
        return moment(date).format("MMMM DD, YYYY  HH:mm");
8bb178441   Neeraj Sharma   implemnt api in s...
827
      },
0a5256600   Amber Dev   added events
828
829
830
      activityDate(date) {
        return moment(date).format("MMMM DD, YYYY");
      },
a17c68a03   Neeraj Sharma   implement two rou...
831
832
833
834
835
836
837
838
839
840
      refreshEvents() {
        this.$refs.calendar.$emit("refetch-events");
      },
      removeEvent() {
        this.$refs.calendar.$emit("remove-event", this.selected);
        this.selected = {};
      },
      eventSelected(event) {
        this.selected = event;
      },
687e0b929   Neeraj Sharma   add user,attenden...
841
842
843
      // eventDropStart: function(event) {
      //   event.editable = false;
      // },
a17c68a03   Neeraj Sharma   implement two rou...
844
845
      eventCreated(...test) {
        console.log(test);
8bb178441   Neeraj Sharma   implemnt api in s...
846
      },
6c05a9f84   Neeraj Sharma   add functionalit ...
847
848
      getStudents() {
        http()
7d0816758   Shikha Mishra   show dashboard wh...
849
          .get("/getStudentsList", {
8deade193   Shikha Mishra   token issue solved
850
            headers: {
bbd60612f   Amber Dev   apis to admin
851
852
              Authorization: "Bearer " + this.token,
            },
7d0816758   Shikha Mishra   show dashboard wh...
853
          })
bbd60612f   Amber Dev   apis to admin
854
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
855
856
857
            this.students = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
858
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
859
860
            // console.log("err====>", err);
            this.showLoader = false;
b0f5f6684   Shikha Mishra   Conditionally sho...
861
862
863
864
865
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
6c05a9f84   Neeraj Sharma   add functionalit ...
866
867
868
869
          });
      },
      getParents() {
        http()
25205ccca   Shikha Mishra   show school logo ...
870
          .get("/getParentsList", {
8deade193   Shikha Mishra   token issue solved
871
            headers: {
bbd60612f   Amber Dev   apis to admin
872
873
              Authorization: "Bearer " + this.token,
            },
25205ccca   Shikha Mishra   show school logo ...
874
          })
bbd60612f   Amber Dev   apis to admin
875
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
876
877
878
            this.parents = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
879
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
880
881
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
882
883
884
885
          });
      },
      getTeachers() {
        http()
7d0816758   Shikha Mishra   show dashboard wh...
886
          .get("/getTeachersList", {
8deade193   Shikha Mishra   token issue solved
887
            headers: {
bbd60612f   Amber Dev   apis to admin
888
889
              Authorization: "Bearer " + this.token,
            },
7d0816758   Shikha Mishra   show dashboard wh...
890
          })
bbd60612f   Amber Dev   apis to admin
891
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
892
893
894
            this.teachers = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
895
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
896
897
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
898
899
900
901
          });
      },
      getClasses() {
        http()
25205ccca   Shikha Mishra   show school logo ...
902
          .get("/getClassesList", {
8deade193   Shikha Mishra   token issue solved
903
            headers: {
bbd60612f   Amber Dev   apis to admin
904
905
              Authorization: "Bearer " + this.token,
            },
25205ccca   Shikha Mishra   show school logo ...
906
          })
bbd60612f   Amber Dev   apis to admin
907
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
908
909
910
            this.classes = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
911
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
912
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
913
          });
01d009dde   Neeraj Sharma   fixed Show Notice...
914
915
916
917
      },
      getNoticeData() {
        this.showLoader = true;
        http()
25205ccca   Shikha Mishra   show school logo ...
918
          .get("/getEventsList", {
8deade193   Shikha Mishra   token issue solved
919
            headers: {
bbd60612f   Amber Dev   apis to admin
920
921
              Authorization: "Bearer " + this.token,
            },
25205ccca   Shikha Mishra   show school logo ...
922
          })
bbd60612f   Amber Dev   apis to admin
923
          .then((response) => {
01d009dde   Neeraj Sharma   fixed Show Notice...
924
925
926
            this.noticeData = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
927
          .catch((error) => {
01d009dde   Neeraj Sharma   fixed Show Notice...
928
            this.showLoader = false;
01d009dde   Neeraj Sharma   fixed Show Notice...
929
930
931
          });
      },
      getUserData() {
68d742034   Neeraj Sharma   implement new des...
932
        // this.showLoader = true;
3f7b85167   Amber Dev   added announcements
933
934
935
936
        if (this.$store.state.role === "PARENT") {
          http()
            .get("/getParticularUserDetail", {
              headers: {
bbd60612f   Amber Dev   apis to admin
937
                Authorization: "Bearer " + this.token,
3f7b85167   Amber Dev   added announcements
938
939
              },
              params: {
bbd60612f   Amber Dev   apis to admin
940
941
                studentId: localStorage.getItem("parentStudentId"),
              },
3f7b85167   Amber Dev   added announcements
942
            })
bbd60612f   Amber Dev   apis to admin
943
            .then((response) => {
3f7b85167   Amber Dev   added announcements
944
945
              this.userData = response.data.data;
              this.showLoader = false;
3f7b85167   Amber Dev   added announcements
946
            })
bbd60612f   Amber Dev   apis to admin
947
            .catch((error) => {
3f7b85167   Amber Dev   added announcements
948
949
950
951
952
953
              this.showLoader = false;
            });
        } else {
          http()
            .get("/getParticularUserDetail", {
              headers: {
bbd60612f   Amber Dev   apis to admin
954
955
                Authorization: "Bearer " + this.token,
              },
3f7b85167   Amber Dev   added announcements
956
            })
bbd60612f   Amber Dev   apis to admin
957
            .then((response) => {
3f7b85167   Amber Dev   added announcements
958
959
960
              this.userData = response.data.data;
              this.showLoader = false;
            })
bbd60612f   Amber Dev   apis to admin
961
            .catch((error) => {
3f7b85167   Amber Dev   added announcements
962
963
964
              this.showLoader = false;
            });
        }
65d5475b6   Shikha Mishra   changes in api an...
965
      },
01b56330e   Shikha Mishra   add api of fee an...
966
967
968
969
970
  
      getFeesAndCollectionsData() {
        http()
          .get("/getTotalFeesAndCollections", {
            headers: {
bbd60612f   Amber Dev   apis to admin
971
972
              Authorization: "Bearer " + this.token,
            },
01b56330e   Shikha Mishra   add api of fee an...
973
          })
bbd60612f   Amber Dev   apis to admin
974
          .then((response) => {
01b56330e   Shikha Mishra   add api of fee an...
975
976
977
978
            this.feeData = response.data.data;
            // this.collectionData = response.data.data;
            this.series[0].data[0] = this.feeData.totalFees;
            this.series[0].data[1] = this.feeData.totalCollection;
01b56330e   Shikha Mishra   add api of fee an...
979
980
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
981
          .catch((error) => {
01b56330e   Shikha Mishra   add api of fee an...
982
983
984
            this.showLoader = false;
          });
      },
65d5475b6   Shikha Mishra   changes in api an...
985
986
      getExpensesData() {
        http()
01b56330e   Shikha Mishra   add api of fee an...
987
988
          .get("/getTotalExpenses", {
            headers: {
bbd60612f   Amber Dev   apis to admin
989
990
              Authorization: "Bearer " + this.token,
            },
01b56330e   Shikha Mishra   add api of fee an...
991
          })
bbd60612f   Amber Dev   apis to admin
992
          .then((response) => {
01b56330e   Shikha Mishra   add api of fee an...
993
994
995
            this.expenseData = response.data.data;
            // var array = response.data.data.sum;
            this.series[0].data[2] = this.expenseData.sum;
4e37936da   Shikha Mishra   make clickable ic...
996
            this.showChart = true;
01b56330e   Shikha Mishra   add api of fee an...
997
998
999
1000
1001
1002
            // this.series = [
            //   {
            //     name: "Total",
            //     data: array
            //   }
            // ];
01b56330e   Shikha Mishra   add api of fee an...
1003
1004
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1005
          .catch((error) => {
01b56330e   Shikha Mishra   add api of fee an...
1006
1007
            this.showLoader = false;
          });
11d037abe   Neeraj Sharma   commit code
1008
      },
32fcd6960   Amber Dev   added logout if a...
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
      // async getparentStudents() {
      //   this.showLoader = true;
      //   await http()
      //     .get("/parentStudentsList")
      //     .then((response) => {
            
      //       /* set values in local storage */
      //       this.studentsData = response.data.data.students;
      //       this.showLoader = false;
      //     })
      //     .catch((err) => {
      //       console.log("err====>", err);
      //       this.showLoader = false;
      //     });
      //   await this.getCourses(parentStudentsId, classId);
      //   await this.getAnnoucementes(classId);
      // },
6f7cf8cf5   Amber Dev   added discussion ...
1026
1027
1028
      async getCourses(parentStudentsId, classId) {
        /* getStudentCourses - to get courseData - defined in GetApis.js*/
        await this.getStudentCourses({
32fcd6960   Amber Dev   added logout if a...
1029
1030
          classId: localStorage.getItem("parentClassId"),
          studentId: localStorage.getItem("parentStudentId"),
6f7cf8cf5   Amber Dev   added discussion ...
1031
        });
11d037abe   Neeraj Sharma   commit code
1032
      },
6f7cf8cf5   Amber Dev   added discussion ...
1033
      getAnnoucementes(classId) {
11d037abe   Neeraj Sharma   commit code
1034
1035
1036
1037
        this.showLoader = true;
        http()
          .get("/getAnnoucementesList", {
            params: {
32fcd6960   Amber Dev   added logout if a...
1038
              classId: localStorage.getItem("parentClassId"),
bbd60612f   Amber Dev   apis to admin
1039
            },
11d037abe   Neeraj Sharma   commit code
1040
          })
bbd60612f   Amber Dev   apis to admin
1041
          .then((response) => {
11d037abe   Neeraj Sharma   commit code
1042
1043
1044
            this.annoucementData = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1045
          .catch((err) => {
11d037abe   Neeraj Sharma   commit code
1046
1047
1048
            console.log("err====>", err);
            this.showLoader = false;
          });
3311ad345   Neeraj Sharma   add event list in...
1049
      },
610e873a0   Amber Dev   solved bug regard...
1050
      async getMeetingEventes() {
3311ad345   Neeraj Sharma   add event list in...
1051
1052
        if (this.role == "TEACHER") {
          this.showLoader = true;
610e873a0   Amber Dev   solved bug regard...
1053
          await http()
3311ad345   Neeraj Sharma   add event list in...
1054
1055
            .get("/getMeetingEventesList", {
              headers: {
bbd60612f   Amber Dev   apis to admin
1056
1057
                Authorization: "Bearer " + this.token,
              },
3311ad345   Neeraj Sharma   add event list in...
1058
            })
bbd60612f   Amber Dev   apis to admin
1059
            .then((response) => {
3311ad345   Neeraj Sharma   add event list in...
1060
1061
1062
              var activityList = response.data.data;
              this.activityList = activityList;
              this.showLoader = false;
8b184d484   Amber Dev   added events to t...
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
  
              /* set activityEvents array to highlight event dates in calender */
              for (var i = 0; i < this.activityList.length; i++) {
                let obj = {};
                obj.date = moment(this.activityList[i].dateOfEvent).format(
                  "YYYY/MM/DD"
                );
                obj.title = this.activityList[i].title;
                obj._id = this.activityList[i]._id;
                this.activityEvents.push(obj);
              }
3311ad345   Neeraj Sharma   add event list in...
1074
            })
bbd60612f   Amber Dev   apis to admin
1075
            .catch((error) => {
3311ad345   Neeraj Sharma   add event list in...
1076
1077
1078
              this.showLoader = false;
            });
        }
bbd60612f   Amber Dev   apis to admin
1079
      },
32fcd6960   Amber Dev   added logout if a...
1080
      
fe15ee8b4   Amber Dev   added course chap...
1081
    },
a26ba60ed   Amber Dev   Added event dialo...
1082
1083
1084
1085
  
    mounted() {
      //  = this.$store.state.schoolToken;
      // console.log("this.$store.state.role", this.token);
610e873a0   Amber Dev   solved bug regard...
1086
1087
1088
1089
      // this.getUsersList();
    },
  
    async created() {
a26ba60ed   Amber Dev   Added event dialo...
1090
1091
      if (this.$store.state.role === "ADMIN") {
        this.token = this.$store.state.token;
bbd60612f   Amber Dev   apis to admin
1092
1093
        await this.getFeesAndCollectionsData();
        await this.getExpensesData();
a26ba60ed   Amber Dev   Added event dialo...
1094
1095
      } else if (this.$store.state.schoolRole === "SUPERADMIN") {
        this.token = this.$store.state.schoolToken;
bbd60612f   Amber Dev   apis to admin
1096
1097
        await this.getFeesAndCollectionsData();
        await this.getExpensesData();
a26ba60ed   Amber Dev   Added event dialo...
1098
1099
1100
1101
1102
1103
1104
1105
      } else if (this.$store.state.role === "TEACHER") {
        this.token = this.$store.state.token;
      } else if (this.$store.state.role === "ACCOUNTANT") {
        this.token = this.$store.state.token;
      } else if (this.$store.state.role === "LIBRARIAN") {
        this.token = this.$store.state.token;
      } else if (this.$store.state.role === "PARENT") {
        this.token = this.$store.state.token;
32fcd6960   Amber Dev   added logout if a...
1106
1107
1108
1109
1110
        // await this.getparentStudents();
        this.studentsData = this.$store.getters.GET_STUDENTS_DATA;
        console.log("students data - ",this.studentsData)
         await this.getCourses();
        await this.getAnnoucementes();
a26ba60ed   Amber Dev   Added event dialo...
1111
1112
      }
      this.role = this.$store.state.role;
f1f1fb026   Amber Dev   apis for admin on...
1113
      
610e873a0   Amber Dev   solved bug regard...
1114
1115
1116
1117
1118
1119
      await this.getStudents();
      await this.getTeachers();
      await this.getParents();
      await this.getClasses();
      await this.getNoticeData();
      await this.getUserData();
a26ba60ed   Amber Dev   Added event dialo...
1120

8b184d484   Amber Dev   added events to t...
1121
      /* get Latest events list for student login*/
ac24ec07a   Amber Dev   added live online
1122
      if (this.$store.state.role == "PARENT") {
3311ad345   Neeraj Sharma   add event list in...
1123
        let response = await this.studentMeetingEvents({
bbd60612f   Amber Dev   apis to admin
1124
          studentId: localStorage.getItem("parentStudentId"),
3311ad345   Neeraj Sharma   add event list in...
1125
1126
        });
        this.activityList = response.data.data;
0a5256600   Amber Dev   added events
1127

3311ad345   Neeraj Sharma   add event list in...
1128
1129
1130
1131
1132
1133
1134
        /* set activityEvents array to highlight event dates in calender */
        for (var i = 0; i < this.activityList.length; i++) {
          let obj = {};
          obj.date = moment(this.activityList[i].meetingEvent.dateOfEvent).format(
            "YYYY/MM/DD"
          );
          obj.title = this.activityList[i].meetingEvent.title;
a26ba60ed   Amber Dev   Added event dialo...
1135
          obj._id = this.activityList[i].meetingEvent._id;
3311ad345   Neeraj Sharma   add event list in...
1136
1137
          this.activityEvents.push(obj);
        }
0a5256600   Amber Dev   added events
1138
      }
8b184d484   Amber Dev   added events to t...
1139

ac24ec07a   Amber Dev   added live online
1140
1141
1142
1143
      /* get Latest events list for teacher login*/
      if (this.role == "TEACHER") {
        await this.getMeetingEventes();
      }
bbd60612f   Amber Dev   apis to admin
1144
    },
8bb178441   Neeraj Sharma   implemnt api in s...
1145
1146
  };
  </script>
687e0b929   Neeraj Sharma   add user,attenden...
1147

68d742034   Neeraj Sharma   implement new des...
1148
  <style scoped>
a17c68a03   Neeraj Sharma   implement two rou...
1149
  @import "fullcalendar/dist/fullcalendar.css";
3f8187137   Shikha Mishra   Added functionali...
1150
1151
1152
1153
  
  a {
    color: white;
  }
a17c68a03   Neeraj Sharma   implement two rou...
1154
  </style>