Blame view

src/pages/Dashboard/dashboard.vue 31.4 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>
68d742034   Neeraj Sharma   implement new des...
70
71
72
73
74
75
76
77
78
79
80
      <v-layout wrap>
        <v-flex xs12>
          <v-layout wrap row>
            <!-- ***** Total Students ***** -->
            <v-flex xs12 sm12 md9>
              <v-container fluid grid-list-xl>
                <v-flex xs12 sm12 md12>
                  <v-layout wrap class>
                    <v-flex xs12 sm12 md3>
                      <router-link :to="{ name:'Students' }">
                        <v-card class="card pink-bgcolor">
37996f3ca   Neeraj Sharma   fixed dashboard card
81
                          <v-card-title primary-title class="titleCard white--text py-3">Students</v-card-title>
7d0816758   Shikha Mishra   show dashboard wh...
82
                          <img src="/static/icon/student.png" class="ml-2" width="40" alt="icons" />
68d742034   Neeraj Sharma   implement new des...
83
84
85
86
87
88
89
90
                          <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">
37996f3ca   Neeraj Sharma   fixed dashboard card
91
                          <v-card-title primary-title class="titleCard white--text py-3">Teachers</v-card-title>
7d0816758   Shikha Mishra   show dashboard wh...
92
                          <img src="/static/icon/teacher.png" class="ml-2" width="40" alt="icons" />
68d742034   Neeraj Sharma   implement new des...
93
94
95
96
97
98
99
100
101
  
                          <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">
37996f3ca   Neeraj Sharma   fixed dashboard card
102
                          <v-card-title primary-title class="titleCard white--text py-3">Parents</v-card-title>
7d0816758   Shikha Mishra   show dashboard wh...
103
                          <img src="/static/icon/parents.png" class="ml-3" width="40px" alt="icons" />
68d742034   Neeraj Sharma   implement new des...
104
105
106
107
108
109
110
111
                          <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">
37996f3ca   Neeraj Sharma   fixed dashboard card
112
                          <v-card-title primary-title class="titleCard white--text py-3">Class</v-card-title>
7d0816758   Shikha Mishra   show dashboard wh...
113
                          <img src="/static/icon/class.png" width="40" alt="icons" class="ml-2" />
68d742034   Neeraj Sharma   implement new des...
114
115
116
117
118
119
                          <v-card-title class="headline py-1 white--text">{{ classes.length }}</v-card-title>
                        </v-card>
                      </router-link>
                    </v-flex>
                  </v-layout>
                </v-flex>
11d037abe   Neeraj Sharma   commit code
120
121
122
123
124
                <p
                  v-if="studentsData.length === 0 && role == 'PARENT'"
                  class="text-center title grey lighten-4 error--text"
                >You have no student registered with scholl</p>
                <v-layout v-if="role != 'PARENT'">
68d742034   Neeraj Sharma   implement new des...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
                  <v-flex xs12>
                    <v-card class="card mt-2 account-Card">
                      <h4>
                        <b>Account</b>
                      </h4>
                      <v-layout wrap>
                        <v-flex xs12 sm12 md3>
                          <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>
01b56330e   Shikha Mishra   add api of fee an...
142
                                  <v-list-tile-title>Rs. {{ feeData.totalFees }}</v-list-tile-title>
68d742034   Neeraj Sharma   implement new des...
143
144
145
146
147
148
149
150
151
152
                                </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>
01b56330e   Shikha Mishra   add api of fee an...
153
                                  <v-list-tile-title>Rs. {{ feeData.totalCollection }}</v-list-tile-title>
68d742034   Neeraj Sharma   implement new des...
154
155
156
157
158
159
160
161
162
163
                                </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>
65d5475b6   Shikha Mishra   changes in api an...
164
                                  <v-list-tile-title>Rs. {{ expenseData.sum }}</v-list-tile-title>
