Blame view

src/pages/Dashboard/dashboard.vue 50.8 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
      <!-- DIALOG BOX EVENT DETAILS -->
d802ef837   Amber Dev   added school even...
71
72
      <v-dialog v-model="viewEventDetails" max-width="500" persistent lazy>
        <v-card flat class="card-style elevation-0" height="600" dark>
a26ba60ed   Amber Dev   Added event dialo...
73
          <v-layout>
d802ef837   Amber Dev   added school even...
74
75
76
77
78
79
80
            <v-flex xs12>
              <v-icon
                size="24"
                class="right"
                @click="active=0;displayEventsList=[];dialogSchoolEvents = [];dialogMeetingEvents=[];viewEventDetails = false"
              >cancel</v-icon>
            </v-flex>
a26ba60ed   Amber Dev   Added event dialo...
81
          </v-layout>
d802ef837   Amber Dev   added school even...
82
83
84
85
86
87
88
          <v-tabs v-model="active" color="#7f62f8" dark v-if="displayEventsList.length == 0">
            <v-tabs-slider color="yellow"></v-tabs-slider>
            <v-tab v-for="(tab,index) in tabs" :key="index">
              <div class="subheading py-1">{{ tab.name }}</div>
            </v-tab>
            <!-- <v-tab href="#schoolTab" v-if="dialogSchoolEvents.length > 0">School Events</v-tab>
            <v-tab href="#meetingTab" v-if="dialogMeetingEvents.length > 0">Meeting Events</v-tab>-->
a26ba60ed   Amber Dev   Added event dialo...
89

