Blame view

src/pages/Dashboard/dashboard.vue 34.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
92
93
94
              <v-list-tile>
                <v-list-tile-content>
                  <v-list-tile-title>Duration : {{particularEvent.duration}}</v-list-tile-title>
                </v-list-tile-content>
              </v-list-tile>
a26ba60ed   Amber Dev   Added event dialo...
95
96
97
98
            </v-list>
          </v-card-text>
        </v-card>
      </v-dialog>
3f7b85167   Amber Dev   added announcements
99
100
101
      <v-layout wrap row>
        <v-flex xs12 sm12 md9>
          <v-container fluid grid-list-xl>
68d742034   Neeraj Sharma   implement new des...
102
            <!-- ***** Total Students ***** -->
ac24ec07a   Amber Dev   added live online
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
            <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...
145

3f7b85167   Amber Dev   added announcements
146
147
148
149
150
151
152
153
154
155
156
            <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>
            <v-layout v-if="role != 'PARENT'">
              <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...
157
                    <v-flex xs12 sm12 md3>
3f7b85167   Amber Dev   added announcements
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
                      <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...
195
                    </v-flex>
3f7b85167   Amber Dev   added announcements
196
197
198
199
200
201
202
203
204
205
206
207
208
                    <v-flex xs12 sm12 md9 lg9>
                      <div id="chart">
                        <div v-if="this.series">
                          <apexchart
                            type="bar"
                            height="250"
                            style="max-width: 800px !important"
                            :options="chartOptions"
                            :series="series"
                            v-show="true"
                          ></apexchart>
                        </div>
                      </div>
68d742034   Neeraj Sharma   implement new des...
209
210
                    </v-flex>
                  </v-layout>
3f7b85167   Amber Dev   added announcements
211
212
213
214
215
                </v-card>
              </v-flex>
            </v-layout>
            <v-card class="mt-2 card" v-if="role != 'PARENT'">
              <!-- <full-calendar
68d742034   Neeraj Sharma   implement new des...
216
217
218
219
220
                    ref="calendar"
                    defaultView="month"
                    droppable="false"
                    :events="events"
                    :config="config"
3f7b85167   Amber Dev   added announcements
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
              ></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>
                    <td class="noticeDecritpion grey--text mt-2">{{ props.item.description}}</td>
  
                    <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>
            <!-- 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;"
                              >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...
301
                  <h4 class="pa-3">
3f7b85167   Amber Dev   added announcements
302
                    <b>Latest Annoucements</b>
68d742034   Neeraj Sharma   implement new des...
303
                  </h4>
01d009dde   Neeraj Sharma   fixed Show Notice...
304

68d742034   Neeraj Sharma   implement new des...
305
                  <v-data-table
3f7b85167   Amber Dev   added announcements
306
                    :items="annoucementData"
68d742034   Neeraj Sharma   implement new des...
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
                    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
324
                          <span class="body-2">{{ props.item.discussionType}}</span>
68d742034   Neeraj Sharma   implement new des...
325
                        </td>
68d742034   Neeraj Sharma   implement new des...
326
327
328
329
330
331
                        <td class="text-xs-center">
                          <span>
                            <v-tooltip top>
                              <img
                                slot="activator"
                                style="cursor:pointer; width:25px; height:25px; "
aa310d61a   Shikha Mishra   added functionali...
332
                                src="/static/icon/view.png"
68d742034   Neeraj Sharma   implement new des...
333
334
335
336
337
338
339
340
341
                              />
                              <span>View</span>
                            </v-tooltip>
                          </span>
                        </td>
                      </tr>
                    </template>
                  </v-data-table>
                </v-card>
3f7b85167   Amber Dev   added announcements
342
343
344
345
346
347
              </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
348

3f7b85167   Amber Dev   added announcements
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
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
                  <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>
                    <img src="/static/icon/user.png" v-if="!userData.schoolLogoUrl" width="80" />
                    <img :src="userData.schoolLogoUrl" v-else-if="userData.schoolLogoUrl" width="80" />