68d742034   Neeraj Sharma   implement new des...
165
166
167
168
169
                                </v-list-tile-content>
                              </v-list-tile>
                            </template>
                          </v-list>
                        </v-flex>
68d600c97   Shikha Mishra   improve dashboard...
170
                        <v-flex xs12 sm12 md9 lg9>
558365e7b   Shikha Mishra   graph change in d...
171
                          <div id="chart">
acb6c9e2b   Shikha Mishra   issues solved rel...
172
173
174
175
176
177
178
179
180
181
                            <div v-if="this.series">
                              <apexchart
                                type="bar"
                                height="250"
                                style="max-width: 800px !important"
                                :options="chartOptions"
                                :series="series"
                                v-show="true"
                              ></apexchart>
                            </div>
558365e7b   Shikha Mishra   graph change in d...
182
                          </div>
68d742034   Neeraj Sharma   implement new des...
183
184
185
186
187
                        </v-flex>
                      </v-layout>
                    </v-card>
                  </v-flex>
                </v-layout>
11d037abe   Neeraj Sharma   commit code
188
                <v-card class="mt-2 card" v-if="role != 'PARENT'">
68d742034   Neeraj Sharma   implement new des...
189
190
191
192
193
194
195
196
197
198
                  <!-- <full-calendar
                    ref="calendar"
                    defaultView="month"
                    droppable="false"
                    :events="events"
                    :config="config"
                  ></full-calendar>-->
                  <h4 class="pa-3">
                    <b>Notice</b>
                  </h4>
01d009dde   Neeraj Sharma   fixed Show Notice...
199

68d742034   Neeraj Sharma   implement new des...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
                  <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"
aa310d61a   Shikha Mishra   added functionali...
230
                                src="/static/icon/view.png"
68d742034   Neeraj Sharma   implement new des...
231
232
233
234
235
236
237
238
239
                              />
                              <span>View</span>
                            </v-tooltip>
                          </span>
                        </td>
                      </tr>
                    </template>
                  </v-data-table>
                </v-card>
11d037abe   Neeraj Sharma   commit code
240
241
242
243
244
245
246
247
248
249
250
251
252
                <!-- 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>
fe15ee8b4   Amber Dev   added course chap...
253
254
255
256
                                  <v-icon
                                    class="account-circle darkBlue-color"
                                    style="cursor: pointer;"
                                  >panorama_fish_eye</v-icon>
11d037abe   Neeraj Sharma   commit code
257
258
                                </v-list-tile-avatar>
                                <v-list-tile-content>
fe15ee8b4   Amber Dev   added course chap...
259
260
                                  <v-list-tile-title
                                    style="cursor: pointer;"
6f7cf8cf5   Amber Dev   added discussion ...
261
                                    @click="routeToCourseDetails(course._id)"
fe15ee8b4   Amber Dev   added course chap...
262
                                  >{{ course.coursrName }}</v-list-tile-title>
11d037abe   Neeraj Sharma   commit code
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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
                                </v-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">
                      <h4 class="pa-3">
                        <b>Latest Annoucements</b>
                      </h4>
  
                      <v-data-table
                        :items="annoucementData"
                        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.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-card>
                  </v-flex>
                  <v-flex xs6>
                    <v-card class="mt-2 card">
                      <h4 class="pa-3">
                        <b>Online User</b>
                      </h4>
  
                      <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>
68d742034   Neeraj Sharma   implement new des...
360
361
362
363
364
365
366
367
368
              </v-container>
            </v-flex>
            <v-flex xs12 sm12 md3>
              <v-card height="100%" class="elevation-0 mt-3 profileDasboard">
                <v-card-text>
                  <h4 class="text-xs-center py-3">
                    <b>Profile</b>
                  </h4>
                  <v-flex xs12 class="py-3">
67a276510   Shikha Mishra   fixed all bugs
369
                    <v-layout wrap>
