Blame view

src/pages/meetingEvent/meetingEvent.vue 24 KB
6ef520020   Neeraj Sharma   implement all fun...
1
2
3
  <template>
    <v-container fluid class="body-color">
      <!-- ****** EDITS  EVENT  ****** -->
db965de89   Amber Dev   added dialog pers...
4
      <v-dialog v-model="editEventdialog" max-width="500px" persistent>
6ef520020   Neeraj Sharma   implement all fun...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
        <v-card flat class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">Edit Meeting Event</label>
              <v-icon size="24" class="right" @click="editEventdialog = false">cancel</v-icon>
            </v-flex>
          </v-layout>
          <v-container fluid>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right">Title:</label>
                </v-flex>
                <v-flex xs7 class="ml-3">
                  <v-text-field v-model="editedItem.title" type="text"></v-text-field>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right">Date:</label>
                </v-flex>
                <v-flex xs7 class="ml-3">
                  <v-menu
                    ref="menu"
                    :close-on-content-click="false"
                    v-model="menuEditDate"
                    :nudge-right="40"
                    lazy
                    transition="scale-transition"
                    offset-y
                    full-width
                    min-width="290px"
                  >
                    <v-text-field
                      slot="activator"
                      v-model="editedItem.dateOfEvent"
                      placeholder="Select date"
                    ></v-text-field>
                    <v-date-picker
                      color="info"
                      ref="picker"
                      v-model="editedItem.dateOfEvent"
                      @input="$refs.menu.save(editedItem.dateOfEvent)"
                    ></v-date-picker>
                  </v-menu>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right">Start Time:</label>
                </v-flex>
                <v-flex xs7 class="ml-3">
                  <v-menu
                    ref="menuEdit"
                    :close-on-content-click="false"
                    v-model="menuEditTime"
                    :nudge-right="40"
                    :return-value.sync="editedItem.startTime"
                    lazy
                    transition="scale-transition"
                    offset-y
                    full-width
                    max-width="290px"
                    min-width="290px"
                  >
                    <v-text-field
                      slot="activator"
                      v-model="editedItem.startTime"
                      append-icon="access_time"
                      readonly
                    ></v-text-field>
                    <v-time-picker
                      v-model="editedItem.startTime"
3f8187137   Shikha Mishra   Added functionali...
82
                      format="24hr"
6ef520020   Neeraj Sharma   implement all fun...
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
                      @change="$refs.menuEdit.save(editedItem.startTime)"
                    ></v-time-picker>
                  </v-menu>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-flex xs12 sm12>
              <v-layout>
                <v-flex xs4 class="pt-4 subheading">
                  <label class="right">Duration:</label>
                </v-flex>
                <v-flex xs7 class="ml-3">
                  <v-text-field v-model="editedItem.duration" type="text"></v-text-field>
                </v-flex>
              </v-layout>
            </v-flex>
            <v-layout>
              <v-flex xs12>
                <v-card-actions class="hidden-xs-only hidden-sm-only">
                  <v-spacer></v-spacer>
                  <v-btn round dark @click="save" class="add-button">Save</v-btn>
                </v-card-actions>
                <v-card-actions class="hidden-md-only hidden-lg-only hidden-xl-only">
                  <v-spacer></v-spacer>
                  <v-btn round dark @click="save" class="add-button">Save</v-btn>
                  <v-spacer></v-spacer>
                </v-card-actions>
              </v-flex>
            </v-layout>
          </v-container>
        </v-card>
      </v-dialog>
      <!-- ****** PROFILE VIEW EVENT  ******  -->
db965de89   Amber Dev   added dialog pers...
116
      <v-dialog v-model="viewEventdialog" max-width="500px" persistent>
6ef520020   Neeraj Sharma   implement all fun...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
        <v-card flat class="card-style pa-3" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">View Meeting Event</label>
              <v-icon size="24" class="right" @click="viewEventdialog = false">cancel</v-icon>
            </v-flex>
          </v-layout>
          <v-card-text>
            <v-container grid-list-md>
              <v-layout wrap>
                <v-flex>
                  <v-layout>
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Title:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.title }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Date:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ dates(editedItem.dateOfEvent) }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Start Time:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.startTime }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Type Of Event:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.typeOfEvent }}</h5>
                    </v-flex>
                  </v-layout>