11d037abe   Neeraj Sharma   commit code
401
                  </v-flex>
3f7b85167   Amber Dev   added announcements
402
403
404
405
406
407
408
                  <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
409
410
                  </v-flex>
                </v-layout>
3f7b85167   Amber Dev   added announcements
411
412
413
              </v-flex>
              <hr />
              <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div>
a26ba60ed   Amber Dev   Added event dialo...
414
              <vue-event-calendar :events="activityEvents" @day-changed="handleDayChanged($event)"></vue-event-calendar>
3f7b85167   Amber Dev   added announcements
415
              <!-- LATEST ACTIVITY -->
3311ad345   Neeraj Sharma   add event list in...
416
              <v-card class="my-3 elevation-0">
68d742034   Neeraj Sharma   implement new des...
417
                <v-card-text>
8b184d484   Amber Dev   added events to t...
418
                  <v-card-title class="justify-center subheading font-weight-bold">Latest Events</v-card-title>
a26ba60ed   Amber Dev   Added event dialo...
419
420
421
422
423
                  <div
                    v-for="(activity,index) in activityList"
                    :key="index"
                    class="mt-2"
                    style="cursor: pointer;"
8b184d484   Amber Dev   added events to t...
424
                    @click="seeEventDetails(activity)"
a26ba60ed   Amber Dev   Added event dialo...
425
                  >
3f7b85167   Amber Dev   added announcements
426
427
428
429
430
                    <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">
8b184d484   Amber Dev   added events to t...
431
432
433
434
435
436
437
438
439
440
                      <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 ...
441

8b184d484   Amber Dev   added events to t...
442
                      <!-- LATEST EVENTS FOR TEACHER -->
3311ad345   Neeraj Sharma   add event list in...
443
444
445
446
447
448
449
                      <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
450
451
                    </div>
                  </div>
3311ad345   Neeraj Sharma   add event list in...
452
453
454
                  <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...
455
456
                </v-card-text>
              </v-card>
3f7b85167   Amber Dev   added announcements
457
458
            </v-card-text>
          </v-card>
68d742034   Neeraj Sharma   implement new des...
459
460
        </v-flex>
      </v-layout>
3f7b85167   Amber Dev   added announcements
461

a17c68a03   Neeraj Sharma   implement two rou...
462
463
464
      <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...
465
466
467
468
469
470
471
472
473
            <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...
474
475
              </v-list-tile-action>
              <v-list-tile-content>
a17c68a03   Neeraj Sharma   implement two rou...
476
                <v-list-tile-title>{{ selected.title }}</v-list-tile-title>
8bb178441   Neeraj Sharma   implemnt api in s...
477
478
              </v-list-tile-content>
            </v-list-tile>
a17c68a03   Neeraj Sharma   implement two rou...
479
480
481
482
483
484
            <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...
485
486
487
488
489
              </v-list-tile-content>
            </v-list-tile>
          </v-flex>
        </v-card>
      </v-dialog>
8bb178441   Neeraj Sharma   implemnt api in s...
490
491
492
493
494
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
a17c68a03   Neeraj Sharma   implement two rou...
495
  import moment from "moment";
6f7cf8cf5   Amber Dev   added discussion ...
496
  import AllApiCalls from "@/Services/AllApiCalls.js";
68d742034   Neeraj Sharma   implement new des...
497
  // import { FunctionalCalendar } from "vue-functional-calendar";