68d742034   Neeraj Sharma   implement new des...
370
371
                      <v-flex xs12 sm12 md4>
                        <img src="/static/icon/user.png" v-if="!userData.schoolLogoUrl" width="80" />
01d009dde   Neeraj Sharma   fixed Show Notice...
372
                        <img
68d742034   Neeraj Sharma   implement new des...
373
374
375
                          :src="userData.schoolLogoUrl"
                          v-else-if="userData.schoolLogoUrl"
                          width="80"
01d009dde   Neeraj Sharma   fixed Show Notice...
376
                        />
68d742034   Neeraj Sharma   implement new des...
377
378
379
380
381
382
383
384
385
386
387
388
                      </v-flex>
                      <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>
                      </v-flex>
                    </v-layout>
                  </v-flex>
                  <hr />
fe15ee8b4   Amber Dev   added course chap...
389
                  <div class="text-xs-center py-3 subheading font-weight-bold">Calender</div>
68d742034   Neeraj Sharma   implement new des...
390
                  <vue-event-calendar :events="demoEvents"></vue-event-calendar>
fe15ee8b4   Amber Dev   added course chap...
391
392
393
394
395
396
397
398
399
400
401
                  <!-- LATEST ACTIVITY -->
                  <v-card class="my-3 elevation-0">
                    <v-card-text>
                      <div class="text-xs-center subheading font-weight-bold">Latest Activity</div>
                      <div>
                        <span
                          style="background-color:yellow ;height: 12px;width: 12px;border-radius: 50%;display: inline-block;"
                        ></span>
                      </div>
                    </v-card-text>
                  </v-card>
68d742034   Neeraj Sharma   implement new des...
402
403
404
405
406
407
                </v-card-text>
              </v-card>
            </v-flex>
          </v-layout>
        </v-flex>
      </v-layout>
a17c68a03   Neeraj Sharma   implement two rou...
408
409
410
      <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...
411
412
413
414
415
416
417
418
419
            <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...
420
421
              </v-list-tile-action>
              <v-list-tile-content>
a17c68a03   Neeraj Sharma   implement two rou...
422
                <v-list-tile-title>{{ selected.title }}</v-list-tile-title>
8bb178441   Neeraj Sharma   implemnt api in s...
423
424
              </v-list-tile-content>
            </v-list-tile>
a17c68a03   Neeraj Sharma   implement two rou...
425
426
427
428
429
430
            <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...
431
432
433
434
435
              </v-list-tile-content>
            </v-list-tile>
          </v-flex>
        </v-card>
      </v-dialog>
8bb178441   Neeraj Sharma   implemnt api in s...
436
437
438
439
440
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
a17c68a03   Neeraj Sharma   implement two rou...
441
  import moment from "moment";
6f7cf8cf5   Amber Dev   added discussion ...
442
  import AllApiCalls from "@/Services/AllApiCalls.js";
68d742034   Neeraj Sharma   implement new des...
443
  // import { FunctionalCalendar } from "vue-functional-calendar";
