Commit 709e7ead authored by Jérémie Passerat's avatar Jérémie Passerat

Fonctions 'detail contenu' ok

parent b2c8f6a4
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<Menu v-show="etat !== 'unlogged'" v-bind:auteur="auteur" v-bind:etat="etat" v-bind:isNotif="isNotif" v-bind:variante="variante" @menu_choisi="changerPage"></Menu> <Menu v-show="etat !== 'unlogged'" v-bind:auteur="auteur" v-bind:etat="etat" v-bind:isNotif="isNotif" v-bind:variante="variante" @menu_choisi="changerPage"></Menu>
<Contenu v-show="etat === 'Contenu'" v-bind:auteur="auteur" @choix_variante="choixVariante" @publication="publication"></Contenu> <Contenu v-show="etat === 'Contenu'" v-bind:auteur="auteur" @choix_variante="choixVariante" @publication="publication"></Contenu>
<Maj v-show="etat === 'Mises à jour'" v-bind:contenuEnPublication="contenuEnPublication" ></Maj> <Maj v-show="etat === 'Mises à jour'" v-bind:auteur="auteur" v-bind:contenuEnPublication="contenuEnPublication" ></Maj>
<Profil v-show="etat === 'Profil'" ></Profil> <Profil v-show="etat === 'Profil'" ></Profil>
<Tags v-show="etat === 'Tags'" ></Tags> <Tags v-show="etat === 'Tags'" ></Tags>
<p style="text-align: center" v-show="errorLogin">Login ou mot de passe erroné</p> <p style="text-align: center" v-show="errorLogin">Login ou mot de passe erroné</p>
......
...@@ -2,115 +2,134 @@ ...@@ -2,115 +2,134 @@
<div> <div>
<span class="niveau" id="recues" v-on:click="naviguer">Maj Recues</span><br> <span class="niveau" id="recues" v-on:click="naviguer">Maj Recues</span><br>
<div id="detailRecues" class="masque"> <div id="detailRecues" class="masque">
<table> <table>
<thead> <thead>
<tr> <tr>
<th colspan="6">Contenus</th> <th colspan="6">Contenus</th>
</tr> </tr>
</thead> </thead>
<tr> <tr>
<th>Titre</th> <th>Titre</th>
<th>Auteur</th> <th>Auteur</th>
<th>Version actuelle</th> <th>Version actuelle</th>
<th>Date Version actuelle</th> <th>Date Version actuelle</th>
<th>Accepter</th> <th>Accepter</th>
<th>Refuser</th> <th>Refuser</th>
</tr> </tr>
<tbody> <tbody>
<!-- <tr v-show="!panierChoisi" v-for="item in contenusbanque" :key="item.titre">
<tr> <td class="modal titreContenu" v-on:click="chargerContenu(item, 'banque')" v-popover:tooltip="'prévisualisation'">{{ item._id }}</td>
<td>Contenu1</td> <td>{{ item.auteur }}</td>
<td>Auteur1</td> <td>The table body</td>
<td>1</td> <td>with two columns</td>
<td>01/06/2021</td> <td>with two columns</td>
<td id="valider"><img v-bind:src="imageCoche" alt='' height=20 width=20></td> <td>with two columns</td>
<td id="refuser"><img v-bind:src="imageCroix" alt='' height=20 width=20></td> <td class="modal tagContenu" v-popover:tooltip="'tags'">with two columns</td>
</tr> <td class="boutonSupprimer"> <input type="checkbox" v-on:change="ajouterCoche(item._id, item.versionEnCours)" class="horns" name="horns"/></td>
</tbody>
</table> </tr>-->
<tr v-for="item in contenusRecu" :key="item._id">
<td>Contenu1</td>
<td>{{ item.auteurDemande }}</td>
<td>1</td>
<td>01/06/2021</td>
<td id="valider"><img v-bind:src="imageCoche" alt='' height=20 width=20></td>
<td id="refuser"><img v-bind:src="imageCroix" alt='' height=20 width=20></td>
</tr>
</tbody>
</table>
</div> </div>
<span class="niveau" id="proposees" v-on:click="naviguer">Maj Proposées</span> <span class="niveau" id="proposees" v-on:click="naviguer">Maj Proposées</span>
<div id="detailProposees" class="masque"> <div id="detailProposees" class="masque">
<table> <table>
<thead> <thead>
<tr> <tr>
<th colspan="8">Contenus</th> <th colspan="8">Contenus</th>
</tr> </tr>
</thead> </thead>
<tr> <tr>
<th>Titre</th>
<th>Auteur</th> <th>Titre</th>
<th>Version proposée</th> <th>Auteur</th>
<th>Date Version proposée</th> <th>Version proposée</th>
<th>Etat</th> <th>Date Version proposée</th>
<th>Conserver</th> <th>Etat</th>
<th>Conserver</th>
<th>Créer Nouveau</th> <th>Créer Nouveau</th>
<th>Supprimer</th> <th>Supprimer</th>
</tr>
</tr> <tbody>
<tbody>
<tr v-for="item in contenusPropose" :key="item._id">
<tr> <td>Contenu1</td>
<td>Contenu1</td> <td>{{ item.auteurContenu }}</td>
<td>Auteur1</td> <td>1</td>
<td>1</td> <td>01/06/2021</td>
<td>01/06/2021</td> <td>{{ item.etat }}</td>
<td>En Cours</td> <td v-on:click="conserver"><img v-bind:src="imageCoche" alt='' height=20 width=20></td>
<td></td> <td v-on:click="creerNouveau"><img v-bind:src="imgNouveau" alt='' height=20 width=20></td>
<td></td> <td v-on:click="supprimer"><img v-bind:src="imgPoubelle" alt='' height=20 width=20></td>
<td></td> </tr>
</tbody>
<!-- <td id="valider"><img v-bind:src="imageCoche" alt='' height=20 width=20></td> </table>
<td id="refuser"><img v-bind:src="imageCroix" alt='' height=20 width=20></td>--> </div>
</tr>
<tr>
<td>Contenu1</td>
<td>Auteur1</td>
<td>1</td>
<td>01/06/2021</td>
<td>Refusée</td>
<td><img v-bind:src="imageCoche" alt='' height=20 width=20></td>
<td><img v-bind:src="imgNouveau" alt='' height=20 width=20></td>
<td><img v-bind:src="imgPoubelle" alt='' height=20 width=20></td>
<!-- <td id="valider"><img v-bind:src="imageCoche" alt='' height=20 width=20></td>
<td id="refuser"><img v-bind:src="imageCroix" alt='' height=20 width=20></td>-->
</tr>
</tbody>
</table>
</div>
</div> </div>
</template> </template>
<script> <script>
import Service from "@/service/Service";
export default { export default {
name: "Maj", name: "Maj",
props: ['contenuEnPublication'], props: ['contenuEnPublication', 'auteur'],
methods: { methods: {
naviguer: function (e) { naviguer: function (e) {
e.target.classList.toggle("niveau-down") e.target.classList.toggle("niveau-down")
//alert(e.target.id) //alert(e.target.id)
document.getElementById("detail" + e.target.id[0].toUpperCase() + e.target.id.substring(1)).classList.toggle('affiche') document.getElementById("detail" + e.target.id[0].toUpperCase() + e.target.id.substring(1)).classList.toggle('affiche')
},
conserver: function () {
alert("conserver")
},
creerNouveau: function() {
alert("creerNouveau")
},
supprimer: function () {
alert("supprimer")
} }
}, },
data: function () { data: function () {
return{ return {
imageCoche: "https://e7.pngegg.com/pngimages/485/477/png-clipart-check-mark-computer-icons-green-check-circle-angle-text.png", imageCoche: "https://e7.pngegg.com/pngimages/485/477/png-clipart-check-mark-computer-icons-green-check-circle-angle-text.png",
imageCroix: "https://e7.pngegg.com/pngimages/993/267/png-clipart-computer-icons-red-cross-miscellaneous-logo.png", imageCroix: "https://e7.pngegg.com/pngimages/993/267/png-clipart-computer-icons-red-cross-miscellaneous-logo.png",
imgPoubelle: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAflBMVEX///8AAACampq4uLh5eXlcXFxlZWXr6+vFxcVFRUWurq6ioqL39/doaGju7u7Z2dmIiIjX19eoqKicnJxZWVlvb28qKirDw8Pl5eU6Ojq5ublAQEDOzs7f398dHR1OTk4xMTGRkZERERGLi4sbGxt+fn4kJCQLCwt0dHRSUlJ5VCwrAAAIRUlEQVR4nO2d6VYbSwyEHbyBMWbHEBKwCev7v+C9jruOMyqpx2YZKTn6fiLj6WJ60TZDr5ckSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkyd9PfzjajWHfe8g7svdtV/a8h7wjqTAVxicVpsL4QGF/Nq4z6//lCvdbP7mfCoOSCjekwqikwg2pMCqpcEMqjMq/r/CwjPtH6yd/lE8edjCq7RlcDFu4KeM+aPvg8KB88qbtgxeDDhXefvPgtkOFB+3D+QIOUmEqTIWpMBWmwlSYCj+Vm/bhfAE3HSqc9z2Yd6gwSZIkSbbm+HLQBZfHbgp/tPshn0J7SvKr+NmRwp9uCqcdKZy6Kew9dCLwwU9gb9GJwoWjwjcezu1osDeZzPe123s0OVsxOVJsD/vzyWRvMFLS6ReOCp94ONgVtNt7XmznlRul7F5PnevacMjDQTntXlGBAprW9HZfbPts8qxKTXg4CFNHOyocFdt3Nk0clAHlD46G9MGOClE667Opvcr6dSiLBlNKWaJVhSfFpkx8vwNfPfIx0uWOCpfFdsImxwO/1+PhXBaLci+qCnHvL9nkoGvDHQ0Hh5eynqoKsX4vyHLn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1RMriwFB63fI8/8txbGF6YpRBennRw/fswgMxj3BltUZZCNERJPzZGDmMFpSuMZy4MheazFhGKFmsoj2E8c2EoNJ+1iJHDWEFOjfGYlqHQfBgsikujTC+ET2JzNBRiyyTfKEYO4zdyaAguRPhkKETwRKGFgxILOTSjLcpQaDZEOSixkE6N8cyFodB61iKOS8MOpRFcGAqt0GKoXMkLOTajWmYoxLEnsyEnypW8kKErwiexdxgKsS/J4OlcuZIX0qlBbUaklgyF1tNucVwaTpKhNiNcAUMhDnZZl4nQhwGki/2s+2GGQvh4si4TJcJfQfn7olA4O4bCcf1LQmAObiuFbV8SApm/14tJdYWyLuP/LMmfyCMfwUUzQNQV4mkSGVpEOvA5u633i+oKF+WnMgZ7pat4Ip0apOOb2TNdIUILmXuM5NJw7hfBRdNN0RXCAZKhRYw+DCBDOzhczXurK8S9kq6f/7MkfyIzowgXmvdWV4h7tRTfEaVosUY6NQj5mjNPV4gZLStVkVya/50XkTfUKxe6QuxK4sR5CJSl6XG6Gq53c33qCrHehOMdpQ8DiKIK3s/VTJ/pCpGYExlv/4dHm0inpvy4uT51hcazFrFcGs5AlB83vWldofGsRZQ+DCDzZPj5FgrVj8bpwwCydKE+c1FVKBPncYoWa2QeA9tHI5OqKkRWVOb0I+UwVljja1QuVIWoWlh/oyhYc6zR86YqtF4+G+vA79E+AUel4YqpCuHgyeDJQUMdcV7DnW4EF6pC4+Wzvu/01BA+F0rwy1aFCENEM0CX/7ByO0QhTQ1r1fd568FyoD4MsGwO8KI3m41P5/3GuJez8YpZ47OX/fnpeDaTOX3vF2AxonTxwm82qfMs+vQjFS3WKO/5/BDRXJrP/38lcfowgPIWzA8R40mLBp+s0FuOwr+v8HP/J2Kssswa7R+PvJ94B776yv8PEKtosUZ7Sff7iZbDWKH8v5IPEM+l+ewjP96Br79m/v3EKlokSZIkSZIkX81/MjFrMKxwu60AAAAASUVORK5CYII=",
imgNouveau: "https://png.pngtree.com/png-vector/20190129/ourmid/pngtree-vector-new-icon-png-image_423422.jpg" imgNouveau: "https://png.pngtree.com/png-vector/20190129/ourmid/pngtree-vector-new-icon-png-image_423422.jpg",
contenusRecu: [],
contenusPropose: []
} }
} },
watch: {
auteur: function () {
let that = this
// Dès que l'auteur est connu, on charge tous ses contenus
Service.getPublicationsRecues(this.auteur).then(function (response) {
that.contenusRecu = response.data
})
Service.getPublicationsProposees(this.auteur).then(function (response) {
that.contenusPropose = response.data
})
}
},
} }
</script> </script>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<button v-show="contenuCliqueProvenance !== 'banque'" v-on:click="actionContenu('supprimer')">supprimer le contenu</button> <button v-show="contenuCliqueProvenance !== 'banque'" v-on:click="actionContenu('supprimer')">supprimer le contenu</button>
<button v-show="contenuCliqueProvenance === 'en-cours'" v-on:click="actionContenu('publier')">publier le contenu</button> <button v-show="contenuCliqueProvenance === 'en-cours'" v-on:click="actionContenu('publier')">publier le contenu</button>
<button v-show="contenuCliqueProvenance === 'banque'" v-on:click="actionContenu('mettreFavori')">mettre le contenu en tiers</button> <button v-show="contenuCliqueProvenance === 'banque'" v-on:click="actionContenu('mettreFavori')">mettre le contenu en tiers</button>
<br> <br>
</div> </div>
...@@ -24,14 +24,7 @@ export default { ...@@ -24,14 +24,7 @@ export default {
props: ['contenuClique', 'contenuCliqueProvenance'], props: ['contenuClique', 'contenuCliqueProvenance'],
methods: { methods: {
actionContenu: function (action) { actionContenu: function (action) {
this.$emit("actionContenu", {action: action, contenu: this.contenuClique})
if (this.contenuCliqueProvenance === 'en-cours'){
this.$emit("actionContenu", {action: action, id_contenu: this.contenuClique.reference, version: this.contenuClique.version})
} else {
this.$emit("actionContenu", {action: action, id_contenu: this.contenuClique._id, version: this.contenuClique.versionEnCours["numero"]})
}
}, },
revenirArriere: function () { revenirArriere: function () {
this.$emit("retour_arriere", {panierChoisi: this.contenuCliqueProvenance !== 'banque'}) this.$emit("retour_arriere", {panierChoisi: this.contenuCliqueProvenance !== 'banque'})
......
...@@ -144,7 +144,6 @@ export default { ...@@ -144,7 +144,6 @@ export default {
Service.getPanierAuteur(this.auteur).then(function (response) { Service.getPanierAuteur(this.auteur).then(function (response) {
that.contenus = response.data that.contenus = response.data
alert(that.contenus.length)
}) })
Service.getBanqueAuteur(this.auteur).then(function (response) { Service.getBanqueAuteur(this.auteur).then(function (response) {
that.contenusbanque = response.data that.contenusbanque = response.data
...@@ -183,7 +182,6 @@ export default { ...@@ -183,7 +182,6 @@ export default {
supprimerContenus: function () { supprimerContenus: function () {
if (this.panierChoisi){ if (this.panierChoisi){
for(let i = 0; i < this.checkes.length; i++) { for(let i = 0; i < this.checkes.length; i++) {
if(this.checkes[i][1] === "perso"){ if(this.checkes[i][1] === "perso"){
Service.supprimerContenu(JSON.stringify(this.checkes[i][0])) Service.supprimerContenu(JSON.stringify(this.checkes[i][0]))
...@@ -195,7 +193,6 @@ export default { ...@@ -195,7 +193,6 @@ export default {
} }
} }
} }
else { else {
for(let i = 0; i < this.checkes.length; i++) { for(let i = 0; i < this.checkes.length; i++) {
...@@ -221,7 +218,6 @@ export default { ...@@ -221,7 +218,6 @@ export default {
}) })
}, },
chargerContenu: function (item, provenance){ chargerContenu: function (item, provenance){
alert(item.provenance)
this.modeConsultation = true; this.modeConsultation = true;
this.contenuClique = item this.contenuClique = item
this.contenuCliqueProvenance = provenance this.contenuCliqueProvenance = provenance
...@@ -232,17 +228,24 @@ export default { ...@@ -232,17 +228,24 @@ export default {
}, },
actionContenu: function (event) { actionContenu: function (event) {
this.modeConsultation = false this.modeConsultation = false
let data = {}
let that = this
switch (event.action) { switch (event.action) {
case "mettreFavori": case "mettreFavori":
data = {auteur: this.auteur, id_tiers:JSON.stringify(event.contenu._id) , version: event.contenu.versionEnCours["numero"]}
Service.creerContenuTiers(data)
Service.getPanierAuteur(this.auteur).then(function (response) {
that.contenus = response.data
that.nouveauContenu = !that.nouveauContenu
})
this.panierChoisi = false this.panierChoisi = false
this.contenus.push(({titre: this.contenuClique , provenance: "tiers"}))
break break
case "modifier": case "modifier":
alert("let's go step by step")
this.panierChoisi = true this.panierChoisi = true
if (this.contenuCliqueProvenance !== 'en-cours'){ if (this.contenuCliqueProvenance !== 'en-cours'){
let that = this data = {auteur: this.auteur, id_contenu: JSON.stringify(event.contenu._id), version: event.contenu.versionEnCours["numero"]}
let data = {auteur: this.auteur, id_contenu: JSON.stringify(event.id_contenu), version: event.version}
Service.creerEnCours(data).then( function() { Service.creerEnCours(data).then( function() {
Service.getPanierAuteur(that.auteur).then(function (response) { Service.getPanierAuteur(that.auteur).then(function (response) {
that.contenus = response.data that.contenus = response.data
...@@ -253,45 +256,48 @@ export default { ...@@ -253,45 +256,48 @@ export default {
case "supprimer": case "supprimer":
this.panierChoisi = true this.panierChoisi = true
// 3 cas : suppression perso, suppression tiers et suppression en cours if(this.contenuCliqueProvenance === "perso"){
if (this.contenuCliqueProvenance !== 'perso'){ Service.supprimerContenu(JSON.stringify(event.contenu._id))
for (let i = 0; i < this.contenus.length; i++){ } else if (this.contenuCliqueProvenance === "tiers"){
if (this.contenus[i].titre === this.contenuClique){ Service.supprimerTiers(this.auteur, JSON.stringify(event.contenu._id))
this.contenus.splice(i, 1)
}
}
} else { } else {
for (let i = 0; i < this.contenus.length; i++){ Service.supprimerEnCours(JSON.stringify(event.contenu._id))
if (this.contenus[i].titre === this.contenuClique){
this.contenus[i].auteur = "Aucun"
}
}
} }
break
case "publier":
this.panierChoisi = true
this.$emit("publication", {document: this.contenuClique})
break
}
},
ajouterCoche: function (idContenu, provenance) {
let existant = false
for (let i = 0; i < this.checkes.length; i++){
if (this.checkes[i][0] === idContenu){ Service.getPanierAuteur(this.auteur).then(function (response) {
existant = true that.contenus = response.data
} that.nouveauContenu = !that.nouveauContenu
} })
break
case "publier":
alert("Je veux publier")
this.panierChoisi = true
data = {id_contenu: JSON.stringify(event.contenu.reference), id_contenu_en_cours: JSON.stringify(event.contenu._id), auteur_en_cours: this.auteur}
//request.args.get('id_contenu'), request.args.get('id_contenu_en_cours'),
Service.creerDemandePublication(data)
// this.$emit("publication", {document: this.contenuClique})
break
}
},
ajouterCoche: function (idContenu, provenance) {
let existant = false
for (let i = 0; i < this.checkes.length; i++){
if (existant){ if (this.checkes[i][0] === idContenu){
this.checkes.splice(this.checkes.indexOf([idContenu, provenance]), 1) existant = true
}
else {
this.checkes.push([idContenu, provenance])
} }
} }
if (existant){
this.checkes.splice(this.checkes.indexOf([idContenu, provenance]), 1)
}
else {
this.checkes.push([idContenu, provenance])
}
} }
} }
}
</script> </script>
......
...@@ -71,13 +71,20 @@ export default { ...@@ -71,13 +71,20 @@ export default {
majCOntenu(){ majCOntenu(){
} },
// bonus : fonction de récupération des tags pour getPanier et getBanque // bonus : fonction de récupération des tags pour getPanier et getBanque
getPublicationsRecues(auteur){
return axios.get(urlBase + "demandePublication/" + auteur + "/False")
},
getPublicationsProposees(auteur){
return axios.get(urlBase + "demandePublication/" + auteur + "/True")
},
creerDemandePublication(data) {
axios.post(urlBase + "demandePublication" , data)
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment