Blame view

src/pages/NoticeBoard/noticeBoard.vue 19 KB
beb598536   Neeraj Sharma   design and functi...
1
2
  <template>
    <v-app id="pages-dasboard">
687e0b929   Neeraj Sharma   add user,attenden...
3
      <v-tabs grow slider-color="gray">
beb598536   Neeraj Sharma   design and functi...
4
5
6
7
8
9
        <v-tab
          ripple
          @click="activeTab('existing')"
          v-bind:class="{ active: isActive }"
          id="tab"
          class="subheading"
46db0a3b5   Neeraj Sharma   add sunbject and ...
10
        >Existing Notice Board</v-tab>
beb598536   Neeraj Sharma   design and functi...
11
12
13
14
15
16
17
        <v-tab
          ripple
          @click="activeTab('new')"
          v-bind:class="{ active: newActive }"
          id="tab1"
          User
          class="subheading"
46db0a3b5   Neeraj Sharma   add sunbject and ...
18
        >Add New Notice Board</v-tab>
beb598536   Neeraj Sharma   design and functi...
19

f4df757fe   Neeraj Sharma   responsive vie in...
20
        <!-- ****** Edit  Notice Board ****** -->
beb598536   Neeraj Sharma   design and functi...
21
22
23
24
25
26
27
28
29
30
  
        <v-tab-item>
          <v-snackbar
            :timeout="timeout"
            :top="y === 'top'"
            :right="x === 'right'"
            :vertical="mode === 'vertical'"
            v-model="snackbar"
            color="success"
          >{{ text }}</v-snackbar>
98ed84410   Neeraj Sharma   fixed design of d...
31
          <v-dialog v-model="dialog" max-width="940px" scrollable>
f4df757fe   Neeraj Sharma   responsive vie in...
32
            <v-card>
756b14fe2   Neeraj Sharma   uploadi image by ...
33
              <v-toolbar color="grey lighten-2" flat>
beb598536   Neeraj Sharma   design and functi...
34
                <v-spacer></v-spacer>
46db0a3b5   Neeraj Sharma   add sunbject and ...
35
                <v-toolbar-title>
756b14fe2   Neeraj Sharma   uploadi image by ...
36
                  <h3>Edit Notice Board</h3>
46db0a3b5   Neeraj Sharma   add sunbject and ...
37
                </v-toolbar-title>
beb598536   Neeraj Sharma   design and functi...
38
39
                <v-spacer></v-spacer>
              </v-toolbar>
756b14fe2   Neeraj Sharma   uploadi image by ...
40
              <v-card-text>
f4df757fe   Neeraj Sharma   responsive vie in...
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
                <v-layout>
                  <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center">
                    <img
                      src="/static/icon/user.png"
                      v-if="!editedItem.eventImageUrl && !imageUrl"
                      width="150px"
                    />
                    <img
                      :src="editedItem.eventImageUrl"
                      height="150"
                      v-else-if="editedItem.eventImageUrl && !imageUrl"
                      width="180px"
                    />
                    <img
                      v-if="imageUrl"
                      :src="imageUrl"
                      height="150"
                      style="border-radius:50%; width:200px"
                    />
                    <input
                      type="file"
                      style="display: none"
                      ref="image"
                      accept="image/*"
                      @change="onFilePicked"
                    />
                  </v-flex>
                </v-layout>
                <v-layout wrap>
                  <v-flex xs12>
beb598536   Neeraj Sharma   design and functi...
71
                    <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
72
73
74
75
76
77
78
79
80
81
82
                      <v-flex xs4 class="pt-4 subheading">
                        <label class="right">Title:</label>
                      </v-flex>
                      <v-flex xs6 class="ml-3">
                        <v-text-field
                          v-model="editedItem.title"
                          placeholder="fill your Title"
                          name="name"
                          type="text"
                          required
                        ></v-text-field>
beb598536   Neeraj Sharma   design and functi...
83
84
                      </v-flex>
                    </v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
85
86
                  </v-flex>
                  <v-flex xs12>
beb598536   Neeraj Sharma   design and functi...
87
                    <v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
88
89
                      <v-flex xs4 class="pt-4 subheading">
                        <label class="right">Description:</label>
756b14fe2   Neeraj Sharma   uploadi image by ...
90
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
91
92
93
94
95
96
97
98
                      <v-flex xs6 class="ml-3">
                        <v-text-field
                          placeholder="fill your Description"
                          v-model="editedItem.description"
                          type="text"
                          name="email"
                          required
                        ></v-text-field>
756b14fe2   Neeraj Sharma   uploadi image by ...
99
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
100
101
102
103
104
105
106
                    </v-layout>
                  </v-flex>
                  <v-flex xs12>
                    <v-layout>
                      <v-flex xs4 class="pt-4 subheading">
                        <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label>
                        <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod :</label>
756b14fe2   Neeraj Sharma   uploadi image by ...
107
                      </v-flex>
f4df757fe   Neeraj Sharma   responsive vie in...
108
109
110
111
112
113
114
                      <v-flex xs6 class="ml-3">
                        <v-text-field
                          label="Select Image"
                          @click="pickFile"
                          v-model="imageName"
                          append-icon="attach_file"
                        ></v-text-field>
beb598536   Neeraj Sharma   design and functi...
115
116
                      </v-flex>
                    </v-layout>
f4df757fe   Neeraj Sharma   responsive vie in...
117
118
119
120
121
122
123
124
125
                  </v-flex>
                  <v-flex xs12 sm9 offset-sm2>
                    <v-card-actions>
                      <v-btn round dark @click.native="close">Cancel</v-btn>
                      <v-spacer></v-spacer>
                      <v-btn round dark @click="save">Save</v-btn>
                    </v-card-actions>
                  </v-flex>
                </v-layout>
756b14fe2   Neeraj Sharma   uploadi image by ...
126
127
              </v-card-text>
            </v-card>
beb598536   Neeraj Sharma   design and functi...
128
          </v-dialog>
46db0a3b5   Neeraj Sharma   add sunbject and ...
129
          <!-- ****** VIEW PROFIL NOTICE BOARD ******  -->
beb598536   Neeraj Sharma   design and functi...
130

0721aca93   Neeraj Sharma   solve bugs in sub...
131
          <v-dialog v-model="dialog1" max-width="940px" scrollable>
f4df757fe   Neeraj Sharma   responsive vie in...
132
            <v-card>
2d0fc1144   Neeraj Sharma   upload dynamic im...
133
134
135
136
137
138
139
140
              <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="close1">close</v-icon>
              </v-toolbar>
beb598536   Neeraj Sharma   design and functi...
141
              <v-card-text>
f4df757fe   Neeraj Sharma   responsive vie in...
142
143
144
145
146
147
148
149
150
151
152
                <v-layout>
                  <v-flex align-center justify-center layout text-xs-center class="mt-2">
                    <img src="/static/icon/user.png" v-if="!editedItem.eventImageUrl" width="130px" />
                    <img
                      :src="editedItem.eventImageUrl"
                      v-else-if="editedItem.eventImageUrl"
                      class="img"
                      width="200"
                    />
                  </v-flex>
                </v-layout>
beb598536   Neeraj Sharma   design and functi...
153
154
155
                <v-container grid-list-md>
                  <v-layout wrap>
                    <v-flex>
beb598536   Neeraj Sharma   design and functi...
156
157
                      <v-layout>
                        <v-flex xs5 sm6>
f4df757fe   Neeraj Sharma   responsive vie in...
158
159
160
                          <h5 class="right my-1">
                            <b>Title:</b>
                          </h5>
beb598536   Neeraj Sharma   design and functi...
161
162
163
164
165
166
167
                        </v-flex>
                        <v-flex sm6 xs8>
                          <h5 class="my-1">{{ editedItem.title }}</h5>
                        </v-flex>
                      </v-layout>
                      <v-layout>
                        <v-flex xs5 sm6>
f4df757fe   Neeraj Sharma   responsive vie in...
168
169
170
                          <h5 class="right my-1">
                            <b>Description:</b>
                          </h5>
beb598536   Neeraj Sharma   design and functi...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
                        </v-flex>
                        <v-flex sm6 xs8>
                          <h5 class="my-1">{{ editedItem.description }}</h5>
                        </v-flex>
                      </v-layout>
                    </v-flex>
                  </v-layout>
                </v-container>
              </v-card-text>
            </v-card>
          </v-dialog>
  
          <v-snackbar
            :timeout="timeout"
            :top="y === 'top'"
            :right="x === 'right'"
            :vertical="mode === 'vertical'"
            v-model="snackbar"
            color="success"
          >{{ text }}</v-snackbar>
80012c476   Neeraj Sharma   fixed design of d...
191
          <!-- ****** EXISTING Notice Board TABLE ****** -->
2b0e316ee   Neeraj Sharma   upload mytiple im...
192

beb598536   Neeraj Sharma   design and functi...
193
194
195
196
197
198
199
          <v-data-table
            :headers="headers"
            :items="desserts"
            :pagination.sync="pagination"
            :search="search"
          >
            <template slot="items" slot-scope="props">
f4df757fe   Neeraj Sharma   responsive vie in...
200
              <td id="td" class="text-xs-center">{{ props.index + 1}}</td>
beb598536   Neeraj Sharma   design and functi...
201
              <td id="td" class="text-xs-center">{{ props.item.title}}</td>
98ed84410   Neeraj Sharma   fixed design of d...
202
              <td id="td" class="text-xs-center td-dec">{{ props.item.description}}</td>
beb598536   Neeraj Sharma   design and functi...
203
204
205
  
              <td class="text-xs-center">
                <span>
495e4037c   Neeraj Sharma   update
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
233
234
235
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:25px; height:18px; "
                      class="mr5"
                      @click="profile(props.item)"
                      src="/static/icon/eye1.png"
                    />
                    <span>View</span>
                  </v-tooltip>
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:20px; height:18px; "
                      class="mr5"
                      @click="editItem(props.item)"
                      src="/static/icon/edit1.png"
                    />
                    <span>Edit</span>
                  </v-tooltip>
                  <v-tooltip top>
                    <img
                      slot="activator"
                      style="cursor:pointer; width:20px; height:20px; "
                      class="mr5"
                      @click="deleteItem(props.item)"
                      src="/static/icon/delete1.png"
                    />
                    <span>Delete</span>
                  </v-tooltip>
beb598536   Neeraj Sharma   design and functi...
236
237
238
239
240
241
242
243
244
245
246
                </span>
              </td>
            </template>
            <v-alert
              slot="no-results"
              :value="true"
              color="error"
              icon="warning"
            >Your search for "{{ search }}" found no results.</v-alert>
          </v-data-table>
        </v-tab-item>
46db0a3b5   Neeraj Sharma   add sunbject and ...
247
        <!-- ****** ADD MULTIPLE Notice Board ****** -->
beb598536   Neeraj Sharma   design and functi...
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
  
        <v-tab-item>
          <v-container>
            <v-snackbar
              :timeout="timeout"
              :top="y === 'top'"
              :right="x === 'right'"
              :vertical="mode === 'vertical'"
              v-model="snackbar"
              color="success"
            >{{ text }}</v-snackbar>
            <v-flex xs12 sm8 offset-sm2 class="top">
              <v-card flat>
                <v-container fluid fill-height>
                  <v-layout align-center>
                    <v-flex xs12>
                      <v-form ref="form" v-model="valid" lazy-validation>
                        <v-layout>
                          <v-flex
                            xs12
0551a0f15   Neeraj Sharma   implemnet functio...
268
                            class="text-xs-center text-sm-center text-md-center text-lg-center my-4"
beb598536   Neeraj Sharma   design and functi...
269
270
                          >
                            <v-avatar size="100px">
46db0a3b5   Neeraj Sharma   add sunbject and ...
271
                              <img src="/static/icon/user.png" v-if="!imageUrl" />
beb598536   Neeraj Sharma   design and functi...
272
                            </v-avatar>
2d0fc1144   Neeraj Sharma   upload dynamic im...
273
                            <input
beb598536   Neeraj Sharma   design and functi...
274
275
276
277
278
                              type="file"
                              style="display: none"
                              ref="image"
                              accept="image/*"
                              @change="onFilePicked"
46db0a3b5   Neeraj Sharma   add sunbject and ...
279
                            />
beb598536   Neeraj Sharma   design and functi...
280
                            <img
2b0e316ee   Neeraj Sharma   upload mytiple im...
281
                              :src="imageUrl"
beb598536   Neeraj Sharma   design and functi...
282
283
284
                              height="150"
                              v-if="imageUrl"
                              style="border-radius:50%; width:200px"
2d0fc1144   Neeraj Sharma   upload dynamic im...
285
                            />
beb598536   Neeraj Sharma   design and functi...
286
287
288
289
290
291
292
293
                          </v-flex>
                        </v-layout>
                        <v-layout>
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Title:</label>
                          </v-flex>
                          <v-flex xs6 class="ml-3">
                            <v-text-field