8bb178441   Neeraj Sharma   implemnt api in s...
498
499
  
  export default {
68d742034   Neeraj Sharma   implement new des...
500
501
502
    components: {
      // FunctionalCalendar
    },
6f7cf8cf5   Amber Dev   added discussion ...
503
    mixins: [AllApiCalls],
a17c68a03   Neeraj Sharma   implement two rou...
504
505
    data() {
      return {
68d742034   Neeraj Sharma   implement new des...
506
507
508
509
510
511
        // data: {
        //   clieckedToday: false
        // },
        // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"],
        // calendarData: {},
        // calendar: {},
6f7cf8cf5   Amber Dev   added discussion ...
512

a26ba60ed   Amber Dev   Added event dialo...
513
514
        // DIALOG BOX EVENT DETAILS
        viewEventDetails: false,
0a5256600   Amber Dev   added events
515
516
517
        // CALENDER
        moment: moment,
        activityEvents: [],
11d037abe   Neeraj Sharma   commit code
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
        onlineUser: [
          {
            user: "Student Demo"
          },
          {
            user: "Teacher Demo"
          },
          {
            user: "Priyansh Gupta"
          },
          {
            user: "Gaurav Aggarwal"
          },
          {
            user: "Approve Arorra"
          }
        ],
a17c68a03   Neeraj Sharma   implement two rou...
535
        showLoader: false,
68d742034   Neeraj Sharma   implement new des...
536
        calendarData: {},
a17c68a03   Neeraj Sharma   implement two rou...
537
        dialog: false,
01d009dde   Neeraj Sharma   fixed Show Notice...
538
        dialogNotice: false,
b28a5f17d   Neeraj Sharma   fixed events and ...
539
540
        HolidaysList: [],
        EventsList: [],
ceb43037a   Neeraj Sharma   fix bugs
541
        events: [],
a17c68a03   Neeraj Sharma   implement two rou...
542
543
544
545
        config: {
          eventClick: event => {
            this.selected = event;
            this.dialog = true;
8bb178441   Neeraj Sharma   implemnt api in s...
546
547
          }
        },
6c05a9f84   Neeraj Sharma   add functionalit ...
548
        selected: {},
01b56330e   Shikha Mishra   add api of fee an...
549
        barGraph: [],
68d742034   Neeraj Sharma   implement new des...
550
        // notice: {},
01d009dde   Neeraj Sharma   fixed Show Notice...
551
        userData: {},
68d742034   Neeraj Sharma   implement new des...
552
553
554
        dated: new Date(2018, 0, 9),
        userList: [],
        sectionList: [],
6c05a9f84   Neeraj Sharma   add functionalit ...
555
556
557
        students: "",
        parents: "",
        teachers: "",
01d009dde   Neeraj Sharma   fixed Show Notice...
558
        classes: "",
68d742034   Neeraj Sharma   implement new des...
559
        noticeData: [],
65d5475b6   Shikha Mishra   changes in api an...
560
        expenseData: [],
01b56330e   Shikha Mishra   add api of fee an...
561
562
        feeData: [],
        collectionData: [],
11d037abe   Neeraj Sharma   commit code
563
564
565
566
        courseData: [],
        studentsData: [],
        annoucementData: [],
        role: "",
68d742034   Neeraj Sharma   implement new des...
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
        attrs: [
          {
            key: "today",
            highlight: true,
            dates: new Date()
          }
        ],
        drawer: true,
        items: [
          { title: "Home", icon: "dashboard" },
          { title: "About", icon: "question_answer" }
        ],
        right: null,
  
        series: [
          {
            name: "Total",
01b56330e   Shikha Mishra   add api of fee an...
584
            data: []
68d742034   Neeraj Sharma   implement new des...
585
586
587
588
589
590
          }
        ],
        chartOptions: {
          chart: {
            type: "bar",
            height: 150,
68d600c97   Shikha Mishra   improve dashboard...
591
592
593
594
595
596
597
598
599
600
601
602
603
604
            stacked: true
            // animations: {
            //   enabled: true,
            //   easing: "easeinout",
            //   speed: 1200,
            //   animateGradually: {
            //     enabled: true,
            //     delay: 450
            //   },
            //   dynamicAnimation: {
            //     enabled: true,
            //     speed: 450
            //   }
            // }
68d742034   Neeraj Sharma   implement new des...
605
606
607
608
609
610
611
612
613
          },
          plotOptions: {
            bar: {
              horizontal: false,
              columnWidth: "25%",
              // endingShape: "rounded",
              distributed: true
            }
          },
68d600c97   Shikha Mishra   improve dashboard...
614
615
616
617
618
619
620
621
622
623
624
625
          responsive: [
            {
              breakpoint: 480,
              options: {
                legend: {
                  position: "bottom",
                  offsetX: -10,
                  offsetY: 0
                }
              }
            }
          ],
68d742034   Neeraj Sharma   implement new des...
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
          legend: {
            show: false
          },
          colors: ["#7852cc", "#f9a825", "#ff8a89"],
          dataLabels: {
            enabled: false
          },
          stroke: {
            show: true,
            width: 2,
            colors: ["transparent"]
          },
          xaxis: {
            categories: ["Fee", "Collections", "Expences"]
          },
          yaxis: {
            title: {
              text: ""
            }
          },
          fill: {
            opacity: 1
          },
          tooltip: {
            y: {
              formatter: function(val, opts) {
                // console.log("opts",opts.w.config.xaxis.categories)
                return "" + val + " ";
              }
            }
          }
0a5256600   Amber Dev   added events
657
658
659
660
661
        },
  
        // LATEST ACTIVITY
        colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"],
        activityList: []
a17c68a03   Neeraj Sharma   implement two rou...
662
663
      };
    },
8bb178441   Neeraj Sharma   implemnt api in s...
664
    methods: {
a26ba60ed   Amber Dev   Added event dialo...
665
666
667
668
669
670
671
      async handleDayChanged(e) {
        console.log("date-changed - ", e);
        await this.getParticularMeetingEvent({
          meetingEventId: e.events[0]._id
        });
        this.viewEventDetails = true;
      },
8b184d484   Amber Dev   added events to t...
672
673
674
675
676
677
678
679
680
681
682
      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({
            meetingEventId: activity.meetingEvent._id
          });
          this.viewEventDetails = true;
        }
a26ba60ed   Amber Dev   Added event dialo...
683
      },