d802ef837   Amber Dev   added school even...
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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
158
159
160
161
162
163
            <!-- SCHOOL EVENTS-->
            <v-tab-item>
              <v-card flat class="card-style pa-2" dark v-if="dialogSchoolEvents.length > 0">
                <v-container fluid>
                  <v-divider class="white"></v-divider>
                  <v-card
                    v-for="(particularEvent,index) in dialogSchoolEvents"
                    :key="index"
                    class="mt-3 pa-2 card-style white--text elevation-0"
                  >
                    <div>
                      <div class="headline">{{particularEvent.title}}</div>
                      <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                      <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div>
                      <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div>
                      <div v-if="particularEvent.link">
                        Link :
                        <a :href="particularEvent.link">{{particularEvent.link}}</a>
                      </div>
                      <div
                        v-if="particularEvent.description"
                      >Description : {{particularEvent.description}}</div>
                    </div>
                    <v-divider class="white mt-3"></v-divider>
                  </v-card>
                </v-container>
              </v-card>
            </v-tab-item>
  
            <!-- MEETING EVENTS -->
            <v-tab-item>
              <v-card v-if="dialogMeetingEvents.length > 0" flat class="card-style pa-2" dark>
                <v-container fluid>
                  <v-divider class="white"></v-divider>
                  <v-card
                    v-for="(particularEvent,index) in dialogMeetingEvents"
                    :key="index"
                    class="mt-3 pa-2 card-style white--text elevation-0"
                  >
                    <div>
                      <div class="headline">{{particularEvent.title}}</div>
                      <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                      <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div>
                      <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div>
                      <div v-if="particularEvent.link">
                        Link :
                        <a :href="particularEvent.link">{{particularEvent.link}}</a>
                      </div>
                      <div
                        v-if="particularEvent.description"
                      >Description : {{particularEvent.description}}</div>
                    </div>
                    <v-divider class="white mt-3"></v-divider>
                  </v-card>
                </v-container>
              </v-card>
            </v-tab-item>
          </v-tabs>
  
          <!-- IF NO MULTIPLE EVENTS ON SAME DATE -->
          <v-card flat class="card-style pa-2 elevation-0" dark v-else>
            <v-container fluid>
              <v-divider class="white"></v-divider>
              <v-card
                v-for="(particularEvent,index) in displayEventsList"
                :key="index"
                class="mt-3 pa-2 card-style white--text elevation-0"
              >
                <div>
                  <div class="headline">{{particularEvent.title}}</div>
                  <div>Date Of Event : {{moment(particularEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                  <div v-if="particularEvent.link">Start Time : {{particularEvent.startTime}}</div>
                  <div v-if="particularEvent.link">Duration : {{particularEvent.duration}}</div>
                  <div v-if="particularEvent.link">
bbd60612f   Amber Dev   apis to admin
164
165
                    Link :
                    <a :href="particularEvent.link">{{particularEvent.link}}</a>
d802ef837   Amber Dev   added school even...
166
167
168
169
170
171
172
173
174
                  </div>
                  <div
                    v-if="particularEvent.description"
                  >Description : {{particularEvent.description}}</div>
                </div>
                <v-divider class="white mt-3"></v-divider>
              </v-card>
            </v-container>
          </v-card>
a26ba60ed   Amber Dev   Added event dialo...
175
176
        </v-card>
      </v-dialog>
3f7b85167   Amber Dev   added announcements
177
      <v-layout wrap row>
d802ef837   Amber Dev   added school even...
178
        <v-flex xs12 sm12 md8>
3f7b85167   Amber Dev   added announcements
179
          <v-container fluid grid-list-xl>
68d742034   Neeraj Sharma   implement new des...
180
            <!-- ***** Total Students ***** -->
ac24ec07a   Amber Dev   added live online
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
            <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...
223

3f7b85167   Amber Dev   added announcements
224
225
226
227
            <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
228
            <!-- ACCOUNT -->
edfe025fa   Amber Dev   added jitsi meet
229
            <v-layout v-if="role == 'SUPERADMIN'|| role == 'ADMIN'">
3f7b85167   Amber Dev   added announcements
230
231
232
233
234
235
              <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...
236
                    <v-flex xs12 sm12 md3>
3f7b85167   Amber Dev   added announcements
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
262
263
264
265
266
267
268
269
270
271
272
273
                      <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...
274
                    </v-flex>
3f7b85167   Amber Dev   added announcements
275
276
                    <v-flex xs12 sm12 md9 lg9>
                      <div id="chart">
4e37936da   Shikha Mishra   make clickable ic...
277
                        <div v-if="showChart">
3f7b85167   Amber Dev   added announcements
278
279
280
281
282
283
                          <apexchart
                            type="bar"
                            height="250"
                            style="max-width: 800px !important"
                            :options="chartOptions"
                            :series="series"
3f7b85167   Amber Dev   added announcements
284
285
286
                          ></apexchart>
                        </div>
                      </div>
68d742034   Neeraj Sharma   implement new des...
287
288
                    </v-flex>
                  </v-layout>
3f7b85167   Amber Dev   added announcements
289
290
                </v-card>
              </v-flex>
edfe025fa   Amber Dev   added jitsi meet
291
            </v-layout>
2d3a8e9c3   Amber Dev   added pdf link
292

4dfee9964   Amber Dev   added school even...
293
            <!-- FOR ADMIN,TEACHER ROLE  -->
4fb0af78f   Amber Dev   added school even...
294
            <v-layout row wrap v-if="role == 'ADMIN'||role == 'TEACHER'">
d802ef837   Amber Dev   added school even...
295
296
              <!-- NOTICE -->
              <v-flex xs12 sm6>
4fb0af78f   Amber Dev   added school even...
297
                <v-card class="card">
d802ef837   Amber Dev   added school even...
298
299
                  <v-container>
                    <v-card-title class="justify-center subheading font-weight-bold">Notice</v-card-title>
3f7b85167   Amber Dev   added announcements
300

d802ef837   Amber Dev   added school even...
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
                    <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>
                          <!-- <td class="grey--text mt-2" >{{ props.item.description}}</td> -->
3f7b85167   Amber Dev   added announcements
323

d802ef837   Amber Dev   added school even...
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
                          <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-container>
                </v-card>
              </v-flex>
  
              <!-- SCHOOL EVENTS -->
4dfee9964   Amber Dev   added school even...
345

d802ef837   Amber Dev   added school even...
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
              <v-flex xs12 sm6>
                <v-card class="card">
                  <v-container>
                    <v-card-title class="justify-center subheading font-weight-bold">School Events</v-card-title>
                    <div
                      v-for="(schoolEvent,index) in schoolEvents"
                      :key="schoolEvent.title"
                      class="mt-2"
                      style="cursor: pointer;"
                      @click="seeEventDetails(schoolEvent,'schoolEvent')"
                    >
                      <!-- color dot-->
                      <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>
                          <!-- date of event -->
                          <div
                            class="grey--text lighten-1 caption"
                            v-if="schoolEvent.dateOfEvent"
                          >{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                          <!-- event title-->
                          <div class="body-1" v-if="schoolEvent.title">{{schoolEvent.title}}</div>
                        </div>
                      </div>
                    </div>
                    <div v-if="schoolEvents.length == 0">
                      <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
                    </div>
                  </v-container>
                </v-card>
              </v-flex>
            </v-layout>
3f8187137   Shikha Mishra   Added functionali...
381
            <!-- FOR TEACHER ROLE  -->
4fb0af78f   Amber Dev   added school even...
382
            <!-- <v-card class="mt-2 card" v-if="role == 'TEACHER'">
3f8187137   Shikha Mishra   Added functionali...
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
              <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...
409
                        <td class="grey--text mt-2">{{ props.item.description}}</td>
3f8187137   Shikha Mishra   Added functionali...
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
  
                        <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
428
                <v-flex xs6 sm6 md6>
3f8187137   Shikha Mishra   Added functionali...
429
                  <v-card-text>
d802ef837   Amber Dev   added school even...
430
                    <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title>
3f8187137   Shikha Mishra   Added functionali...
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
                    <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>
4dfee9964   Amber Dev   added school even...
458
            </v-card>-->
3f8187137   Shikha Mishra   Added functionali...
459

4dfee9964   Amber Dev   added school even...
460
            <!-- ROLE == PARENT, MY COURSES -->
3f7b85167   Amber Dev   added announcements
461
462
            <v-layout v-if="role == 'PARENT'">
              <v-flex xs12>
4dfee9964   Amber Dev   added school even...
463
464
465
466
467
                <v-card class="elevation-0 account-Card">
                  <v-container>
                  <v-card-title
                      class="justify-center title font-weight-bold"
                    >My Courses</v-card-title>
3f7b85167   Amber Dev   added announcements
468
469
470
471
472
473
                  <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>
107ec8845   Shikha Mishra   change icon while...
474
                              <!-- <v-icon
3f7b85167   Amber Dev   added announcements
475
476
                                class="account-circle darkBlue-color"
                                style="cursor: pointer;"
4e37936da   Shikha Mishra   make clickable ic...
477
                                @click="routeToCourseDetails(course._id)"
107ec8845   Shikha Mishra   change icon while...
478
479
480
481
482
483
484
485
486
487
488
489
                              >panorama_fish_eye</v-icon>-->
                              <span>
                                <v-tooltip top>
                                  <img
                                    slot="activator"
                                    style="cursor:pointer; width:25px; height:25px; "
                                    src="/static/icon/view.png"
                                    @click="routeToCourseDetails(course._id)"
                                  />
                                  <span>View</span>
                                </v-tooltip>
                              </span>
3f7b85167   Amber Dev   added announcements
490
491
492
493
494
495
496
497
498
499
500
501
                            </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>
4dfee9964   Amber Dev   added school even...
502
                  </v-container>
3f7b85167   Amber Dev   added announcements
503
504
505
                </v-card>
              </v-flex>
            </v-layout>
4dfee9964   Amber Dev   added school even...
506
507
508
  
            <v-layout row wrap v-if="role == 'PARENT'">
              <!-- LATEST ANNOUNCEMENTSS , IF ROLE ==  PARENT -->
3f7b85167   Amber Dev   added announcements
509
              <v-flex xs6>
4dfee9964   Amber Dev   added school even...
510
511
512
513
514
                <v-card class="card">
                  <v-container>
                    <v-card-title
                      class="justify-center subheading font-weight-bold"
                    >Latest Announcements</v-card-title>
01d009dde   Neeraj Sharma   fixed Show Notice...
515

4dfee9964   Amber Dev   added school even...
516
517
518
519
520
521
                    <v-data-table
                      :items="annoucementData"
                      class="elevation-0"
                      flat
                      hide-actions
                      hide-headers
68d742034   Neeraj Sharma   implement new des...
522
523
                      style="border-spacing: 0 !important;"
                    >
4dfee9964   Amber Dev   added school even...
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
                      <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.discussionType}}</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-container>
68d742034   Neeraj Sharma   implement new des...
553
                </v-card>
3f7b85167   Amber Dev   added announcements
554
              </v-flex>
4dfee9964   Amber Dev   added school even...
555
              <!-- IF ROLE == PARENT, SCHOOL EVENTS -->
3f7b85167   Amber Dev   added announcements
556
              <v-flex xs6>
4dfee9964   Amber Dev   added school even...
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
                <v-card class="card">
                  <v-container>
                    <v-card-title class="justify-center subheading font-weight-bold">School Events</v-card-title>
                    <div
                      v-for="(schoolEvent,index) in schoolEvents"
                      :key="schoolEvent.title"
                      class="mt-2"
                      style="cursor: pointer;"
                      @click="seeEventDetails(schoolEvent,'schoolEvent')"
                    >
                      <!-- color dot-->
                      <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>
                          <!-- date of event -->
                          <div
                            class="grey--text lighten-1 caption"
                            v-if="schoolEvent.dateOfEvent"
                          >{{moment(schoolEvent.dateOfEvent).format("DD MMMM, YYYY")}}</div>
                          <!-- event title-->
                          <div class="body-1" v-if="schoolEvent.title">{{schoolEvent.title}}</div>
                        </div>
                      </div>
                    </div>
                    <div v-if="schoolEvents.length == 0">
                      <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
                    </div>
                  </v-container>
                </v-card>
              </v-flex>
              <!-- ONLINE USER , IF ROLE == PARENT -->
              <v-flex xs6>
                <v-card class="card">
                  <v-container>
                    <v-card-title class="justify-center subheading font-weight-bold">Online user</v-card-title>
11d037abe   Neeraj Sharma   commit code
595

4dfee9964   Amber Dev   added school even...
596
597
598
599
600
601
                    <v-data-table
                      :items="onlineUser"
                      class="elevation-0"
                      flat
                      hide-actions
                      hide-headers
3f7b85167   Amber Dev   added announcements
602
603
                      style="border-spacing: 0 !important;"
                    >
4dfee9964   Amber Dev   added school even...
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
                      <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-container>
3f7b85167   Amber Dev   added announcements
631
632
633
634
635
636
637
                </v-card>
              </v-flex>
            </v-layout>
          </v-container>
        </v-flex>
        <v-spacer></v-spacer>
        <!-- SIDE BAR -->
d802ef837   Amber Dev   added school even...
638
        <v-flex xs12 sm12 md4>
3f7b85167   Amber Dev   added announcements
639
640
641
642
643
644
645
646
          <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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
                    <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
664
                  </v-flex>
3f7b85167   Amber Dev   added announcements
665
666
667
668
669
670
671
                  <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
672
673
                  </v-flex>
                </v-layout>
3f7b85167   Amber Dev   added announcements
674
675
676
              </v-flex>
              <hr />
              <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div>
852713654   Amber Dev   added live class ...
677

a26ba60ed   Amber Dev   Added event dialo...
678
              <vue-event-calendar :events="activityEvents" @day-changed="handleDayChanged($event)"></vue-event-calendar>
1dea1c0ef   Amber Dev   solved bugs
679

4fb0af78f   Amber Dev   added school even...
680
              <!-- MEETING EVENTS -->
d802ef837   Amber Dev   added school even...
681
              <!-- IF ROLE IS ADMIN -->
4fb0af78f   Amber Dev   added school even...
682
              <v-card class="my-3 elevation-0">
e5699315c   Shikha Mishra   Show latest event...
683
                <v-card-text v-if="$store.state.role === 'ADMIN' ">
d802ef837   Amber Dev   added school even...
684
685
                  <!-- MEETING EVENTS -->
                  <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title>
a26ba60ed   Amber Dev   Added event dialo...
686
687
688
689
690
                  <div
                    v-for="(activity,index) in activityList"
                    :key="index"
                    class="mt-2"
                    style="cursor: pointer;"
8b184d484   Amber Dev   added events to t...
691
                    @click="seeEventDetails(activity)"
a26ba60ed   Amber Dev   Added event dialo...
692
                  >
3f7b85167   Amber Dev   added announcements
693
694
695
696
697
                    <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">
e5699315c   Shikha Mishra   Show latest event...
698
                      <div>
3311ad345   Neeraj Sharma   add event list in...
699
700
701
702
                        <div
                          class="grey--text lighten-1 caption"
                          v-if="activity.dateOfEvent"
                        >{{moment(activity.dateOfEvent).format("DD MMMM, YYYY")}}</div>
d802ef837   Amber Dev   added school even...
703
                        <div class="body-1" v-if="activity.title">{{activity.title}}</div>
3311ad345   Neeraj Sharma   add event list in...
704
                      </div>
3f7b85167   Amber Dev   added announcements
705
706
                    </div>
                  </div>
3311ad345   Neeraj Sharma   add event list in...
707
708
709
                  <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...
710
                </v-card-text>
d802ef837   Amber Dev   added school even...
711
712
  
                <!-- ROLE IS NOT ADMIN -->
107ec8845   Shikha Mishra   change icon while...
713
                <v-card-text v-if="$store.state.role != 'ADMIN'">
4fb0af78f   Amber Dev   added school even...
714
                  <v-card-title class="justify-center subheading font-weight-bold">Meeting Events</v-card-title>
107ec8845   Shikha Mishra   change icon while...
715
                  <div
e5699315c   Shikha Mishra   Show latest event...
716
717
718
719
720
721
722
723
724
                    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;"
107ec8845   Shikha Mishra   change icon while...
725
726
                    ></span>
                    <div style="display: inline-block;" class="ml-2">
4fb0af78f   Amber Dev   added school even...
727
                      <!-- MEETING EVENTS FOR PARENT -->
107ec8845   Shikha Mishra   change icon while...
728
729
730
731
732
733
734
735
736
737
                      <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>
e5699315c   Shikha Mishra   Show latest event...
738

4fb0af78f   Amber Dev   added school even...
739
                      <!-- MEETING EVENTS FOR TEACHER -->
107ec8845   Shikha Mishra   change icon while...
740
741
742
743
744
745
746
747
748
749
                      <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>
                    </div>
                    <div v-if="activityList.length == 0">
                      <p class="text-center title grey lighten-4 error--text">No Data Found!</p>
e5699315c   Shikha Mishra   Show latest event...
750
751
                    </div>
                  </div>
e5699315c   Shikha Mishra   Show latest event...
752
                </v-card-text>
68d742034   Neeraj Sharma   implement new des...
753
              </v-card>
3f7b85167   Amber Dev   added announcements
754
755
            </v-card-text>
          </v-card>
68d742034   Neeraj Sharma   implement new des...
756
757
        </v-flex>
      </v-layout>
3f7b85167   Amber Dev   added announcements
758

db965de89   Amber Dev   added dialog pers...
759
      <v-dialog v-model="dialog" max-width="500" persistent>
a17c68a03   Neeraj Sharma   implement two rou...
760
761
        <v-card color="grey lighten-4" flat>
          <v-toolbar dark color="fixcolors">
a17c68a03   Neeraj Sharma   implement two rou...
762
763
764
765
766
767
768
769
770
            <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...
771
772
              </v-list-tile-action>
              <v-list-tile-content>
a17c68a03   Neeraj Sharma   implement two rou...
773
                <v-list-tile-title>{{ selected.title }}</v-list-tile-title>
8bb178441   Neeraj Sharma   implemnt api in s...
774
775
              </v-list-tile-content>
            </v-list-tile>
a17c68a03   Neeraj Sharma   implement two rou...
776
777
778
779
780
781
            <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...
782
783
784
785
786
              </v-list-tile-content>
            </v-list-tile>
          </v-flex>
        </v-card>
      </v-dialog>
8bb178441   Neeraj Sharma   implemnt api in s...
787
788
789
790
791
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
a17c68a03   Neeraj Sharma   implement two rou...
792
  import moment from "moment";
6f7cf8cf5   Amber Dev   added discussion ...
793
  import AllApiCalls from "@/Services/AllApiCalls.js";
68d742034   Neeraj Sharma   implement new des...
794
  // import { FunctionalCalendar } from "vue-functional-calendar";
8bb178441   Neeraj Sharma   implemnt api in s...
795
796
  
  export default {
68d742034   Neeraj Sharma   implement new des...
797
798
799
    components: {
      // FunctionalCalendar
    },
6f7cf8cf5   Amber Dev   added discussion ...
800
    mixins: [AllApiCalls],
a17c68a03   Neeraj Sharma   implement two rou...
801
802
    data() {
      return {
68d742034   Neeraj Sharma   implement new des...
803
804
805
806
807
808
        // data: {
        //   clieckedToday: false
        // },
        // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"],
        // calendarData: {},
        // calendar: {},
6f7cf8cf5   Amber Dev   added discussion ...
809

a26ba60ed   Amber Dev   Added event dialo...
810
        // DIALOG BOX EVENT DETAILS
d802ef837   Amber Dev   added school even...
811
812
813
814
        tabs: [
          { name: "School Events", icon: "mdi-account" },
          { name: "Meeting Events", icon: "mdi-account-outline" },
        ],
a26ba60ed   Amber Dev   Added event dialo...
815
        viewEventDetails: false,
d802ef837   Amber Dev   added school even...
816
817
818
819
820
        active: 0,
        particularEvent: [],
        displayEventsList: [],
        dialogSchoolEvents: [],
        dialogMeetingEvents: [],
a26ba60ed   Amber Dev   Added event dialo...
821

0a5256600   Amber Dev   added events
822
823
824
        // CALENDER
        moment: moment,
        activityEvents: [],
11d037abe   Neeraj Sharma   commit code
825
826
        onlineUser: [
          {
bbd60612f   Amber Dev   apis to admin
827
            user: "Student Demo",
11d037abe   Neeraj Sharma   commit code
828
829
          },
          {
bbd60612f   Amber Dev   apis to admin
830
            user: "Teacher Demo",
11d037abe   Neeraj Sharma   commit code
831
832
          },
          {
bbd60612f   Amber Dev   apis to admin
833
            user: "Priyansh Gupta",
11d037abe   Neeraj Sharma   commit code
834
835
          },
          {
bbd60612f   Amber Dev   apis to admin
836
            user: "Gaurav Aggarwal",
11d037abe   Neeraj Sharma   commit code
837
838
          },
          {
bbd60612f   Amber Dev   apis to admin
839
840
            user: "Approve Arorra",
          },
11d037abe   Neeraj Sharma   commit code
841
        ],
a17c68a03   Neeraj Sharma   implement two rou...
842
        showLoader: false,
68d742034   Neeraj Sharma   implement new des...
843
        calendarData: {},
a17c68a03   Neeraj Sharma   implement two rou...
844
        dialog: false,
01d009dde   Neeraj Sharma   fixed Show Notice...
845
        dialogNotice: false,
b28a5f17d   Neeraj Sharma   fixed events and ...
846
847
        HolidaysList: [],
        EventsList: [],
ceb43037a   Neeraj Sharma   fix bugs
848
        events: [],
a17c68a03   Neeraj Sharma   implement two rou...
849
        config: {
bbd60612f   Amber Dev   apis to admin
850
          eventClick: (event) => {
a17c68a03   Neeraj Sharma   implement two rou...
851
852
            this.selected = event;
            this.dialog = true;
bbd60612f   Amber Dev   apis to admin
853
          },
8bb178441   Neeraj Sharma   implemnt api in s...
854
        },
6c05a9f84   Neeraj Sharma   add functionalit ...
855
        selected: {},
01b56330e   Shikha Mishra   add api of fee an...
856
        barGraph: [],
68d742034   Neeraj Sharma   implement new des...
857
        // notice: {},
01d009dde   Neeraj Sharma   fixed Show Notice...
858
        userData: {},
68d742034   Neeraj Sharma   implement new des...
859
860
861
        dated: new Date(2018, 0, 9),
        userList: [],
        sectionList: [],
6c05a9f84   Neeraj Sharma   add functionalit ...
862
863
864
        students: "",
        parents: "",
        teachers: "",
01d009dde   Neeraj Sharma   fixed Show Notice...
865
        classes: "",
68d742034   Neeraj Sharma   implement new des...
866
        noticeData: [],
65d5475b6   Shikha Mishra   changes in api an...
867
        expenseData: [],
01b56330e   Shikha Mishra   add api of fee an...
868
869
        feeData: [],
        collectionData: [],
11d037abe   Neeraj Sharma   commit code
870
871
872
873
        courseData: [],
        studentsData: [],
        annoucementData: [],
        role: "",
68d742034   Neeraj Sharma   implement new des...
874
875
876
877
        attrs: [
          {
            key: "today",
            highlight: true,
bbd60612f   Amber Dev   apis to admin
878
879
            dates: new Date(),
          },
68d742034   Neeraj Sharma   implement new des...
880
881
882
883
        ],
        drawer: true,
        items: [
          { title: "Home", icon: "dashboard" },
bbd60612f   Amber Dev   apis to admin
884
          { title: "About", icon: "question_answer" },
68d742034   Neeraj Sharma   implement new des...
885
886
887
888
889
890
        ],
        right: null,
  
        series: [
          {
            name: "Total",
bbd60612f   Amber Dev   apis to admin
891
892
            data: [],
          },
68d742034   Neeraj Sharma   implement new des...
893
        ],
4e37936da   Shikha Mishra   make clickable ic...
894
        showChart: false,
68d742034   Neeraj Sharma   implement new des...
895
896
897
898
        chartOptions: {
          chart: {
            type: "bar",
            height: 150,
bbd60612f   Amber Dev   apis to admin
899
            stacked: true,
68d600c97   Shikha Mishra   improve dashboard...
900
901
902
903
904
905
906
907
908
909
910
911
912
            // animations: {
            //   enabled: true,
            //   easing: "easeinout",
            //   speed: 1200,
            //   animateGradually: {
            //     enabled: true,
            //     delay: 450
            //   },
            //   dynamicAnimation: {
            //     enabled: true,
            //     speed: 450
            //   }
            // }
68d742034   Neeraj Sharma   implement new des...
913
914
915
916
917
918
          },
          plotOptions: {
            bar: {
              horizontal: false,
              columnWidth: "25%",
              // endingShape: "rounded",
bbd60612f   Amber Dev   apis to admin
919
920
              distributed: true,
            },
68d742034   Neeraj Sharma   implement new des...
921
          },
68d600c97   Shikha Mishra   improve dashboard...
922
923
924
925
926
927
928
          responsive: [
            {
              breakpoint: 480,
              options: {
                legend: {
                  position: "bottom",
                  offsetX: -10,
bbd60612f   Amber Dev   apis to admin
929
930
931
932
                  offsetY: 0,
                },
              },
            },
68d600c97   Shikha Mishra   improve dashboard...
933
          ],
68d742034   Neeraj Sharma   implement new des...
934
          legend: {
bbd60612f   Amber Dev   apis to admin
935
            show: false,
68d742034   Neeraj Sharma   implement new des...
936
937
938
          },
          colors: ["#7852cc", "#f9a825", "#ff8a89"],
          dataLabels: {
bbd60612f   Amber Dev   apis to admin
939
            enabled: false,
68d742034   Neeraj Sharma   implement new des...
940
941
942
943
          },
          stroke: {
            show: true,
            width: 2,
bbd60612f   Amber Dev   apis to admin
944
            colors: ["transparent"],
68d742034   Neeraj Sharma   implement new des...
945
946
          },
          xaxis: {
bbd60612f   Amber Dev   apis to admin
947
            categories: ["Fee", "Collections", "Expences"],
68d742034   Neeraj Sharma   implement new des...
948
949
950
          },
          yaxis: {
            title: {
bbd60612f   Amber Dev   apis to admin
951
952
              text: "",
            },
68d742034   Neeraj Sharma   implement new des...
953
954
          },
          fill: {
bbd60612f   Amber Dev   apis to admin
955
            opacity: 1,
68d742034   Neeraj Sharma   implement new des...
956
957
958
          },
          tooltip: {
            y: {
bbd60612f   Amber Dev   apis to admin
959
              formatter: function (val, opts) {
68d742034   Neeraj Sharma   implement new des...
960
                return "" + val + " ";
bbd60612f   Amber Dev   apis to admin
961
962
963
              },
            },
          },
0a5256600   Amber Dev   added events
964
965
966
967
        },
  
        // LATEST ACTIVITY
        colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"],
bbd60612f   Amber Dev   apis to admin
968
        activityList: [],
a17c68a03   Neeraj Sharma   implement two rou...
969
970
      };
    },
32fcd6960   Amber Dev   added logout if a...
971

8bb178441   Neeraj Sharma   implemnt api in s...
972
    methods: {
852713654   Amber Dev   added live class ...
973
974
975
      test(e) {
        console.log(" test - ", e);
      },
4dfee9964   Amber Dev   added school even...
976
977
  
      /*WHEN CALENDER IS CLICKED - DISPLAYS EVENTS IN DIALOG BOX */
a26ba60ed   Amber Dev   Added event dialo...
978
      async handleDayChanged(e) {
d802ef837   Amber Dev   added school even...
979
980
        console.log("event calender - ", e);
        /*the list of events that will be used in dialog box to display events */
4dfee9964   Amber Dev   added school even...
981

d802ef837   Amber Dev   added school even...
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
        this.dialogMeetingEvents = [];
        this.dialogSchoolEvents = [];
  
        for (var i = 0; i < e.events.length; i++) {
          if (e.events[i].eventType == "meetingEvent") {
            let meetingEventResponse = await this.getParticularMeetingEvent({
              meetingEventId: e.events[i]._id,
            });
            this.dialogMeetingEvents.push(meetingEventResponse.data.data);
          }
          if (e.events[i].eventType == "schoolEvent") {
            let schoolEventResponse = await this.getParticularSchoolEvent({
              schoolEventId: e.events[i]._id,
            });
            this.dialogSchoolEvents.push(schoolEventResponse.data.data);
          }
        }
4dfee9964   Amber Dev   added school even...
999
        /* Opens the dialog box */
a26ba60ed   Amber Dev   Added event dialo...
1000
1001
        this.viewEventDetails = true;
      },
4dfee9964   Amber Dev   added school even...
1002
1003
  
      /* see meeting events, school events individually (when calender is not clicked) */
d802ef837   Amber Dev   added school even...
1004
      async seeEventDetails(activity, message) {
4fb0af78f   Amber Dev   added school even...
1005
1006
1007
1008
1009
1010
1011
1012
        // if (this.$store.state.role === "TEACHER") {
        //   let response = await this.getParticularMeetingEvent({
        //     meetingEventId: activity._id,
        //   });
        //   this.displayEventsList = [];
        //   this.displayEventsList.push(response.data.data);
        //   this.viewEventDetails = true;
        // }
8b184d484   Amber Dev   added events to t...
1013
        if (this.$store.state.role === "PARENT") {
4dfee9964   Amber Dev   added school even...
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
          if (message == "schoolEvent") {
            let response = await this.getParticularSchoolEvent({
              schoolEventId: activity._id,
            });
            this.displayEventsList = [];
            this.displayEventsList.push(response.data.data);
          } else {
            let response = await this.getParticularMeetingEvent({
              meetingEventId: activity.meetingEvent._id,
            });
            this.displayEventsList = [];
            this.displayEventsList.push(response.data.data);
          }
8b184d484   Amber Dev   added events to t...
1027
1028
          this.viewEventDetails = true;
        }
4dfee9964   Amber Dev   added school even...
1029
1030
1031
1032
        if (
          this.$store.state.role === "ADMIN" ||
          this.$store.state.role === "TEACHER"
        ) {
d802ef837   Amber Dev   added school even...
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
          if (message == "schoolEvent") {
            let response = await this.getParticularSchoolEvent({
              schoolEventId: activity._id,
            });
            this.displayEventsList = [];
            this.displayEventsList.push(response.data.data);
          } else {
            let response = await this.getParticularMeetingEvent({
              meetingEventId: activity._id,
            });
            this.displayEventsList = [];
            this.displayEventsList.push(response.data.data);
          }
e5699315c   Shikha Mishra   Show latest event...
1046
1047
          this.viewEventDetails = true;
        }
a26ba60ed   Amber Dev   Added event dialo...
1048
      },
6f7cf8cf5   Amber Dev   added discussion ...
1049
1050
1051
1052
1053
1054
1055
1056
      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
1057
            query: { courseId: courseId },
6f7cf8cf5   Amber Dev   added discussion ...
1058
1059
1060
1061
1062
          });
        } else {
          this.seeSnackbar("No Data Available", "warning");
        }
      },