b0f5f6684   Shikha Mishra   Conditionally sho...
168
169
170
171
172
173
174
175
176
177
                  <v-layout v-if="editedItem.courseId">
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Course Name:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.courseId.courseName }}</h5>
                    </v-flex>
                  </v-layout>
6ef520020   Neeraj Sharma   implement all fun...
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
                  <v-layout v-if="editedItem.classId">
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Class:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.classId.classNum }}</h5>
                    </v-flex>
                  </v-layout>
                  <v-layout>
                    <v-flex xs4 sm6>
                      <h5 class="right my-1">
                        <b>Duration:</b>
                      </h5>
                    </v-flex>
                    <v-flex sm6 xs8>
                      <h5 class="my-1">{{ editedItem.duration }}</h5>
                    </v-flex>
                  </v-layout>
                </v-flex>
              </v-layout>
            </v-container>
          </v-card-text>
        </v-card>
      </v-dialog>
  
      <!-- ******  EVENT TABLE ****** -->
  
      <v-toolbar color="transparent" flat>
        <v-btn
          fab
          dark
          class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only"
          small
          @click="meetEventDialog = true"
        >
          <v-icon dark>add</v-icon>
        </v-btn>
        <v-btn
          round
          class="open-dialog-button hidden-sm-only hidden-xs-only"
          dark
          @click="meetEventDialog = true"
        >
          <v-icon class="white--text pr-1" size="20">add</v-icon>Add Event
        </v-btn>
        <v-spacer></v-spacer>
        <v-card-title class="body-1" v-show="show">
          <v-btn icon large flat @click="displaySearch">
            <v-avatar size="27">
              <img src="/static/icon/search.png" alt="icon" />
            </v-avatar>
          </v-btn>
        </v-card-title>
612b79bb4   Amber Dev   made serch auto f...
233
        <v-flex xs8 sm8 md3 lg2 v-if="showSearch">
6ef520020   Neeraj Sharma   implement all fun...
234
          <v-layout>
8e8d14254   Shikha Mishra   Cleared data whil...
235
236
237
238
239
240
241
            <v-text-field
              autofocus
              v-model="search"
              label="Search"
              prepend-inner-icon="search"
              color="primary"
            ></v-text-field>
6ef520020   Neeraj Sharma   implement all fun...
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
            <v-icon @click="closeSearch" color="error">close</v-icon>
          </v-layout>
        </v-flex>
      </v-toolbar>
      <v-data-table :headers="headers" :items="events" :pagination.sync="pagination" :search="search">
        <template slot="items" slot-scope="props">
          <tr class="tr">
            <td class="td td-row">{{ props.index + 1}}</td>
            <td
              class="td td-row text-xs-center"
            >{{ props.item.classId ? props.item.classId.classNum : "-" }}</td>
            <td class="td td-row text-xs-center">{{ props.item.title }}</td>
            <td class="td td-row text-xs-center">{{ dates(props.item.dateOfEvent) }}</td>
            <td class="td td-row text-xs-center">{{ props.item.startTime }}</td>
            <td class="td td-row text-xs-center">
              <span>
                <v-tooltip top>
                  <img
                    slot="activator"
                    style="cursor:pointer; width:25px; height:25px; "
                    class="mr-3"
                    @click="profile(props.item)"
                    src="/static/icon/view.png"
                  />
                  <span>View</span>
                </v-tooltip>
                <v-tooltip top>
                  <img
                    slot="activator"
                    style="cursor:pointer; width:20px; height:18px; "
                    class="mr-3"
                    @click="editItem(props.item)"
                    src="/static/icon/edit.png"
                  />
                  <span>Edit</span>
                </v-tooltip>
                <v-tooltip top>
                  <img
                    slot="activator"
                    style="cursor:pointer; width:20px; height:20px; "
                    class="mr-3"
                    @click="deleteItem(props.item)"
                    src="/static/icon/delete.png"
                  />
                  <span>Delete</span>
                </v-tooltip>
              </span>
            </td>
          </tr>
        </template>
        <v-alert
          slot="no-results"
          :value="true"
          color="error"
          icon="warning"
        >Your search for "{{ search }}" found no results.</v-alert>
      </v-data-table>
      <!-- ****** ADD MULTIPLE EVENT ****** -->
860da881d   Shikha Mishra   comment all consoles
300
      <v-dialog v-model="meetEventDialog" max-width="500px" persistent v-if="meetEventDialog">
6ef520020   Neeraj Sharma   implement all fun...
301
302
303
304
        <v-card flat class="card-style pa-2" dark>
          <v-layout>
            <v-flex xs12>
              <label class="title text-xs-center">Add Meeting Event</label>
8e8d14254   Shikha Mishra   Cleared data whil...
305
306
307
308
309
              <v-icon
                size="24"
                class="right"
                @click="meetEventDialog = false; $refs.form.reset()"
              >cancel</v-icon>
6ef520020   Neeraj Sharma   implement all fun...
310
311
            </v-flex>
          </v-layout>
8e8d14254   Shikha Mishra   Cleared data whil...
312
          <v-form ref="form" v-model="valid" lazy-validation>
6ef520020   Neeraj Sharma   implement all fun...
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
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
            <v-container fluid>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Title:</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-text-field
                      v-model="meetEvent.title"
                      placeholder="fill your Title"
                      type="text"
                      :rules="titleRules"
                      required
                    ></v-text-field>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Date:</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-menu
                      ref="menu1"
                      :close-on-content-click="false"
                      v-model="menu1"
                      :nudge-right="40"
                      :return-value.sync="meetEvent.dateOfEvent"
                      app
                      lazy
                      transition="scale-transition"
                      offset-y
                      full-width
                      min-width="290px"
                    >
                      <v-text-field
                        slot="activator"
                        :rules="dateRules"
                        v-model="meetEvent.dateOfEvent"
                        append-icon="event"
                        placeholder="Select date"
                      ></v-text-field>
                      <v-date-picker
                        color="info"
                        v-model="meetEvent.dateOfEvent"
                        @input="$refs.menu1.save(meetEvent.dateOfEvent)"
                      ></v-date-picker>
                    </v-menu>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Start Time:</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-menu
                      ref="menuA"
                      :close-on-content-click="false"
                      v-model="menu2"
                      :nudge-right="40"
                      :return-value.sync="meetEvent.startTime"
                      lazy
                      transition="scale-transition"
                      offset-y
                      full-width
                      max-width="290px"
                      min-width="290px"
                    >
                      <v-text-field
                        slot="activator"
                        v-model="meetEvent.startTime"
                        placeholder="Select Start time"
                        append-icon="access_time"
                        :rules="startTimeRules"
                        readonly
                      ></v-text-field>
                      <v-time-picker
                        v-model="meetEvent.startTime"
3f8187137   Shikha Mishra   Added functionali...
394
                        format="24hr"
6ef520020   Neeraj Sharma   implement all fun...
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
                        @change="$refs.menuA.save(meetEvent.startTime)"
                      ></v-time-picker>
                    </v-menu>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Type Of Event:</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-select
                      :items="typeOfEvent"
                      label="Select Type Of Event"
                      v-model="meetEvent.typeOfEvent"
                      :rules="typeOfEventRules"
6ef520020   Neeraj Sharma   implement all fun...
412
413
414
415
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
b0f5f6684   Shikha Mishra   Conditionally sho...
416
              <v-flex xs12 v-show="meetEvent.typeOfEvent">
6ef520020   Neeraj Sharma   implement all fun...
417
418
419
420
421
422
423
424
425
426
427
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Class:</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-select
                      :items="addclass"
                      label="Select Class"
                      v-model="meetEvent.classId"
                      item-text="classNum"
                      item-value="_id"
c47792a3b   Amber Dev   meetng event bug
428
                      @change="getCourses(meetEvent.classId)"
6ef520020   Neeraj Sharma   implement all fun...
429
430
431
432
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
b0f5f6684   Shikha Mishra   Conditionally sho...
433
              <v-flex xs12 v-show="meetEvent.typeOfEvent === 'Course'">
