@@ -93,10 +48,10 @@
-
+
close
-
+
@@ -193,6 +154,48 @@
+
+
+
+
+
+
+
+
+
+
+ cancel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cancel
+ add_circle
+
+
+
+
@@ -230,7 +233,7 @@
class="mt-4 pa-2"
v-if="editedItem.imageUrl"
>
-
+
@@ -257,6 +260,20 @@
{{ editedItem.description }}
+
+
+
+ You Tube Link Url:
+
+
+
+
+ {{ youTubeLinkUrl }}
+
+
+
@@ -284,13 +301,13 @@
{{ props.index}} |
-
+
|
{{ props.item.title}} |
{{ props.item.description}} |
-
+ |
-
- cancel
+ cancel
add_circle
@@ -501,7 +517,8 @@ export default {
addclass: [],
addSection: [],
finds: [{ value: "" }],
- youTubeLinkUrl: "",
+ updates: [{ youTubeLink: "" }],
+ youTubeLink: {},
addGallery: {
youTubeLinkUrl: []
},
@@ -513,6 +530,8 @@ export default {
imageFile: "",
image: [],
upload: "",
+ editImageName: "",
+ editFiles: [],
files: [],
addclass: [],
token: "",
@@ -537,51 +556,16 @@ export default {
],
desserts: [],
editedIndex: -1,
- editedItem: {},
- userName: "",
- items: [
- {
- href: "/changepassword",
- title: "Change Password",
- click: e => {
- console.log(e);
- }
- },
- {
- href: "#",
- title: "Logout",
- click: e => {
- window.getApp.$emit("APP_LOGOUT");
- }
- }
- ]
+ editedItem: {}
}),
methods: {
- getSections(_id) {
- console.log("_id", _id);
- var token = this.$store.state.token;
- http()
- .get(
- "/getSectionsList",
- { params: { classId: _id } },
- {
- headers: { Authorization: "Bearer " + token }
- }
- )
- .then(response => {
- this.addSection = response.data.data;
- // console.log("getSectionsList=====>", this.addSection);
- })
- .catch(err => {
- console.log("err====>", err);
- // this.$router.replace({ path: '/' });
- });
- },
pickFile() {
this.$refs.image.click();
},
+ editPickFile() {
+ this.$refs.editImage.click();
+ },
onFilePicked(e) {
- // console.log(e)
const files = e.target.files;
/** fetch Image Name **/
if (files[0] !== undefined) {
@@ -601,6 +585,7 @@ export default {
e.target.result
);
};
+ console.log("uploadImage=======>", this.files);
});
fr.readAsDataURL(file);
return getResult.then(file => {
@@ -611,7 +596,6 @@ export default {
fr.readAsDataURL(files[0]);
fr.addEventListener("load", () => {
this.imageFile = files; // this is an image file that can be sent to server...
- // console.log("uploadImage=======>", this.imageFile );
});
} else {
this.imageName = "";
@@ -619,6 +603,41 @@ export default {
this.imageUrl = "";
}
},
+ editFilePicked(e) {
+ const files = e.target.files;
+ /** fetch Image Name **/
+ if (files[0] !== undefined) {
+ this.editImageName = files[0].name;
+ if (this.editImageName.lastIndexOf(".") <= 0) {
+ return;
+ }
+ /** Select many image and showing many image add to Gallery card **/
+ const test = Array.from(files).forEach((file, idx) => {
+ const fr = new FileReader();
+ const getResult = new Promise(resolve => {
+ fr.onload = e => {
+ this.editFiles.push(
+ // id: idx,
+ e.target.result
+ );
+ };
+ console.log("uploadImage=======>", this.files);
+ });
+ fr.readAsDataURL(file);
+ return getResult.then(file => {
+ return file;
+ });
+ });
+ const fr = new FileReader();
+ fr.readAsDataURL(files[0]);
+ // fr.addEventListener("load", () => {
+ // this.imageFile = files; // this is an image file that can be sent to server...
+ // });
+ } else {
+ this.editImageName = "";
+ this.editFiles = "";
+ }
+ },
getGalleryList() {
this.showLoader = true;
http()
@@ -632,13 +651,30 @@ export default {
.catch(err => {
// console.log("err====>", err);
this.showLoader = false;
- // this.$router.replace({ path: "/" });
+ if (error.response.status === 401) {
+ this.$router.replace({ path: "/" });
+ this.$store.dispatch("setToken", null);
+ this.$store.dispatch("Id", null);
+ }
});
},
editItem(item) {
this.files = [];
this.editedIndex = this.desserts.indexOf(item);
this.editedItem = Object.assign({}, item);
+ console.log("this.editedItem", this.editedItem);
+ // for (let i = 0; i < this.editedItem.youTubeLinkUrl.length; i++) {
+ // console.log(
+ // "this.editedItem.youTubeLinkUrl[i]",
+ // this.editedItem.youTubeLinkUrl[i]
+ // );
+ // this.updates = this.editedItem.youTubeLinkUrl[i];
+ // console.log("this.updates.linkUrl", this.updates);
+ // }
+ // this.updates[i].push(this.editedItem.youTubeLinkUrl);
+ // console.log("updates", this.updates[i]);
+ // console.log("updates", this.updates[i].youTubeLinkUrl);
+ // }
this.dialog = true;
},
profile(item) {
@@ -648,39 +684,40 @@ export default {
},
deleteItem(item) {
let deleteGallery = {
- gelleryId: item._id
+ galleryId: item._id
};
http()
.delete(
- "/deleteGellery",
+ "/deleteGallery",
confirm("Are you sure you want to delete this?") && {
- params: deleteGallery
+ params: deleteGallery,
+ headers: {
+ Authorization: "Bearer " + this.token
+ }
}
)
.then(response => {
if ((this.snackbar = true)) {
this.text = "Successfully delete Existing News";
}
- this.getNewsList();
+ this.getGalleryList();
})
.catch(error => {
// console.log(error);
});
},
- deleteImage(imageId, newsId) {
- console.log(imageId, newsId);
+ deleteImage(imageId, id) {
+ console.log("imageId", imageId, "id", id);
let deleteImages = {
- newsId: newsId,
+ galleryId: id,
imageId: imageId
};
http()
- .put("/deleteImages", deleteImages)
+ .put("/deleteImage", deleteImages)
.then(response => {
- console.log("deleteNews", deleteImages);
- if ((this.snackbar = true)) {
- this.text = "Image deleted Successfully";
- }
- this.getNewsList();
+ this.snackbar = true;
+ this.text = response.data.message;
+ this.getGalleryList();
this.close();
})
.catch(error => {
@@ -712,7 +749,9 @@ export default {
},
submit() {
this.loading = true;
- this.addGallery.youTubeLinkUrl.push(this.youTubeLinkUrl);
+ for (let i = 0; i < this.finds.length; i++) {
+ this.addGallery.youTubeLinkUrl.push(this.finds[i].value);
+ }
if (this.$refs.form.validate()) {
if (this.files) {
var ary = [];
@@ -727,10 +766,10 @@ export default {
http()
.post("/createGallery", this.addGallery)
.then(response => {
+ this.getGalleryList();
this.loading = false;
this.snackbar = true;
this.text = response.data.message;
- this.getGelleryList();
this.clear();
})
.catch(error => {
@@ -745,6 +784,9 @@ export default {
},
save() {
this.editedItem.gelleryId = this.editedItem._id;
+ for (let i = 0; i < this.updates.length; i++) {
+ this.editedItem.youTubeLinkUrl.push(this.updates[i].value);
+ }
if (this.files) {
var ary = [];
var imageData = [];
@@ -755,17 +797,18 @@ export default {
this.editedItem.upload = imageData;
}
}
- http()
- .put("/updateGellery", this.editedItem)
- .then(response => {
- this.snackbar = true;
- this.text = response.data.message;
- this.getGelleryList();
- this.close();
- })
- .catch(error => {
- console.log(error);
- });
+ console.log("this.editedItem", this.editedItem);
+ // http()
+ // .put("/updateGellery", this.editedItem)
+ // .then(response => {
+ // this.getGalleryList();
+ // this.close();
+ // this.snackbar = true;
+ // this.text = response.data.message;
+ // })
+ // .catch(error => {
+ // console.log(error);
+ // });
},
getAllClasses() {
http()
@@ -777,21 +820,41 @@ export default {
})
.catch(err => {
// console.log("err====>", err);
- // this.$router.replace({ path: "/" });
});
},
- handleDrawerToggle() {
- window.getApp.$emit("APP_DRAWER_TOGGLED");
- },
- handleFullScreen() {
- Util.toggleFullScreen();
- },
addFind: function() {
this.finds.push({ value: "" });
},
+ update: function() {
+ this.updates.push({ youTubeLink: "" });
+ },
deleteFind: function(index) {
this.finds.splice(index, 1);
if (index === 0) this.addFind();
+ },
+ deleteUpdate: function(index) {
+ this.updates.splice(index, 1);
+ if (index === 0) this.update();
+ },
+ deleteUrl: function(index,youTubelinkId,id) {
+ this.editedItem.youTubeLinkUrl.splice(index, 1);
+ if (index === 0) this.update();
+ console.log("imageId", youTubelinkId, "id", id);
+ let deleteYouTubeUrl = {
+ galleryId: id,
+ youTubeId: youTubelinkId
+ };
+ http()
+ .put("/deleteYoutubeLink", deleteYouTubeUrl)
+ .then(response => {
+ this.snackbar = true;
+ this.text = response.data.message;
+ this.getGalleryList();
+ this.close();
+ })
+ .catch(error => {
+ console.log(error);
+ });
}
},
mounted() {
@@ -799,83 +862,23 @@ export default {
this.getAllClasses();
this.getGalleryList();
},
- computed: {
- toolbarColor() {
- return this.$vuetify.options.extra.mainNav;
- }
+ created() {
+ this.$root.$on("app:search", search => {
+ this.search = search;
+ });
+ },
+ beforeDestroy() {
+ // dont forget to remove the listener
+ this.$root.$off("app:search");
}
};
\ No newline at end of file
diff --git a/src/pages/News/news.vue b/src/pages/News/news.vue
index 6acfdd5..e4f0090 100644
--- a/src/pages/News/news.vue
+++ b/src/pages/News/news.vue
@@ -1,50 +1,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.icon }}
-
-
- {{ item.title }}
-
-
-
-
-
{
- console.log(e);
- }
- },
- {
- href: "#",
- title: "Logout",
- click: e => {
- window.getApp.$emit("APP_LOGOUT");
- }
- }
- ]
}),
methods: {
getSections(_id) {
@@ -583,7 +521,11 @@ export default {
.catch(err => {
// console.log("err====>", err);
this.showLoader = false;
- this.$router.replace({ path: "/" });
+ if (error.response.status === 401) {
+ this.$router.replace({ path: "/" });
+ this.$store.dispatch("setToken", null);
+ this.$store.dispatch("Id", null);
+ }
});
},
editItem(item) {
@@ -697,8 +639,6 @@ export default {
});
}
},
- mail() {},
- download() {},
clear() {
this.$refs.form.reset();
},
@@ -706,18 +646,18 @@ export default {
let editNews = {
title: this.editedItem.title,
description: this.editedItem.description,
- newsId: this.editedItem._id,
+ newsId: this.editedItem._id
};
if (this.files) {
- var ary = [];
- var imageData = [];
- ary = this.files;
- for (let i = 0; i < ary.length; i++) {
- const [baseUrl, imageUrl] = ary[i].split(/,/);
- imageData.push(imageUrl);
- editNews.upload = imageData;
- }
+ var ary = [];
+ var imageData = [];
+ ary = this.files;
+ for (let i = 0; i < ary.length; i++) {
+ const [baseUrl, imageUrl] = ary[i].split(/,/);
+ imageData.push(imageUrl);
+ editNews.upload = imageData;
}
+ }
http()
.put("/updateNews", editNews)
.then(response => {
@@ -732,107 +672,23 @@ export default {
// console.log(error);
});
},
- handleDrawerToggle() {
- window.getApp.$emit("APP_DRAWER_TOGGLED");
- },
- handleFullScreen() {
- Util.toggleFullScreen();
- }
},
mounted() {
this.getNewsList();
- // var token = this.$store.state.token;
- // http()
- // .get("/getClassesList", {
- // headers: { Authorization: "Bearer " + token }
- // })
- // .then(response => {
- // this.addclass = response.data.data;
- // // console.log("getClassesList=====>",this.addclass)
- // })
- // .catch(err => {
- // // console.log("err====>", err);
- // });
this.editItem;
},
- computed: {
- toolbarColor() {
- return this.$vuetify.options.extra.mainNav;
- }
+ created() {
+ this.$root.$on("app:search", search => {
+ this.search = search;
+ });
+ },
+ beforeDestroy() {
+ // dont forget to remove the listener
+ this.$root.$off("app:search");
}
};
\ No newline at end of file
diff --git a/src/pages/NoticeBoard/noticeBoard.vue b/src/pages/NoticeBoard/noticeBoard.vue
index f00e833..5118bf0 100644
--- a/src/pages/NoticeBoard/noticeBoard.vue
+++ b/src/pages/NoticeBoard/noticeBoard.vue
@@ -1,51 +1,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.icon }}
-
-
- {{ item.title }}
-
-
-
-
-
{
- console.log(e);
- }
- },
- {
- href: "#",
- title: "Logout",
- click: e => {
- window.getApp.$emit("APP_LOGOUT");
- }
- }
- ]
+ }
}),
methods: {
pickFile() {
@@ -487,8 +424,6 @@ export default {
fr.addEventListener("load", () => {
this.imageUrl = fr.result;
this.imageFile = files[0]; // this is an image file that can be sent to server...
- console.log("upload=======>", this.imageUrl);
- console.log("imageFile", this.imageFile);
});
} else {
this.imageName = "";
@@ -506,12 +441,14 @@ export default {
.then(response => {
this.desserts = response.data.data;
this.showLoader = false;
- // console.log("getEventList=====>",this.desserts)
})
.catch(err => {
this.showLoader = false;
- // console.log("err====>", err);
- // this.$router.replace({ path: "/" });
+ if (error.response.status === 401) {
+ this.$router.replace({ path: "/" });
+ this.$store.dispatch("setToken", null);
+ this.$store.dispatch("Id", null);
+ }
});
},
editItem(item) {
@@ -614,97 +551,28 @@ export default {
this.text = "Successfully Edit Existing Notice Data";
}
this.getNoticeDataList();
+ this.close();
})
.catch(error => {
// console.log(error);
});
- this.close();
- },
- handleDrawerToggle() {
- window.getApp.$emit("APP_DRAWER_TOGGLED");
- },
- handleFullScreen() {
- Util.toggleFullScreen();
}
},
mounted() {
this.getNoticeDataList();
},
- computed: {
- toolbarColor() {
- return this.$vuetify.options.extra.mainNav;
- }
+ created() {
+ this.$root.$on("app:search", search => {
+ this.search = search;
+ });
+ },
+ beforeDestroy() {
+ // dont forget to remove the listener
+ this.$root.$off("app:search");
}
};
\ No newline at end of file
diff --git a/src/pages/Notification/notification.vue b/src/pages/Notification/notification.vue
index a0723f2..fac895e 100644
--- a/src/pages/Notification/notification.vue
+++ b/src/pages/Notification/notification.vue
@@ -1,51 +1,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.icon }}
-
-
- {{ item.title }}
-
-
-
-
-
- Edit Notifictaion
+
+ Edit Notifictaion
+
@@ -90,7 +46,7 @@
class="text-xs-center text-sm-center text-md-center text-lg-center mr-4"
>
-
+
+ />
+ />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Cancel
-
- Save
-
+
+ Cancel
+
+ Save
+
@@ -156,22 +112,24 @@
- Notification
+
+ Notification
+
close
-
+
-
-
+
+
Title:
@@ -203,7 +161,7 @@
color="success"
>{{ text }}
-
+
{{ props.item.title}} |
{{ props.item.description}} |
-
+ |
+ />
+ />
+ />
|