46db0a3b5   Neeraj Sharma   add sunbject and ...
294
                              v-model="addNoticeBoard.title"
beb598536   Neeraj Sharma   design and functi...
295
296
297
298
299
300
301
302
                              placeholder="fill your Title"
                              name="name"
                              type="text"
                              :rules="titleRules"
                              required
                            ></v-text-field>
                          </v-flex>
                        </v-layout>
46db0a3b5   Neeraj Sharma   add sunbject and ...
303
                        <v-layout>
beb598536   Neeraj Sharma   design and functi...
304
305
306
307
308
                          <v-flex xs4 class="pt-4 subheading">
                            <label class="right">Description:</label>
                          </v-flex>
                          <v-flex xs6 class="ml-3">
                            <v-text-field
46db0a3b5   Neeraj Sharma   add sunbject and ...
309
                              v-model="addNoticeBoard.description"
beb598536   Neeraj Sharma   design and functi...
310
311
312
313
314
315
316
317
                              placeholder="fill your Description"
                              name="name"
                              type="text"
                              :rules="descriptionRules"
                              required
                            ></v-text-field>
                          </v-flex>
                        </v-layout>
2d0fc1144   Neeraj Sharma   upload dynamic im...
318
                        <v-layout>
2b0e316ee   Neeraj Sharma   upload mytiple im...
319
                          <v-flex xs4 class="pt-4 subheading">
aa8fc5033   Neeraj Sharma   implenment all pa...
320
321
                            <label class="right hidden-xs-only hidden-sm-only">Uplaod Image:</label>
                            <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Uplaod :</label>
2b0e316ee   Neeraj Sharma   upload mytiple im...
322
323
324
325
326
327
328
329
330
                          </v-flex>
                          <v-flex xs6 class="ml-3">
                            <v-text-field
                              label="Select Image"
                              @click="pickFile"
                              v-model="imageName"
                              append-icon="attach_file"
                            ></v-text-field>
                          </v-flex>
2d0fc1144   Neeraj Sharma   upload dynamic im...
331
                        </v-layout>
2b0e316ee   Neeraj Sharma   upload mytiple im...
332
                        <v-layout>
beb598536   Neeraj Sharma   design and functi...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
                          <v-flex xs12 sm9 offset-sm2>
                            <v-card-actions>
                              <v-btn @click="clear" round dark>clear</v-btn>
                              <v-spacer></v-spacer>
                              <v-btn @click="submit" round dark :loading="loading">Add</v-btn>
                            </v-card-actions>
                          </v-flex>
                        </v-layout>
                      </v-form>
                    </v-flex>
                  </v-layout>
                </v-container>
              </v-card>
            </v-flex>
          </v-container>
        </v-tab-item>
      </v-tabs>
36fc987df   Neeraj Sharma   add loader in all...
350
351
352
      <div class="loader" v-if="showLoader">
        <v-progress-circular indeterminate color="white"></v-progress-circular>
      </div>