8bb178441   Neeraj Sharma   implemnt api in s...
444
445
  
  export default {
68d742034   Neeraj Sharma   implement new des...
446
447
448
    components: {
      // FunctionalCalendar
    },
6f7cf8cf5   Amber Dev   added discussion ...
449
    mixins: [AllApiCalls],
a17c68a03   Neeraj Sharma   implement two rou...
450
451
    data() {
      return {
68d742034   Neeraj Sharma   implement new des...
452
453
454
455
456
457
        // data: {
        //   clieckedToday: false
        // },
        // markedDates: ["16/4/2019", "18/4/2019", "20/4/2019", "21/4/2019"],
        // calendarData: {},
        // calendar: {},
6f7cf8cf5   Amber Dev   added discussion ...
458

fe15ee8b4   Amber Dev   added course chap...
459
        colorsArray: ["#ff8a89", "#71d9ea", "#7852cc", "#F9A825"],
68d742034   Neeraj Sharma   implement new des...
460
461
462
463
464
465
466
467
468
469
470
471
        demoEvents: [
          {
            date: "2020/01/10", // Required
            title: "Foo" // Required
          },
          {
            date: "2020/01/12",
            title: "Bar",
            desc: "description",
            customClass: "disabled highlight" // Custom classes to an calendar cell
          }
        ],
11d037abe   Neeraj Sharma   commit code
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
        onlineUser: [
          {
            user: "Student Demo"
          },
          {
            user: "Teacher Demo"
          },
          {
            user: "Priyansh Gupta"
          },
          {
            user: "Gaurav Aggarwal"
          },
          {
            user: "Approve Arorra"
          }
        ],
a17c68a03   Neeraj Sharma   implement two rou...
489
        showLoader: false,
68d742034   Neeraj Sharma   implement new des...
490
        calendarData: {},
a17c68a03   Neeraj Sharma   implement two rou...
491
        dialog: false,
01d009dde   Neeraj Sharma   fixed Show Notice...
492
        dialogNotice: false,
b28a5f17d   Neeraj Sharma   fixed events and ...
493
494
        HolidaysList: [],
        EventsList: [],
ceb43037a   Neeraj Sharma   fix bugs
495
        events: [],
a17c68a03   Neeraj Sharma   implement two rou...
496
497
498
499
        config: {
          eventClick: event => {
            this.selected = event;
            this.dialog = true;
8bb178441   Neeraj Sharma   implemnt api in s...
500
501
          }
        },
6c05a9f84   Neeraj Sharma   add functionalit ...
502
        selected: {},
01b56330e   Shikha Mishra   add api of fee an...
503
        barGraph: [],
68d742034   Neeraj Sharma   implement new des...
504
        // notice: {},
01d009dde   Neeraj Sharma   fixed Show Notice...
505
        userData: {},
68d742034   Neeraj Sharma   implement new des...
506
507
508
        dated: new Date(2018, 0, 9),
        userList: [],
        sectionList: [],
6c05a9f84   Neeraj Sharma   add functionalit ...
509
510
511
        students: "",
        parents: "",
        teachers: "",
01d009dde   Neeraj Sharma   fixed Show Notice...
512
        classes: "",
68d742034   Neeraj Sharma   implement new des...
513
        noticeData: [],
65d5475b6   Shikha Mishra   changes in api an...
514
        expenseData: [],
01b56330e   Shikha Mishra   add api of fee an...
515
516
        feeData: [],
        collectionData: [],
11d037abe   Neeraj Sharma   commit code
517
518
519
520
        courseData: [],
        studentsData: [],
        annoucementData: [],
        role: "",
68d742034   Neeraj Sharma   implement new des...
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
        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...
538
            data: []
68d742034   Neeraj Sharma   implement new des...
539
540
541
542
543
544
          }
        ],
        chartOptions: {
          chart: {
            type: "bar",
            height: 150,
68d600c97   Shikha Mishra   improve dashboard...
545
546
547
548
549
550
551
552
553
554
555
556
557
558
            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...
559
560
561
562
563
564
565
566
567
          },
          plotOptions: {
            bar: {
              horizontal: false,
              columnWidth: "25%",
              // endingShape: "rounded",
              distributed: true
            }
          },
68d600c97   Shikha Mishra   improve dashboard...
568
569
570
571
572
573
574
575
576
577
578
579
          responsive: [
            {
              breakpoint: 480,
              options: {
                legend: {
                  position: "bottom",
                  offsetX: -10,
                  offsetY: 0
                }
              }
            }
          ],
68d742034   Neeraj Sharma   implement new des...
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
          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 + " ";
              }
            }
          }
        }
a17c68a03   Neeraj Sharma   implement two rou...
612
613
      };
    },