0a5256600   Amber Dev   added events
1063

01d009dde   Neeraj Sharma   fixed Show Notice...
1064
1065
1066
      closeNotice() {
        this.dialogNotice = false;
      },
68d742034   Neeraj Sharma   implement new des...
1067
      profile() {
01d009dde   Neeraj Sharma   fixed Show Notice...
1068
        // this.editedIndex = this.desserts.indexOf(item);
68d742034   Neeraj Sharma   implement new des...
1069
1070
        // this.notice = Object.assign({}, item);
        // this.dialogNotice = true;
3f8187137   Shikha Mishra   Added functionali...
1071
        this.$router.push("/noticeBoard");
01d009dde   Neeraj Sharma   fixed Show Notice...
1072
      },
bbd60612f   Amber Dev   apis to admin
1073
      date: function (date) {
68d742034   Neeraj Sharma   implement new des...
1074
        return moment(date).format("MMMM DD, YYYY  HH:mm");
8bb178441   Neeraj Sharma   implemnt api in s...
1075
      },
0a5256600   Amber Dev   added events
1076
1077
1078
      activityDate(date) {
        return moment(date).format("MMMM DD, YYYY");
      },
a17c68a03   Neeraj Sharma   implement two rou...
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
      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...
1089
1090
1091
      // eventDropStart: function(event) {
      //   event.editable = false;
      // },
