Commit 6c05a9f840682ea2e77e74a24a517c5f2d5f8429

Authored by Neeraj Sharma
1 parent ab54b56569

add functionalit and design of library

src/Services/http.js
... ... @@ -3,7 +3,7 @@ import store from '@/store/store'
3 3  
4 4 export default () => {
5 5 return axios.create({
6   - // baseURL: 'http://192.168.2.221:3002/v1',
  6 + // baseURL: 'http://192.168.4.220:3002/v1',
7 7 baseURL: 'http://13.234.251.173:8001/v1',
8 8 headers: {
9 9 Authorization: `Bearer ${store.state.token}`
... ...
... ... @@ -83,10 +83,10 @@ const Menu = [
83 83 component: 'Library',
84 84 icon: '/static/schoolIcons/Library.png',
85 85 items: [
86   - // { name: 'libraryMember', title: ' Library Member', component: 'libraryMember', action: '', },
  86 + { name: 'libraryMember', title: ' Library Member', component: 'libraryMember', action: '', },
87 87 { name: 'Books', title: 'Books', component: 'Books', action: '', },
88 88 // { name: 'Issue', title: ' Issue', component: 'Issue', action: '', },
89   - // { name: 'eBooks', title: 'E-Books', component: 'eBooks', action: '', }
  89 + { name: 'eBooks', title: 'E-Books', component: 'eBooks', action: '', }
90 90  
91 91 ]
92 92 },
... ...
src/pages/Dashboard/dashboard.vue
1 1 <template>
2 2 <v-app id="pages-dasboard">
3   - <full-calendar
4   - ref="calendar"
5   - defaultView="month"
6   - droppable="false"
7   - :events="events"
8   - :config="config"
9   - ></full-calendar>
  3 + <v-container fluid grid-list-xl>
  4 + <!-- <v-card flat class="dashCard"> -->
  5 + <v-layout row wrap class="pt-3">
  6 + <!-- ***** Total Students ***** -->
  7 + <v-flex xs12 class="pt-2">
  8 + <v-layout row wrap>
  9 + <v-flex xs12 sm12 lg3 md4>
  10 + <v-card width="90" height="90" class="ml-3 pa-1 white iconCard" dark>
  11 + <img
  12 + src="/static/schoolIcons/Students.png"
  13 + class="iconOfDashboard"
  14 + width="80"
  15 + alt="Students"
  16 + />
  17 + </v-card>
  18 + <v-card class="pa-3" style="margin-top: -44px;">
  19 + <div class="body-2 grey--text text-xs-right">Students</div>
  20 + <br />
  21 + <h3 class="headline text-xs-right pb-4">{{ students.length }}</h3>
  22 + </v-card>
  23 + </v-flex>
  24 + <!-- ***** Total Parents ***** -->
  25 + <v-flex xs12 sm12 lg3 md4>
  26 + <v-card width="90" height="90" class="ml-3 pa-1 white agentIcon" dark>
  27 + <img
  28 + src="/static/schoolIcons/Parents.png"
  29 + width="80"
  30 + class="iconOfDashboard"
  31 + alt="Parents"
  32 + />
  33 + </v-card>
  34 + <v-card class="pa-3" style="margin-top: -44px;">
  35 + <div class="body-2 grey--text text-xs-right">Parents</div>
  36 + <br />
  37 + <h3 class="headline text-xs-right pb-4">{{ parents.length }}</h3>
  38 + </v-card>
  39 + </v-flex>
  40 + <!-- ***** Total Teachers***** -->
  41 + <v-flex xs12 sm12 lg3 md4>
  42 + <v-card width="90" height="90" class="ml-3 pa-1 white farmerIcon" dark>
  43 + <img
  44 + src="/static/schoolIcons/Teachers.png"
  45 + width="80"
  46 + class="iconOfDashboard"
  47 + alt="Teachers"
  48 + />
  49 + </v-card>
  50 + <v-card class="pa-3" style="margin-top: -44px;">
  51 + <div class="body-2 grey--text text-xs-right">Teachers</div>
  52 + <br />
  53 + <h3 class="headline text-xs-right pb-4">{{ teachers.length }}</h3>
  54 + </v-card>
  55 + </v-flex>
  56 + <!-- ***** Total Class***** -->
  57 + <v-flex xs12 sm12 lg3 md4>
  58 + <v-card width="90" height="90" class="ml-3 pa-1 white khasraIcon" dark>
  59 + <img src="/static/schoolIcons/Class.png" width="80" class="s" alt="class" />
  60 + </v-card>
  61 + <v-card class="pa-3" style="margin-top: -44px;">
  62 + <div class="body-2 grey--text text-xs-right">Class</div>
  63 + <br />
  64 + <h3 class="headline text-xs-right pb-4">{{ classes.length}}</h3>
  65 + </v-card>
  66 + </v-flex>
  67 + </v-layout>
  68 + </v-flex>
  69 + </v-layout>
  70 + <v-card class="pt-4 mt-3" flat>
  71 + <full-calendar
  72 + ref="calendar"
  73 + defaultView="month"
  74 + droppable="false"
  75 + :events="events"
  76 + :config="config"
  77 + ></full-calendar>
  78 + </v-card>
  79 + </v-container>
10 80 <v-dialog v-model="dialog" max-width="500">
11 81 <v-card color="grey lighten-4" flat>
12 82 <v-toolbar dark color="fixcolors">
... ... @@ -62,9 +132,21 @@ export default {
62 132 this.dialog = true;
63 133 }
64 134 },
65   - selected: {}
  135 + selected: {},
  136 + students: "",
  137 + parents: "",
  138 + teachers: "",
  139 + classes: ""
66 140 };
67 141 },
  142 + mounted() {
  143 + this.token = this.$store.state.token;
  144 + this.getData();
  145 + this.getStudents();
  146 + this.getTeachers();
  147 + this.getParents();
  148 + this.getClasses();
  149 + },
68 150 methods: {
69 151 date: function(date) {
70 152 return moment(date).format("MMMM DD, YYYY HH:mm:ss");
... ... @@ -107,7 +189,6 @@ export default {
107 189 this.$store.dispatch("Id", null);
108 190 }
109 191 });
110   - var token = this.$store.state.token;
111 192 http()
112 193 .get("/getSchoolEventsList", {
113 194 headers: { Authorization: "Bearer " + token }
... ... @@ -128,6 +209,82 @@ export default {
128 209 this.$store.dispatch("Id", null);
129 210 }
130 211 });
  212 + },
  213 + getStudents() {
  214 + http()
  215 + .get("/getStudentsList", {
  216 + headers: { Authorization: "Bearer " + this.token }
  217 + })
  218 + .then(response => {
  219 + this.students = response.data.data;
  220 + this.showLoader = false;
  221 + })
  222 + .catch(err => {
  223 + // console.log("err====>", err);
  224 + this.showLoader = false;
  225 + if (error.response.status === 401) {
  226 + this.$router.replace({ path: "/" });
  227 + this.$store.dispatch("setToken", null);
  228 + this.$store.dispatch("Id", null);
  229 + }
  230 + });
  231 + },
  232 + getParents() {
  233 + http()
  234 + .get("/getParentsList", {
  235 + headers: { Authorization: "Bearer " + this.token }
  236 + })
  237 + .then(response => {
  238 + this.parents = response.data.data;
  239 + this.showLoader = false;
  240 + })
  241 + .catch(err => {
  242 + // console.log("err====>", err);
  243 + this.showLoader = false;
  244 + if (error.response.status === 401) {
  245 + this.$router.replace({ path: "/" });
  246 + this.$store.dispatch("setToken", null);
  247 + this.$store.dispatch("Id", null);
  248 + }
  249 + });
  250 + },
  251 + getTeachers() {
  252 + http()
  253 + .get("/getTeachersList", {
  254 + headers: { Authorization: "Bearer " + this.token }
  255 + })
  256 + .then(response => {
  257 + this.teachers = response.data.data;
  258 + this.showLoader = false;
  259 + })
  260 + .catch(err => {
  261 + // console.log("err====>", err);
  262 + this.showLoader = false;
  263 + if (error.response.status === 401) {
  264 + this.$router.replace({ path: "/" });
  265 + this.$store.dispatch("setToken", null);
  266 + this.$store.dispatch("Id", null);
  267 + }
  268 + });
  269 + },
  270 + getClasses() {
  271 + http()
  272 + .get("/getClassesList", {
  273 + headers: { Authorization: "Bearer " + this.token }
  274 + })
  275 + .then(response => {
  276 + this.classes = response.data.data;
  277 + this.showLoader = false;
  278 + })
  279 + .catch(err => {
  280 + // console.log("err====>", err);
  281 + this.showLoader = false;
  282 + if (error.response.status === 401) {
  283 + this.$router.replace({ path: "/" });
  284 + this.$store.dispatch("setToken", null);
  285 + this.$store.dispatch("Id", null);
  286 + }
  287 + });
131 288 }
132 289 // eventSources() {
133 290 // const self = this;
... ... @@ -141,9 +298,6 @@ export default {
141 298 // }
142 299 // ];
143 300 // }
144   - },
145   - mounted() {
146   - this.getData();
147 301 }
148 302 };
149 303 </script>
... ... @@ -166,4 +320,29 @@ export default {
166 320 transition-duration: 0.4s;
167 321 box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
168 322 }
  323 +.iconCard {
  324 + position: relative !important;
  325 + border-radius: 4px;
  326 + z-index: 1;
  327 +}
  328 +.agentIcon {
  329 + position: relative !important;
  330 + border-radius: 4px;
  331 + z-index: 1;
  332 +}
  333 +.farmerIcon {
  334 + position: relative !important;
  335 + border-radius: 4px;
  336 + z-index: 1;
  337 +}
  338 +.khasraIcon {
  339 + position: relative !important;
  340 + border-radius: 4px;
  341 + z-index: 1;
  342 +}
  343 +.maleFarmerIcon {
  344 + position: relative !important;
  345 + border-radius: 4px;
  346 + z-index: 1;
  347 +}