6ef520020   Neeraj Sharma   implement all fun...
434
435
436
437
438
439
440
441
442
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Courses:</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-select
                      :items="courseData"
                      label="Select Course"
                      v-model="meetEvent.courseId"
0a5256600   Amber Dev   added events
443
                      item-text="courseName"
6ef520020   Neeraj Sharma   implement all fun...
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
                      item-value="_id"
                      required
                    ></v-select>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-flex xs12>
                <v-layout>
                  <v-flex xs4 class="pt-4 subheading">
                    <label class="right">Duration</label>
                  </v-flex>
                  <v-flex xs8 sm8 class="ml-3">
                    <v-text-field
                      placeholder="fill your Description"
                      :rules="descriptionRules"
                      v-model="meetEvent.duration"
                      type="text"
                      required
                    ></v-text-field>
                  </v-flex>
                </v-layout>
              </v-flex>
              <v-layout>
                <v-flex xs12>
                  <v-layout class="right">
                    <v-btn @click="clear" round class="clear-button" dark>clear</v-btn>
                    <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn>
                  </v-layout>
                </v-flex>
              </v-layout>
            </v-container>
          </v-form>
        </v-card>
      </v-dialog>
      <v-snackbar
        :timeout="timeout"
        :top="y === 'top'"
        :right="x === 'right'"
        :vertical="mode === 'vertical'"
        v-model="snackbar"
        :color="color"
      >{{ text }}</v-snackbar>
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
    </v-container>
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import moment from "moment";
  
  export default {
    data: () => ({
      snackbar: false,
      y: "top",
      x: "right",
      mode: "",
      timeout: 5000,
      text: "",
      color: "",
      loading: false,
      date: null,
      search: "",
      color: "",
      show: true,
      meetEventDialog: false,
      showSearch: false,
      showLoader: false,
      editEventdialog: false,
      viewEventdialog: false,
      valid: true,
      addclass: [],
      courseData: [],
      pagination: {
8e8d14254   Shikha Mishra   Cleared data whil...
519
        rowsPerPage: 10,
6ef520020   Neeraj Sharma   implement all fun...
520
521
522
523
524
525
      },
      date: null,
      menu1: false,
      menu: false,
      menuEditTime: false,
      menuEditDate: false,
8e8d14254   Shikha Mishra   Cleared data whil...
526
527
528
529
530
      titleRules: [(v) => !!v || " Tilte is required"],
      descriptionRules: [(v) => !!v || " Discription is required"],
      dateRules: [(v) => !!v || "Date of event is required"],
      startTimeRules: [(v) => !!v || "Start Time is required"],
      typeOfEventRules: [(v) => !!v || "Type of event is required"],
6ef520020   Neeraj Sharma   implement all fun...
531
532
533
534
535
      headers: [
        {
          text: "No",
          align: "",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
536
          value: "No",
6ef520020   Neeraj Sharma   implement all fun...
537
538
539
540
541
        },
        {
          text: "Class",
          value: "classNum",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
542
          align: "center",
6ef520020   Neeraj Sharma   implement all fun...
543
544
545
546
547
548
        },
        { text: "Title", value: "title", sortable: false, align: "center" },
        {
          text: "Date Of Event",
          value: "dateOfEvent",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
549
          align: "center",
6ef520020   Neeraj Sharma   implement all fun...
550
551
552
553
554
        },
        {
          text: "Start Time",
          value: "startTime",
          sortable: false,
8e8d14254   Shikha Mishra   Cleared data whil...
555
          align: "center",
6ef520020   Neeraj Sharma   implement all fun...
556
        },
8e8d14254   Shikha Mishra   Cleared data whil...
557
        { text: "Action", value: "", sortable: false, align: "center" },
6ef520020   Neeraj Sharma   implement all fun...
558
559
560
561
562
      ],
      events: [],
      typeOfEvent: ["Class", "Course"],
      editedIndex: -1,
      meetEvent: {
8e8d14254   Shikha Mishra   Cleared data whil...
563
        startTime: null,
6ef520020   Neeraj Sharma   implement all fun...
564
565
566
567
      },
      editedItem: {},
      menu1: false,
      menu2: false,
8e8d14254   Shikha Mishra   Cleared data whil...
568
      loginId: "",
6ef520020   Neeraj Sharma   implement all fun...
569
    }),
8e8d14254   Shikha Mishra   Cleared data whil...
570
571
572
573
574
575
576
    watch: {
      meetEventDialog: function (val) {
        if (!val) {
          this.meetEvent = [];
        }
      },
    },
6ef520020   Neeraj Sharma   implement all fun...
577
    methods: {
8e8d14254   Shikha Mishra   Cleared data whil...
578
      dates: function (date) {
6ef520020   Neeraj Sharma   implement all fun...
579
580
581
582
583
584
585
586
        return moment(date).format("MMMM DD, YYYY");
      },
      getEvents() {
        this.showLoader = true;
        var token = this.$store.state.token;
        http()
          .get("/getMeetingEventesList", {
            params: { teacherId: this.loginId },
8e8d14254   Shikha Mishra   Cleared data whil...
587
            headers: { Authorization: "Bearer " + token },
6ef520020   Neeraj Sharma   implement all fun...
588
          })
8e8d14254   Shikha Mishra   Cleared data whil...
589
          .then((response) => {
6ef520020   Neeraj Sharma   implement all fun...
590
591
592
            this.events = response.data.data;
            this.showLoader = false;
          })
8e8d14254   Shikha Mishra   Cleared data whil...
593
          .catch((error) => {
6ef520020   Neeraj Sharma   implement all fun...
594
595
596
597
598
599
600
601
602
603
604
605
606
            // console.log("err====>", err);
            this.showLoader = false;
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
          });
      },
      editItem(item) {
        this.editedIndex = this.events.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.editedItem.meetingEventId = item._id;
8e8d14254   Shikha Mishra   Cleared data whil...
607
608
609
        this.editedItem.startTime = moment(this.editedItem.startTime, [
          "h:mm A",
        ]).format("HH:mm");
6ef520020   Neeraj Sharma   implement all fun...
610
611
612
613
614
615
616
617
618
619
        this.editEventdialog = true;
      },
      profile(item) {
        this.editedIndex = this.events.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.viewEventdialog = true;
      },
  
      deleteItem(item) {
        let deleteEvent = {
8e8d14254   Shikha Mishra   Cleared data whil...
620
          meetingEventId: item._id,
6ef520020   Neeraj Sharma   implement all fun...
621
622
623
624
625
        };
        http()
          .delete(
            "/deleteMeetingEvent",
            confirm("Are you sure you want to delete this?") && {
8e8d14254   Shikha Mishra   Cleared data whil...
626
              params: deleteEvent,
6ef520020   Neeraj Sharma   implement all fun...
627
628
            }
          )
8e8d14254   Shikha Mishra   Cleared data whil...
629
          .then((response) => {
6ef520020   Neeraj Sharma   implement all fun...
630
631
632
633
634
635
636
            this.snackbar = true;
            this.text = response.data.message;
            this.getEvents();
            this.snackbar = true;
            this.color = "green";
            this.text = response.data.message;
          })
8e8d14254   Shikha Mishra   Cleared data whil...
637
          .catch((error) => {
6ef520020   Neeraj Sharma   implement all fun...
638
639
640
641
642
643
            this.snackbar = true;
            this.text = error.response.data.message;
            this.color = "error";
            this.loading = false;
          });
      },
6ef520020   Neeraj Sharma   implement all fun...
644
645
646
      getAllClass() {
        http()
          .get("/getClassesList")
8e8d14254   Shikha Mishra   Cleared data whil...
647
          .then((response) => {
6ef520020   Neeraj Sharma   implement all fun...
648
649
            this.addclass = response.data.data;
          })
8e8d14254   Shikha Mishra   Cleared data whil...
650
          .catch((error) => {
6ef520020   Neeraj Sharma   implement all fun...
651
652
653
654
655
656
657
658
659
            // console.log("err====>", err);
            // this.$router.replace({ path: "/" });
          });
      },
      getCourses(classId) {
        this.showLoader = true;
        http()
          .get("/getCourseesList", {
            params: {
8e8d14254   Shikha Mishra   Cleared data whil...
660
661
              classId: classId,
            },
6ef520020   Neeraj Sharma   implement all fun...
662
          })
8e8d14254   Shikha Mishra   Cleared data whil...
663
          .then((response) => {
6ef520020   Neeraj Sharma   implement all fun...
664
665
666
            this.courseData = response.data.data;
            this.showLoader = false;
          })
8e8d14254   Shikha Mishra   Cleared data whil...
667
          .catch((err) => {
860da881d   Shikha Mishra   comment all consoles
668
            //   console.log("err====>", err);
6ef520020   Neeraj Sharma   implement all fun...
669
            this.showLoader = false;
860da881d   Shikha Mishra   comment all consoles
670
671
672
            this.snackbar = true;
            this.color = "error";
            this.text = error.response.data.message;
6ef520020   Neeraj Sharma   implement all fun...
673
674
675
676
677
678
679
680
          });
      },
      close() {
        this.editEventdialog = false;
      },
      submit() {
        if (this.$refs.form.validate()) {
          this.loading = true;
8e8d14254   Shikha Mishra   Cleared data whil...
681
682
683
684
          this.meetEvent.startTime = moment(
            this.meetEvent.startTime,
            "hh:mm"
          ).format("LT");
6ef520020   Neeraj Sharma   implement all fun...
685
686
          http()
            .post("/createMeetingEvent", this.meetEvent)
8e8d14254   Shikha Mishra   Cleared data whil...
687
            .then((response) => {
6ef520020   Neeraj Sharma   implement all fun...
688
689
690
691
692
693
694
695
              this.snackbar = true;
              this.text = response.data.message;
              this.color = "green";
              this.getEvents();
              this.clear();
              this.loading = false;
              this.meetEventDialog = false;
            })
8e8d14254   Shikha Mishra   Cleared data whil...
696
            .catch((error) => {
6ef520020   Neeraj Sharma   implement all fun...
697
698
699
700
701
702
703
704
705
706
707
              this.snackbar = true;
              this.text = error.response.data.message;
              this.color = "error";
              this.loading = false;
            });
        }
      },
      clear() {
        this.$refs.form.reset();
      },
      save() {
860da881d   Shikha Mishra   comment all consoles
708
        //   console.log("=======this.editedItem=====", this.editedItem);
b039d39fb   Shikha Mishra   Hide Edit functio...
709
710
711
        if (this.editedItem.courseId) {
          this.editedItem.courseId = this.editedItem.courseId._id;
        }
6ef520020   Neeraj Sharma   implement all fun...
712
        delete this.editedItem.classId;
8e8d14254   Shikha Mishra   Cleared data whil...
713
714
715
716
717
  
        this.editedItem.startTime = moment(
          this.editedItem.startTime,
          "hh:mm"
        ).format("LT");
6ef520020   Neeraj Sharma   implement all fun...
718
719
        http()
          .put("/updateMeetingEvent", this.editedItem)
8e8d14254   Shikha Mishra   Cleared data whil...
720
          .then((response) => {
6ef520020   Neeraj Sharma   implement all fun...
721
722
723
724
725
726
            this.snackbar = true;
            this.text = response.data.message;
            this.color = "green";
            this.getEvents();
            this.close();
          })
8e8d14254   Shikha Mishra   Cleared data whil...
727
          .catch((error) => {
6ef520020   Neeraj Sharma   implement all fun...
728
729
730
731
732
733
734
735
736
737
738
739
            this.snackbar = true;
            this.text = error.response.data.message;
            this.color = "error";
          });
      },
      displaySearch() {
        (this.show = false), (this.showSearch = true);
      },
      closeSearch() {
        this.showSearch = false;
        this.show = true;
        this.search = "";
8e8d14254   Shikha Mishra   Cleared data whil...
740
      },
6ef520020   Neeraj Sharma   implement all fun...
741
742
743
744
745
    },
    mounted() {
      this.loginId = this.$store.state.id;
      this.getEvents();
      this.getAllClass();
8e8d14254   Shikha Mishra   Cleared data whil...
746
    },
6ef520020   Neeraj Sharma   implement all fun...
747
748
  };
  </script>