a17c68a03   Neeraj Sharma   implement two rou...
1092
1093
      eventCreated(...test) {
        console.log(test);
8bb178441   Neeraj Sharma   implemnt api in s...
1094
      },
6c05a9f84   Neeraj Sharma   add functionalit ...
1095
1096
      getStudents() {
        http()
02a841878   Amber Dev   ccommented token
1097
          .get("/getStudentsList")
bbd60612f   Amber Dev   apis to admin
1098
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1099
1100
1101
            this.students = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1102
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1103
1104
            // console.log("err====>", err);
            this.showLoader = false;
b0f5f6684   Shikha Mishra   Conditionally sho...
1105
1106
1107
1108
1109
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
6c05a9f84   Neeraj Sharma   add functionalit ...
1110
1111
1112
1113
          });
      },
      getParents() {
        http()
02a841878   Amber Dev   ccommented token
1114
          .get("/getParentsList")
bbd60612f   Amber Dev   apis to admin
1115
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1116
1117
1118
            this.parents = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1119
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1120
1121
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
1122
1123
1124
1125
          });
      },
      getTeachers() {
        http()
02a841878   Amber Dev   ccommented token
1126
          .get("/getTeachersList")
bbd60612f   Amber Dev   apis to admin
1127
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1128
1129
1130
            this.teachers = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1131
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1132
1133
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
1134
1135
1136
1137
          });
      },
      getClasses() {
        http()
02a841878   Amber Dev   ccommented token
1138
          .get("/getClassesList")
bbd60612f   Amber Dev   apis to admin
1139
          .then((response) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1140
1141
1142
            this.classes = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1143
          .catch((error) => {
6c05a9f84   Neeraj Sharma   add functionalit ...
1144
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
1145
          });
01d009dde   Neeraj Sharma   fixed Show Notice...
1146
1147
1148
1149
      },
      getNoticeData() {
        this.showLoader = true;
        http()
02a841878   Amber Dev   ccommented token
1150
          .get("/getEventsList")
bbd60612f   Amber Dev   apis to admin
1151
          .then((response) => {
01d009dde   Neeraj Sharma   fixed Show Notice...
1152
1153
1154
            this.noticeData = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1155
          .catch((error) => {
01d009dde   Neeraj Sharma   fixed Show Notice...
1156
            this.showLoader = false;
01d009dde   Neeraj Sharma   fixed Show Notice...
1157
1158
1159
          });
      },
      getUserData() {
68d742034   Neeraj Sharma   implement new des...
1160
        // this.showLoader = true;
3f7b85167   Amber Dev   added announcements
1161
1162
1163
        if (this.$store.state.role === "PARENT") {
          http()
            .get("/getParticularUserDetail", {
3f7b85167   Amber Dev   added announcements
1164
              params: {
bbd60612f   Amber Dev   apis to admin
1165
1166
                studentId: localStorage.getItem("parentStudentId"),
              },
3f7b85167   Amber Dev   added announcements
1167
            })
bbd60612f   Amber Dev   apis to admin
1168
            .then((response) => {
3f7b85167   Amber Dev   added announcements
1169
1170
              this.userData = response.data.data;
              this.showLoader = false;
3f7b85167   Amber Dev   added announcements
1171
            })
bbd60612f   Amber Dev   apis to admin
1172
            .catch((error) => {
3f7b85167   Amber Dev   added announcements
1173
1174
1175
1176
              this.showLoader = false;
            });
        } else {
          http()
02a841878   Amber Dev   ccommented token
1177
            .get("/getParticularUserDetail")
bbd60612f   Amber Dev   apis to admin
1178
            .then((response) => {
3f7b85167   Amber Dev   added announcements
1179
1180
1181
              this.userData = response.data.data;
              this.showLoader = false;
            })
bbd60612f   Amber Dev   apis to admin
1182
            .catch((error) => {
3f7b85167   Amber Dev   added announcements
1183
1184
1185
              this.showLoader = false;
            });
        }
65d5475b6   Shikha Mishra   changes in api an...
1186
      },
01b56330e   Shikha Mishra   add api of fee an...
1187
1188
1189
  
      getFeesAndCollectionsData() {
        http()
02a841878   Amber Dev   ccommented token
1190
          .get("/getTotalFeesAndCollections")
bbd60612f   Amber Dev   apis to admin
1191
          .then((response) => {
01b56330e   Shikha Mishra   add api of fee an...
1192
1193
1194
1195
            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...
1196
1197
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1198
          .catch((error) => {
01b56330e   Shikha Mishra   add api of fee an...
1199
1200
1201
            this.showLoader = false;
          });
      },
65d5475b6   Shikha Mishra   changes in api an...
1202
1203
      getExpensesData() {
        http()
02a841878   Amber Dev   ccommented token
1204
          .get("/getTotalExpenses")
bbd60612f   Amber Dev   apis to admin
1205
          .then((response) => {
01b56330e   Shikha Mishra   add api of fee an...
1206
1207
1208
            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...
1209
            this.showChart = true;
01b56330e   Shikha Mishra   add api of fee an...
1210
1211
1212
1213
1214
1215
            // this.series = [
            //   {
            //     name: "Total",
            //     data: array
            //   }
            // ];
01b56330e   Shikha Mishra   add api of fee an...
1216
1217
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1218
          .catch((error) => {
01b56330e   Shikha Mishra   add api of fee an...
1219
1220
            this.showLoader = false;
          });
11d037abe   Neeraj Sharma   commit code
1221
      },
32fcd6960   Amber Dev   added logout if a...
1222
1223
1224
1225
1226
      // async getparentStudents() {
      //   this.showLoader = true;
      //   await http()
      //     .get("/parentStudentsList")
      //     .then((response) => {
058c4a6cf   Shikha Mishra   Improve the funct...
1227

32fcd6960   Amber Dev   added logout if a...
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
      //       /* 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 ...
1239
1240
1241
      async getCourses(parentStudentsId, classId) {
        /* getStudentCourses - to get courseData - defined in GetApis.js*/
        await this.getStudentCourses({
32fcd6960   Amber Dev   added logout if a...
1242
1243
          classId: localStorage.getItem("parentClassId"),
          studentId: localStorage.getItem("parentStudentId"),
6f7cf8cf5   Amber Dev   added discussion ...
1244
        });
11d037abe   Neeraj Sharma   commit code
1245
      },
6f7cf8cf5   Amber Dev   added discussion ...
1246
      getAnnoucementes(classId) {
11d037abe   Neeraj Sharma   commit code
1247
1248
1249
1250
        this.showLoader = true;
        http()
          .get("/getAnnoucementesList", {
            params: {
32fcd6960   Amber Dev   added logout if a...
1251
              classId: localStorage.getItem("parentClassId"),
bbd60612f   Amber Dev   apis to admin
1252
            },
11d037abe   Neeraj Sharma   commit code
1253
          })
bbd60612f   Amber Dev   apis to admin
1254
          .then((response) => {
11d037abe   Neeraj Sharma   commit code
1255
1256
1257
            this.annoucementData = response.data.data;
            this.showLoader = false;
          })
bbd60612f   Amber Dev   apis to admin
1258
          .catch((err) => {
11d037abe   Neeraj Sharma   commit code
1259
1260
1261
            console.log("err====>", err);
            this.showLoader = false;
          });
3311ad345   Neeraj Sharma   add event list in...
1262
      },
4dfee9964   Amber Dev   added school even...
1263
1264
  
      /* MEETING EVENTS, SCHOOL EVENTS */
610e873a0   Amber Dev   solved bug regard...
1265
      async getMeetingEventes() {
e5699315c   Shikha Mishra   Show latest event...
1266
        if (this.role == "TEACHER" || this.role === "ADMIN") {
3311ad345   Neeraj Sharma   add event list in...
1267
          this.showLoader = true;
610e873a0   Amber Dev   solved bug regard...
1268
          await http()
02a841878   Amber Dev   ccommented token
1269
            .get("/getMeetingEventesList")
bbd60612f   Amber Dev   apis to admin
1270
            .then((response) => {
3311ad345   Neeraj Sharma   add event list in...
1271
1272
1273
              var activityList = response.data.data;
              this.activityList = activityList;
              this.showLoader = false;
8b184d484   Amber Dev   added events to t...
1274

4fb0af78f   Amber Dev   added school even...
1275
              /* set meetingEvents in activityEvents array to highlight event dates in calender */
8b184d484   Amber Dev   added events to t...
1276
1277
1278
1279
1280
1281
1282
              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;
d802ef837   Amber Dev   added school even...
1283
                obj.eventType = "meetingEvent";
4fb0af78f   Amber Dev   added school even...
1284
                /* activityEvents is an array used to display events in calender on particular dates */
8b184d484   Amber Dev   added events to t...
1285
1286
                this.activityEvents.push(obj);
              }
3311ad345   Neeraj Sharma   add event list in...
1287
            })
bbd60612f   Amber Dev   apis to admin
1288
            .catch((error) => {
3311ad345   Neeraj Sharma   add event list in...
1289
1290
1291
              this.showLoader = false;
            });
        }
4dfee9964   Amber Dev   added school even...
1292
1293
1294
1295
1296
1297
1298
        /* If role is ADMIN,TEACHER, PARENT then school events need to be displayed too */
        if (
          this.role === "ADMIN" ||
          this.role === "TEACHER" ||
          this.role === "PARENT"
        ) {
          /* this will get data in a  "schoolEvents" data property */
d802ef837   Amber Dev   added school even...
1299
          await this.getSchoolEventsList();
4fb0af78f   Amber Dev   added school even...
1300
          /* set schoolEvents in activityEvents array to highlight event dates in calender */
d802ef837   Amber Dev   added school even...
1301
1302
1303
1304
1305
1306
1307
1308
          for (var i = 0; i < this.schoolEvents.length; i++) {
            let obj = {};
            obj.date = moment(this.schoolEvents[i].dateOfEvent).format(
              "YYYY/MM/DD"
            );
            obj.title = this.schoolEvents[i].title;
            obj._id = this.schoolEvents[i]._id;
            obj.eventType = "schoolEvent";
4dfee9964   Amber Dev   added school even...
1309
            /* activityEvents is an array used to display events in calender on particular dates */
d802ef837   Amber Dev   added school even...
1310
1311
1312
            this.activityEvents.push(obj);
          }
        }
bbd60612f   Amber Dev   apis to admin
1313
      },
fe15ee8b4   Amber Dev   added course chap...
1314
    },
a26ba60ed   Amber Dev   Added event dialo...
1315
1316
1317
1318
  
    mounted() {
      //  = this.$store.state.schoolToken;
      // console.log("this.$store.state.role", this.token);
610e873a0   Amber Dev   solved bug regard...
1319
1320
1321
1322
      // this.getUsersList();
    },
  
    async created() {
a26ba60ed   Amber Dev   Added event dialo...
1323
      if (this.$store.state.role === "ADMIN") {
02a841878   Amber Dev   ccommented token
1324
        // this.token = this.$store.state.token;
bbd60612f   Amber Dev   apis to admin
1325
1326
        await this.getFeesAndCollectionsData();
        await this.getExpensesData();
a26ba60ed   Amber Dev   Added event dialo...
1327
      } else if (this.$store.state.schoolRole === "SUPERADMIN") {
02a841878   Amber Dev   ccommented token
1328
        // this.token = this.$store.state.schoolToken;
bbd60612f   Amber Dev   apis to admin
1329
1330
        await this.getFeesAndCollectionsData();
        await this.getExpensesData();
a26ba60ed   Amber Dev   Added event dialo...
1331
      } else if (this.$store.state.role === "TEACHER") {
02a841878   Amber Dev   ccommented token
1332
        // this.token = this.$store.state.token;
a26ba60ed   Amber Dev   Added event dialo...
1333
      } else if (this.$store.state.role === "ACCOUNTANT") {
02a841878   Amber Dev   ccommented token
1334
        // this.token = this.$store.state.token;
a26ba60ed   Amber Dev   Added event dialo...
1335
      } else if (this.$store.state.role === "LIBRARIAN") {
02a841878   Amber Dev   ccommented token
1336
        // this.token = this.$store.state.token;
a26ba60ed   Amber Dev   Added event dialo...
1337
      } else if (this.$store.state.role === "PARENT") {
02a841878   Amber Dev   ccommented token
1338
        // this.token = this.$store.state.token;
32fcd6960   Amber Dev   added logout if a...
1339
1340
        // await this.getparentStudents();
        this.studentsData = this.$store.getters.GET_STUDENTS_DATA;
058c4a6cf   Shikha Mishra   Improve the funct...
1341
1342
        console.log("students data - ", this.studentsData);
        await this.getCourses();
32fcd6960   Amber Dev   added logout if a...
1343
        await this.getAnnoucementes();
a26ba60ed   Amber Dev   Added event dialo...
1344
1345
      }
      this.role = this.$store.state.role;
058c4a6cf   Shikha Mishra   Improve the funct...
1346

610e873a0   Amber Dev   solved bug regard...
1347
1348
1349
1350
1351
1352
      await this.getStudents();
      await this.getTeachers();
      await this.getParents();
      await this.getClasses();
      await this.getNoticeData();
      await this.getUserData();
a26ba60ed   Amber Dev   Added event dialo...
1353

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

3311ad345   Neeraj Sharma   add event list in...
1361
1362
1363
1364
1365
1366
1367
        /* 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...
1368
          obj._id = this.activityList[i].meetingEvent._id;
4dfee9964   Amber Dev   added school even...
1369
          obj.eventType = "meetingEvent";
3311ad345   Neeraj Sharma   add event list in...
1370
1371
          this.activityEvents.push(obj);
        }
0a5256600   Amber Dev   added events
1372
      }
8b184d484   Amber Dev   added events to t...
1373

ac24ec07a   Amber Dev   added live online
1374
      /* get Latest events list for teacher login*/
4dfee9964   Amber Dev   added school even...
1375
1376
1377
1378
1379
      if (
        this.role == "TEACHER" ||
        this.role == "ADMIN" ||
        this.role == "PARENT"
      ) {
ac24ec07a   Amber Dev   added live online
1380
1381
        await this.getMeetingEventes();
      }
bbd60612f   Amber Dev   apis to admin
1382
    },
8bb178441   Neeraj Sharma   implemnt api in s...
1383
1384
  };
  </script>
687e0b929   Neeraj Sharma   add user,attenden...
1385

68d742034   Neeraj Sharma   implement new des...
1386
  <style scoped>
a17c68a03   Neeraj Sharma   implement two rou...
1387
  @import "fullcalendar/dist/fullcalendar.css";
d802ef837   Amber Dev   added school even...
1388
1389
1390
  .wrap-text {
    -webkit-line-clamp: unset !important;
  }
3f8187137   Shikha Mishra   Added functionali...
1391
1392
1393
1394
  
  a {
    color: white;
  }
a17c68a03   Neeraj Sharma   implement two rou...
1395
  </style>