169 348 </style>
170 349 \ No newline at end of file
... ...
src/pages/Library/eBook.vue
... ... @@ -37,13 +37,13 @@
37 37 </v-toolbar-title>
38 38 <v-spacer></v-spacer>
39 39 </v-toolbar>
40   - <v-card-text style="height:600px;">
  40 + <v-card-text style="height:760px;">
41 41 <v-form ref="form">
42 42 <v-container fluid>
43 43 <v-layout row>
44 44 <v-flex
45 45 xs12
46   - class="text-xs-center text-sm-center text-md-center text-lg-center my-4 mr-4"
  46 + class="text-xs-center text-sm-center text-md-center text-lg-center mr-4"
47 47 >
48 48 <input
49 49 type="file"
... ... @@ -51,9 +51,22 @@
51 51 ref="image"
52 52 accept="image/*"
53 53 multiple
54   - @change="onFilePicked"
  54 + @change="onImagePicked"
55 55 />
56 56 <v-layout justify-center>
  57 + <v-flex v-if="files != ''">
  58 + <img :src="files" height="450" width="500;" />
  59 + </v-flex>
  60 + </v-layout>
  61 + <img
  62 + v-if="editedItem.coverPhotoUrl && files == '' "
  63 + :src="editedItem.coverPhotoUrl"
  64 + height="450"
  65 + width="500"
  66 + alt="eBooks"
  67 + class="pa-2"
  68 + />
  69 + <!-- <v-layout justify-center>
57 70 <v-flex
58 71 xs3
59 72 v-for="Image in editedItem.newsImageUrl"
... ... @@ -61,13 +74,7 @@
61 74 v-if="editedItem.newsImageUrl"
62 75 class="profile-image-wrapper"
63 76 >
64   - <img
65   - :src="Image.imageUrl"
66   - height="160"
67   - width="160"
68   - alt="eBooks"
69   - class="pa-2"
70   - />
  77 +
71 78 <v-icon
72 79 class="red edit-profile-icon"
73 80 dark
... ... @@ -77,30 +84,27 @@
77 84 <v-flex v-for="(file, index) in files" :key="index">
78 85 <img :src="file" height="160" width="160" class="pa-2" />
79 86 </v-flex>
80   - </v-layout>
  87 + </v-layout>-->
81 88 <img
82 89 src="/static/icon/user.png"
83   - v-if="editedItem.newsImageUrl ==''"
  90 + v-if="editedItem.coverPhotoUrl == ''"
84 91 height="160"
85 92 width="160"
86 93 alt="Books"
87 94 />
88 95 </v-flex>
89 96 </v-layout>
90   - <!-- </v-layout> -->
91 97 <v-layout>
92 98 <v-flex xs12 sm12>
93 99 <v-layout>
94 100 <v-flex xs4 class="pt-4 subheading">
95   - <label class="right">Title:</label>
  101 + <label class="right">Name:</label>
96 102 </v-flex>
97 103 <v-flex xs5 class="ml-3">
98 104 <v-text-field
99   - v-model="editedItem.title"
100   - placeholder="fill your Title"
101   - name="name"
  105 + v-model="editedItem.name"
  106 + placeholder="fill your Name"
102 107 type="text"
103   - required
104 108 ></v-text-field>
105 109 </v-flex>
106 110 </v-layout>
... ... @@ -108,28 +112,38 @@
108 112 <v-flex xs12 sm12>
109 113 <v-layout>
110 114 <v-flex xs4 class="pt-4 subheading">
111   - <label class="right">Description:</label>
  115 + <label class="right">Author:</label>
  116 + </v-flex>
  117 + <v-flex xs5 class="ml-3">
  118 + <v-text-field placeholder="fill your Author" v-model="editedItem.author"></v-text-field>
  119 + </v-flex>
  120 + </v-layout>
  121 + </v-flex>
  122 + <v-flex xs12 sm12>
  123 + <v-layout>
  124 + <v-flex xs4 class="pt-4 subheading">
  125 + <label class="right">Class:</label>
112 126 </v-flex>
113 127 <v-flex xs5 class="ml-3">
114 128 <v-text-field
115   - placeholder="fill your Description"
116   - v-model="editedItem.description"
117   - type="text"
118   - name="email"
119   - required
  129 + v-model="editedItem.className"
  130 + :items="addClass"
  131 + label="Select Class"
  132 + item-text="classNum"
  133 + item-value="_id"
120 134 ></v-text-field>
121 135 </v-flex>
122 136 </v-layout>
123 137 </v-flex>
124   - <v-flex xs12>
  138 + <v-flex xs12 sm12>
125 139 <v-layout>
126 140 <v-flex xs4 class="pt-4 subheading">
127   - <label class="right">Add New Images:</label>
  141 + <label class="right">Upload Image:</label>
128 142 </v-flex>
129 143 <v-flex xs5 class="ml-3">
130 144 <v-text-field
131 145 label="Select Image"
132   - @click="pickFile"
  146 + @click="pickImage"
133 147 v-model="imageName"
134 148 append-icon="attach_file"
135 149 multiple
... ... @@ -137,13 +151,45 @@
137 151 </v-flex>
138 152 </v-layout>
139 153 </v-flex>
  154 + <v-flex xs12 sm12>
  155 + <v-layout>
  156 + <v-flex xs4 class="pt-4 subheading">
  157 + <label class="right">Upload File:</label>
  158 + </v-flex>
  159 + <v-flex xs5 class="ml-3">
  160 + <input
  161 + type="file"
  162 + style="display: none"
  163 + ref="file"
  164 + @change="onFilePicked"
  165 + />
  166 + <v-text-field
  167 + label="Select File"
  168 + @click="pickFile"
  169 + v-model="fileName"
  170 + append-icon="attach_file"
  171 + multiple
  172 + ></v-text-field>
  173 + </v-flex>
  174 + </v-layout>
  175 + </v-flex>
  176 + <v-flex xs12 sm12>
  177 + <v-layout>
  178 + <v-flex xs4 class="pt-4 subheading">
  179 + <label class="right">Private:</label>
  180 + </v-flex>
  181 + <v-flex xs5 class="ml-3">
  182 + <v-checkbox v-model="editedItem.private"></v-checkbox>
  183 + </v-flex>
  184 + </v-layout>
  185 + </v-flex>