6f7cf8cf5   Amber Dev   added discussion ...
684
685
686
687
688
689
690
691
692
693
694
695
696
697
      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",
            query: { courseId: courseId }
          });
        } else {
          this.seeSnackbar("No Data Available", "warning");
        }
      },
0a5256600   Amber Dev   added events
698

01d009dde   Neeraj Sharma   fixed Show Notice...
699
700
701
      closeNotice() {
        this.dialogNotice = false;
      },
68d742034   Neeraj Sharma   implement new des...
702
      profile() {
01d009dde   Neeraj Sharma   fixed Show Notice...
703
        // this.editedIndex = this.desserts.indexOf(item);
68d742034   Neeraj Sharma   implement new des...
704
705
706
        // this.notice = Object.assign({}, item);
        // this.dialogNotice = true;
        this.$router.push({ name: "NoticeBoard" });
01d009dde   Neeraj Sharma   fixed Show Notice...
707
      },
a17c68a03   Neeraj Sharma   implement two rou...
708
      date: function(date) {
68d742034   Neeraj Sharma   implement new des...
709
        return moment(date).format("MMMM DD, YYYY  HH:mm");
8bb178441   Neeraj Sharma   implemnt api in s...
710
      },
0a5256600   Amber Dev   added events
711
712
713
      activityDate(date) {
        return moment(date).format("MMMM DD, YYYY");
      },
a17c68a03   Neeraj Sharma   implement two rou...
714
715
716
717
718
719
720
721
722
      refreshEvents() {
        this.$refs.calendar.$emit("refetch-events");
      },
      removeEvent() {
        this.$refs.calendar.$emit("remove-event", this.selected);
        this.selected = {};
      },
      eventSelected(event) {
        this.selected = event;
db0c39244   Neeraj Sharma   implement event a...
723
        console.log("this.selected", this.selected);
a17c68a03   Neeraj Sharma   implement two rou...
724
      },
687e0b929   Neeraj Sharma   add user,attenden...
725
726
727
      // eventDropStart: function(event) {
      //   event.editable = false;
      // },