6c05a9f84   Neeraj Sharma   add functionalit ...
614
    mounted() {
8deade193   Shikha Mishra   token issue solved
615
616
617
618
619
620
      //  = this.$store.state.schoolToken;
      // console.log("this.$store.state.role", this.token);
      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;
710438de6   Shikha Mishra   added teacher mod...
621
622
      } else if (this.$store.state.role === "TEACHER") {
        this.token = this.$store.state.token;
acb6c9e2b   Shikha Mishra   issues solved rel...
623
624
625
626
      } 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;
11d037abe   Neeraj Sharma   commit code
627
628
      } else if (this.$store.state.role === "PARENT") {
        this.token = this.$store.state.token;
8deade193   Shikha Mishra   token issue solved
629
      }
11d037abe   Neeraj Sharma   commit code
630
      this.role = this.$store.state.role;
8deade193   Shikha Mishra   token issue solved
631
      // console.log("role", this.$store.state.schoolRole,"tt",this.$store.state.schoolToken);
68d742034   Neeraj Sharma   implement new des...
632
      // this.getData();
6c05a9f84   Neeraj Sharma   add functionalit ...
633
634
635
636
      this.getStudents();
      this.getTeachers();
      this.getParents();
      this.getClasses();
01d009dde   Neeraj Sharma   fixed Show Notice...
637
638
      this.getNoticeData();
      this.getUserData();
01b56330e   Shikha Mishra   add api of fee an...
639
      this.getFeesAndCollectionsData();
65d5475b6   Shikha Mishra   changes in api an...
640
      this.getExpensesData();
11d037abe   Neeraj Sharma   commit code
641
      this.getparentStudents();
68d742034   Neeraj Sharma   implement new des...
642
      // this.getUsersList();
6c05a9f84   Neeraj Sharma   add functionalit ...
643
    },
8bb178441   Neeraj Sharma   implemnt api in s...
644
    methods: {
6f7cf8cf5   Amber Dev   added discussion ...
645
646
647
648
649
650
651
652
653
654
655
656
657
658
      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");
        }
      },
fe15ee8b4   Amber Dev   added course chap...
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
      studentMeetingEvents() {
        http()
          .get("/studentMeetingEvents", {
            params: {
              studentId: localStorage.getItem("parentStudentId")
            }
          })
          .then(response => {
            console.log("response of studentMeetingEvents - ", response);
            this.showLoader = false;
          })
          .catch(err => {
            console.log("err====>", err);
            this.showLoader = false;
          });
      },
01d009dde   Neeraj Sharma   fixed Show Notice...
675
676
677
      closeNotice() {
        this.dialogNotice = false;
      },
68d742034   Neeraj Sharma   implement new des...
678
      profile() {
01d009dde   Neeraj Sharma   fixed Show Notice...
679
        // this.editedIndex = this.desserts.indexOf(item);
68d742034   Neeraj Sharma   implement new des...
680
681
682
        // this.notice = Object.assign({}, item);
        // this.dialogNotice = true;
        this.$router.push({ name: "NoticeBoard" });
01d009dde   Neeraj Sharma   fixed Show Notice...
683
      },
a17c68a03   Neeraj Sharma   implement two rou...
684
      date: function(date) {
68d742034   Neeraj Sharma   implement new des...
685
        return moment(date).format("MMMM DD, YYYY  HH:mm");
8bb178441   Neeraj Sharma   implemnt api in s...
686
      },
a17c68a03   Neeraj Sharma   implement two rou...
687
688
689
690
691
692
693
694
695
      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...
696
        console.log("this.selected", this.selected);
a17c68a03   Neeraj Sharma   implement two rou...
697
      },
687e0b929   Neeraj Sharma   add user,attenden...
698
699
700
      // eventDropStart: function(event) {
      //   event.editable = false;
      // },
a17c68a03   Neeraj Sharma   implement two rou...
701
702
      eventCreated(...test) {
        console.log(test);
8bb178441   Neeraj Sharma   implemnt api in s...
703
      },