140 186 </v-layout>
141 187 <v-layout>
142 188 <v-flex xs12 sm8 offset-sm2>
143 189 <v-card-actions>
144 190 <v-btn round dark @click.native="close">Cancel</v-btn>
145 191 <v-spacer></v-spacer>
146   - <v-btn round dark @click="save">Save</v-btn>
  192 + <v-btn round dark @click="save" :loading="loadingUpadte">Save</v-btn>
147 193 </v-card-actions>
148 194 </v-flex>
149 195 </v-layout>
... ... @@ -186,11 +232,11 @@
186 232 <template slot="items" slot-scope="props">
187 233 <td class="text-xs-center">{{ props.index + 1}}</td>
188 234 <td id="td" class="text-xs-center">
189   - <img :src="props.item.fileUrl" alt="newsImage" width="100" height="70" />
  235 + <img :src="props.item.coverPhotoUrl" alt="newsImage" width="100" height="70" />
190 236 </td>
191 237 <td id="td" class="text-xs-center">{{ props.item.name}}</td>
192 238 <td id="td" class="text-xs-center">{{ props.item.author}}</td>
193   - <td id="td" class="text-xs-center">{{ props.item.classId}}</td>
  239 + <td id="td" class="text-xs-center">{{ props.item.classId.classNum}}</td>
194 240  
195 241 <td class="text-xs-center">
196 242 <span>
... ... @@ -253,8 +299,8 @@
253 299 @change="onImagePicked"
254 300 />
255 301 <v-layout justify-center>
256   - <v-flex v-if="files">
257   - <img :src="files" height="160" width="160px;" />
  302 + <v-flex v-if="files != ''">
  303 + <img :src="files" height="240" width="260px;" />
258 304 </v-flex>
259 305 </v-layout>
260 306 <img
... ... @@ -341,7 +387,7 @@
341 387 <v-flex xs4 class="ml-3">
342 388 <input type="file" style="display: none" ref="file" @change="onFilePicked" />
343 389 <v-text-field
344   - label="Select Image"
  390 + label="Select File"