a17c68a03   Neeraj Sharma   implement two rou...
728
729
      eventCreated(...test) {
        console.log(test);
8bb178441   Neeraj Sharma   implemnt api in s...
730
      },
6c05a9f84   Neeraj Sharma   add functionalit ...
731
732
      getStudents() {
        http()
7d0816758   Shikha Mishra   show dashboard wh...
733
          .get("/getStudentsList", {
8deade193   Shikha Mishra   token issue solved
734
735
736
            headers: {
              Authorization: "Bearer " + this.token
            }
7d0816758   Shikha Mishra   show dashboard wh...
737
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
738
739
740
741
          .then(response => {
            this.students = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
742
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
743
744
            // console.log("err====>", err);
            this.showLoader = false;
229463bd5   Neeraj Sharma   implement design ...
745
746
747
748
749
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
6c05a9f84   Neeraj Sharma   add functionalit ...
750
751
752
753
          });
      },
      getParents() {
        http()
25205ccca   Shikha Mishra   show school logo ...
754
          .get("/getParentsList", {
8deade193   Shikha Mishra   token issue solved
755
756
757
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
758
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
759
760
761
762
          .then(response => {
            this.parents = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
763
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
764
765
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
766
767
768
769
          });
      },
      getTeachers() {
        http()
7d0816758   Shikha Mishra   show dashboard wh...
770
          .get("/getTeachersList", {
8deade193   Shikha Mishra   token issue solved
771
772
773
            headers: {
              Authorization: "Bearer " + this.token
            }
7d0816758   Shikha Mishra   show dashboard wh...
774
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
775
776
777
778
          .then(response => {
            this.teachers = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
779
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
780
781
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
782
783
784
785
          });
      },
      getClasses() {
        http()
25205ccca   Shikha Mishra   show school logo ...
786
          .get("/getClassesList", {
8deade193   Shikha Mishra   token issue solved
787
788
789
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
790
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
791
792
793
794
          .then(response => {
            this.classes = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
795
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
796
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
797
          });
01d009dde   Neeraj Sharma   fixed Show Notice...
798
799
800
801
      },
      getNoticeData() {
        this.showLoader = true;
        http()
25205ccca   Shikha Mishra   show school logo ...
802
          .get("/getEventsList", {
8deade193   Shikha Mishra   token issue solved
803
804
805
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
806
          })
01d009dde   Neeraj Sharma   fixed Show Notice...
807
808
809
810
811
812
          .then(response => {
            this.noticeData = response.data.data;
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
01d009dde   Neeraj Sharma   fixed Show Notice...
813
814
815
          });
      },
      getUserData() {
68d742034   Neeraj Sharma   implement new des...
816
        // this.showLoader = true;
3f7b85167   Amber Dev   added announcements
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
        if (this.$store.state.role === "PARENT") {
          http()
            .get("/getParticularUserDetail", {
              headers: {
                Authorization: "Bearer " + this.token
              },
              params: {
                studentId: localStorage.getItem("parentStudentId")
              }
            })
            .then(response => {
              this.userData = response.data.data;
              this.showLoader = false;
              console.log("sdsdfsdfsd - ", response);
            })
            .catch(error => {
              this.showLoader = false;
            });
        } else {
          http()
            .get("/getParticularUserDetail", {
              headers: {
                Authorization: "Bearer " + this.token
              }
            })
            .then(response => {
              this.userData = response.data.data;
              this.showLoader = false;
            })
            .catch(error => {
              this.showLoader = false;
            });
        }
65d5475b6   Shikha Mishra   changes in api an...
850
      },
01b56330e   Shikha Mishra   add api of fee an...
851
852
853
854
855
856
857
858
859
860
861
862
863
  
      getFeesAndCollectionsData() {
        http()
          .get("/getTotalFeesAndCollections", {
            headers: {
              Authorization: "Bearer " + this.token
            }
          })
          .then(response => {
            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;
11d037abe   Neeraj Sharma   commit code
864
            // console.log("this.series====", this.series);
01b56330e   Shikha Mishra   add api of fee an...
865
866
867
868
869
870
871
  
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
          });
      },
65d5475b6   Shikha Mishra   changes in api an...
872
873
      getExpensesData() {
        http()
01b56330e   Shikha Mishra   add api of fee an...
874
875
876
877
878
879
880
881
882
          .get("/getTotalExpenses", {
            headers: {
              Authorization: "Bearer " + this.token
            }
          })
          .then(response => {
            this.expenseData = response.data.data;
            // var array = response.data.data.sum;
            this.series[0].data[2] = this.expenseData.sum;
01b56330e   Shikha Mishra   add api of fee an...
883
884
885
886
887
888
889
890
891
892
893
894
            // this.series = [
            //   {
            //     name: "Total",
            //     data: array
            //   }
            // ];
            // console.log("this.series====", this.series);
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
          });
11d037abe   Neeraj Sharma   commit code
895
      },
610e873a0   Amber Dev   solved bug regard...
896
      async getparentStudents() {
11d037abe   Neeraj Sharma   commit code
897
        this.showLoader = true;
610e873a0   Amber Dev   solved bug regard...
898
899
900
        var parentStudentsId;
        var classId;
        await http()
11d037abe   Neeraj Sharma   commit code
901
902
903
904
          .get("/parentStudentsList")
          .then(response => {
            // console.log("resssssss", response.data.data.students[0].classId);
            this.studentsData = response.data.data;
610e873a0   Amber Dev   solved bug regard...
905
906
907
908
909
910
911
912
            localStorage.setItem(
              "parentStudentId",
              this.studentsData.students[0]._id
            );
            localStorage.setItem(
              "parentClassId",
              this.studentsData.students[0].classId
            );
fe15ee8b4   Amber Dev   added course chap...
913

11d037abe   Neeraj Sharma   commit code
914
            if (localStorage.getItem("parentStudentId") == null) {
610e873a0   Amber Dev   solved bug regard...
915
916
              parentStudentsId = response.data.data.students[0].classId;
              classId = response.data.data.students[0]._id;
11d037abe   Neeraj Sharma   commit code
917
918
            }
            if (localStorage.getItem("parentStudentId")) {
610e873a0   Amber Dev   solved bug regard...
919
920
              parentStudentsId = localStorage.getItem("parentStudentId");
              classId = localStorage.getItem("parentClassId");
11d037abe   Neeraj Sharma   commit code
921
            }
610e873a0   Amber Dev   solved bug regard...
922

11d037abe   Neeraj Sharma   commit code
923
924
925
926
927
928
            this.showLoader = false;
          })
          .catch(err => {
            console.log("err====>", err);
            this.showLoader = false;
          });
610e873a0   Amber Dev   solved bug regard...
929
930
        await this.getCourses(parentStudentsId, classId);
        await this.getAnnoucementes(classId);
11d037abe   Neeraj Sharma   commit code
931
      },
6f7cf8cf5   Amber Dev   added discussion ...
932
933
934
935
936
937
      async getCourses(parentStudentsId, classId) {
        /* getStudentCourses - to get courseData - defined in GetApis.js*/
        await this.getStudentCourses({
          classId: classId,
          studentId: parentStudentsId
        });
11d037abe   Neeraj Sharma   commit code
938
      },
6f7cf8cf5   Amber Dev   added discussion ...
939
      getAnnoucementes(classId) {
11d037abe   Neeraj Sharma   commit code
940
941
942
943
        this.showLoader = true;
        http()
          .get("/getAnnoucementesList", {
            params: {
6f7cf8cf5   Amber Dev   added discussion ...
944
              classId: classId
11d037abe   Neeraj Sharma   commit code
945
946
947
948
949
950
951
952
953
954
            }
          })
          .then(response => {
            this.annoucementData = response.data.data;
            this.showLoader = false;
          })
          .catch(err => {
            console.log("err====>", err);
            this.showLoader = false;
          });
3311ad345   Neeraj Sharma   add event list in...
955
      },
610e873a0   Amber Dev   solved bug regard...
956
      async getMeetingEventes() {
3311ad345   Neeraj Sharma   add event list in...
957
958
        if (this.role == "TEACHER") {
          this.showLoader = true;
610e873a0   Amber Dev   solved bug regard...
959
          await http()
3311ad345   Neeraj Sharma   add event list in...
960
961
962
963
964
965
966
967
968
            .get("/getMeetingEventesList", {
              headers: {
                Authorization: "Bearer " + this.token
              }
            })
            .then(response => {
              var activityList = response.data.data;
              this.activityList = activityList;
              this.showLoader = false;
8b184d484   Amber Dev   added events to t...
969
970
971
972
973
974
975
976
977
978
979
  
              /* 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...
980
981
982
983
984
            })
            .catch(error => {
              this.showLoader = false;
            });
        }
8bb178441   Neeraj Sharma   implemnt api in s...
985
      }
fe15ee8b4   Amber Dev   added course chap...
986
    },
a26ba60ed   Amber Dev   Added event dialo...
987
988
989
990
  
    mounted() {
      //  = this.$store.state.schoolToken;
      // console.log("this.$store.state.role", this.token);
610e873a0   Amber Dev   solved bug regard...
991
992
993
994
      // this.getUsersList();
    },
  
    async created() {
a26ba60ed   Amber Dev   Added event dialo...
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
      if (this.$store.state.role === "ADMIN") {
        this.token = this.$store.state.token;
      } else if (this.$store.state.schoolRole === "SUPERADMIN") {
        this.token = this.$store.state.schoolToken;
      } 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;
      }
      this.role = this.$store.state.role;
      // console.log("role", this.$store.state.schoolRole,"tt",this.$store.state.schoolToken);
      // this.getData();
610e873a0   Amber Dev   solved bug regard...
1011
1012
1013
1014
1015
1016
1017
1018
1019
      await this.getStudents();
      await this.getTeachers();
      await this.getParents();
      await this.getClasses();
      await this.getNoticeData();
      await this.getUserData();
      await this.getFeesAndCollectionsData();
      await this.getExpensesData();
      await this.getparentStudents();
a26ba60ed   Amber Dev   Added event dialo...
1020

8b184d484   Amber Dev   added events to t...
1021
      /* get Latest events list for student login*/
ac24ec07a   Amber Dev   added live online
1022
      if (this.$store.state.role == "PARENT") {
3311ad345   Neeraj Sharma   add event list in...
1023
1024
1025
1026
        let response = await this.studentMeetingEvents({
          studentId: localStorage.getItem("parentStudentId")
        });
        this.activityList = response.data.data;
0a5256600   Amber Dev   added events
1027

3311ad345   Neeraj Sharma   add event list in...
1028
1029
1030
1031
1032
1033
1034
        /* 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...
1035
          obj._id = this.activityList[i].meetingEvent._id;
3311ad345   Neeraj Sharma   add event list in...
1036
1037
          this.activityEvents.push(obj);
        }
0a5256600   Amber Dev   added events
1038
      }
8b184d484   Amber Dev   added events to t...
1039

ac24ec07a   Amber Dev   added live online
1040
1041
1042
1043
      /* get Latest events list for teacher login*/
      if (this.role == "TEACHER") {
        await this.getMeetingEventes();
      }
8bb178441   Neeraj Sharma   implemnt api in s...
1044
1045
1046
    }
  };
  </script>
687e0b929   Neeraj Sharma   add user,attenden...
1047

68d742034   Neeraj Sharma   implement new des...
1048
  <style scoped>
a17c68a03   Neeraj Sharma   implement two rou...
1049
  @import "fullcalendar/dist/fullcalendar.css";
a17c68a03   Neeraj Sharma   implement two rou...
1050
  </style>