beb598536   Neeraj Sharma   design and functi...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
    </v-app>
  </template>
  
  <script>
  import http from "@/Services/http.js";
  import Util from "@/util";
  
  export default {
    data: () => ({
      snackbar: false,
      y: "top",
      x: "right",
      mode: "",
      timeout: 3000,
      text: "",
fc82ac667   Neeraj Sharma   fix design and re...
368
      showLoader: false,
beb598536   Neeraj Sharma   design and functi...
369
370
371
      loading: false,
      date: null,
      search: "",
beb598536   Neeraj Sharma   design and functi...
372
373
374
375
376
377
378
379
380
381
      dialog: false,
      dialog1: false,
      valid: true,
      isActive: true,
      newActive: false,
      addclass: [],
      addSection: [],
      gender: ["Male", "Female"],
      AddUsercredentials: {},
      pagination: {
2b0e316ee   Neeraj Sharma   upload mytiple im...
382
        rowsPerPage: 19
beb598536   Neeraj Sharma   design and functi...
383
      },
beb598536   Neeraj Sharma   design and functi...
384
385
386
      imageName: "",
      imageUrl: "",
      imageFile: "",
46db0a3b5   Neeraj Sharma   add sunbject and ...
387
      upload: "",
beb598536   Neeraj Sharma   design and functi...
388
389
390
391
392
393
394
395
396
397
      titleRules: [v => !!v || " Title is required"],
      descriptionRules: [v => !!v || " Description is required"],
      headers: [
        {
          text: "No",
          align: "center",
          sortable: false,
          value: "No"
        },
        { text: "Title", value: "title", sortable: false, align: "center" },
fc82ac667   Neeraj Sharma   fix design and re...
398
399
400
401
402
403
        {
          text: "Description",
          value: "description",
          sortable: false,
          align: "center"
        },
beb598536   Neeraj Sharma   design and functi...
404
405
406
407
        { text: "Action", value: "", sortable: false, align: "center" }
      ],
      desserts: [],
      editedIndex: -1,
46db0a3b5   Neeraj Sharma   add sunbject and ...
408
      addNoticeBoard: {},
beb598536   Neeraj Sharma   design and functi...
409
410
411
412
413
414
415
      editedItem: {
        title: "",
        description: ""
      },
      defaultItem: {
        title: "",
        description: ""
a17c68a03   Neeraj Sharma   implement two rou...
416
      }
beb598536   Neeraj Sharma   design and functi...
417
    }),
beb598536   Neeraj Sharma   design and functi...
418
419
420
421
    methods: {
      pickFile() {
        this.$refs.image.click();
      },
2d0fc1144   Neeraj Sharma   upload dynamic im...
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
      onFilePicked(e) {
        // console.log(e)
        const files = e.target.files;
        this.upload = e.target.files[0];
        console.log("thisupload==>", this.upload);
        if (files[0] !== undefined) {
          this.imageName = files[0].name;
          if (this.imageName.lastIndexOf(".") <= 0) {
            return;
          }
          const fr = new FileReader();
          fr.readAsDataURL(files[0]);
          fr.addEventListener("load", () => {
            this.imageUrl = fr.result;
            this.imageFile = files[0]; // this is an image file that can be sent to server...
2d0fc1144   Neeraj Sharma   upload dynamic im...
437
438
439
440
441
442
443
          });
        } else {
          this.imageName = "";
          this.imageFile = "";
          this.imageUrl = "";
        }
      },
46db0a3b5   Neeraj Sharma   add sunbject and ...
444
      getNoticeDataList() {
36fc987df   Neeraj Sharma   add loader in all...
445
        this.showLoader = true;
beb598536   Neeraj Sharma   design and functi...
446
447
448
449
450
451
452
        var token = this.$store.state.token;
        http()
          .get("/getEventsList", {
            headers: { Authorization: "Bearer " + token }
          })
          .then(response => {
            this.desserts = response.data.data;
36fc987df   Neeraj Sharma   add loader in all...
453
            this.showLoader = false;
beb598536   Neeraj Sharma   design and functi...
454
          })
00e4bc4e1   Neeraj Sharma   fixed auntentication
455
          .catch(error => {
36fc987df   Neeraj Sharma   add loader in all...
456
            this.showLoader = false;
a17c68a03   Neeraj Sharma   implement two rou...
457
458
459
460
461
            if (error.response.status === 401) {
              this.$router.replace({ path: "/" });
              this.$store.dispatch("setToken", null);
              this.$store.dispatch("Id", null);
            }
beb598536   Neeraj Sharma   design and functi...
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
          });
      },
      editItem(item) {
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog = true;
      },
      profile(item) {
        this.editedIndex = this.desserts.indexOf(item);
        this.editedItem = Object.assign({}, item);
        this.dialog1 = true;
      },
      deleteItem(item) {
        let deleteEvent = {
          eventId: item._id
        };
        http()
          .delete(
            "/deleteEvent",
            confirm("Are you sure you want to delete this?") && {
              params: deleteEvent
            }
          )
          .then(response => {
            // console.log("deleteUers",deleteEvent)
            if ((this.snackbar = true)) {
46db0a3b5   Neeraj Sharma   add sunbject and ...
488
              this.text = "Successfully delete Existing Notice Data";
beb598536   Neeraj Sharma   design and functi...
489
            }
2d0fc1144   Neeraj Sharma   upload dynamic im...
490
            this.getNoticeDataList();
beb598536   Neeraj Sharma   design and functi...
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
519
520
          })
          .catch(error => {
            // console.log(error);
          });
      },
      activeTab(type) {
        switch (type) {
          case "existing":
            this.newActive = false;
            this.isActive = true;
            break;
  
          default:
            this.newActive = true;
            this.isActive = false;
            break;
        }
      },
      close() {
        this.dialog = false;
        setTimeout(() => {
          this.editedItem = Object.assign({}, this.defaultItem);
          this.editedIndex = -1;
        }, 300);
      },
      close1() {
        this.dialog1 = false;
      },
      submit() {
        if (this.$refs.form.validate()) {
2d0fc1144   Neeraj Sharma   upload dynamic im...
521
522
523
524
525
          if (this.imageUrl) {
            var str = this.imageUrl;
            const [baseUrl, imageUrl] = str.split(/,/);
            this.addNoticeBoard.upload = imageUrl;
          }
beb598536   Neeraj Sharma   design and functi...
526
          http()
46db0a3b5   Neeraj Sharma   add sunbject and ...
527
            .post("/createEvent", this.addNoticeBoard)
beb598536   Neeraj Sharma   design and functi...
528
            .then(response => {
0551a0f15   Neeraj Sharma   implemnet functio...
529
530
531
              this.imageUrl = "";
              this.snackbar = true;
              this.text = "New Notice added successfully";
2d0fc1144   Neeraj Sharma   upload dynamic im...
532
              this.getNoticeDataList();
beb598536   Neeraj Sharma   design and functi...
533
534
535
536
              this.clear();
            })
            .catch(error => {
              // console.log(error);
0551a0f15   Neeraj Sharma   implemnet functio...
537
538
              this.snackbar = true;
              this.text = error.response.data.message;
beb598536   Neeraj Sharma   design and functi...
539
540
541
            });
        }
      },
beb598536   Neeraj Sharma   design and functi...
542
543
      clear() {
        this.$refs.form.reset();
0551a0f15   Neeraj Sharma   implemnet functio...
544
        this.imageUrl = "";
beb598536   Neeraj Sharma   design and functi...
545
546
      },
      save() {
2d0fc1144   Neeraj Sharma   upload dynamic im...
547
        let editNoticeBoard = {
beb598536   Neeraj Sharma   design and functi...
548
549
          eventId: this.editedItem._id,
          title: this.editedItem.title,
2d0fc1144   Neeraj Sharma   upload dynamic im...
550
          description: this.editedItem.description
beb598536   Neeraj Sharma   design and functi...
551
        };
2d0fc1144   Neeraj Sharma   upload dynamic im...
552
553
554
555
556
        if (this.imageUrl) {
          var str = this.imageUrl;
          const [baseUrl, imageUrl] = str.split(/,/);
          editNoticeBoard.upload = imageUrl;
        }
beb598536   Neeraj Sharma   design and functi...
557
        http()
2d0fc1144   Neeraj Sharma   upload dynamic im...
558
          .put("/updateEvent", editNoticeBoard)
beb598536   Neeraj Sharma   design and functi...
559
          .then(response => {
beb598536   Neeraj Sharma   design and functi...
560
            if ((this.snackbar = true)) {
46db0a3b5   Neeraj Sharma   add sunbject and ...
561
              this.text = "Successfully Edit Existing Notice Data";
beb598536   Neeraj Sharma   design and functi...
562
            }
2d0fc1144   Neeraj Sharma   upload dynamic im...
563
            this.getNoticeDataList();
a17c68a03   Neeraj Sharma   implement two rou...
564
            this.close();
beb598536   Neeraj Sharma   design and functi...
565
566
567
568
          })
          .catch(error => {
            // console.log(error);
          });
beb598536   Neeraj Sharma   design and functi...
569
570
571
      }
    },
    mounted() {
46db0a3b5   Neeraj Sharma   add sunbject and ...
572
      this.getNoticeDataList();
beb598536   Neeraj Sharma   design and functi...
573
    },
a17c68a03   Neeraj Sharma   implement two rou...
574
575
576
577
578
579
580
581
    created() {
      this.$root.$on("app:search", search => {
        this.search = search;
      });
    },
    beforeDestroy() {
      // dont forget to remove the listener
      this.$root.$off("app:search");
beb598536   Neeraj Sharma   design and functi...
582
583
584
585
    }
  };
  </script>
  <style scoped>
beb598536   Neeraj Sharma   design and functi...
586
  .active {
687e0b929   Neeraj Sharma   add user,attenden...
587
    background-color: gray;
beb598536   Neeraj Sharma   design and functi...
588
589
590
591
592
    color: white !important;
  }
  .activebtn {
    color: black !important;
  }
98ed84410   Neeraj Sharma   fixed design of d...
593
594
595
  .td-dec {
    max-width: 200px !important;
  }
beb598536   Neeraj Sharma   design and functi...
596
  </style>