345 391 @click="pickFile"
346 392 v-model="fileName"
347 393 append-icon="attach_file"
... ... @@ -395,6 +441,7 @@ export default {
395 441 timeout: 3000,
396 442 text: "",
397 443 loading: false,
  444 + loadingUpadte: false,
398 445 date: null,
399 446 search: "",
400 447 showLoader: false,
... ... @@ -446,26 +493,6 @@ export default {
446 493 token: ""
447 494 }),
448 495 methods: {
449   - getSections(_id) {
450   - console.log("_id", _id);
451   - var token = this.$store.state.token;
452   - http()
453   - .get(
454   - "/getSectionsList",
455   - { params: { classId: _id } },
456   - {
457   - headers: { Authorization: "Bearer " + token }
458   - }
459   - )
460   - .then(response => {
461   - this.addSection = response.data.data;
462   - // console.log("getSectionsList=====>", this.addSection);
463   - })
464   - .catch(err => {
465   - console.log("err====>", err);
466   - // this.$router.replace({ path: '/' });
467   - });
468   - },
469 496 pickImage() {
470 497 this.$refs.image.click();
471 498 },
... ... @@ -486,7 +513,6 @@ export default {
486 513 fr.readAsDataURL(files[0]);
487 514 fr.addEventListener("load", () => {
488 515 this.files = fr.result;
489   - console.log("uploadImagethis.files=======>", this.files);
490 516 });
491 517 } else {
492 518 this.imageName = "";
... ... @@ -495,7 +521,7 @@ export default {
495 521 this.imageUrl = "";
496 522 }
497 523 },
498   - getBooksList() {
  524 + getEBooksList() {
499 525 this.showLoader = true;
500 526 http()
501 527 .get("/getEBooksList", {
... ... @@ -504,16 +530,15 @@ export default {
504 530 .then(response => {
505 531 this.eBookData = response.data.data;
506 532 this.showLoader = false;
507   - console.log("getNewsList=====>", response.data.data);
508 533 })
509 534 .catch(err => {
510 535 // console.log("err====>", err);
511 536 this.showLoader = false;
512   - // if (error.response.status === 401) {
513   - // this.$router.replace({ path: "/" });
514   - // this.$store.dispatch("setToken", null);
515   - // this.$store.dispatch("Id", null);
516   - // }
  537 + if (error.response.status === 401) {
  538 + this.$router.replace({ path: "/" });
  539 + this.$store.dispatch("setToken", null);
  540 + this.$store.dispatch("Id", null);
  541 + }
517 542 });
518 543 },
519 544 onFilePicked(e) {
... ... @@ -540,6 +565,7 @@ export default {
540 565 this.files = [];
541 566 this.editedIndex = this.eBookData.indexOf(item);
542 567 this.editedItem = Object.assign({}, item);
  568 + this.editedItem.className = item.classId.classNum;
543 569 this.dialog = true;
544 570 },
545 571 profile(item) {
... ... @@ -548,45 +574,24 @@ export default {
548 574 this.dialog1 = true;
549 575 },
550 576 deleteItem(item) {
551   - let deleteNews = {
552   - newsId: item._id
  577 + let deleteEBooks = {
  578 + ebookId: item._id
553 579 };
554 580 http()
555 581 .delete(
556   - "/deleteNews",
  582 + "/deleteEBook",
557 583 confirm("Are you sure you want to delete this?") && {
558   - params: deleteNews
  584 + params: deleteEBooks
559 585 }
560 586 )
561 587 .then(response => {
562   - // console.log("deleteNews",deleteNews)
563   - if ((this.snackbar = true)) {
564   - this.text = "Successfully delete Existing News";
565   - }
566   - this.getNewsList();
567   - })
568   - .catch(error => {
569   - // console.log(error);
570   - });
571   - },
572   - deleteImage(imageId, newsId) {
573   - console.log(imageId, newsId);
574   - let deleteImages = {
575   - newsId: newsId,
576   - imageId: imageId
577   - };
578   - http()
579   - .put("/deleteImages", deleteImages)
580   - .then(response => {
581   - console.log("deleteNews", deleteImages);
582   - if ((this.snackbar = true)) {
583   - this.text = "Image deleted Successfully";
584   - }
585   - this.getNewsList();
586   - this.close();
  588 + this.snackbar = true;
  589 + this.text = "Successfully delete Existing News";
  590 + this.getEBooksList();
587 591 })
588 592 .catch(error => {
589   - console.log(error);
  593 + this.snackbar = true;
  594 + this.text = error.response.data.message;
590 595 });
591 596 },
592 597 activeTab(type) {
... ... @@ -628,18 +633,18 @@ export default {
628 633 http()
629 634 .post("/createEBook", this.addEBooks)
630 635 .then(response => {
631   - if ((this.snackbar = true)) {
632   - this.text = "New E-Book added successfully";
633   - }
  636 + this.snackbar = true;
  637 + this.text = "New E-Book added successfully";
634 638 this.addEBooks.uploadCover = "";
635   - // this.getNewsList();
  639 + this.addEBooks.uploadFile = "";
  640 + this.files = "";
  641 + this.getEBooksList();
636 642 this.loading = false;
637 643 this.clear();
638 644 })
639 645 .catch(error => {
640   - if ((this.snackbar = true)) {
641   - this.text = error.response.data.message;
642   - }
  646 + this.snackbar = true;
  647 + this.text = error.response.data.message;
643 648 });
644 649 }
645 650 },
... ... @@ -647,31 +652,35 @@ export default {
647 652 this.$refs.form.reset();
648 653 },
649 654 save() {
650   - if (this.files) {
651   - var ary = [];
652   - var imageData = [];
653   - ary = this.files;
654   - for (let i = 0; i < ary.length; i++) {
655   - const [baseUrl, imageUrl] = ary[i].split(/,/);
656   - imageData.push(imageUrl);
657   - this.editedItem.uploadCover = imageData;
658   - }
  655 + this.loadingUpadte = true;
  656 + if (this.files.length > 0) {
  657 + const [baseUrl, imageUrl] = this.files.split(/,/);
  658 + this.editedItem.uploadCover = imageUrl;
  659 + // console.log("anyFile.split(/,/)", this.addEBooks.uploadCover);
659 660 }
660 661 if (this.anyFile) {
661 662 const [baseUrl, fileUrl] = this.anyFile.split(/,/);
662   - console.log("anyFile.split(/,/)", fileUrl);
  663 + this.editedItem.uploadFile = fileUrl;
  664 + // console.log("anyFile.split(/,/)", this.addEBooks.uploadFile);
663 665 }
  666 + this.editedItem.ebookId = this.editedItem._id;
664 667 http()
665   - .put("/updateNews", editNews)
  668 + .put("/updateEBook", this.editedItem)
666 669 .then(response => {
667   - // console.log("updateNews",updateNews);
668   - if ((this.snackbar = true)) {
669   - this.text = "Successfully Edit Existing News";
670   - }
671   - this.getNewsList();
  670 + this.loadingUpadte = false;
  671 + this.snackbar = true;
  672 + this.text = "Successfully Edit Existing E-Book";
  673 + this.getEBooksList();
  674 + this.editedItem.uploadFile = "";
  675 + this.editedItem.uploadCover = "";
  676 + this.anyFile = "";
  677 + this.files = "";
672 678 this.close();
673 679 })
674 680 .catch(error => {
  681 + this.loadingUpadte = false;
  682 + this.snackbar = true;
  683 + this.text = error.response.data.message;
675 684 // console.log(error);
676 685 });
677 686 },
... ... @@ -691,7 +700,7 @@ export default {
691 700 },
692 701 mounted() {
693 702 this.token = this.$store.state.token;
694   - this.getBooksList();
  703 + this.getEBooksList();
695 704 this.getAllClass();
696 705 // this.editItem;
697 706 },
... ...
src/pages/Library/issue.vue
... ... @@ -213,6 +213,33 @@
213 213 >{{ text }}</v-snackbar>
214 214  
215 215 <!-- ****** EXISTING-USERS NEWS TABLE ****** -->
  216 + <v-card>
  217 + <v-layout>
  218 + <v-flex lg1 xs4 md4 xl1 class="hidden-xs-only">
  219 + <label class="right pt-4">Library ID:</label>
  220 + </v-flex>
  221 + <v-flex lg2 md3 xs7>
  222 + <v-text-field class="pl-3" @keyup.enter="searchLibrary" v-model="libraryId" placeholder="fill your library Id"></v-text-field>
  223 + </v-flex>
  224 + <v-flex lg9 md3 xs5>
  225 + <v-btn
  226 + round
  227 + class="black mt-1 right hidden-xs-only"
  228 + @click="searchLibrary"
  229 + :loading="loadingSearch"
  230 + dark
  231 + >Search</v-btn>
  232 + <v-btn
  233 + round
  234 + class="black mt-4 right hidden-sm-only hidden-xl-only hidden-md-only hidden-lg-only"
  235 + :loading="loadingSearch"
  236 + @click="searchLibrary"
  237 + small
  238 + dark
  239 + >Search</v-btn>
  240 + </v-flex>
  241 + </v-layout>
  242 + </v-card>
216 243 <v-data-table
217 244 :headers="headers"
218 245 :items="desserts"
... ... @@ -347,7 +374,7 @@
347 374 </v-flex>
348 375 </v-layout>
349 376 </v-flex>
350   - <v-flex xs12>
  377 + <v-flex xs12>
351 378 <v-layout>
352 379 <v-flex xs4 class="pt-4 subheading">
353 380 <label class="right">Subject Code:</label>
... ... @@ -361,7 +388,7 @@
361 388 </v-flex>
362 389 </v-layout>
363 390 </v-flex>
364   - <v-flex xs12>
  391 + <v-flex xs12>
365 392 <v-layout>
366 393 <v-flex xs4 class="pt-4 subheading">
367 394 <label class="right">Serial No:</label>
... ... @@ -423,7 +450,9 @@ export default {
423 450 mode: "",
424 451 timeout: 3000,
425 452 text: "",
  453 + libraryId: "",
426 454 loading: false,
  455 + loadingSearch: false,
427 456 date: null,
428 457 search: "",
429 458 showLoader: false,
... ... @@ -528,21 +557,33 @@ export default {
528 557 // this.imageUrl = "";
529 558 // }
530 559 // },
531   - getIssueList() {
  560 + searchLibrary() {
532 561 this.showLoader = true;
  562 + this.loadingSearch = true;
533 563 var token = this.$store.state.token;
534 564 http()
535   - .get("/getIssueList", {
536   - headers: { Authorization: "Bearer " + token }
537   - })
  565 + .get(
  566 + "/getLibrary",
  567 + {
  568 + params: { libraryId: this.libraryId }
  569 + },
  570 + {
  571 + headers: { Authorization: "Bearer " + this.token }
  572 + }
  573 + )
538 574 .then(response => {
539   - this.desserts = response.data.data;
  575 + // this.desserts = response.data.data;
540 576 this.showLoader = false;
  577 + this.loadingSearch = false;
  578 +
541 579 // console.log("getIssueList=====>",this.desserts)
542 580 })
543   - .catch(err => {
  581 + .catch(error => {
544 582 // console.log("err====>", err);
545 583 this.showLoader = false;
  584 + this.loadingSearch = false;
  585 + this.snackbar = true;
  586 + this.text = error.response.data.message;
546 587 if (error.response.status === 401) {
547 588 this.$router.replace({ path: "/" });
548 589 this.$store.dispatch("setToken", null);
... ...
src/pages/Library/member.vue
... ... @@ -8,7 +8,413 @@
8 8 v-model="snackbar"
9 9 color="success"
10 10 >{{ text }}</v-snackbar>
11   - <!-- Add Library Dialog -->
  11 +
  12 + <!-- ****** PROFILE VIEW STUDENTS LIBRARY MEMBER DEATILS ****** -->
  13 +
  14 + <v-dialog v-model="dialogStudents" max-width="1100px" scrollable>
  15 + <v-card>
  16 + <v-toolbar color="grey lighten-2" flat>
  17 + <v-spacer></v-spacer>
  18 + <v-toolbar-title>Student Profile</v-toolbar-title>
  19 + <v-spacer></v-spacer>
  20 + <v-icon @click="closeViewStudent">close</v-icon>
  21 + </v-toolbar>
  22 + <v-card-text style="height: 700px;">
  23 + <v-flex align-center justify-center layout text-xs-center class="mt-3">
  24 + <v-avatar size="160px">
  25 + <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" />
  26 + <img :src="editedItem.profilePicUrl" v-else-if="editedItem.profilePicUrl" />
  27 + </v-avatar>
  28 + </v-flex>
  29 + <v-container grid-list-md>
  30 + <v-layout wrap>
  31 + <v-flex xs12>
  32 + <v-layout wrap>
  33 + <v-flex xs12 sm6>
  34 + <v-layout>
  35 + <v-flex xs6 sm5>
  36 + <h5 class="right my-1">
  37 + <b>Full Name:</b>
  38 + </h5>
  39 + </v-flex>
  40 + <v-flex sm7 xs6>
  41 + <h5 class="my-1 left">{{ editedItem.name }}</h5>
  42 + </v-flex>
  43 + </v-layout>
  44 + </v-flex>
  45 + <v-flex xs12 sm6>
  46 + <v-layout>
  47 + <v-flex xs6 sm4>
  48 + <h5 class="right my-1">
  49 + <b>Email:</b>
  50 + </h5>
  51 + </v-flex>
  52 + <v-flex sm8 xs6>
  53 + <h5 class="my-1 left">{{ editedItem.email }}</h5>
  54 + </v-flex>
  55 + </v-layout>
  56 + </v-flex>
  57 + </v-layout>
  58 + <v-layout wrap>
  59 + <v-flex xs12 sm6>
  60 + <v-layout>
  61 + <v-flex xs6 sm5>
  62 + <b>
  63 + <h5 class="right my-1">
  64 + <b>Gender:</b>
  65 + </h5>
  66 + </b>
  67 + </v-flex>
  68 + <v-flex sm7 xs6>
  69 + <h5 class="my-1 left">{{ editedItem.gender }}</h5>
  70 + </v-flex>
  71 + </v-layout>
  72 + </v-flex>
  73 + <v-flex xs12 sm6>
  74 + <v-layout>
  75 + <v-flex xs6 sm4>
  76 + <b>
  77 + <h5 class="right my-1">
  78 + <b>D.O.B:</b>
  79 + </h5>
  80 + </b>
  81 + </v-flex>
  82 + <v-flex sm7 xs6>
  83 + <h5 class="my-1">{{ dates(editedItem.dob) }}</h5>
  84 + </v-flex>
  85 + </v-layout>
  86 + </v-flex>
  87 + </v-layout>
  88 + <v-layout wrap>
  89 + <v-flex xs12 sm6>
  90 + <v-layout>
  91 + <v-flex xs6 sm5>
  92 + <b>
  93 + <h5 class="right my-1">
  94 + <b>Blood Group:</b>
  95 + </h5>
  96 + </b>
  97 + </v-flex>
  98 + <v-flex sm7 xs6>
  99 + <h5 class="my-1 left">{{ editedItem.bloodGroup }}</h5>
  100 + </v-flex>
  101 + </v-layout>
  102 + </v-flex>
  103 + <v-flex xs12 sm6>
  104 + <v-layout>
  105 + <v-flex xs6 sm4>
  106 + <b>
  107 + <h5 class="right my-1">
  108 + <b>Allergies:</b>
  109 + </h5>
  110 + </b>
  111 + </v-flex>
  112 + <v-flex sm8 xs6>
  113 + <h5 class="my-1">{{ editedItem.allergies }}</h5>
  114 + </v-flex>
  115 + </v-layout>
  116 + </v-flex>
  117 + </v-layout>
  118 + <v-layout wrap>
  119 + <v-flex xs12 sm6>
  120 + <v-layout>
  121 + <v-flex xs6 sm5>
  122 + <b>
  123 + <h5 class="right my-1">
  124 + <b>Height:</b>
  125 + </h5>
  126 + </b>
  127 + </v-flex>
  128 + <v-flex sm7 xs6>
  129 + <h5 class="my-1 left">{{ editedItem.height }}</h5>
  130 + </v-flex>
  131 + </v-layout>
  132 + </v-flex>
  133 + <v-flex xs12 sm6>
  134 + <v-layout>
  135 + <v-flex xs6 sm4>
  136 + <b>
  137 + <h5 class="right my-1">
  138 + <b>Weight:</b>
  139 + </h5>
  140 + </b>
  141 + </v-flex>
  142 + <v-flex sm8 xs6>
  143 + <h5 class="my-1">{{ editedItem.weight }}</h5>
  144 + </v-flex>
  145 + </v-layout>
  146 + </v-flex>
  147 + </v-layout>
  148 + <v-layout wrap>
  149 + <v-flex xs12 sm6>
  150 + <v-layout>
  151 + <v-flex xs6 sm5>
  152 + <b>
  153 + <h5 class="right my-1">
  154 + <b>City:</b>
  155 + </h5>
  156 + </b>
  157 + </v-flex>
  158 + <v-flex sm7 xs6>
  159 + <h5 class="my-1 left">{{ editedItem.city }}</h5>
  160 + </v-flex>
  161 + </v-layout>
  162 + </v-flex>
  163 + <v-flex xs12 sm6>
  164 + <v-layout>
  165 + <v-flex xs6 sm4>
  166 + <b>
  167 + <h5 class="right my-1">
  168 + <b>State:</b>
  169 + </h5>
  170 + </b>
  171 + </v-flex>
  172 + <v-flex sm8 xs6>
  173 + <h5 class="my-1">{{ editedItem.state }}</h5>
  174 + </v-flex>
  175 + </v-layout>
  176 + </v-flex>
  177 + </v-layout>
  178 + <v-layout wrap>
  179 + <v-flex xs12 sm6>
  180 + <v-layout>
  181 + <v-flex xs6 sm5>
  182 + <b>
  183 + <h5 class="right my-1">
  184 + <b>Pincode:</b>
  185 + </h5>
  186 + </b>
  187 + </v-flex>
  188 + <v-flex sm7 xs6>
  189 + <h5 class="my-1">{{ editedItem.pincode }}</h5>
  190 + </v-flex>
  191 + </v-layout>
  192 + </v-flex>
  193 + <v-flex xs12 sm5>
  194 + <v-layout>
  195 + <v-flex xs6 sm5>
  196 + <b>
  197 + <h5 class="right my-1">
  198 + <b>Country:</b>
  199 + </h5>
  200 + </b>
  201 + </v-flex>
  202 + <v-flex sm7 xs6>
  203 + <h5 class="my-1">{{ editedItem.country }}</h5>
  204 + </v-flex>
  205 + </v-layout>
  206 + </v-flex>
  207 + </v-layout>
  208 + <v-layout wrap>
  209 + <v-flex xs12 sm6>
  210 + <v-layout>
  211 + <v-flex sm5 xs6>
  212 + <b>
  213 + <h5 class="right my-1">
  214 + <b>Mobile No:</b>
  215 + </h5>
  216 + </b>
  217 + </v-flex>
  218 + <v-flex sm6 xs6>
  219 + <h5 class="my-1">{{ editedItem.mobile }}</h5>
  220 + </v-flex>
  221 + </v-layout>
  222 + </v-flex>
  223 + <v-flex xs12 sm6>
  224 + <v-layout>
  225 + <v-flex xs6 sm4>
  226 + <b>
  227 + <h5 class="right my-1">
  228 + <b>Library ID :</b>
  229 + </h5>
  230 + </b>
  231 + </v-flex>
  232 + <v-flex sm8 xs6>
  233 + <h5 class="my-1">{{ editedItem.libraryId }}</h5>
  234 + </v-flex>
  235 + </v-layout>
  236 + </v-flex>
  237 + </v-layout>
  238 + <v-layout wrap>
  239 + <v-flex xs12 sm5>
  240 + <v-layout>
  241 + <v-flex xs6 sm6>
  242 + <b>
  243 + <h5 class="right my-1">
  244 + <b>Library Fee:</b>
  245 + </h5>
  246 + </b>
  247 + </v-flex>
  248 + <v-flex sm6 xs6>
  249 + <h5 class="my-1">{{ editedItem.libraryFee }}</h5>
  250 + </v-flex>
  251 + </v-layout>
  252 + </v-flex>
  253 + <v-flex xs12 sm6>
  254 + <v-layout>
  255 + <v-flex xs6 sm6>
  256 + <b>
  257 + <h5 class="my-1 right">
  258 + <b>Academic Year:</b>
  259 + </h5>
  260 + </b>
  261 + </v-flex>
  262 + <v-flex sm5 xs6>
  263 + <h5 class="my-1">{{ editedItem.establishmentYear }}</h5>
  264 + </v-flex>
  265 + </v-layout>
  266 + </v-flex>
  267 + </v-layout>
  268 + <v-layout wrap>
  269 + <v-flex xs12 sm5>
  270 + <v-layout>
  271 + <v-flex xs6 sm6>
  272 + <b>
  273 + <h5 class="my-1 right">
  274 + <b>Medical Notes:</b>
  275 + </h5>
  276 + </b>
  277 + </v-flex>
  278 + <v-flex sm5 xs6>
  279 + <h5 class="my-1">{{ editedItem.medicalNotes }}</h5>
  280 + </v-flex>
  281 + </v-layout>
  282 + </v-flex>
  283 + <v-flex xs12 sm6>
  284 + <v-layout>
  285 + <v-flex xs6 sm6>
  286 + <b>
  287 + <h5 class="right my-1">
  288 + <b>Roll No. :</b>
  289 + </h5>
  290 + </b>
  291 + </v-flex>
  292 + <v-flex sm6 xs8>
  293 + <h5 class="my-1">{{ editedItem.rollNo }}</h5>
  294 + </v-flex>
  295 + </v-layout>
  296 + </v-flex>
  297 + </v-layout>
  298 + <v-layout wrap>
  299 + <v-flex xs12 sm5>
  300 + <v-layout>
  301 + <v-flex xs6 sm6>
  302 + <b>
  303 + <h5 class="my-1 right">
  304 + <b>present Address:</b>
  305 + </h5>
  306 + </b>
  307 + </v-flex>
  308 + <v-flex sm5 xs6>
  309 + <h5 class="my-1">{{ editedItem.presentAddress }}</h5>
  310 + </v-flex>
  311 + </v-layout>
  312 + </v-flex>
  313 + <v-flex xs12 sm6>
  314 + <v-layout>
  315 + <v-flex xs6 sm6>
  316 + <b>
  317 + <h5 class="right my-1">
  318 + <b>present Address:</b>
  319 + </h5>
  320 + </b>
  321 + </v-flex>
  322 + <v-flex sm6 xs8>
  323 + <h5 class="my-1">{{ editedItem.permanentAddress }}</h5>
  324 + </v-flex>
  325 + </v-layout>
  326 + </v-flex>
  327 + </v-layout>
  328 + </v-flex>
  329 + </v-layout>
  330 + </v-container>
  331 + </v-card-text>
  332 + </v-card>
  333 + </v-dialog>
  334 +
  335 + <!-- Edit Student Library Member Dialog -->
  336 +
  337 + <v-dialog v-model="editStudentdialog" max-width="600px" scrollable>
  338 + <v-card flat>
  339 + <v-toolbar color="grey lighten-2" flat>
  340 + <v-spacer></v-spacer>
  341 + <v-toolbar-title>
  342 + <h3>Edit Student Profile</h3>
  343 + </v-toolbar-title>
  344 + <v-spacer></v-spacer>
  345 + </v-toolbar>
  346 + <v-card-text style="height: 426px;">
  347 + <v-form ref="form">
  348 + <v-container fluid>
  349 + <v-layout>
  350 + <v-flex
  351 + xs12
  352 + class="text-xs-center text-sm-center text-md-center text-lg-center mr-4"
  353 + >
  354 + <v-avatar size="160px">
  355 + <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl && !imageUrl" />
  356 + <img
  357 + :src="editedItem.profilePicUrl"
  358 + v-else-if="editedItem.profilePicUrl && !imageUrl"
  359 + />
  360 + <img
  361 + v-if="imageUrl"
  362 + :src="imageUrl"
  363 + height="150"
  364 + style="border-radius:50%; width:200px"
  365 + />
  366 + </v-avatar>
  367 + </v-flex>
  368 + </v-layout>
  369 + <v-layout wrap>
  370 + <v-flex xs12 sm12 md10>
  371 + <v-layout>
  372 + <v-flex xs4 class="pt-4 subheading">
  373 + <label class="right hidden-xs-only hidden-sm-only">Library ID:</label>
  374 + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Library ID:</label>
  375 + </v-flex>
  376 + <v-flex xs8 class="ml-3">
  377 + <v-text-field
  378 + v-model="editedItem.libraryId"
  379 + placeholder="fill your Library ID"
  380 + ></v-text-field>
  381 + </v-flex>
  382 + </v-layout>
  383 + </v-flex>
  384 + <v-flex xs12 sm12 md10>
  385 + <v-layout>
  386 + <v-flex xs4 class="pt-4 subheading">
  387 + <label class="right hidden-xs-only hidden-sm-only">Library Fee:</label>
  388 + <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Library Fee:</label>
  389 + </v-flex>
  390 + <v-flex xs8 class="ml-3">
  391 + <v-text-field
  392 + v-model="editedItem.libraryFee"
  393 + placeholder="fill your Library Fee"
  394 + ></v-text-field>
  395 + </v-flex>
  396 + </v-layout>
  397 + </v-flex>
  398 + </v-layout>
  399 + <v-layout>
  400 + <v-flex xs12 sm12>
  401 + <v-layout>
  402 + <v-flex xs6>
  403 + <v-btn round dark @click.native="closeEditStudentDialog">Cancel</v-btn>
  404 + </v-flex>
  405 + <v-flex xs6>
  406 + <v-btn @click="save" round dark :loading="loading" class="right">Save</v-btn>
  407 + </v-flex>
  408 + </v-layout>
  409 + </v-flex>
  410 + </v-layout>
  411 + </v-container>
  412 + </v-form>
  413 + </v-card-text>
  414 + </v-card>
  415 + </v-dialog>
  416 + <!-- Add Student Library Member Dialog -->
  417 +
12 418 <v-dialog v-model="addLibrary" max-width="600px">
13 419 <v-toolbar color="grey lighten-2">
14 420 <v-spacer></v-spacer>
... ... @@ -21,14 +427,19 @@
21 427 <v-card-text>
22 428 <v-container>
23 429 <v-layout wrap justify-center>
24   - <v-flex xs12 sm9>
25   - <v-form>
  430 + <v-flex xs12 sm12 md10>
  431 + <v-form ref="form" v-model="valid" lazy-validation>
26 432 <v-layout>
27 433 <v-flex xs4 class="pt-4 subheading">
28 434 <label class="right pr-3">Library Id:</label>
29 435 </v-flex>
30 436 <v-flex xs8>
31   - <v-text-field v-model="addBook.libraryId" placeholder="fill your Library ID"></v-text-field>
  437 + <v-text-field
  438 + v-model="addBook.libraryId"
  439 + :rules="libraryIdRules"
  440 + type="number"
  441 + placeholder="fill your Library ID"
  442 + ></v-text-field>
32 443 </v-flex>
33 444 </v-layout>
34 445 <v-layout>
... ... @@ -38,14 +449,16 @@
38 449 <v-flex xs8>
39 450 <v-text-field
40 451 v-model="addBook.libraryFee"
  452 + type="number"
  453 + :rules="libraryFeeRules"
41 454 placeholder="fill your Library Fee"
42 455 ></v-text-field>
43 456 </v-flex>
44 457 </v-layout>
45 458 <v-card-actions>
46   - <v-btn round dark @click.native="close">Cancel</v-btn>
  459 + <v-btn round dark @click.native="addLibrary = false">Cancel</v-btn>
47 460 <v-spacer></v-spacer>
48   - <v-btn round dark @click="submit">Add Member</v-btn>
  461 + <v-btn round dark @click="submit" :loading="loading">Add Member</v-btn>
49 462 </v-card-actions>
50 463 </v-form>
51 464 </v-flex>
... ... @@ -98,21 +511,15 @@
98 511 <td id="td" class="text-xs-center">{{ props.item.name}}</td>
99 512 <td id="td" class="text-xs-center">{{ props.item.rollNo }}</td>
100 513 <td id="td" class="text-xs-center">{{ props.item.email }}</td>
101   - <!-- <td id="td" class="text-xs-center">{{ dates(props.item.dob) }}</td> -->
102   - <!-- <td id="td" class="text-xs-center">{{ props.item.gender }}</td> -->
103   - <!-- <td id="td" class="text-xs-center">{{ props.item.parentId.fatherName }}</td> -->
104   - <!-- <td id="td" class="text-xs-center">{{ props.item.parentId.motherName }}</td> -->
105   - <!-- <td id="td" class="text-xs-center">{{ props.item.establishmentYear }}</td> -->
106   - <!-- <td id="td" class="text-xs-center">{{ props.item.mobile}}</td> -->
107   -
108 514 <td class="text-xs-center">
109 515 <img
  516 + v-if="!props.item.libraryId"
110 517 style="cursor:pointer; width:25px; height:18px; "
111 518 class="mr-5"
112   - @click="addLibrary = true"
  519 + @click="addLibraryData(props.item)"
113 520 src="/static/icon/add.png"
114 521 />
115   - <span>
  522 + <span v-if="props.item.libraryId">
116 523 <img
117 524 style="cursor:pointer; width:25px; height:18px; "
118 525 class="mr-5"
... ... @@ -163,6 +570,11 @@ export default {
163 570 showLoader: false,
164 571 loading: false,
165 572 addLibrary: false,
  573 + dialogStudents: false,
  574 + editStudentdialog: false,
  575 + valid: true,
  576 + libraryIdRules: [v => !!v || "Library Id Fee is required"],
  577 + libraryFeeRules: [v => !!v || "Library Fee is required"],
166 578 date: null,
167 579 search: "",
168 580 addclass: [],
... ... @@ -181,8 +593,8 @@ export default {
181 593 value: "index"
182 594 },
183 595 {
184   - text: "Profile Pic",
185   - value: "profilePicUrl",
  596 + text: "Photo",
  597 + value: "uploadCover",
186 598 sortable: false,
187 599 align: "center"
188 600 },
... ... @@ -192,9 +604,11 @@ export default {
192 604 { text: "Action", value: "", sortable: false, align: "center" }
193 605 ],
194 606 studentData: [],
  607 + editedItem: {},
195 608 parentId: "",
196 609 token: "",
197   - selectStudents: {}
  610 + selectStudents: {},
  611 + editedIndex: -1
198 612 }),
199 613 methods: {
200 614 getAllStudents() {
... ... @@ -210,271 +624,98 @@ export default {
210 624 })
211 625 .catch(err => {
212 626 // console.log("err====>", err);
213   - // this.$router.replace({ path: "/" });
  627 + if (error.response.status === 401) {
  628 + this.$router.replace({ path: "/" });
  629 + this.$store.dispatch("setToken", null);
  630 + this.$store.dispatch("Id", null);
  631 + }
  632 + });
  633 + },
  634 + addLibraryData(item) {
  635 + this.addBook.studentId = item._id;
  636 + this.addLibrary = true;
  637 + },
  638 + editItem(item) {
  639 + this.editedIndex = this.studentData.indexOf(item);
  640 + this.editedItem = Object.assign({}, item);
  641 + this.editStudentdialog = true;
  642 + },
  643 + dates: function(date) {
  644 + return moment(date).format("MMMM DD, YYYY");
  645 + },
  646 + profile(item) {
  647 + console.log("item", item);
  648 + this.editedIndex = this.studentData.indexOf(item);
  649 + this.editedItem = Object.assign({}, item);
  650 + this.dialogStudents = true;
  651 + },
  652 + deleteItem(item) {
  653 + let deleteStudentLibraryData = {
  654 + studentId: item._id,
  655 + libraryId: item.libraryId
  656 +
  657 + };
  658 + http()
  659 + .put(
  660 + "/deleteLibrary",
  661 + confirm("Are you sure you want to delete this?") && deleteStudentLibraryData )
  662 + .then(response => {
  663 + this.snackbar = true;
  664 + this.text = "Delete Successfully";
  665 + this.getAllStudents();
  666 + })
  667 + .catch(error => {
  668 + // console.log(error);
214 669 });
215 670 },
216   - // getSection(_id) {
217   - // var token = this.$store.state.token;
218   - // http()
219   - // .get(
220   - // "/getSectionsList",
221   - // { params: { classId: _id } },
222   - // {
223   - // headers: { Authorization: "Bearer " + token }
224   - // }
225   - // )
226   - // .then(response => {
227   - // this.addSection = response.data.data;
228   - // console.log("getSectionsList=====>", this.addSection);
229   - // })
230   - // .catch(err => {
231   - // // console.log("err====>", err);
232   - // // this.$router.replace({ path: '/' });
233   - // });
234   - // },
235   - // pickFile() {
236   - // this.$refs.image.click();
237   - // },
238   - // dates: function(date) {
239   - // return moment(date).format("MMMM DD, YYYY");
240   - // },
241   - // onFilePicked(e) {
242   - // // console.log(e)
243   - // const files = e.target.files;
244   - // this.imageData.upload = e.target.files[0];
245   - // if (files[0] !== undefined) {
246   - // this.imageName = files[0].name;
247   - // if (this.imageName.lastIndexOf(".") <= 0) {
248   - // return;
249   - // }
250   - // const fr = new FileReader();
251   - // fr.readAsDataURL(files[0]);
252   - // fr.addEventListener("load", () => {
253   - // this.imageUrl = fr.result;
254   - // this.imageFile = files[0]; // this is an image file that can be sent to server...
255   - // this.imageData.imageUrl = URL.createObjectURL(this.imageFile);
256   - // });
257   - // } else {
258   - // this.imageName = "";
259   - // this.imageFile = "";
260   - // this.imageUrl = "";
261   - // }
262   - // },
263   - // getStudentList() {
264   - // this.showLoader = true;
265   - // var token = this.$store.state.token;
266   - // http()
267   - // .get("/getStudentsList", {
268   - // headers: { Authorization: "Bearer " + token }
269   - // })
270   - // .then(response => {
271   - // this.desserts = response.data.data;
272   - // this.showLoader = false;
273   - // // console.log("getStudentList=====>",this.desserts)
274   - // })
275   - // .catch(err => {
276   - // // console.log("err====>", err);
277   - // this.showLoader = false;
278   - // this.$router.replace({ path: "/" });
279   - // });
280   - // },
281   - // editItem(item) {
282   - // this.editedIndex = this.desserts.indexOf(item);
283   - // this.editedItem = Object.assign({}, item);
284   - // this.editedItem.fatherName = item.parentId.fatherName;
285   - // this.editedItem.fatherCellNo = item.parentId.fatherCellNo;
286   - // this.editedItem.motherName = item.parentId.motherName;
287   - // this.editedItem.motherCellNo = item.parentId.motherCellNo;
288   - // // if(this.editedItem.dob != undefined){
289   - // // this.editedItem.dob = this.editedItem.dob.substring(0, 10)
290   - // // }else if(this.editedItem.dob = undefined){
291   - // // this.editedItem.dob = ''
292   - // // }
293   - // this.editedItem.dob =
294   - // this.editedItem.dob != undefined
295   - // ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10))
296   - // : (this.editedItem.dob = "");
297   - // this.dialog = true;
298   - // },
299   - // profile(item) {
300   - // console.log("item", item);
301   - // this.editedIndex = this.desserts.indexOf(item);
302   - // this.editedItem = Object.assign({}, item);
303   - // this.editedItem.fatherName = item.parentId.fatherName;
304   - // this.editedItem.fatherCellNo = item.parentId.fatherCellNo;
305   - // this.editedItem.motherName = item.parentId.motherName;
306   - // this.editedItem.motherCellNo = item.parentId.motherCellNo;
307   - // this.dialog1 = true;
308   - // },
309   - // deleteItem(item) {
310   - // let deleteStudent = {
311   - // studentId: item._id
312   - // };
313   - // http()
314   - // .delete(
315   - // "/deleteStudent",
316   - // confirm("Are you sure you want to delete this?") && {
317   - // params: deleteStudent
318   - // }
319   - // )
320   - // .then(response => {
321   - // // console.log("deleteUers",deleteStudent)
322   - // if ((this.snackbar = true)) {
323   - // this.text = "Successfully delete Existing Student";
324   - // }
325   - // this.getStudentList();
326   - // })
327   - // .catch(error => {
328   - // // console.log(error);
329   - // });
330   - // },
331   - // activeTab(type) {
332   - // switch (type) {
333   - // case "existing":
334   - // this.newActive = false;
335   - // this.isActive = true;
336   - // break;
337   - // default:
338   - // this.newActive = true;
339   - // this.isActive = false;
340   - // break;
341   - // }
342   - // },
343   - // close() {
344   - // this.dialog = false;
345   - // setTimeout(() => {
346   - // this.editedItem = Object.assign({}, this.defaultItem);
347   - // this.editedIndex = -1;
348   - // }, 300);
349   - // },
350   - // close1() {
351   - // this.dialog1 = false;
352   - // },
  671 + close() {
  672 + this.dialog = false;
  673 + },
  674 + closeEditStudentDialog() {
  675 + this.editStudentdialog = false;
  676 + },
  677 + closeViewStudent() {
  678 + this.dialogStudents = false;
  679 + },
353 680 submit() {
354 681 if (this.$refs.form.validate()) {
355 682 this.loading = true;
356 683 http()
357   - .post("/addBook", this.addBook)
  684 + .put("/addLibrary", this.addBook)
358 685 .then(response => {
359   - // console.log(addStudent);
360   - // if ((this.snackbar = true)) {
361   - // this.text = "New Student added successfully";
362   - // }
363   - // this.getStudentList();
  686 + this.snackbar = true;
  687 + this.text = "New Library Member added successfully";
  688 + this.getAllStudents();
364 689 this.clear();
  690 + this.addLibrary = false;
365 691 this.loading = false;
366 692 })
367 693 .catch(error => {
368 694 // console.log(error);
369   - if ((this.snackbar = true)) {
370   - this.text = error.response.data.message;
371   - }
  695 + this.snackbar = true;
  696 + this.text = error.response.data.message;
372 697 this.loading = false;
373 698 });
374 699 }
375 700 },
376   - // clear() {
377   - // this.$refs.form.reset();
378   - // },
379   - // save() {
380   - // let editStudent = {
381   - // studentId: this.editedItem._id,
382   - // name: this.editedItem.name,
383   - // email: this.editedItem.email,
384   - // role: this.editedItem.role,
385   - // dob: this.editedItem.dob,
386   - // city: this.editedItem.city,
387   - // pincode: this.editedItem.pincode,
388   - // country: this.editedItem.country,
389   - // permanentAddress: this.editedItem.permanentAddress,
390   - // presentAddress: this.editedItem.presentAddress,
391   - // mobile: this.editedItem.mobile,
392   - // state: this.editedItem.state,
393   - // gender: this.editedItem.gender,
394   - // establishmentYear: this.editedItem.establishmentYear,
395   - // classId: this.editedItem.select,
396   - // sectionId: this.editedItem.selectSection,
397   - // bloodGroup: this.editedItem.bloodGroup,
398   - // allergies: this.editedItem.allergies,
399   - // medicalNotes: this.editedItem.medicalNotes,
400   - // height: this.editedItem.height,
401   - // weight: this.editedItem.weight,
402   - // rollNo: this.editedItem.rollNo
403   - // };
404   - // if (this.imageUrl) {
405   - // var str = this.imageUrl;
406   - // const [baseUrl, imageUrl] = str.split(/,/);
407   - // editStudent.upload = imageUrl;
408   - // }
409   - // http()
410   - // .put("/updateStudent", editStudent)
411   - // .then(response => {
412   - // if ((this.snackbar = true)) {
413   - // this.text = "Successfully Student Existing User";
414   - // }
415   - // this.findStudents();
416   - // this.close();
417   - // })
418   - // .catch(error => {
419   - // // console.log(error);
420   - // if ((this.snackbar = true)) {
421   - // this.text = error.response.data.statusText;
422   - // }
423   - // });
424   - // },
425   - // submitParentDetails() {
426   - // if (this.$refs.parentForm.validate()) {
427   - // let addparentDetails = {
428   - // email: this.parentData.email,
429   - // fatherName: this.parentData.fatherName,
430   - // fatherCellNo: this.parentData.fatherCellNo,
431   - // motherName: this.parentData.motherName,
432   - // motherCellNo: this.parentData.motherCellNo,
433   - // role: "PARENT"
434   - // };
435   - // this.loading = true;
436   - // http()
437   - // .post("/createParent", addparentDetails)
438   - // .then(response => {
439   - // this.parentId = response.data.data.id;
440   - // this.e2 = 2;
441   - // if ((this.snackbar = true)) {
442   - // this.text = "successfully";
443   - // }
444   - // // this.getStudentList();
445   - // this.clear();
446   - // this.loading = false;
447   - // })
448   - // .catch(error => {
449   - // console.log(error.response.data);
450   - // if ((this.snackbar = true)) {
451   - // this.text = error.response.data.message;
452   - // this.text = error.response.data.statusText;
453   - // }
454   - // this.loading = false;
455   - // });
456   - // }
457   - // },
458   - // getParentDetails() {
459   - // if (this.parentData.email) {
460   - // http()
461   - // .get("getParticularParent", {
462   - // params: { email: this.parentData.email },
463   - // headers: {
464   - // Authorization: "Bearer " + this.$store.state.token
465   - // }
466   - // })
467   - // .then(response => {
468   - // this.showNext = true;
469   - // this.showParent = false;
470   - // this.parentData = response.data.data;
471   - // this.parentId = response.data.data._id;
472   - // })
473   - // .catch(error => {
474   - // console.log("err====>", error.response.data.message);
475   - // });
476   - // }
477   - // }
  701 + clear() {
  702 + this.$refs.form.reset();
  703 + },
  704 + save() {
  705 + this.editedItem.studentId = this.editedItem._id;
  706 + http()
  707 + .put("/updateLibrary", this.editedItem)
  708 + .then(response => {
  709 + this.snackbar = true;
  710 + this.text = "Edit Library Member Successfully";
  711 + this.getAllStudents();
  712 + this.closeEditStudentDialog();
  713 + })
  714 + .catch(error => {
  715 + this.snackbar = true;
  716 + this.text = error.response.data.statusText;
  717 + });
  718 + },
478 719 getAllClass() {
479 720 http()
480 721 .get("/getClassesList", {
... ...
src/pages/Students/students.vue
... ... @@ -29,7 +29,7 @@
29 29 color="success"
30 30 >{{ text }}</v-snackbar>
31 31 <v-dialog v-model="dialog" max-width="1500px" scrollable>
32   - <v-card flat style="height: 586px;" class="mx-2">
  32 + <v-card flat>
33 33 <v-toolbar color="grey lighten-2" flat>
34 34 <v-spacer></v-spacer>
35 35 <v-toolbar-title>
... ... @@ -37,7 +37,7 @@
37 37 </v-toolbar-title>
38 38 <v-spacer></v-spacer>
39 39 </v-toolbar>
40   - <v-card-text>
  40 + <v-card-text style="height: 586px;">
41 41 <v-form ref="form">
42 42 <v-container fluid>
43 43 <v-layout>
... ... @@ -524,14 +524,14 @@
524 524 <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** -->
525 525  
526 526 <v-dialog v-model="dialog1" max-width="1100px" scrollable>
527   - <v-card style="height: 700px;" class="mx-2">
  527 + <v-card >
528 528 <v-toolbar color="grey lighten-2" flat>
529 529 <v-spacer></v-spacer>
530 530 <v-toolbar-title>Student Profile</v-toolbar-title>
531 531 <v-spacer></v-spacer>
532 532 <v-icon @click="close1">close</v-icon>
533 533 </v-toolbar>
534   - <v-card-text>
  534 + <v-card-text style="height: 700px;">
535 535 <v-flex align-center justify-center layout text-xs-center class="mt-3">
536 536 <v-avatar size="160px">
537 537 <img src="/static/icon/user.png" v-if="!editedItem.profilePicUrl" />
... ...
static/css/custom.css
... ... @@ -247,4 +247,11 @@ h4 {
247 247 width: 33px;
248 248 margin-top: 5px;
249 249 }
  250 + .iconOfDashboard {
  251 + top: 0px !important;
  252 + left: 0px !important;
  253 + height: 80px !important;
  254 + width: 80px !important;
  255 + margin-top: 0px !important;
  256 + }
250 257 }
251 258 \ No newline at end of file
... ...