6c05a9f84   Neeraj Sharma   add functionalit ...
704
705
      getStudents() {
        http()
7d0816758   Shikha Mishra   show dashboard wh...
706
          .get("/getStudentsList", {
8deade193   Shikha Mishra   token issue solved
707
708
709
            headers: {
              Authorization: "Bearer " + this.token
            }
7d0816758   Shikha Mishra   show dashboard wh...
710
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
711
712
713
714
          .then(response => {
            this.students = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
715
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
716
717
            // console.log("err====>", err);
            this.showLoader = false;
229463bd5   Neeraj Sharma   implement design ...
718
719
720
721
722
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
6c05a9f84   Neeraj Sharma   add functionalit ...
723
724
725
726
          });
      },
      getParents() {
        http()
25205ccca   Shikha Mishra   show school logo ...
727
          .get("/getParentsList", {
8deade193   Shikha Mishra   token issue solved
728
729
730
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
731
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
732
733
734
735
          .then(response => {
            this.parents = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
736
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
737
738
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
739
740
741
742
          });
      },
      getTeachers() {
        http()
7d0816758   Shikha Mishra   show dashboard wh...
743
          .get("/getTeachersList", {
8deade193   Shikha Mishra   token issue solved
744
745
746
            headers: {
              Authorization: "Bearer " + this.token
            }
7d0816758   Shikha Mishra   show dashboard wh...
747
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
748
749
750
751
          .then(response => {
            this.teachers = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
752
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
753
754
            // console.log("err====>", err);
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
755
756
757
758
          });
      },
      getClasses() {
        http()
25205ccca   Shikha Mishra   show school logo ...
759
          .get("/getClassesList", {
8deade193   Shikha Mishra   token issue solved
760
761
762
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
763
          })
6c05a9f84   Neeraj Sharma   add functionalit ...
764
765
766
767
          .then(response => {
            this.classes = response.data.data;
            this.showLoader = false;
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
768
          .catch(error => {
6c05a9f84   Neeraj Sharma   add functionalit ...
769
            this.showLoader = false;
6c05a9f84   Neeraj Sharma   add functionalit ...
770
          });
01d009dde   Neeraj Sharma   fixed Show Notice...
771
772
773
774
      },
      getNoticeData() {
        this.showLoader = true;
        http()
25205ccca   Shikha Mishra   show school logo ...
775
          .get("/getEventsList", {
8deade193   Shikha Mishra   token issue solved
776
777
778
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
779
          })
01d009dde   Neeraj Sharma   fixed Show Notice...
780
781
782
783
784
785
          .then(response => {
            this.noticeData = response.data.data;
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
01d009dde   Neeraj Sharma   fixed Show Notice...
786
787
788
          });
      },
      getUserData() {
68d742034   Neeraj Sharma   implement new des...
789
        // this.showLoader = true;
01d009dde   Neeraj Sharma   fixed Show Notice...
790
        http()
25205ccca   Shikha Mishra   show school logo ...
791
          .get("/getParticularUserDetail", {
8deade193   Shikha Mishra   token issue solved
792
793
794
            headers: {
              Authorization: "Bearer " + this.token
            }
25205ccca   Shikha Mishra   show school logo ...
795
          })
01d009dde   Neeraj Sharma   fixed Show Notice...
796
797
798
799
800
801
          .then(response => {
            this.userData = response.data.data;
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
01d009dde   Neeraj Sharma   fixed Show Notice...
802
          });
65d5475b6   Shikha Mishra   changes in api an...
803
      },
01b56330e   Shikha Mishra   add api of fee an...
804
805
806
807
808
809
810
811
812
813
814
815
816
  
      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
817
            // console.log("this.series====", this.series);
01b56330e   Shikha Mishra   add api of fee an...
818
819
820
821
822
823
824
  
            this.showLoader = false;
          })
          .catch(error => {
            this.showLoader = false;
          });
      },
65d5475b6   Shikha Mishra   changes in api an...
825
826
      getExpensesData() {
        http()
01b56330e   Shikha Mishra   add api of fee an...
827
828
829
830
831
832
833
834
835
          .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...
836
837
838
839
840
841
842
843
844
845
846
847
            // 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
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
      },
      getparentStudents() {
        this.showLoader = true;
        http()
          .get("/parentStudentsList")
          .then(response => {
            // console.log("resssssss", response.data.data.students[0].classId);
            this.studentsData = response.data.data;
            // localStorage.setItem(
            //   "parentStudentId",
            //   this.studentsData.students[0]._id
            // );
            // localStorage.setItem(
            //   "parentClassId",
            //   this.studentsData.students[0].classId
            // );
fe15ee8b4   Amber Dev   added course chap...
864

11d037abe   Neeraj Sharma   commit code
865
866
            if (localStorage.getItem("parentStudentId") == null) {
              var parentStudentsId = response.data.data.students[0].classId;
6f7cf8cf5   Amber Dev   added discussion ...
867
              var classId = response.data.data.students[0]._id;
11d037abe   Neeraj Sharma   commit code
868
869
870
            }
            if (localStorage.getItem("parentStudentId")) {
              var parentStudentsId = localStorage.getItem("parentStudentId");
6f7cf8cf5   Amber Dev   added discussion ...
871
              var classId = localStorage.getItem("parentClassId");
11d037abe   Neeraj Sharma   commit code
872
            }
6f7cf8cf5   Amber Dev   added discussion ...
873
874
            this.getCourses(parentStudentsId, classId);
            this.getAnnoucementes(classId);
11d037abe   Neeraj Sharma   commit code
875
876
877
878
879
880
881
            this.showLoader = false;
          })
          .catch(err => {
            console.log("err====>", err);
            this.showLoader = false;
          });
      },
6f7cf8cf5   Amber Dev   added discussion ...
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
      async getCourses(parentStudentsId, classId) {
        /* getStudentCourses - to get courseData - defined in GetApis.js*/
        await this.getStudentCourses({
          classId: classId,
          studentId: parentStudentsId
        });
        // this.showLoader = true;
        // http()
        //   .get("/getStudentCourses", {
        //     params: {
        //       classId: classId,
        //       studentId: parentStudentsId
        //     }
        //   })
        //   .then(response => {
        //     this.courseData = response.data.data;
        //     console.log("course data - ",this.courseData)
        //     this.showLoader = false;
        //   })
        //   .catch(err => {
        //     console.log("err====>", err);
        //     this.showLoader = false;
        //   });
11d037abe   Neeraj Sharma   commit code
905
      },
6f7cf8cf5   Amber Dev   added discussion ...
906
      getAnnoucementes(classId) {
11d037abe   Neeraj Sharma   commit code
907
908
909
910
        this.showLoader = true;
        http()
          .get("/getAnnoucementesList", {
            params: {
6f7cf8cf5   Amber Dev   added discussion ...
911
              classId: classId
11d037abe   Neeraj Sharma   commit code
912
913
914
915
916
917
918
919
920
921
            }
          })
          .then(response => {
            this.annoucementData = response.data.data;
            this.showLoader = false;
          })
          .catch(err => {
            console.log("err====>", err);
            this.showLoader = false;
          });
8bb178441   Neeraj Sharma   implemnt api in s...
922
      }
fe15ee8b4   Amber Dev   added course chap...
923
924
925
926
    },
    created() {
      /* get Latest events list */
      this.studentMeetingEvents();
8bb178441   Neeraj Sharma   implemnt api in s...
927
928
929
    }
  };
  </script>
687e0b929   Neeraj Sharma   add user,attenden...
930

68d742034   Neeraj Sharma   implement new des...
931
  <style scoped>
a17c68a03   Neeraj Sharma   implement two rou...
932
  @import "fullcalendar/dist/fullcalendar.css";
a17c68a03   Neeraj Sharma   implement two rou...
933
  </style>