diff --git a/src/App.vue b/src/App.vue index 76a687c..49edf93 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,6 +40,7 @@ import AppDrawer from '@/components/pageHeader/AppDrawer'; import AppToolbar from '@/components/pageHeader/AppToolbar'; import menu from '@/api/menu'; import AppEvents from './event'; + export default { components: { AppDrawer, diff --git a/src/Services/http.js b/src/Services/http.js index 3d11187..c8bbbd5 100644 --- a/src/Services/http.js +++ b/src/Services/http.js @@ -3,7 +3,7 @@ import store from '@/store/store' export default () => { return axios.create({ - // baseURL:'http://192.168.2.221:3002/v1', + // baseURL:'http://192.168.4.220:3002/v1', baseURL:'http://139.59.58.160:8001/v1', headers: { Authorization: `Bearer ${store.state.token}` diff --git a/src/pages/Class/addclass.vue b/src/pages/Class/addclass.vue index f31c76b..29ca70f 100644 --- a/src/pages/Class/addclass.vue +++ b/src/pages/Class/addclass.vue @@ -211,12 +211,7 @@ - - - - - - + @@ -236,9 +231,9 @@ - clear Add + diff --git a/src/pages/News/news.vue b/src/pages/News/news.vue index 62a4766..9909be3 100644 --- a/src/pages/News/news.vue +++ b/src/pages/News/news.vue @@ -73,83 +73,42 @@ v-model="snackbar" color="success" >{{ text }} - - - + + +

Edit News

-
- +
+ - - - - - - News - - - - - - - - - - - - - - - - - - - - - - - - + + + News + close + + + + + + News + @@ -186,7 +145,7 @@ - + +
- - + +

News

close -
- +
- - News + + News @@ -280,9 +239,7 @@ {{ props.index}} - - newsImage - + newsImage {{ props.item.title}} @@ -338,7 +295,7 @@ - - - - - + + + + @@ -549,16 +505,16 @@ export default { return; } this.files = []; - console.log("files", this.files); + // console.log("files", this.files); /** Select many image and showing many image add to news card **/ const test = Array.from(files).forEach((file, idx) => { const fr = new FileReader(); const getResult = new Promise(resolve => { fr.onload = e => { - this.files.push({ - id: idx, - url: e.target.result - }); + this.files.push( + // id: idx, + e.target.result + ); }; }); fr.readAsDataURL(file); @@ -570,7 +526,7 @@ 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 ); + // console.log("uploadImage=======>", this.imageFile ); }); } else { this.imageName = ""; @@ -628,6 +584,25 @@ export default { // console.log(error); }); }, + deleteImage(imageId, newsId){ + console.log(imageId, newsId) + let deleteImages = { + newsId: newsId, + imageId: imageId + }; + http() + .put("/deleteImages", deleteImages) + .then(response => { + console.log("deleteNews",deleteImages) + if ((this.snackbar = true)) { + this.text = "Image deleted Successfully"; + } + this.getNewsList(); + }) + .catch(error => { + console.log(error); + }); + }, activeTab(type) { switch (type) { case "existing": @@ -655,15 +630,19 @@ export default { console.log("===========>",this.image) this.loading = true; if (this.$refs.form.validate()) { - let newsData = new FormData(); - for( var i = 0; i < this.imageFile.length; i++ ){ - let file = this.imageFile[i]; - newsData.append("upload", file ); + // let newsData = new FormData(); + // for( var i = 0; i < this.imageFile.length; i++ ){ + // let file = this.imageFile[i]; + // newsData.append("upload", file ); + // } + // newsData.append("title",this.addNews.title); + // newsData.append("description",this.addNews.description); + // console.log("newsDataData",newsData); + let newsData ={ + title:this.addNews.title, + description:this.addNews.description, + upload:this.files } - newsData.append("title",this.addNews.title); - newsData.append("description",this.addNews.description); - console.log("newsDataData",newsData); - http() .post("/createNews", newsData) .then(response => { @@ -688,13 +667,18 @@ export default { this.$refs.form.reset(); }, save() { - let newsData = new FormData(); - for( var i = 0; i < this.imageFile.length; i++ ){ - let file = this.imageFile[i]; - newsData.append("upload", file ); - } - newsData.append("title",this.editedItem.title); - newsData.append("description",this.editedItem.description); + // let imageData = new FormData(); + // for( var i = 0; i < this.imageFile.length; i++ ){ + // let file = this.imageFile[i]; + // imageData.append("upload", file ); + // } + // console.log(imageData) + let editNews = { + title:this.editedItem.title, + description:this.editedItem.description, + newsId:this.editedItem._id, + upload:this.files + } http() .put("/updateNews", editNews) .then(response => { @@ -703,11 +687,11 @@ export default { this.text = "Successfully Edit Existing News"; } this.getNewsList(); + this.close(); }) .catch(error => { // console.log(error); }); - this.close(); }, handleDrawerToggle() { window.getApp.$emit("APP_DRAWER_TOGGLED"); @@ -829,6 +813,23 @@ h4 { .list{ padding: 0 0px !important; } +.profile-image-wrapper { + position: relative; + } + .edit-profile-icon { + position: absolute; + right: 15px; + top: 15px; + cursor: pointer; + } + .profile-image-wrapper > .edit-profile-icon { + right: 10%; + top: 0%; + margin-top: 8px; + border-radius: 50%; + padding: 7px; + font-size: 20px; +} @media screen and (max-width: 769px) { .top { margin-top: 0 !important; diff --git a/src/pages/Section/section.vue b/src/pages/Section/section.vue index 6e824b0..841ecb5 100644 --- a/src/pages/Section/section.vue +++ b/src/pages/Section/section.vue @@ -240,12 +240,7 @@ - - - - - - + diff --git a/src/pages/Students/students.vue b/src/pages/Students/students.vue index 37820c3..db333e0 100644 --- a/src/pages/Students/students.vue +++ b/src/pages/Students/students.vue @@ -72,14 +72,14 @@ v-model="snackbar" color="success" >{{ text }} - - - + + +

Edit Student Profile

- + @@ -87,8 +87,16 @@ xs12 class="text-xs-center text-sm-center text-md-center text-lg-center mr-4" > - - + + + + -
@@ -391,7 +393,6 @@
- @@ -402,7 +403,7 @@ label="Select Image" @click="pickFile" v-model="imageName" - prepend-icon="attach_file" + append-icon="attach_file" > @@ -412,7 +413,7 @@ - +
+ + - - + + - - + + > + + Cancel Save - + - -
- + + + +
-
- - - - Student Profile - - close - + - - - + + + Student Profile + + close + + + + + + - - -
-
+
Full Name:
@@ -622,12 +626,12 @@ @@ -635,7 +639,7 @@